From 6861f1a2a8076d779c74bbbebb64fe43263b9f3d Mon Sep 17 00:00:00 2001 From: jhfnetboy Date: Thu, 18 Jun 2026 09:16:27 +0700 Subject: [PATCH] =?UTF-8?q?chore(docs):=20version=20docs=20=E2=80=94=20fre?= =?UTF-8?q?eze=20v0.16.23=20snapshot,=20fix=20license=20to=20Apache-2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Freeze current docs (SDK v0.16.23) into /0.16.23/ as an archived line; root stays the latest (v0.20.x) line. - Evidence the live content is v0.16.23: guide/installation.md integrity hash + changelog.md '## [0.16.23]'. - Scope all root-absolute /guide /api /examples links inside 0.16.23/ to /0.16.23/* so the snapshot is self-contained. - Add archived-version banner to 0.16.23/index.md pointing to latest (/). - config.ts: add version dropdown to nav; mirror guide/api/examples/zh-guide sidebars under /0.16.23/* via a prefixSidebar() helper. - Fix stale MIT -> Apache-2.0 in index.md badge and config footer. --- .vitepress/config.ts | 329 +- .../@aastar/account/classes/UserOpClient.md | 72 + .../functions/createEOAWalletClient.md | 15 + .../account/functions/getUserOpHash.md | 17 + .../account/functions/packUserOpLimits.md | 16 + .../account/functions/toSimpleSmartAccount.md | 31 + 0.16.23/api/@aastar/account/index.md | 15 + .../account/type-aliases/EOAWalletClient.md | 30 + .../type-aliases/SimpleSmartAccount.md | 39 + 0.16.23/api/@aastar/analytics.md | 440 +++ .../analytics/classes/AnalyticsClient.md | 109 + 0.16.23/api/@aastar/analytics/index.md | 440 +++ .../community/classes/CommunityClient.md | 232 ++ 0.16.23/api/@aastar/community/index.md | 10 + .../interfaces/CommunityLaunchConfig.md | 67 + .../community/interfaces/CommunityStats.md | 35 + .../community/interfaces/SBTRuleConfig.md | 27 + .../interfaces/XPNTsIssuanceParams.md | 27 + 0.16.23/api/@aastar/core/classes/BLSSigner.md | 129 + .../api/@aastar/core/classes/BaseClient.md | 171 + .../api/@aastar/core/classes/BundlerClient.md | 119 + .../core/classes/ContractConfigManager.md | 25 + .../core/classes/RequirementChecker.md | 158 + .../@aastar/core/classes/SepoliaFaucetAPI.md | 710 ++++ .../@aastar/core/classes/StateValidator.md | 117 + .../core/enumerations/EntryPointVersion.md | 17 + .../api/@aastar/core/enumerations/NodeType.md | 33 + .../core/enumerations/RolePermissionLevel.md | 43 + .../@aastar/core/functions/accountActions.md | 23 + .../core/functions/accountFactoryActions.md | 24 + .../core/functions/aggregatorActions.md | 23 + .../api/@aastar/core/functions/applyConfig.md | 15 + .../functions/createAAStarPublicClient.md | 16 + .../api/@aastar/core/functions/dvtActions.md | 23 + .../core/functions/entryPointActions.md | 23 + .../@aastar/core/functions/gTokenActions.md | 23 + .../@aastar/core/functions/getAddressUrl.md | 25 + .../core/functions/getAllCommunityConfigs.md | 9 + .../core/functions/getAllV2Contracts.md | 20 + .../core/functions/getBlockExplorer.md | 24 + .../api/@aastar/core/functions/getChainId.md | 24 + .../@aastar/core/functions/getCommunities.md | 74 + .../@aastar/core/functions/getCommunity.md | 25 + .../core/functions/getCommunityConfig.md | 15 + .../api/@aastar/core/functions/getContract.md | 25 + .../core/functions/getContractNetworks.md | 18 + .../@aastar/core/functions/getContracts.md | 192 + .../core/functions/getCoreContracts.md | 69 + .../core/functions/getDeploymentDate.md | 25 + .../@aastar/core/functions/getEntryPoint.md | 23 + .../api/@aastar/core/functions/getNetwork.md | 24 + .../core/functions/getPaymasterV4_1.md | 23 + .../api/@aastar/core/functions/getRoleName.md | 15 + .../api/@aastar/core/functions/getRpcUrl.md | 23 + .../core/functions/getSimpleAccountFactory.md | 23 + .../core/functions/getSuperPaymasterV2.md | 23 + .../@aastar/core/functions/getTestAccounts.md | 28 + .../core/functions/getTestTokenContracts.md | 36 + .../core/functions/getTokenContracts.md | 29 + .../api/@aastar/core/functions/getTxUrl.md | 25 + .../core/functions/getV2ContractByAddress.md | 26 + .../core/functions/getV2ContractByName.md | 26 + .../core/functions/getV2ContractsByDate.md | 24 + .../functions/isContractNetworkSupported.md | 25 + .../core/functions/isRegisteredCommunity.md | 15 + .../@aastar/core/functions/isV2Contract.md | 25 + .../core/functions/paymasterActions.md | 23 + .../core/functions/paymasterFactoryActions.md | 23 + .../@aastar/core/functions/registryActions.md | 23 + .../core/functions/reputationActions.md | 23 + .../api/@aastar/core/functions/sbtActions.md | 23 + .../@aastar/core/functions/stakingActions.md | 23 + .../core/functions/superPaymasterActions.md | 23 + .../@aastar/core/functions/tokenActions.md | 23 + .../core/functions/xPNTsFactoryActions.md | 23 + .../core/functions/xPNTsTokenActions.md | 23 + 0.16.23/api/@aastar/core/index.md | 223 ++ .../@aastar/core/interfaces/AccountBalance.md | 41 + .../interfaces/BalanceValidationParams.md | 51 + .../core/interfaces/BundlerResponse.md | 51 + .../@aastar/core/interfaces/ClientConfig.md | 103 + .../core/interfaces/CommunityConfig.md | 81 + .../core/interfaces/ContractVersion.md | 63 + .../interfaces/DeploymentValidationParams.md | 39 + .../@aastar/core/interfaces/PublicClient.md | 3151 +++++++++++++++++ .../api/@aastar/core/interfaces/RoleConfig.md | 83 + .../core/interfaces/RoleRequirement.md | 43 + .../core/interfaces/RoleValidationParams.md | 55 + .../core/interfaces/SuperPaymasterConfig.md | 57 + .../TokenBalanceValidationParams.md | 63 + .../core/interfaces/TransactionOptions.md | 24 + .../core/interfaces/UserOperationV07.md | 73 + .../core/interfaces/ValidationParams.md | 25 + .../core/interfaces/ValidationResult.md | 25 + .../@aastar/core/interfaces/WalletClient.md | 1846 ++++++++++ .../core/type-aliases/AccountActions.md | 135 + .../type-aliases/AccountFactoryActions.md | 45 + .../core/type-aliases/AggregatorActions.md | 365 ++ .../core/type-aliases/BusinessResult.md | 12 + .../core/type-aliases/ContractCategory.md | 5 + .../core/type-aliases/ContractNetwork.md | 5 + .../@aastar/core/type-aliases/DVTActions.md | 267 ++ .../@aastar/core/type-aliases/ERC20Actions.md | 187 + .../core/type-aliases/EntryPointActions.md | 90 + .../@aastar/core/type-aliases/FaucetConfig.md | 51 + .../type-aliases/FaucetPreparationResult.md | 35 + .../core/type-aliases/GTokenActions.md | 151 + .../core/type-aliases/NetworkContracts.md | 5 + .../core/type-aliases/OperatorConfig.md | 83 + .../core/type-aliases/PaymasterActions.md | 781 ++++ .../type-aliases/PaymasterFactoryActions.md | 409 +++ .../core/type-aliases/RegistryActions.md | 1065 ++++++ .../core/type-aliases/ReputationActions.md | 665 ++++ .../core/type-aliases/ReputationBreakdown.md | 35 + .../core/type-aliases/ReputationRule.md | 35 + .../core/type-aliases/RoleConfigDetailed.md | 99 + .../@aastar/core/type-aliases/SBTActions.md | 918 +++++ .../api/@aastar/core/type-aliases/SBTData.md | 35 + .../core/type-aliases/SBTMembership.md | 43 + .../@aastar/core/type-aliases/SlashRecord.md | 43 + .../core/type-aliases/StakingActions.md | 577 +++ .../type-aliases/SuperPaymasterActions.md | 1044 ++++++ .../core/type-aliases/SupportedNetwork.md | 3 + .../@aastar/core/type-aliases/TokenActions.md | 3 + .../core/type-aliases/XPNTsFactoryActions.md | 443 +++ .../core/type-aliases/XPNTsTokenActions.md | 518 +++ .../core/variables/AASTAR_COMMUNITY.md | 8 + .../@aastar/core/variables/ALL_ADDRESSES.md | 75 + .../api/@aastar/core/variables/ALL_ROLES.md | 5 + .../@aastar/core/variables/APNTS_ADDRESS.md | 3 + .../core/variables/BLSAggregatorABI.md | 3 + .../core/variables/BLSAggregatorArtifact.md | 13 + .../api/@aastar/core/variables/BLSHelpers.md | 80 + .../@aastar/core/variables/BLSValidatorABI.md | 3 + .../core/variables/BLSValidatorArtifact.md | 13 + .../core/variables/BLS_AGGREGATOR_ADDRESS.md | 3 + .../core/variables/BLS_VALIDATOR_ADDRESS.md | 3 + .../@aastar/core/variables/BPS_DENOMINATOR.md | 3 + .../api/@aastar/core/variables/BRANDING.md | 67 + .../@aastar/core/variables/BREAD_COMMUNITY.md | 8 + .../@aastar/core/variables/CHAIN_MAINNET.md | 3 + .../@aastar/core/variables/CHAIN_SEPOLIA.md | 3 + .../api/@aastar/core/variables/COMMUNITIES.md | 5 + .../core/variables/COMMUNITY_OWNERS.md | 15 + .../api/@aastar/core/variables/CONTRACTS.md | 179 + .../core/variables/CONTRACT_METADATA.md | 67 + .../core/variables/CONTRACT_SRC_HASH.md | 5 + .../@aastar/core/variables/CORE_ADDRESSES.md | 51 + .../core/variables/DEFAULT_ADMIN_ROLE.md | 17 + .../core/variables/DEFAULT_APNTS_PRICE_USD.md | 3 + .../core/variables/DEFAULT_CALL_GAS_LIMIT.md | 3 + .../DEFAULT_GAS_TOKEN_MINT_AMOUNT.md | 3 + .../variables/DEFAULT_PRE_VERIFICATION_GAS.md | 3 + .../core/variables/DEFAULT_TIMEOUT_MS.md | 3 + .../core/variables/DEFAULT_TOKEN_NAME.md | 3 + .../core/variables/DEFAULT_TOKEN_SYMBOL.md | 3 + .../variables/DEFAULT_USDT_MINT_AMOUNT.md | 3 + .../DEFAULT_VERIFICATION_GAS_LIMIT.md | 3 + .../@aastar/core/variables/DVTValidatorABI.md | 3 + .../core/variables/DVTValidatorArtifact.md | 13 + .../core/variables/DVT_VALIDATOR_ADDRESS.md | 3 + .../core/variables/ENTRY_POINT_ADDRESS.md | 3 + .../@aastar/core/variables/EntryPointABI.md | 3 + .../core/variables/EntryPointArtifact.md | 13 + .../@aastar/core/variables/FAUCET_API_URL.md | 5 + .../@aastar/core/variables/GTOKEN_ADDRESS.md | 3 + .../core/variables/GTOKEN_STAKING_ADDRESS.md | 3 + .../api/@aastar/core/variables/GTokenABI.md | 3 + .../@aastar/core/variables/GTokenArtifact.md | 13 + .../core/variables/GTokenStakingABI.md | 3 + .../core/variables/GTokenStakingArtifact.md | 13 + .../core/variables/INITIAL_ROLE_STAKES.md | 13 + 0.16.23/api/@aastar/core/variables/LINKS.md | 33 + .../@aastar/core/variables/MAX_SERVICE_FEE.md | 3 + .../core/variables/MONITORING_ADDRESSES.md | 15 + .../api/@aastar/core/variables/MySBTABI.md | 3 + .../@aastar/core/variables/MySBTArtifact.md | 13 + .../api/@aastar/core/variables/NETWORKS.md | 151 + .../core/variables/NODE_STAKE_AMOUNTS.md | 21 + .../core/variables/OFFICIAL_ADDRESSES.md | 11 + .../core/variables/PAYMASTER_ADDRESSES.md | 15 + .../variables/PAYMASTER_FACTORY_ADDRESS.md | 3 + .../core/variables/PAYMASTER_V4_ADDRESS.md | 3 + .../variables/PAYMASTER_V4_IMPL_ADDRESS.md | 3 + .../@aastar/core/variables/PaymasterABI.md | 3 + .../core/variables/PaymasterArtifact.md | 13 + .../core/variables/PaymasterFactoryABI.md | 3 + .../variables/PaymasterFactoryArtifact.md | 13 + .../core/variables/REGISTRY_ADDRESS.md | 3 + .../variables/REPUTATION_SYSTEM_ADDRESS.md | 3 + .../api/@aastar/core/variables/ROLE_ANODE.md | 29 + .../@aastar/core/variables/ROLE_COMMUNITY.md | 29 + .../api/@aastar/core/variables/ROLE_DVT.md | 29 + .../@aastar/core/variables/ROLE_ENDUSER.md | 33 + .../api/@aastar/core/variables/ROLE_KMS.md | 29 + .../api/@aastar/core/variables/ROLE_NAMES.md | 3 + .../core/variables/ROLE_PAYMASTER_AOA.md | 29 + .../core/variables/ROLE_PAYMASTER_SUPER.md | 33 + .../core/variables/ROLE_PERMISSION_LEVELS.md | 3 + .../api/@aastar/core/variables/RegistryABI.md | 3 + .../core/variables/RegistryArtifact.md | 13 + .../core/variables/ReputationSystemABI.md | 3 + .../variables/ReputationSystemArtifact.md | 13 + .../api/@aastar/core/variables/SBT_ADDRESS.md | 3 + .../core/variables/SEPOLIA_CONTRACTS.md | 175 + .../core/variables/SEPOLIA_V2_VERSIONS.md | 67 + .../core/variables/SERVICE_FEE_RATE.md | 3 + .../core/variables/SUPER_PAYMASTER_ADDRESS.md | 3 + .../core/variables/SimpleAccountABI.md | 3 + .../core/variables/SimpleAccountArtifact.md | 13 + .../core/variables/SimpleAccountFactoryABI.md | 3 + .../variables/SimpleAccountFactoryArtifact.md | 13 + .../core/variables/SuperPaymasterABI.md | 3 + .../core/variables/SuperPaymasterArtifact.md | 13 + .../core/variables/TEST_ACCOUNT_ADDRESSES.md | 11 + .../core/variables/TEST_ACCOUNT_POOL_SIZE.md | 3 + .../core/variables/TEST_COMMUNITIES.md | 19 + .../core/variables/TEST_TOKEN_ADDRESSES.md | 19 + .../@aastar/core/variables/TOKEN_ADDRESSES.md | 11 + .../api/@aastar/core/variables/V2_SUMMARY.md | 39 + .../core/variables/XPNTS_FACTORY_ADDRESS.md | 3 + .../@aastar/core/variables/xPNTsFactoryABI.md | 3 + .../core/variables/xPNTsFactoryArtifact.md | 13 + .../@aastar/core/variables/xPNTsTokenABI.md | 3 + .../core/variables/xPNTsTokenArtifact.md | 13 + 0.16.23/api/@aastar/dapp/classes/DVTClient.md | 74 + .../@aastar/dapp/functions/useCreditScore.md | 21 + .../dapp/functions/useSuperPaymaster.md | 13 + 0.16.23/api/@aastar/dapp/index.md | 8 + .../enduser/classes/CommunityClient.md | 445 +++ .../api/@aastar/enduser/classes/UserClient.md | 583 +++ .../@aastar/enduser/classes/UserLifecycle.md | 451 +++ 0.16.23/api/@aastar/enduser/index.md | 16 + .../interfaces/CommunityClientConfig.md | 159 + .../enduser/interfaces/CommunityInfo.md | 9 + .../interfaces/CreateCommunityParams.md | 33 + .../enduser/interfaces/GaslessConfig.md | 17 + .../enduser/interfaces/OnboardResult.md | 25 + .../enduser/interfaces/ReputationData.md | 25 + .../enduser/interfaces/UserClientConfig.md | 167 + .../enduser/interfaces/UserLifecycleConfig.md | 159 + .../identity/classes/ReputationClient.md | 137 + .../@aastar/identity/functions/checkMySBT.md | 17 + .../@aastar/identity/functions/getMySBTId.md | 18 + 0.16.23/api/@aastar/identity/index.md | 8 + .../operator/classes/OperatorLifecycle.md | 689 ++++ .../classes/PaymasterOperatorClient.md | 546 +++ .../operator/classes/ProtocolClient.md | 375 ++ .../operator/enumerations/ProposalState.md | 65 + 0.16.23/api/@aastar/operator/index.md | 16 + .../interfaces/OperatorClientConfig.md | 151 + .../operator/interfaces/OperatorStatus.md | 25 + .../interfaces/ProtocolClientConfig.md | 159 + .../operator/interfaces/SponsorshipPolicy.md | 25 + .../paymaster/classes/PaymasterClient.md | 261 ++ .../paymaster/classes/PaymasterOperator.md | 330 ++ .../classes/SuperPaymasterAdminClient.md | 144 + .../paymaster/classes/SuperPaymasterClient.md | 30 + .../paymaster/functions/buildPaymasterData.md | 21 + .../functions/buildSuperPaymasterData.md | 26 + .../paymaster/functions/checkEligibility.md | 19 + .../paymaster/functions/formatUserOpV07.md | 15 + .../functions/getPaymasterV4Middleware.md | 31 + .../functions/getSuperPaymasterMiddleware.md | 31 + .../paymaster/functions/getUserOpHashV07.md | 15 + .../paymaster/functions/tuneGasLimit.md | 18 + 0.16.23/api/@aastar/paymaster/index.md | 24 + .../type-aliases/GaslessReadinessReport.md | 55 + .../type-aliases/GaslessTransactionConfig.md | 59 + .../paymaster/type-aliases/PaymasterConfig.md | 43 + .../PaymasterV4MiddlewareConfig.md | 35 + 0.16.23/api/@aastar/sdk.md | 189 + 0.16.23/api/@aastar/sdk/index.md | 189 + .../@aastar/tokens/classes/FinanceClient.md | 307 ++ 0.16.23/api/@aastar/tokens/index.md | 3 + 0.16.23/api/index.md | 189 + 0.16.23/api/modules/analytics.md | 440 +++ 0.16.23/api/modules/sdk.md | 189 + 0.16.23/changelog.md | 189 + 0.16.23/examples/README.md | 18 + 0.16.23/examples/community-flow.md | 34 + 0.16.23/examples/enduser-flow.md | 27 + 0.16.23/examples/index.md | 29 + 0.16.23/examples/multi-chain.md | 31 + 0.16.23/examples/operator-flow.md | 41 + 0.16.23/guide/ABI_MAINTENANCE_PLAN.md | 132 + 0.16.23/guide/API_REFERENCE.md | 796 +++++ 0.16.23/guide/CLI_GUIDE.md | 65 + 0.16.23/guide/Configuration_Sync.md | 47 + 0.16.23/guide/DAO_Mining_Distribution_Plan.md | 522 +++ 0.16.23/guide/DEMO_REFACTOR_PLAN.md | 289 ++ 0.16.23/guide/DOCUMENTATION_PLAN.md | 455 +++ 0.16.23/guide/ENV_SEPOLIA_UPDATE.md | 68 + 0.16.23/guide/L2_BUSINESS_CLIENTS_PLAN.md | 394 +++ ...3-demo-API-and-simple-demo-walk-through.md | 294 ++ 0.16.23/guide/L4_Manual_Test_CheatSheet.md | 172 + 0.16.23/guide/Plan.md | 266 ++ 0.16.23/guide/Regression_Testing_Guide.md | 70 + ...Reputation-to-Credit_Mapping_Whitepaper.md | 242 ++ 0.16.23/guide/SDK_ABI_COVERAGE.md | 839 +++++ 0.16.23/guide/SDK_COVERAGE_STRATEGY.md | 397 +++ .../guide/SDK_Optimization_Evaluation_Plan.md | 51 + 0.16.23/guide/SDK_REGRESSION_AND_API_PLAN.md | 98 + 0.16.23/guide/SDK_STAGE3_PLAN.md | 151 + 0.16.23/guide/SEPOLIA_ENV_REFERENCE.md | 51 + 0.16.23/guide/STAGE3.md | 191 + 0.16.23/guide/Script_Comparison_Report.md | 91 + 0.16.23/guide/Security-solution.md | 106 + 0.16.23/guide/Sepolia_Latest_Deployment.md | 117 + 0.16.23/guide/TESTER_GUIDE_GASLESS.md | 409 +++ 0.16.23/guide/TEST_COMMANDS.md | 320 ++ 0.16.23/guide/TEST_COVERAGE_MATRIX.md | 72 + 0.16.23/guide/TODO_SDK_COVERAGE.md | 55 + 0.16.23/guide/USER_CASE_DESIGN.md | 110 + 0.16.23/guide/Verifier_L4_Gasless_Plan.md | 454 +++ 0.16.23/guide/api_compliance_report.md | 65 + 0.16.23/guide/concepts/account-abstraction.md | 95 + 0.16.23/guide/concepts/rainbow-bridge.md | 68 + 0.16.23/guide/concepts/reputation.md | 95 + 0.16.23/guide/concepts/superpaymaster.md | 141 + 0.16.23/guide/deployments/index.md | 30 + .../verify.op-sepolia.contracts.md | 26 + .../deployments/verify.optimism.contracts.md | 22 + .../deployments/verify.sepolia.contracts.md | 26 + 0.16.23/guide/docs/ABI_MAINTENANCE_PLAN.md | 132 + 0.16.23/guide/docs/API_REFERENCE.md | 826 +++++ .../docs/Account_Initialization_Guide_CN.md | 89 + 0.16.23/guide/docs/Configuration_Sync.md | 73 + .../docs/DAO_Mining_Distribution_Plan.md | 522 +++ 0.16.23/guide/docs/DEMO_REFACTOR_PLAN.md | 289 ++ 0.16.23/guide/docs/DOCUMENTATION_PLAN.md | 455 +++ 0.16.23/guide/docs/ENV_SEPOLIA_UPDATE.md | 68 + .../guide/docs/L2_BUSINESS_CLIENTS_PLAN.md | 394 +++ .../docs/L3_Complete_Demo_Walkthrough.md | 110 + .../docs/L3_Lifecycle_Developer_Guide.md | 111 + .../docs/L3_Lifecycle_Patterns_Design.md | 518 +++ 0.16.23/guide/docs/L3_Use_Case_Analysis.md | 68 + .../guide/docs/L4_Manual_Test_CheatSheet.md | 172 + 0.16.23/guide/docs/Plan.md | 266 ++ .../guide/docs/Regression_Testing_Guide.md | 70 + ...Reputation-to-Credit_Mapping_Whitepaper.md | 242 ++ 0.16.23/guide/docs/SDK_ABI_COVERAGE.md | 839 +++++ 0.16.23/guide/docs/SDK_COVERAGE_STRATEGY.md | 397 +++ .../docs/SDK_Optimization_Evaluation_Plan.md | 51 + .../guide/docs/SDK_REGRESSION_AND_API_PLAN.md | 98 + 0.16.23/guide/docs/SDK_STAGE3_ANALYSIS.md | 60 + 0.16.23/guide/docs/SDK_STAGE3_PLAN.md | 151 + 0.16.23/guide/docs/SEPOLIA_ENV_REFERENCE.md | 51 + 0.16.23/guide/docs/STAGE3.md | 191 + .../guide/docs/Script_Comparison_Report.md | 91 + .../guide/docs/Sepolia_Latest_Deployment.md | 117 + 0.16.23/guide/docs/TESTER_GUIDE_GASLESS.md | 411 +++ 0.16.23/guide/docs/TEST_COVERAGE_MATRIX.md | 72 + 0.16.23/guide/docs/TODO_SDK_COVERAGE.md | 60 + 0.16.23/guide/docs/USER_CASE_DESIGN.md | 110 + .../guide/docs/Verifier_L4_Gasless_Plan.md | 454 +++ 0.16.23/guide/docs/api_compliance_report.md | 65 + 0.16.23/guide/docs/old-solution.md | 1078 ++++++ 0.16.23/guide/docs/paper-data-collection.md | 69 + 0.16.23/guide/docs/release_plan_v0.16.12.md | 49 + 0.16.23/guide/docs/technical_plan.md | 510 +++ .../guide/docs/verify.op-sepolia.contracts.md | 22 + .../guide/docs/verify.sepolia.contracts.md | 22 + 0.16.23/guide/getting-started.md | 189 + 0.16.23/guide/installation.md | 54 + 0.16.23/guide/keeper.md | 107 + 0.16.23/guide/old-solution.md | 1078 ++++++ 0.16.23/guide/packages/analytics/index.md | 440 +++ 0.16.23/guide/paper-data-collection.md | 69 + 0.16.23/guide/quick-start.md | 52 + 0.16.23/guide/real-l3-demo-log.md | 131 + 0.16.23/guide/release_plan_v0.16.12.md | 49 + 0.16.23/guide/task_breakdown.md | 121 + 0.16.23/guide/technical_plan.md | 510 +++ .../guide/use-cases/community-management.md | 141 + .../guide/use-cases/gasless-transactions.md | 71 + 0.16.23/guide/use-cases/operator-staking.md | 84 + 0.16.23/guide/use-cases/yop.md | 72 + 0.16.23/guide/verify.op-sepolia.contracts.md | 22 + 0.16.23/guide/verify.sepolia.contracts.md | 22 + 0.16.23/index.md | 98 + 0.16.23/zh/api/index.md | 7 + 0.16.23/zh/examples/community-flow.md | 38 + 0.16.23/zh/examples/complete-workflow.md | 10 + 0.16.23/zh/examples/enduser-flow.md | 33 + 0.16.23/zh/examples/index.md | 18 + 0.16.23/zh/examples/multi-chain.md | 46 + 0.16.23/zh/examples/operator-flow.md | 37 + 0.16.23/zh/guide/CLI_GUIDE.md | 48 + 0.16.23/zh/guide/DOCUMENTATION_PLAN.md | 455 +++ 0.16.23/zh/guide/Plan.md | 266 ++ .../guide/SDK_Optimization_Evaluation_Plan.md | 51 + 0.16.23/zh/guide/Security-solution.md | 106 + 0.16.23/zh/guide/TEST_COMMANDS.md | 125 + 0.16.23/zh/guide/TEST_COVERAGE_MATRIX.md | 72 + .../zh/guide/concepts/account-abstraction.md | 95 + 0.16.23/zh/guide/concepts/rainbow-bridge.md | 68 + 0.16.23/zh/guide/concepts/reputation.md | 95 + 0.16.23/zh/guide/concepts/superpaymaster.md | 141 + 0.16.23/zh/guide/getting-started.md | 133 + 0.16.23/zh/guide/installation.md | 107 + 0.16.23/zh/guide/old-solution.md | 1078 ++++++ 0.16.23/zh/guide/paper-data-collection.md | 69 + 0.16.23/zh/guide/quick-start.md | 134 + 0.16.23/zh/guide/sdk-readme.md | 253 ++ 0.16.23/zh/guide/task_breakdown.md | 76 + 0.16.23/zh/guide/technical_plan.md | 510 +++ .../guide/use-cases/community-management.md | 141 + .../guide/use-cases/gasless-transactions.md | 71 + .../zh/guide/use-cases/operator-staking.md | 84 + 0.16.23/zh/guide/use-cases/yop.md | 72 + index.md | 2 +- 412 files changed, 53170 insertions(+), 144 deletions(-) create mode 100644 0.16.23/api/@aastar/account/classes/UserOpClient.md create mode 100644 0.16.23/api/@aastar/account/functions/createEOAWalletClient.md create mode 100644 0.16.23/api/@aastar/account/functions/getUserOpHash.md create mode 100644 0.16.23/api/@aastar/account/functions/packUserOpLimits.md create mode 100644 0.16.23/api/@aastar/account/functions/toSimpleSmartAccount.md create mode 100644 0.16.23/api/@aastar/account/index.md create mode 100644 0.16.23/api/@aastar/account/type-aliases/EOAWalletClient.md create mode 100644 0.16.23/api/@aastar/account/type-aliases/SimpleSmartAccount.md create mode 100644 0.16.23/api/@aastar/analytics.md create mode 100644 0.16.23/api/@aastar/analytics/classes/AnalyticsClient.md create mode 100644 0.16.23/api/@aastar/analytics/index.md create mode 100644 0.16.23/api/@aastar/community/classes/CommunityClient.md create mode 100644 0.16.23/api/@aastar/community/index.md create mode 100644 0.16.23/api/@aastar/community/interfaces/CommunityLaunchConfig.md create mode 100644 0.16.23/api/@aastar/community/interfaces/CommunityStats.md create mode 100644 0.16.23/api/@aastar/community/interfaces/SBTRuleConfig.md create mode 100644 0.16.23/api/@aastar/community/interfaces/XPNTsIssuanceParams.md create mode 100644 0.16.23/api/@aastar/core/classes/BLSSigner.md create mode 100644 0.16.23/api/@aastar/core/classes/BaseClient.md create mode 100644 0.16.23/api/@aastar/core/classes/BundlerClient.md create mode 100644 0.16.23/api/@aastar/core/classes/ContractConfigManager.md create mode 100644 0.16.23/api/@aastar/core/classes/RequirementChecker.md create mode 100644 0.16.23/api/@aastar/core/classes/SepoliaFaucetAPI.md create mode 100644 0.16.23/api/@aastar/core/classes/StateValidator.md create mode 100644 0.16.23/api/@aastar/core/enumerations/EntryPointVersion.md create mode 100644 0.16.23/api/@aastar/core/enumerations/NodeType.md create mode 100644 0.16.23/api/@aastar/core/enumerations/RolePermissionLevel.md create mode 100644 0.16.23/api/@aastar/core/functions/accountActions.md create mode 100644 0.16.23/api/@aastar/core/functions/accountFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/functions/aggregatorActions.md create mode 100644 0.16.23/api/@aastar/core/functions/applyConfig.md create mode 100644 0.16.23/api/@aastar/core/functions/createAAStarPublicClient.md create mode 100644 0.16.23/api/@aastar/core/functions/dvtActions.md create mode 100644 0.16.23/api/@aastar/core/functions/entryPointActions.md create mode 100644 0.16.23/api/@aastar/core/functions/gTokenActions.md create mode 100644 0.16.23/api/@aastar/core/functions/getAddressUrl.md create mode 100644 0.16.23/api/@aastar/core/functions/getAllCommunityConfigs.md create mode 100644 0.16.23/api/@aastar/core/functions/getAllV2Contracts.md create mode 100644 0.16.23/api/@aastar/core/functions/getBlockExplorer.md create mode 100644 0.16.23/api/@aastar/core/functions/getChainId.md create mode 100644 0.16.23/api/@aastar/core/functions/getCommunities.md create mode 100644 0.16.23/api/@aastar/core/functions/getCommunity.md create mode 100644 0.16.23/api/@aastar/core/functions/getCommunityConfig.md create mode 100644 0.16.23/api/@aastar/core/functions/getContract.md create mode 100644 0.16.23/api/@aastar/core/functions/getContractNetworks.md create mode 100644 0.16.23/api/@aastar/core/functions/getContracts.md create mode 100644 0.16.23/api/@aastar/core/functions/getCoreContracts.md create mode 100644 0.16.23/api/@aastar/core/functions/getDeploymentDate.md create mode 100644 0.16.23/api/@aastar/core/functions/getEntryPoint.md create mode 100644 0.16.23/api/@aastar/core/functions/getNetwork.md create mode 100644 0.16.23/api/@aastar/core/functions/getPaymasterV4_1.md create mode 100644 0.16.23/api/@aastar/core/functions/getRoleName.md create mode 100644 0.16.23/api/@aastar/core/functions/getRpcUrl.md create mode 100644 0.16.23/api/@aastar/core/functions/getSimpleAccountFactory.md create mode 100644 0.16.23/api/@aastar/core/functions/getSuperPaymasterV2.md create mode 100644 0.16.23/api/@aastar/core/functions/getTestAccounts.md create mode 100644 0.16.23/api/@aastar/core/functions/getTestTokenContracts.md create mode 100644 0.16.23/api/@aastar/core/functions/getTokenContracts.md create mode 100644 0.16.23/api/@aastar/core/functions/getTxUrl.md create mode 100644 0.16.23/api/@aastar/core/functions/getV2ContractByAddress.md create mode 100644 0.16.23/api/@aastar/core/functions/getV2ContractByName.md create mode 100644 0.16.23/api/@aastar/core/functions/getV2ContractsByDate.md create mode 100644 0.16.23/api/@aastar/core/functions/isContractNetworkSupported.md create mode 100644 0.16.23/api/@aastar/core/functions/isRegisteredCommunity.md create mode 100644 0.16.23/api/@aastar/core/functions/isV2Contract.md create mode 100644 0.16.23/api/@aastar/core/functions/paymasterActions.md create mode 100644 0.16.23/api/@aastar/core/functions/paymasterFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/functions/registryActions.md create mode 100644 0.16.23/api/@aastar/core/functions/reputationActions.md create mode 100644 0.16.23/api/@aastar/core/functions/sbtActions.md create mode 100644 0.16.23/api/@aastar/core/functions/stakingActions.md create mode 100644 0.16.23/api/@aastar/core/functions/superPaymasterActions.md create mode 100644 0.16.23/api/@aastar/core/functions/tokenActions.md create mode 100644 0.16.23/api/@aastar/core/functions/xPNTsFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/functions/xPNTsTokenActions.md create mode 100644 0.16.23/api/@aastar/core/index.md create mode 100644 0.16.23/api/@aastar/core/interfaces/AccountBalance.md create mode 100644 0.16.23/api/@aastar/core/interfaces/BalanceValidationParams.md create mode 100644 0.16.23/api/@aastar/core/interfaces/BundlerResponse.md create mode 100644 0.16.23/api/@aastar/core/interfaces/ClientConfig.md create mode 100644 0.16.23/api/@aastar/core/interfaces/CommunityConfig.md create mode 100644 0.16.23/api/@aastar/core/interfaces/ContractVersion.md create mode 100644 0.16.23/api/@aastar/core/interfaces/DeploymentValidationParams.md create mode 100644 0.16.23/api/@aastar/core/interfaces/PublicClient.md create mode 100644 0.16.23/api/@aastar/core/interfaces/RoleConfig.md create mode 100644 0.16.23/api/@aastar/core/interfaces/RoleRequirement.md create mode 100644 0.16.23/api/@aastar/core/interfaces/RoleValidationParams.md create mode 100644 0.16.23/api/@aastar/core/interfaces/SuperPaymasterConfig.md create mode 100644 0.16.23/api/@aastar/core/interfaces/TokenBalanceValidationParams.md create mode 100644 0.16.23/api/@aastar/core/interfaces/TransactionOptions.md create mode 100644 0.16.23/api/@aastar/core/interfaces/UserOperationV07.md create mode 100644 0.16.23/api/@aastar/core/interfaces/ValidationParams.md create mode 100644 0.16.23/api/@aastar/core/interfaces/ValidationResult.md create mode 100644 0.16.23/api/@aastar/core/interfaces/WalletClient.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/AccountActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/AccountFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/AggregatorActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/BusinessResult.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ContractCategory.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ContractNetwork.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/DVTActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ERC20Actions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/EntryPointActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/FaucetConfig.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/FaucetPreparationResult.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/GTokenActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/NetworkContracts.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/OperatorConfig.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/PaymasterActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/PaymasterFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/RegistryActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ReputationActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ReputationBreakdown.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/ReputationRule.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/RoleConfigDetailed.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SBTActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SBTData.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SBTMembership.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SlashRecord.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/StakingActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SuperPaymasterActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/SupportedNetwork.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/TokenActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/XPNTsFactoryActions.md create mode 100644 0.16.23/api/@aastar/core/type-aliases/XPNTsTokenActions.md create mode 100644 0.16.23/api/@aastar/core/variables/AASTAR_COMMUNITY.md create mode 100644 0.16.23/api/@aastar/core/variables/ALL_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/ALL_ROLES.md create mode 100644 0.16.23/api/@aastar/core/variables/APNTS_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/BLSAggregatorABI.md create mode 100644 0.16.23/api/@aastar/core/variables/BLSAggregatorArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/BLSHelpers.md create mode 100644 0.16.23/api/@aastar/core/variables/BLSValidatorABI.md create mode 100644 0.16.23/api/@aastar/core/variables/BLSValidatorArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/BPS_DENOMINATOR.md create mode 100644 0.16.23/api/@aastar/core/variables/BRANDING.md create mode 100644 0.16.23/api/@aastar/core/variables/BREAD_COMMUNITY.md create mode 100644 0.16.23/api/@aastar/core/variables/CHAIN_MAINNET.md create mode 100644 0.16.23/api/@aastar/core/variables/CHAIN_SEPOLIA.md create mode 100644 0.16.23/api/@aastar/core/variables/COMMUNITIES.md create mode 100644 0.16.23/api/@aastar/core/variables/COMMUNITY_OWNERS.md create mode 100644 0.16.23/api/@aastar/core/variables/CONTRACTS.md create mode 100644 0.16.23/api/@aastar/core/variables/CONTRACT_METADATA.md create mode 100644 0.16.23/api/@aastar/core/variables/CONTRACT_SRC_HASH.md create mode 100644 0.16.23/api/@aastar/core/variables/CORE_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md create mode 100644 0.16.23/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md create mode 100644 0.16.23/api/@aastar/core/variables/DVTValidatorABI.md create mode 100644 0.16.23/api/@aastar/core/variables/DVTValidatorArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/EntryPointABI.md create mode 100644 0.16.23/api/@aastar/core/variables/EntryPointArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/FAUCET_API_URL.md create mode 100644 0.16.23/api/@aastar/core/variables/GTOKEN_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/GTokenABI.md create mode 100644 0.16.23/api/@aastar/core/variables/GTokenArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/GTokenStakingABI.md create mode 100644 0.16.23/api/@aastar/core/variables/GTokenStakingArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md create mode 100644 0.16.23/api/@aastar/core/variables/LINKS.md create mode 100644 0.16.23/api/@aastar/core/variables/MAX_SERVICE_FEE.md create mode 100644 0.16.23/api/@aastar/core/variables/MONITORING_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/MySBTABI.md create mode 100644 0.16.23/api/@aastar/core/variables/MySBTArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/NETWORKS.md create mode 100644 0.16.23/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md create mode 100644 0.16.23/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/PAYMASTER_V4_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/PaymasterABI.md create mode 100644 0.16.23/api/@aastar/core/variables/PaymasterArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/PaymasterFactoryABI.md create mode 100644 0.16.23/api/@aastar/core/variables/PaymasterFactoryArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/REGISTRY_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_ANODE.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_COMMUNITY.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_DVT.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_ENDUSER.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_KMS.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_NAMES.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md create mode 100644 0.16.23/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md create mode 100644 0.16.23/api/@aastar/core/variables/RegistryABI.md create mode 100644 0.16.23/api/@aastar/core/variables/RegistryArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/ReputationSystemABI.md create mode 100644 0.16.23/api/@aastar/core/variables/ReputationSystemArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/SBT_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md create mode 100644 0.16.23/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md create mode 100644 0.16.23/api/@aastar/core/variables/SERVICE_FEE_RATE.md create mode 100644 0.16.23/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/SimpleAccountABI.md create mode 100644 0.16.23/api/@aastar/core/variables/SimpleAccountArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/SimpleAccountFactoryABI.md create mode 100644 0.16.23/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/SuperPaymasterABI.md create mode 100644 0.16.23/api/@aastar/core/variables/SuperPaymasterArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md create mode 100644 0.16.23/api/@aastar/core/variables/TEST_COMMUNITIES.md create mode 100644 0.16.23/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/TOKEN_ADDRESSES.md create mode 100644 0.16.23/api/@aastar/core/variables/V2_SUMMARY.md create mode 100644 0.16.23/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md create mode 100644 0.16.23/api/@aastar/core/variables/xPNTsFactoryABI.md create mode 100644 0.16.23/api/@aastar/core/variables/xPNTsFactoryArtifact.md create mode 100644 0.16.23/api/@aastar/core/variables/xPNTsTokenABI.md create mode 100644 0.16.23/api/@aastar/core/variables/xPNTsTokenArtifact.md create mode 100644 0.16.23/api/@aastar/dapp/classes/DVTClient.md create mode 100644 0.16.23/api/@aastar/dapp/functions/useCreditScore.md create mode 100644 0.16.23/api/@aastar/dapp/functions/useSuperPaymaster.md create mode 100644 0.16.23/api/@aastar/dapp/index.md create mode 100644 0.16.23/api/@aastar/enduser/classes/CommunityClient.md create mode 100644 0.16.23/api/@aastar/enduser/classes/UserClient.md create mode 100644 0.16.23/api/@aastar/enduser/classes/UserLifecycle.md create mode 100644 0.16.23/api/@aastar/enduser/index.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/CommunityClientConfig.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/CommunityInfo.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/CreateCommunityParams.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/GaslessConfig.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/OnboardResult.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/ReputationData.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/UserClientConfig.md create mode 100644 0.16.23/api/@aastar/enduser/interfaces/UserLifecycleConfig.md create mode 100644 0.16.23/api/@aastar/identity/classes/ReputationClient.md create mode 100644 0.16.23/api/@aastar/identity/functions/checkMySBT.md create mode 100644 0.16.23/api/@aastar/identity/functions/getMySBTId.md create mode 100644 0.16.23/api/@aastar/identity/index.md create mode 100644 0.16.23/api/@aastar/operator/classes/OperatorLifecycle.md create mode 100644 0.16.23/api/@aastar/operator/classes/PaymasterOperatorClient.md create mode 100644 0.16.23/api/@aastar/operator/classes/ProtocolClient.md create mode 100644 0.16.23/api/@aastar/operator/enumerations/ProposalState.md create mode 100644 0.16.23/api/@aastar/operator/index.md create mode 100644 0.16.23/api/@aastar/operator/interfaces/OperatorClientConfig.md create mode 100644 0.16.23/api/@aastar/operator/interfaces/OperatorStatus.md create mode 100644 0.16.23/api/@aastar/operator/interfaces/ProtocolClientConfig.md create mode 100644 0.16.23/api/@aastar/operator/interfaces/SponsorshipPolicy.md create mode 100644 0.16.23/api/@aastar/paymaster/classes/PaymasterClient.md create mode 100644 0.16.23/api/@aastar/paymaster/classes/PaymasterOperator.md create mode 100644 0.16.23/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md create mode 100644 0.16.23/api/@aastar/paymaster/classes/SuperPaymasterClient.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/buildPaymasterData.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/buildSuperPaymasterData.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/checkEligibility.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/formatUserOpV07.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/getUserOpHashV07.md create mode 100644 0.16.23/api/@aastar/paymaster/functions/tuneGasLimit.md create mode 100644 0.16.23/api/@aastar/paymaster/index.md create mode 100644 0.16.23/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md create mode 100644 0.16.23/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md create mode 100644 0.16.23/api/@aastar/paymaster/type-aliases/PaymasterConfig.md create mode 100644 0.16.23/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md create mode 100644 0.16.23/api/@aastar/sdk.md create mode 100644 0.16.23/api/@aastar/sdk/index.md create mode 100644 0.16.23/api/@aastar/tokens/classes/FinanceClient.md create mode 100644 0.16.23/api/@aastar/tokens/index.md create mode 100644 0.16.23/api/index.md create mode 100644 0.16.23/api/modules/analytics.md create mode 100644 0.16.23/api/modules/sdk.md create mode 100644 0.16.23/changelog.md create mode 100644 0.16.23/examples/README.md create mode 100644 0.16.23/examples/community-flow.md create mode 100644 0.16.23/examples/enduser-flow.md create mode 100644 0.16.23/examples/index.md create mode 100644 0.16.23/examples/multi-chain.md create mode 100644 0.16.23/examples/operator-flow.md create mode 100644 0.16.23/guide/ABI_MAINTENANCE_PLAN.md create mode 100644 0.16.23/guide/API_REFERENCE.md create mode 100644 0.16.23/guide/CLI_GUIDE.md create mode 100644 0.16.23/guide/Configuration_Sync.md create mode 100644 0.16.23/guide/DAO_Mining_Distribution_Plan.md create mode 100644 0.16.23/guide/DEMO_REFACTOR_PLAN.md create mode 100644 0.16.23/guide/DOCUMENTATION_PLAN.md create mode 100644 0.16.23/guide/ENV_SEPOLIA_UPDATE.md create mode 100644 0.16.23/guide/L2_BUSINESS_CLIENTS_PLAN.md create mode 100644 0.16.23/guide/L3-demo-API-and-simple-demo-walk-through.md create mode 100644 0.16.23/guide/L4_Manual_Test_CheatSheet.md create mode 100644 0.16.23/guide/Plan.md create mode 100644 0.16.23/guide/Regression_Testing_Guide.md create mode 100644 0.16.23/guide/Reputation-to-Credit_Mapping_Whitepaper.md create mode 100644 0.16.23/guide/SDK_ABI_COVERAGE.md create mode 100644 0.16.23/guide/SDK_COVERAGE_STRATEGY.md create mode 100644 0.16.23/guide/SDK_Optimization_Evaluation_Plan.md create mode 100644 0.16.23/guide/SDK_REGRESSION_AND_API_PLAN.md create mode 100644 0.16.23/guide/SDK_STAGE3_PLAN.md create mode 100644 0.16.23/guide/SEPOLIA_ENV_REFERENCE.md create mode 100644 0.16.23/guide/STAGE3.md create mode 100644 0.16.23/guide/Script_Comparison_Report.md create mode 100644 0.16.23/guide/Security-solution.md create mode 100644 0.16.23/guide/Sepolia_Latest_Deployment.md create mode 100644 0.16.23/guide/TESTER_GUIDE_GASLESS.md create mode 100644 0.16.23/guide/TEST_COMMANDS.md create mode 100644 0.16.23/guide/TEST_COVERAGE_MATRIX.md create mode 100644 0.16.23/guide/TODO_SDK_COVERAGE.md create mode 100644 0.16.23/guide/USER_CASE_DESIGN.md create mode 100644 0.16.23/guide/Verifier_L4_Gasless_Plan.md create mode 100644 0.16.23/guide/api_compliance_report.md create mode 100644 0.16.23/guide/concepts/account-abstraction.md create mode 100644 0.16.23/guide/concepts/rainbow-bridge.md create mode 100644 0.16.23/guide/concepts/reputation.md create mode 100644 0.16.23/guide/concepts/superpaymaster.md create mode 100644 0.16.23/guide/deployments/index.md create mode 100644 0.16.23/guide/deployments/verify.op-sepolia.contracts.md create mode 100644 0.16.23/guide/deployments/verify.optimism.contracts.md create mode 100644 0.16.23/guide/deployments/verify.sepolia.contracts.md create mode 100644 0.16.23/guide/docs/ABI_MAINTENANCE_PLAN.md create mode 100644 0.16.23/guide/docs/API_REFERENCE.md create mode 100644 0.16.23/guide/docs/Account_Initialization_Guide_CN.md create mode 100644 0.16.23/guide/docs/Configuration_Sync.md create mode 100644 0.16.23/guide/docs/DAO_Mining_Distribution_Plan.md create mode 100644 0.16.23/guide/docs/DEMO_REFACTOR_PLAN.md create mode 100644 0.16.23/guide/docs/DOCUMENTATION_PLAN.md create mode 100644 0.16.23/guide/docs/ENV_SEPOLIA_UPDATE.md create mode 100644 0.16.23/guide/docs/L2_BUSINESS_CLIENTS_PLAN.md create mode 100644 0.16.23/guide/docs/L3_Complete_Demo_Walkthrough.md create mode 100644 0.16.23/guide/docs/L3_Lifecycle_Developer_Guide.md create mode 100644 0.16.23/guide/docs/L3_Lifecycle_Patterns_Design.md create mode 100644 0.16.23/guide/docs/L3_Use_Case_Analysis.md create mode 100644 0.16.23/guide/docs/L4_Manual_Test_CheatSheet.md create mode 100644 0.16.23/guide/docs/Plan.md create mode 100644 0.16.23/guide/docs/Regression_Testing_Guide.md create mode 100644 0.16.23/guide/docs/Reputation-to-Credit_Mapping_Whitepaper.md create mode 100644 0.16.23/guide/docs/SDK_ABI_COVERAGE.md create mode 100644 0.16.23/guide/docs/SDK_COVERAGE_STRATEGY.md create mode 100644 0.16.23/guide/docs/SDK_Optimization_Evaluation_Plan.md create mode 100644 0.16.23/guide/docs/SDK_REGRESSION_AND_API_PLAN.md create mode 100644 0.16.23/guide/docs/SDK_STAGE3_ANALYSIS.md create mode 100644 0.16.23/guide/docs/SDK_STAGE3_PLAN.md create mode 100644 0.16.23/guide/docs/SEPOLIA_ENV_REFERENCE.md create mode 100644 0.16.23/guide/docs/STAGE3.md create mode 100644 0.16.23/guide/docs/Script_Comparison_Report.md create mode 100644 0.16.23/guide/docs/Sepolia_Latest_Deployment.md create mode 100644 0.16.23/guide/docs/TESTER_GUIDE_GASLESS.md create mode 100644 0.16.23/guide/docs/TEST_COVERAGE_MATRIX.md create mode 100644 0.16.23/guide/docs/TODO_SDK_COVERAGE.md create mode 100644 0.16.23/guide/docs/USER_CASE_DESIGN.md create mode 100644 0.16.23/guide/docs/Verifier_L4_Gasless_Plan.md create mode 100644 0.16.23/guide/docs/api_compliance_report.md create mode 100644 0.16.23/guide/docs/old-solution.md create mode 100644 0.16.23/guide/docs/paper-data-collection.md create mode 100644 0.16.23/guide/docs/release_plan_v0.16.12.md create mode 100644 0.16.23/guide/docs/technical_plan.md create mode 100644 0.16.23/guide/docs/verify.op-sepolia.contracts.md create mode 100644 0.16.23/guide/docs/verify.sepolia.contracts.md create mode 100644 0.16.23/guide/getting-started.md create mode 100644 0.16.23/guide/installation.md create mode 100644 0.16.23/guide/keeper.md create mode 100644 0.16.23/guide/old-solution.md create mode 100644 0.16.23/guide/packages/analytics/index.md create mode 100644 0.16.23/guide/paper-data-collection.md create mode 100644 0.16.23/guide/quick-start.md create mode 100644 0.16.23/guide/real-l3-demo-log.md create mode 100644 0.16.23/guide/release_plan_v0.16.12.md create mode 100644 0.16.23/guide/task_breakdown.md create mode 100644 0.16.23/guide/technical_plan.md create mode 100644 0.16.23/guide/use-cases/community-management.md create mode 100644 0.16.23/guide/use-cases/gasless-transactions.md create mode 100644 0.16.23/guide/use-cases/operator-staking.md create mode 100644 0.16.23/guide/use-cases/yop.md create mode 100644 0.16.23/guide/verify.op-sepolia.contracts.md create mode 100644 0.16.23/guide/verify.sepolia.contracts.md create mode 100644 0.16.23/index.md create mode 100644 0.16.23/zh/api/index.md create mode 100644 0.16.23/zh/examples/community-flow.md create mode 100644 0.16.23/zh/examples/complete-workflow.md create mode 100644 0.16.23/zh/examples/enduser-flow.md create mode 100644 0.16.23/zh/examples/index.md create mode 100644 0.16.23/zh/examples/multi-chain.md create mode 100644 0.16.23/zh/examples/operator-flow.md create mode 100644 0.16.23/zh/guide/CLI_GUIDE.md create mode 100644 0.16.23/zh/guide/DOCUMENTATION_PLAN.md create mode 100644 0.16.23/zh/guide/Plan.md create mode 100644 0.16.23/zh/guide/SDK_Optimization_Evaluation_Plan.md create mode 100644 0.16.23/zh/guide/Security-solution.md create mode 100644 0.16.23/zh/guide/TEST_COMMANDS.md create mode 100644 0.16.23/zh/guide/TEST_COVERAGE_MATRIX.md create mode 100644 0.16.23/zh/guide/concepts/account-abstraction.md create mode 100644 0.16.23/zh/guide/concepts/rainbow-bridge.md create mode 100644 0.16.23/zh/guide/concepts/reputation.md create mode 100644 0.16.23/zh/guide/concepts/superpaymaster.md create mode 100644 0.16.23/zh/guide/getting-started.md create mode 100644 0.16.23/zh/guide/installation.md create mode 100644 0.16.23/zh/guide/old-solution.md create mode 100644 0.16.23/zh/guide/paper-data-collection.md create mode 100644 0.16.23/zh/guide/quick-start.md create mode 100644 0.16.23/zh/guide/sdk-readme.md create mode 100644 0.16.23/zh/guide/task_breakdown.md create mode 100644 0.16.23/zh/guide/technical_plan.md create mode 100644 0.16.23/zh/guide/use-cases/community-management.md create mode 100644 0.16.23/zh/guide/use-cases/gasless-transactions.md create mode 100644 0.16.23/zh/guide/use-cases/operator-staking.md create mode 100644 0.16.23/zh/guide/use-cases/yop.md diff --git a/.vitepress/config.ts b/.vitepress/config.ts index 042aad3bf..a8001a3f1 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -1,11 +1,173 @@ import { defineConfig } from 'vitepress' +import type { DefaultTheme } from 'vitepress' + +// Helper: deep-clone a sidebar array and prefix every root-absolute `link` +// with the given version path (e.g. '/0.16.23'). Used to mirror the latest +// sidebars for the frozen archived version without hand-editing each entry. +function prefixSidebar( + items: DefaultTheme.SidebarItem[], + prefix: string +): DefaultTheme.SidebarItem[] { + return items.map((item) => { + const next: DefaultTheme.SidebarItem = { ...item } + if (typeof next.link === 'string' && next.link.startsWith('/')) { + next.link = prefix + next.link + } + if (Array.isArray(next.items)) { + next.items = prefixSidebar(next.items, prefix) + } + return next + }) +} + +// --- Latest (root) sidebars ------------------------------------------------- + +const guideSidebar: DefaultTheme.SidebarItem[] = [ + { + text: 'Introduction', + items: [ + { text: 'Getting Started', link: '/guide/getting-started' }, + { text: 'Installation', link: '/guide/installation' }, + { text: 'Quick Start', link: '/guide/quick-start' } + ] + }, + { + text: 'Core Concepts', + items: [ + { text: 'Account Abstraction', link: '/guide/concepts/account-abstraction' }, + { text: 'SuperPaymaster (AOA+)', link: '/guide/concepts/superpaymaster' }, + { text: 'EOA Rainbow Bridge', link: '/guide/concepts/rainbow-bridge' }, + { text: 'Reputation System', link: '/guide/concepts/reputation' } + ] + }, + { + text: 'Use Cases', + items: [ + { text: 'Community Management', link: '/guide/use-cases/community-management' }, + { text: 'Gasless Transactions', link: '/guide/use-cases/gasless-transactions' }, + { text: 'Operator Staking', link: '/guide/use-cases/operator-staking' }, + { text: 'Build Your Own Protocol', link: '/guide/use-cases/yop' } + ] + }, + { + text: 'Deployments', + items: [ + { text: 'Overview (Optimism Default)', link: '/guide/deployments/' }, + { text: 'Optimism Contracts', link: '/guide/deployments/verify.optimism.contracts' }, + { text: 'OP-Sepolia Contracts', link: '/guide/deployments/verify.op-sepolia.contracts' }, + { text: 'Sepolia Contracts', link: '/guide/deployments/verify.sepolia.contracts' } + ] + }, + { + text: 'Operations', + items: [ + { text: 'Configuration Sync', link: '/guide/docs/Configuration_Sync' }, + { text: 'Gasless Tester Guide', link: '/guide/docs/TESTER_GUIDE_GASLESS' }, + { text: 'Account Initialization (CN)', link: '/guide/docs/Account_Initialization_Guide_CN' }, + { text: 'Stage3 Analysis', link: '/guide/docs/SDK_STAGE3_ANALYSIS' } + ] + }, + { + text: 'Lifecycle API (L3)', + items: [ + { text: 'Developer Guide', link: '/guide/docs/L3_Lifecycle_Developer_Guide' }, + { text: 'Complete Demo Walkthrough', link: '/guide/docs/L3_Complete_Demo_Walkthrough' }, + { text: 'Patterns Design', link: '/guide/docs/L3_Lifecycle_Patterns_Design' } + ] + } +] + +const zhGuideSidebar: DefaultTheme.SidebarItem[] = [ + { + text: '快速入门', + items: [ + { text: '开始使用', link: '/zh/guide/getting-started' }, + { text: '安裝', link: '/zh/guide/installation' }, + { text: '快速開始', link: '/zh/guide/quick-start' } + ] + }, + { + text: '核心概念', + items: [ + { text: '賬戶抽象', link: '/zh/guide/concepts/account-abstraction' }, + { text: 'SuperPaymaster (AOA+)', link: '/zh/guide/concepts/superpaymaster' }, + { text: 'EOA Rainbow Bridge', link: '/zh/guide/concepts/rainbow-bridge' }, + { text: '聲譽系統', link: '/zh/guide/concepts/reputation' } + ] + }, + { + text: '应用场景', + items: [ + { text: '社区管理', link: '/zh/guide/use-cases/community-management' }, + { text: 'Gasless 交易', link: '/zh/guide/use-cases/gasless-transactions' }, + { text: 'Operator 質押', link: '/zh/guide/use-cases/operator-staking' }, + { text: '自建協議', link: '/zh/guide/use-cases/yop' } + ] + } +] + +const apiSidebar: DefaultTheme.SidebarItem[] = [ + { + text: 'Getting Started', + items: [ + { text: 'Overview', link: '/api/' }, + { text: 'Installation', link: '/api/@aastar/sdk#installation' }, + { text: 'Quick Start', link: '/api/@aastar/sdk#usage' } + ] + }, + { + text: '@aastar/sdk (Meta Package)', + items: [ + { text: 'Overview', link: '/api/@aastar/sdk' }, + { text: 'Node.js Tools', link: '/api/@aastar/sdk/node' } + ] + }, + { + text: 'Core Modules', + collapsed: false, + items: [ + { text: '@aastar/community', link: '/api/@aastar/community' }, + { text: '@aastar/operator', link: '/api/@aastar/operator' }, + { text: '@aastar/enduser', link: '/api/@aastar/enduser' }, + { text: '@aastar/core', link: '/api/@aastar/core' }, + { text: '@aastar/account', link: '/api/@aastar/account' }, + { text: '@aastar/paymaster', link: '/api/@aastar/paymaster' }, + { text: '@aastar/tokens', link: '/api/@aastar/tokens' }, + { text: '@aastar/identity', link: '/api/@aastar/identity' }, + { text: '@aastar/analytics', link: '/api/@aastar/analytics' }, + { text: '@aastar/dapp', link: '/api/@aastar/dapp' } + ] + }, + { + text: 'Examples', + items: [ + { text: 'SDK Handbooks', link: '/api/@aastar/sdk#core-scenarios' } + ] + } +] + +const examplesSidebar: DefaultTheme.SidebarItem[] = [ + { + text: 'Complete Examples', + items: [ + { text: 'Overview', link: '/examples/' }, + { text: 'Operator Flow', link: '/examples/operator-flow' }, + { text: 'Community Flow', link: '/examples/community-flow' }, + { text: 'End User Flow', link: '/examples/enduser-flow' }, + { text: 'L3 Complete Lifecycle', link: '/guide/docs/L3_Complete_Demo_Walkthrough' }, + { text: 'Multi-Chain Setup', link: '/examples/multi-chain' } + ] + } +] + +const ARCHIVED_VERSION = '/0.16.23' export default defineConfig({ title: 'AAStar SDK', description: 'Build Your Own Protocol with Account Abstraction', - + lang: 'en', - ignoreDeadLinks: true, + ignoreDeadLinks: true, lastUpdated: true, vite: { plugins: [ @@ -52,159 +214,40 @@ export default defineConfig({ themeConfig: { logo: '/aastar-logo.png', lastUpdatedText: 'Last Updated', - + // Enable right sidebar (TOC) outline: { level: [2, 3], label: 'On this page' }, - + nav: [ { text: 'Guide', link: '/guide/getting-started' }, { text: 'API', link: '/api/' }, { text: 'Examples', link: '/examples/' }, { text: 'Deployments', link: '/guide/deployments/' }, - { text: 'History', link: '/changelog' } + { text: 'History', link: '/changelog' }, + { + text: 'v0.20.x (latest)', + items: [ + { text: 'v0.20.x (latest)', link: '/' }, + { text: 'v0.16.23', link: '/0.16.23/' } + ] + } ], sidebar: { - '/guide/': [ - { - text: 'Introduction', - items: [ - { text: 'Getting Started', link: '/guide/getting-started' }, - { text: 'Installation', link: '/guide/installation' }, - { text: 'Quick Start', link: '/guide/quick-start' } - ] - }, - { - text: 'Core Concepts', - items: [ - { text: 'Account Abstraction', link: '/guide/concepts/account-abstraction' }, - { text: 'SuperPaymaster (AOA+)', link: '/guide/concepts/superpaymaster' }, - { text: 'EOA Rainbow Bridge', link: '/guide/concepts/rainbow-bridge' }, - { text: 'Reputation System', link: '/guide/concepts/reputation' } - ] - }, - { - text: 'Use Cases', - items: [ - { text: 'Community Management', link: '/guide/use-cases/community-management' }, - { text: 'Gasless Transactions', link: '/guide/use-cases/gasless-transactions' }, - { text: 'Operator Staking', link: '/guide/use-cases/operator-staking' }, - { text: 'Build Your Own Protocol', link: '/guide/use-cases/yop' } - ] - }, - { - text: 'Deployments', - items: [ - { text: 'Overview (Optimism Default)', link: '/guide/deployments/' }, - { text: 'Optimism Contracts', link: '/guide/deployments/verify.optimism.contracts' }, - { text: 'OP-Sepolia Contracts', link: '/guide/deployments/verify.op-sepolia.contracts' }, - { text: 'Sepolia Contracts', link: '/guide/deployments/verify.sepolia.contracts' } - ] - }, - { - text: 'Operations', - items: [ - { text: 'Configuration Sync', link: '/guide/docs/Configuration_Sync' }, - { text: 'Gasless Tester Guide', link: '/guide/docs/TESTER_GUIDE_GASLESS' }, - { text: 'Account Initialization (CN)', link: '/guide/docs/Account_Initialization_Guide_CN' }, - { text: 'Stage3 Analysis', link: '/guide/docs/SDK_STAGE3_ANALYSIS' } - ] - }, - { - text: 'Lifecycle API (L3)', - items: [ - { text: 'Developer Guide', link: '/guide/docs/L3_Lifecycle_Developer_Guide' }, - { text: 'Complete Demo Walkthrough', link: '/guide/docs/L3_Complete_Demo_Walkthrough' }, - { text: 'Patterns Design', link: '/guide/docs/L3_Lifecycle_Patterns_Design' } - ] - } - ], - - '/zh/guide/': [ - { - text: '快速入门', - items: [ - { text: '开始使用', link: '/zh/guide/getting-started' }, - { text: '安裝', link: '/zh/guide/installation' }, - { text: '快速開始', link: '/zh/guide/quick-start' } - ] - }, - { - text: '核心概念', - items: [ - { text: '賬戶抽象', link: '/zh/guide/concepts/account-abstraction' }, - { text: 'SuperPaymaster (AOA+)', link: '/zh/guide/concepts/superpaymaster' }, - { text: 'EOA Rainbow Bridge', link: '/zh/guide/concepts/rainbow-bridge' }, - { text: '聲譽系統', link: '/zh/guide/concepts/reputation' } - ] - }, - { - text: '应用场景', - items: [ - { text: '社区管理', link: '/zh/guide/use-cases/community-management' }, - { text: 'Gasless 交易', link: '/zh/guide/use-cases/gasless-transactions' }, - { text: 'Operator 質押', link: '/zh/guide/use-cases/operator-staking' }, - { text: '自建協議', link: '/zh/guide/use-cases/yop' } - ] - } - ], - - '/api/': [ - { - text: 'Getting Started', - items: [ - { text: 'Overview', link: '/api/' }, - { text: 'Installation', link: '/api/@aastar/sdk#installation' }, - { text: 'Quick Start', link: '/api/@aastar/sdk#usage' } - ] - }, - { - text: '@aastar/sdk (Meta Package)', - items: [ - { text: 'Overview', link: '/api/@aastar/sdk' }, - { text: 'Node.js Tools', link: '/api/@aastar/sdk/node' } - ] - }, - { - text: 'Core Modules', - collapsed: false, - items: [ - { text: '@aastar/community', link: '/api/@aastar/community' }, - { text: '@aastar/operator', link: '/api/@aastar/operator' }, - { text: '@aastar/enduser', link: '/api/@aastar/enduser' }, - { text: '@aastar/core', link: '/api/@aastar/core' }, - { text: '@aastar/account', link: '/api/@aastar/account' }, - { text: '@aastar/paymaster', link: '/api/@aastar/paymaster' }, - { text: '@aastar/tokens', link: '/api/@aastar/tokens' }, - { text: '@aastar/identity', link: '/api/@aastar/identity' }, - { text: '@aastar/analytics', link: '/api/@aastar/analytics' }, - { text: '@aastar/dapp', link: '/api/@aastar/dapp' } - ] - }, - { - text: 'Examples', - items: [ - { text: 'SDK Handbooks', link: '/api/@aastar/sdk#core-scenarios' } - ] - } - ], - - '/examples/': [ - { - text: 'Complete Examples', - items: [ - { text: 'Overview', link: '/examples/' }, - { text: 'Operator Flow', link: '/examples/operator-flow' }, - { text: 'Community Flow', link: '/examples/community-flow' }, - { text: 'End User Flow', link: '/examples/enduser-flow' }, - { text: 'L3 Complete Lifecycle', link: '/guide/docs/L3_Complete_Demo_Walkthrough' }, - { text: 'Multi-Chain Setup', link: '/examples/multi-chain' } - ] - } - ] + '/guide/': guideSidebar, + '/zh/guide/': zhGuideSidebar, + '/api/': apiSidebar, + '/examples/': examplesSidebar, + + // Mirrored sidebars for the frozen archived version (v0.16.23). + // Links are auto-prefixed with the version path via prefixSidebar(). + '/0.16.23/guide/': prefixSidebar(guideSidebar, ARCHIVED_VERSION), + '/0.16.23/api/': prefixSidebar(apiSidebar, ARCHIVED_VERSION), + '/0.16.23/examples/': prefixSidebar(examplesSidebar, ARCHIVED_VERSION), + '/0.16.23/zh/guide/': prefixSidebar(zhGuideSidebar, ARCHIVED_VERSION) }, socialLinks: [ @@ -213,7 +256,7 @@ export default defineConfig({ ], footer: { - message: 'Released under the MIT License.', + message: 'Released under the Apache-2.0 License.', copyright: 'Copyright © 2023-present AAStar Community' }, diff --git a/0.16.23/api/@aastar/account/classes/UserOpClient.md b/0.16.23/api/@aastar/account/classes/UserOpClient.md new file mode 100644 index 000000000..72f6c0bdc --- /dev/null +++ b/0.16.23/api/@aastar/account/classes/UserOpClient.md @@ -0,0 +1,72 @@ +Defined in: [packages/account/src/index.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L40) + +UserOperation Client for handling high-level flows + +## Constructors + +### Constructor + +> **new UserOpClient**(): `UserOpClient` + +#### Returns + +`UserOpClient` + +## Methods + +### estimateGas() + +> `static` **estimateGas**(`bundler`, `op`, `entryPoint`): `Promise`\<`any`\> + +Defined in: [packages/account/src/index.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `bundler` | `any` | +| `op` | `any` | +| `entryPoint` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### getReceipt() + +> `static` **getReceipt**(`bundler`, `hash`): `Promise`\<`any`\> + +Defined in: [packages/account/src/index.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L55) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `bundler` | `any` | +| `hash` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### sendUserOp() + +> `static` **sendUserOp**(`bundler`, `op`, `entryPoint`): `Promise`\<`any`\> + +Defined in: [packages/account/src/index.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L48) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `bundler` | `any` | +| `op` | `any` | +| `entryPoint` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> diff --git a/0.16.23/api/@aastar/account/functions/createEOAWalletClient.md b/0.16.23/api/@aastar/account/functions/createEOAWalletClient.md new file mode 100644 index 000000000..e24a5ffca --- /dev/null +++ b/0.16.23/api/@aastar/account/functions/createEOAWalletClient.md @@ -0,0 +1,15 @@ +> **createEOAWalletClient**(`privateKey`, `chain`, `transport`): [`EOAWalletClient`](../type-aliases/EOAWalletClient.md) + +Defined in: [packages/account/src/eoa.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/eoa.ts#L9) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `privateKey` | `` `0x${string}` `` | +| `chain` | [`Chain`](https://viem.sh/docs/index.html) | +| `transport` | [`Transport`](https://viem.sh/docs/index.html) | + +## Returns + +[`EOAWalletClient`](../type-aliases/EOAWalletClient.md) diff --git a/0.16.23/api/@aastar/account/functions/getUserOpHash.md b/0.16.23/api/@aastar/account/functions/getUserOpHash.md new file mode 100644 index 000000000..81f365080 --- /dev/null +++ b/0.16.23/api/@aastar/account/functions/getUserOpHash.md @@ -0,0 +1,17 @@ +> **getUserOpHash**(`op`, `ep`, `chainId`): `` `0x${string}` `` + +Defined in: [packages/account/src/index.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L16) + +Local implementation of EntryPoint v0.7 getUserOpHash + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `op` | `any` | +| `ep` | `` `0x${string}` `` | +| `chainId` | `number` | + +## Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/account/functions/packUserOpLimits.md b/0.16.23/api/@aastar/account/functions/packUserOpLimits.md new file mode 100644 index 000000000..6eaebb705 --- /dev/null +++ b/0.16.23/api/@aastar/account/functions/packUserOpLimits.md @@ -0,0 +1,16 @@ +> **packUserOpLimits**(`high`, `low`): `` `0x${string}` `` + +Defined in: [packages/account/src/index.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/index.ts#L9) + +Common Pack Logic for v0.7 UserOperations + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `high` | `bigint` | +| `low` | `bigint` | + +## Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/account/functions/toSimpleSmartAccount.md b/0.16.23/api/@aastar/account/functions/toSimpleSmartAccount.md new file mode 100644 index 000000000..12b0e50a7 --- /dev/null +++ b/0.16.23/api/@aastar/account/functions/toSimpleSmartAccount.md @@ -0,0 +1,31 @@ +> **toSimpleSmartAccount**(`parameters`): `Promise`\<[`SimpleSmartAccount`](../type-aliases/SimpleSmartAccount.md)\> + +Defined in: [packages/account/src/accounts/simple.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/accounts/simple.ts#L22) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | \{ `client`: `any`; `entryPoint`: \{ `address`: `` `0x${string}` ``; `version`: `"0.6"` \| `"0.7"`; \}; `factoryAddress`: `` `0x${string}` ``; `index?`: `bigint`; `owner`: \{ `address`: `` `0x${string}` ``; `nonceManager?`: [`NonceManager`](https://viem.sh/docs/index.html); `publicKey`: `` `0x${string}` ``; `sign?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; `signAuthorization?`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `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`; \} | +| `parameters.client` | `any` | +| `parameters.entryPoint` | \{ `address`: `` `0x${string}` ``; `version`: `"0.6"` \| `"0.7"`; \} | +| `parameters.entryPoint.address` | `` `0x${string}` `` | +| `parameters.entryPoint.version` | `"0.6"` \| `"0.7"` | +| `parameters.factoryAddress` | `` `0x${string}` `` | +| `parameters.index?` | `bigint` | +| `parameters.owner` | \{ `address`: `` `0x${string}` ``; `nonceManager?`: [`NonceManager`](https://viem.sh/docs/index.html); `publicKey`: `` `0x${string}` ``; `sign?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; `signAuthorization?`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`__namedParameters`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`serializer`, `transaction`\>(`transaction`, `options?`) => `Promise`\<`` `0x${string}` ``\>; `signTypedData`: \<`typedData`, `primaryType`\>(`parameters`) => `Promise`\<`` `0x${string}` ``\>; `source`: `string`; `type`: `"local"`; \} | +| `parameters.owner.address` | `` `0x${string}` `` | +| `parameters.owner.nonceManager?` | [`NonceManager`](https://viem.sh/docs/index.html) | +| `parameters.owner.publicKey` | `` `0x${string}` `` | +| `parameters.owner.sign?` | (`parameters`) => `Promise`\<`` `0x${string}` ``\> | +| `parameters.owner.signAuthorization?` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | +| `parameters.owner.signMessage` | (`__namedParameters`) => `Promise`\<`` `0x${string}` ``\> | +| `parameters.owner.signTransaction` | \<`serializer`, `transaction`\>(`transaction`, `options?`) => `Promise`\<`` `0x${string}` ``\> | +| `parameters.owner.signTypedData` | \<`typedData`, `primaryType`\>(`parameters`) => `Promise`\<`` `0x${string}` ``\> | +| `parameters.owner.source` | `string` | +| `parameters.owner.type` | `"local"` | +| `parameters.salt?` | `bigint` | + +## Returns + +`Promise`\<[`SimpleSmartAccount`](../type-aliases/SimpleSmartAccount.md)\> diff --git a/0.16.23/api/@aastar/account/index.md b/0.16.23/api/@aastar/account/index.md new file mode 100644 index 000000000..3ded6a761 --- /dev/null +++ b/0.16.23/api/@aastar/account/index.md @@ -0,0 +1,15 @@ +## Classes + +- [UserOpClient](classes/UserOpClient.md) + +## Type Aliases + +- [EOAWalletClient](type-aliases/EOAWalletClient.md) +- [SimpleSmartAccount](type-aliases/SimpleSmartAccount.md) + +## Functions + +- [createEOAWalletClient](functions/createEOAWalletClient.md) +- [getUserOpHash](functions/getUserOpHash.md) +- [packUserOpLimits](functions/packUserOpLimits.md) +- [toSimpleSmartAccount](functions/toSimpleSmartAccount.md) diff --git a/0.16.23/api/@aastar/account/type-aliases/EOAWalletClient.md b/0.16.23/api/@aastar/account/type-aliases/EOAWalletClient.md new file mode 100644 index 000000000..2ae0243f2 --- /dev/null +++ b/0.16.23/api/@aastar/account/type-aliases/EOAWalletClient.md @@ -0,0 +1,30 @@ +> **EOAWalletClient** = [`WalletClient`](https://viem.sh/docs/index.html) & `object` + +Defined in: [packages/account/src/eoa.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/eoa.ts#L4) + +## Type Declaration + +### getAddress() + +> **getAddress**: () => `Address` + +#### Returns + +`Address` + +### sendTransaction() + +> **sendTransaction**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `data?`: [`Hex`](https://viem.sh/docs/index.html); `to`: `Address`; `value?`: `bigint`; \} | +| `args.data?` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.to` | `Address` | +| `args.value?` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> diff --git a/0.16.23/api/@aastar/account/type-aliases/SimpleSmartAccount.md b/0.16.23/api/@aastar/account/type-aliases/SimpleSmartAccount.md new file mode 100644 index 000000000..2630ebf8e --- /dev/null +++ b/0.16.23/api/@aastar/account/type-aliases/SimpleSmartAccount.md @@ -0,0 +1,39 @@ +> **SimpleSmartAccount** = [`LocalAccount`](https://viem.sh/docs/index.html) & `object` + +Defined in: [packages/account/src/accounts/simple.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/account/src/accounts/simple.ts#L15) + +## Type Declaration + +### entryPoint + +> **entryPoint**: `Address` + +### getDummySignature() + +> **getDummySignature**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +### getInitCode() + +> **getInitCode**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +### signUserOperation() + +> **signUserOperation**: (`userOp`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `userOp` | `any` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> diff --git a/0.16.23/api/@aastar/analytics.md b/0.16.23/api/@aastar/analytics.md new file mode 100644 index 000000000..8ba9794ef --- /dev/null +++ b/0.16.23/api/@aastar/analytics.md @@ -0,0 +1,440 @@ +# Analytics Package (AAStar Gas Analytics & Experimentation) + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It supports **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis with rigorous, on-chain ground truth verification. + +```bash +# 快速入口(从 aastar-sdk 根目录运行) + +# 收集 OP Mainnet paymaster 基线 +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts --network op-mainnet --n 50 + +# 收集 Paper7 专属数据 +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 + +# 全流程协调器 +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia + +# Gas 分析报告文档 +packages/analytics/docs/OP_Mainnet_Gas_Analysis_Report.md +``` + +--- + +## System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # Traffic Generation Logic +│ ├── collectors/ # Etherscan/RPC Fetchers +│ │ └── EventFetcher.ts # On-chain UserOperationEvent collector +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── scripts/ # ← All data collection scripts (consolidated) +│ ├── collect_paymaster_baselines.ts # OP mainnet V4/SuperPM baselines +│ ├── collect_eoa_erc20_baseline.ts # EOA ERC20 transfer baseline +│ ├── collect_industry_baseline.ts # Alchemy/Pimlico baselines +│ ├── compute_cost_summary.ts # Aggregated cost breakdown table +│ ├── gasless-collect.ts # Gasless data collector (OP mainnet) +│ ├── paper7-exclusive-data.ts # Paper7 closed-loop data (anvil) +│ ├── paper7_credit_loop.ts # Credit→Debt→Repay cycle runner +│ ├── paper7_reputation_credit.ts # Reputation→Credit mapping runner +│ ├── run_analytics_coordinator.ts # Full pipeline coordinator +│ ├── run_paper7_exclusive_data.sh # Paper7 shell wrapper (CI-friendly) +│ ├── fetch-tx-hashes.ts # TX hash fetcher utility +│ └── scrape-tx.ts # Puppeteer Etherscan scraper +├── docs/ # ← Research reports and analysis documents +│ └── OP_Mainnet_Gas_Analysis_Report.md # Paper3/Paper7 gas cost evidence +├── data/ # Raw data store +│ ├── gasless_data_collection.csv # T1/T2/T2.1/T5 baseline (v1) +│ ├── gasless_data_collection_v2.csv # Controlled single-UserOp (v2) +│ ├── gasless_metrics_detailed.csv # Full L1/L2 fee decomposition +│ ├── industry_paymaster_baselines.csv # Alchemy, Pimlico on-chain baselines +│ ├── eoa_erc20_baseline.csv # Raw EOA transfer baseline +│ ├── paper7_exclusive/ # Paper7 credit/reputation/liquidity +│ └── paper_gas_op_mainnet/ # Paper3 per-date controlled datasets +│ ├── 2026-02-17/ # V4 n=36, SuperPM n=43 +│ └── 2026-02-18/ # V4/SuperPM with sender (n=50) +└── reports/ # HTML/Markdown summaries +``` + +--- + +## Workflows + +### A. Collect OP Mainnet Paymaster Baselines (Paper3) +```bash +# V4 baseline: strict single UserOp + ERC20 transfer filter +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type v4 --n 50 --strict-transfer --single-userop + +# SuperPaymaster baseline +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type super --n 50 +``` + +### B. Run Full Experiment (Coordinator) +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia +``` + +### C. Fetch Historical Data Only +```bash +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### D. Transaction Scraper (Etherscan) +Reads from `data/gasless_data_collection.csv`, outputs to `data/gasless_metrics_detailed.csv`. +```bash +pnpm tsx packages/analytics/scripts/scrape-tx.ts +``` + +--- + +## Data Directory + +| File | Description | +|------|-------------| +| `data/gasless_data_collection.csv` | T1/T2/T2.1/T5 records with TxHash + Label | +| `data/gasless_data_collection_v2.csv` | High-fidelity controlled dataset (single-UserOp, ERC20) | +| `data/gasless_metrics_detailed.csv` | L1 Fee, L2 Fee, Gas Used (Puppeteer scraped) | +| `data/industry_paymaster_baselines.csv` | Alchemy (mean=257k) + Pimlico (mean=387k) on-chain baselines | +| `data/eoa_erc20_baseline.csv` | Raw EOA ERC20 transfer baseline | +| `data/paper7_exclusive/` | Credit cycle + reputation + liquidity simulation (Anvil) | +| `data/paper_gas_op_mainnet/2026-02-17/` | V4 n=36, SuperPM n=43 (strict filter) | +| `data/paper_gas_op_mainnet/2026-02-18/` | V4/SuperPM with sender field (n=50) | + +--- + +## Paper7 Exclusive Data (Credit / Reputation / Liquidity) + +Paper7 requires a distinct set of evidence to prove **CommunityFi closed-loop semantics**: + +- **Reputation → Credit**: contribution/reputation synced into Registry, credit limit observed to change +- **Credit → Debt → Repay**: debt recorded in Paymaster/Registry, cleared via xPNTs +- **Liquidity (Baseline)**: simulation curve showing gas-redeemable vs non-redeemable points over time + +### Running + +```bash +# Unified entry (Anvil auto-start, deploy, sync, run all subtasks) +pnpm exec tsx packages/analytics/scripts/paper7-exclusive-data.ts --network anvil --cycles 5 + +# Shell wrapper (CI-friendly) +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### Output Structure + +```text +data/paper7_exclusive// + credit_cycle_1.json # credit→debt→repay per account + ... + reputation_credit.json # reputation sync → credit limit mapping + liquidity_velocity_simulation.csv + synced_config.anvil.json +``` + +#### `credit_cycle_*.json` fields +- `creditLimitWei / creditLimitEth`: credit limit in Registry +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`: debt lifecycle +- `gasUsed.*`: per-step gas units (approve, setCreditTier, recordDebt, mint) + +#### `reputation_credit.json` fields +- `score` / `globalReputation` / `creditLimitWei`: reputation → credit mapping +- `gasUsed.*`: setRule, syncToRegistry, etc. + +#### `liquidity_velocity_simulation.csv` columns +- `day`: simulation step +- `points_gas_redeemable`: points stock when gas-redeemable +- `points_baseline`: points stock without gas redemption + +--- + +## Key Modules + +### 1. Traffic Generators (`src/generators/`) +- **EOAGenerator**: Baseline ETH transfers for network cost measurement. +- **SuperPaymasterGenerator**: Treatment group — credit/asset-oriented gasless model. +- **PaymasterV4Generator**: Treatment group B — deposit model for comparison. + +### 2. Data Collectors (`src/collectors/`) +- **HistoricalFetcher**: Etherscan/OptimismScan API for full transaction histories. +- **EventFetcher**: On-chain `UserOperationEvent` log collector with strict filtering. + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +- **Attribution**: L1 Security | L2 Execution | Protocol Overhead breakdown. +- **Comparison**: T1 vs T2 vs T2.1 vs T5 vs industry baselines. + + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It has been upgraded to support **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis, moving beyond simple log analysis to rigorous, on-chain ground truth verification. +工作流: + +收集数据(日常运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia +产生新实验数据(需要时运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --gen-traffic + +收集events +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --fetch-events + +分析报告(查看结果): +pnpm tsx packages/analytics/src/gas-analyzer-v4.ts --network sepolia + +步骤是解耦的,按需执行即可 +--- + +## 🏗 System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## 🧩 Key Modules + +### 1. Traffic Generators (`src/generators/`) +Responsible for creating controlled, verifiable traffic patterns on testnets (Sepolia, OP Sepolia) and mainnets. +- **EOAGenerator**: Baseline ETH transfers to measure intrinsic network costs. +- **StandardAAGenerator**: ERC-4337 flows using industry-standard Paymasters (Pimlico/Alchemy). +- **SuperPaymasterGenerator**: **Treatment Group**. Uses the `EndUserClient` to execute gasless transactions via the "Credit/Asset-Oriented" model (Dual-Token). +- **PaymasterV4Generator**: **Treatment Group B**. Uses the "Deposit" model (Single-Token) for comparative analysis. + +### 2. Data Collectors (`src/collectors/`) +Responsible for gathering "Ground Truth" data. +- **HistoricalFetcher**: Connects to Etherscan/OptimismScan APIs to retrieve full transaction histories for test accounts defined in `l4-state.json`. **Crucial for auditability.** +- **LogParser**: Legacy parser for development logs (kept for backward compatibility). + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +The brain of the operation. +- **Double-Layer Analysis**: + - **Intrinsic Layer**: Gas used, Blob gas, Calldata efficiency. + - **Economic Layer**: USD costs, Protocol Revenue, Net Profit. +- **Attribution**: Breaks down cost into L1 Security, L2 Execution, and Protocol Overhead. + +--- + +## 🚀 Workflows + +### A. Run Full Experiment (Coordinator) +The `run_analytics_coordinator.ts` script orchestrates the entire lifecycle. + +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +npx tsx scripts/run_analytics_coordinator.ts --network sepolia +``` + +### B. Fetch Historical Data Only +Useful for auditing existing accounts without spending gas. +```bash +npx tsx scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### C. Traffic Generation Only +Generate a specific number of transactions for a specific group. +```bash +npx tsx packages/analytics/src/generators/cli.ts --group superpaymaster --runs 10 +``` + +--- + +## 📊 Data & Metrics + +We prioritize **Intrinsic Metrics** to ensure scientific validity independent of market volatility. + +| Metric | Definition | Source | +| :--- | :--- | :--- | +| **Gas Used** | Total gas consumed by the transaction | `receipt.gasUsed` | +| **L1 Fee** | Cost of posting data to L1 (for L2s) | Oracle Contract / Header | +| **Latency** | Time from `UserOp` submission to inclusion | Client-side Timestamp | +| **Steps** | Number of signatures/interactions required | Protocol Definition | + +--- + +## 📂 Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # [NEW] Traffic Generation Logic +│ ├── collectors/ # [NEW] Etherscan/RPC Fetchers +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── data/ # Raw JSON Data Store +└── reports/ # HTML/Markdown Reports +``` + +--- + +## 🕷️ Transaction Scraper + +A Puppeteer-based scraper to extract detailed gas and fee metrics from Optimism Etherscan. + +### Prerequisites + +- Node.js & pnpm +- Chrome browser (Puppeteer will attempt to install this automatically, but you can run `npx puppeteer browsers install chrome` if needed) + +### Running the Scraper + +The scraper reads transaction hashes from `data/gasless_data_collection.csv` and outputs enriched metrics to `data/gasless_metrics_detailed.csv`. + +```bash +pnpm tsx scripts/scrape-tx.ts +``` + +## 📂 Data Directory (Paper7 Ground Truth) + +- `data/gasless_data_collection.csv`: 输入文件,包含 `Timestamp,Label,TxHash`,用于抓取交易详情。 +- `data/gasless_data_collection_v2.csv`: 主网/测试网的高保真样本集合(包含 `GasUsed(L2)`, `L2ExecutionFee(Wei)`, `L1DataFee(Wei)` 等列),用于论文/报告里的“真实网络成本与可用性”对照。 +- `data/gasless_metrics_detailed.csv`: 抓取后的明细输出(L1 Fee, L2 Fee, Gas Used 等),主要由 `scripts/scrape-tx.ts` 生成。 + +--- + +## 🧪 Paper7 专属数据:Credit / Reputation / Liquidity Loop + +Paper7 需要一组**与通用 gasless 基线不同**的专属证据,用来证明 CommunityFi 的闭环语义成立(而不仅是“能跑通 gasless”): + +- **Reputation → Credit**:将贡献/声誉同步进 Registry,并观察信用额度随之变化 +- **Credit → Debt → Repay**:在 Paymaster/Registry 侧记录债务,再用 xPNTs 完成清算归零 +- **Liquidity(Baseline Liquidity)**:用可复现实验/仿真曲线展示“积分可用于偿债/赞助”对流动性速度的影响(作为机制层证据,不依赖市场价格) + +### 1) 如何运行(推荐) + +统一入口脚本(负责启动 Anvil、必要时自动部署并同步配置,然后跑各子任务): + +```bash +pnpm exec tsx scripts/paper7-exclusive-data.ts --network anvil --cycles 5 +``` + +等价的 shell 包装(更适合 CI/重复跑批): + +```bash +./packages/analytics/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### 2) 脚本目标与流程定位 + +- `scripts/paper7-exclusive-data.ts` + - **目标**:生成 Paper7 专属闭环数据(credit cycles + reputation→credit + liquidity simulation)。 + - **作用位置**:属于“可重复的受控实验层”,用 gas units 固定地刻画合约路径开销与状态变化,避免 ETH/USD 等市场变量污染结论。 +- `scripts/paper7_credit_loop.ts` + - **目标**:跑一次完整 **credit→debt→repay** 闭环(Anvil-only,依赖 `anvil_*` RPC)。 + - **产出**:每次运行写一个 `credit_cycle_*.json`。 +- `scripts/paper7_reputation_credit.ts` + - **目标**:跑一次 **reputation sync → registry credit update**,并记录关键读数与每笔交易 gasUsed。 + - **产出**:写 `reputation_credit.json`。 +- `liquidity_velocity_simulation.csv` + - **目标**:给论文提供“Baseline Liquidity 机制”的直观趋势证据(对比可用于 gas 清算 vs 不可清算时,积分存量随时间的衰减/累积差异)。 + +### 3) 数据产物(在哪里、是什么、怎么看) + +所有 Paper7 专属数据默认写入: + +`packages/analytics/data/paper7_exclusive//` + +典型结构如下: + +```text +paper7_exclusive// + credit_cycle_1.json + credit_cycle_2.json + ... + reputation_credit.json + liquidity_velocity_simulation.csv + anvil.log # 若自动启动/部署,保留日志便于审计 + deploy.log # 若触发自动部署,保留 forge 日志便于复现 + synced_config.anvil.json # 若触发自动同步,记录当次使用的合约地址快照 +``` + +#### A) `credit_cycle_*.json`(闭环清算) + +每个 cycle 都是一次独立账户的闭环验证,核心字段: + +- `creditLimitWei / creditLimitEth`:该账户在 Registry 的信用额度(用于赞助/欠款边界) +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`:欠款从 0 → 增加 → 清算归零 +- `gasUsed.*`:每一步合约调用的 gas units(`approve`, `setCreditTier`, `recordDebt`, `mint`) +- `tx.*`:对应交易哈希(便于回溯 receipts / debug) + +#### B) `reputation_credit.json`(声誉到信用映射) + +用于证明 Reputation sync 后,Registry 中的 `globalReputation` 与 `getCreditLimit` 发生预期变化,并给出每步 gas units: + +- `score`:ReputationSystem 计算出的 score +- `globalReputation`:Registry 聚合后的全局声誉 +- `creditLimitWei / creditLimitEth`:映射后的信用额度 +- `gasUsed.*`:`setRule`, `setReputationSource`, `setEntropyFactor`, `syncToRegistry` + +#### C) `liquidity_velocity_simulation.csv`(基线流动性趋势) + +列定义: + +- `day`:仿真步(天) +- `points_gas_redeemable`:积分可用于 gas 清算/赞助时的积分存量曲线 +- `points_baseline`:积分不可清算(仅基础用途)时的积分存量曲线 diff --git a/0.16.23/api/@aastar/analytics/classes/AnalyticsClient.md b/0.16.23/api/@aastar/analytics/classes/AnalyticsClient.md new file mode 100644 index 000000000..a4adb93be --- /dev/null +++ b/0.16.23/api/@aastar/analytics/classes/AnalyticsClient.md @@ -0,0 +1,109 @@ +Defined in: [index.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/analytics/src/index.ts#L17) + +Analytics client for monitoring and statistics + +## Role Required + +None (public query APIs) + +## Description + +Dashboard and monitoring tools + +## No Permission Required - All Public Queries + +## Typical Users: +- Dashboard Developers +- Community Analytics +- Investors & Researchers + +## Constructors + +### Constructor + +> **new AnalyticsClient**(`publicClient`, `addresses?`): `AnalyticsClient` + +Defined in: [index.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/analytics/src/index.ts#L25) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `publicClient` | [`PublicClient`](../../core/interfaces/PublicClient.md) | **`Internal`** | +| `addresses?` | \{ `gtoken?`: `` `0x${string}` ``; `registry?`: `` `0x${string}` ``; \} | - | +| `addresses.gtoken?` | `` `0x${string}` `` | - | +| `addresses.registry?` | `` `0x${string}` `` | - | + +#### Returns + +`AnalyticsClient` + +## Methods + +### getRoleEntranceCost() + +> **getRoleEntranceCost**(`roleId`): `Promise`\<\{ `entryBurn`: `bigint`; `exitFee`: \{ `minFee`: `bigint`; `percent`: `number`; \}; `minStake`: `bigint`; `totalRequired`: `bigint`; \}\> + +Defined in: [index.ts:124](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/analytics/src/index.ts#L124) + +Get role entrance cost breakdown + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<\{ `entryBurn`: `bigint`; `exitFee`: \{ `minFee`: `bigint`; `percent`: `number`; \}; `minStake`: `bigint`; `totalRequired`: `bigint`; \}\> + +#### Role Required + +None (public view) + +*** + +### getSupplyMetrics() + +> **getSupplyMetrics**(): `Promise`\<\{ `cap`: `bigint`; `deflationRate`: `number`; `remainingMintable`: `bigint`; `totalLifetimeBurned`: `bigint`; `totalSupply`: `bigint`; \}\> + +Defined in: [index.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/analytics/src/index.ts#L42) + +Get complete supply metrics + +#### Returns + +`Promise`\<\{ `cap`: `bigint`; `deflationRate`: `number`; `remainingMintable`: `bigint`; `totalLifetimeBurned`: `bigint`; `totalSupply`: `bigint`; \}\> + +#### Role Required + +None (public view) + +*** + +### subscribeToBurnEvents() + +> **subscribeToBurnEvents**(`callback`): () => `void` + +Defined in: [index.ts:90](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/analytics/src/index.ts#L90) + +Subscribe to real-time burn events + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `callback` | (`event`) => `void` | + +#### Returns + +> (): `void` + +##### Returns + +`void` + +#### Role Required + +None (public events) diff --git a/0.16.23/api/@aastar/analytics/index.md b/0.16.23/api/@aastar/analytics/index.md new file mode 100644 index 000000000..8ba9794ef --- /dev/null +++ b/0.16.23/api/@aastar/analytics/index.md @@ -0,0 +1,440 @@ +# Analytics Package (AAStar Gas Analytics & Experimentation) + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It supports **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis with rigorous, on-chain ground truth verification. + +```bash +# 快速入口(从 aastar-sdk 根目录运行) + +# 收集 OP Mainnet paymaster 基线 +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts --network op-mainnet --n 50 + +# 收集 Paper7 专属数据 +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 + +# 全流程协调器 +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia + +# Gas 分析报告文档 +packages/analytics/docs/OP_Mainnet_Gas_Analysis_Report.md +``` + +--- + +## System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # Traffic Generation Logic +│ ├── collectors/ # Etherscan/RPC Fetchers +│ │ └── EventFetcher.ts # On-chain UserOperationEvent collector +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── scripts/ # ← All data collection scripts (consolidated) +│ ├── collect_paymaster_baselines.ts # OP mainnet V4/SuperPM baselines +│ ├── collect_eoa_erc20_baseline.ts # EOA ERC20 transfer baseline +│ ├── collect_industry_baseline.ts # Alchemy/Pimlico baselines +│ ├── compute_cost_summary.ts # Aggregated cost breakdown table +│ ├── gasless-collect.ts # Gasless data collector (OP mainnet) +│ ├── paper7-exclusive-data.ts # Paper7 closed-loop data (anvil) +│ ├── paper7_credit_loop.ts # Credit→Debt→Repay cycle runner +│ ├── paper7_reputation_credit.ts # Reputation→Credit mapping runner +│ ├── run_analytics_coordinator.ts # Full pipeline coordinator +│ ├── run_paper7_exclusive_data.sh # Paper7 shell wrapper (CI-friendly) +│ ├── fetch-tx-hashes.ts # TX hash fetcher utility +│ └── scrape-tx.ts # Puppeteer Etherscan scraper +├── docs/ # ← Research reports and analysis documents +│ └── OP_Mainnet_Gas_Analysis_Report.md # Paper3/Paper7 gas cost evidence +├── data/ # Raw data store +│ ├── gasless_data_collection.csv # T1/T2/T2.1/T5 baseline (v1) +│ ├── gasless_data_collection_v2.csv # Controlled single-UserOp (v2) +│ ├── gasless_metrics_detailed.csv # Full L1/L2 fee decomposition +│ ├── industry_paymaster_baselines.csv # Alchemy, Pimlico on-chain baselines +│ ├── eoa_erc20_baseline.csv # Raw EOA transfer baseline +│ ├── paper7_exclusive/ # Paper7 credit/reputation/liquidity +│ └── paper_gas_op_mainnet/ # Paper3 per-date controlled datasets +│ ├── 2026-02-17/ # V4 n=36, SuperPM n=43 +│ └── 2026-02-18/ # V4/SuperPM with sender (n=50) +└── reports/ # HTML/Markdown summaries +``` + +--- + +## Workflows + +### A. Collect OP Mainnet Paymaster Baselines (Paper3) +```bash +# V4 baseline: strict single UserOp + ERC20 transfer filter +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type v4 --n 50 --strict-transfer --single-userop + +# SuperPaymaster baseline +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type super --n 50 +``` + +### B. Run Full Experiment (Coordinator) +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia +``` + +### C. Fetch Historical Data Only +```bash +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### D. Transaction Scraper (Etherscan) +Reads from `data/gasless_data_collection.csv`, outputs to `data/gasless_metrics_detailed.csv`. +```bash +pnpm tsx packages/analytics/scripts/scrape-tx.ts +``` + +--- + +## Data Directory + +| File | Description | +|------|-------------| +| `data/gasless_data_collection.csv` | T1/T2/T2.1/T5 records with TxHash + Label | +| `data/gasless_data_collection_v2.csv` | High-fidelity controlled dataset (single-UserOp, ERC20) | +| `data/gasless_metrics_detailed.csv` | L1 Fee, L2 Fee, Gas Used (Puppeteer scraped) | +| `data/industry_paymaster_baselines.csv` | Alchemy (mean=257k) + Pimlico (mean=387k) on-chain baselines | +| `data/eoa_erc20_baseline.csv` | Raw EOA ERC20 transfer baseline | +| `data/paper7_exclusive/` | Credit cycle + reputation + liquidity simulation (Anvil) | +| `data/paper_gas_op_mainnet/2026-02-17/` | V4 n=36, SuperPM n=43 (strict filter) | +| `data/paper_gas_op_mainnet/2026-02-18/` | V4/SuperPM with sender field (n=50) | + +--- + +## Paper7 Exclusive Data (Credit / Reputation / Liquidity) + +Paper7 requires a distinct set of evidence to prove **CommunityFi closed-loop semantics**: + +- **Reputation → Credit**: contribution/reputation synced into Registry, credit limit observed to change +- **Credit → Debt → Repay**: debt recorded in Paymaster/Registry, cleared via xPNTs +- **Liquidity (Baseline)**: simulation curve showing gas-redeemable vs non-redeemable points over time + +### Running + +```bash +# Unified entry (Anvil auto-start, deploy, sync, run all subtasks) +pnpm exec tsx packages/analytics/scripts/paper7-exclusive-data.ts --network anvil --cycles 5 + +# Shell wrapper (CI-friendly) +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### Output Structure + +```text +data/paper7_exclusive// + credit_cycle_1.json # credit→debt→repay per account + ... + reputation_credit.json # reputation sync → credit limit mapping + liquidity_velocity_simulation.csv + synced_config.anvil.json +``` + +#### `credit_cycle_*.json` fields +- `creditLimitWei / creditLimitEth`: credit limit in Registry +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`: debt lifecycle +- `gasUsed.*`: per-step gas units (approve, setCreditTier, recordDebt, mint) + +#### `reputation_credit.json` fields +- `score` / `globalReputation` / `creditLimitWei`: reputation → credit mapping +- `gasUsed.*`: setRule, syncToRegistry, etc. + +#### `liquidity_velocity_simulation.csv` columns +- `day`: simulation step +- `points_gas_redeemable`: points stock when gas-redeemable +- `points_baseline`: points stock without gas redemption + +--- + +## Key Modules + +### 1. Traffic Generators (`src/generators/`) +- **EOAGenerator**: Baseline ETH transfers for network cost measurement. +- **SuperPaymasterGenerator**: Treatment group — credit/asset-oriented gasless model. +- **PaymasterV4Generator**: Treatment group B — deposit model for comparison. + +### 2. Data Collectors (`src/collectors/`) +- **HistoricalFetcher**: Etherscan/OptimismScan API for full transaction histories. +- **EventFetcher**: On-chain `UserOperationEvent` log collector with strict filtering. + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +- **Attribution**: L1 Security | L2 Execution | Protocol Overhead breakdown. +- **Comparison**: T1 vs T2 vs T2.1 vs T5 vs industry baselines. + + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It has been upgraded to support **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis, moving beyond simple log analysis to rigorous, on-chain ground truth verification. +工作流: + +收集数据(日常运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia +产生新实验数据(需要时运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --gen-traffic + +收集events +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --fetch-events + +分析报告(查看结果): +pnpm tsx packages/analytics/src/gas-analyzer-v4.ts --network sepolia + +步骤是解耦的,按需执行即可 +--- + +## 🏗 System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## 🧩 Key Modules + +### 1. Traffic Generators (`src/generators/`) +Responsible for creating controlled, verifiable traffic patterns on testnets (Sepolia, OP Sepolia) and mainnets. +- **EOAGenerator**: Baseline ETH transfers to measure intrinsic network costs. +- **StandardAAGenerator**: ERC-4337 flows using industry-standard Paymasters (Pimlico/Alchemy). +- **SuperPaymasterGenerator**: **Treatment Group**. Uses the `EndUserClient` to execute gasless transactions via the "Credit/Asset-Oriented" model (Dual-Token). +- **PaymasterV4Generator**: **Treatment Group B**. Uses the "Deposit" model (Single-Token) for comparative analysis. + +### 2. Data Collectors (`src/collectors/`) +Responsible for gathering "Ground Truth" data. +- **HistoricalFetcher**: Connects to Etherscan/OptimismScan APIs to retrieve full transaction histories for test accounts defined in `l4-state.json`. **Crucial for auditability.** +- **LogParser**: Legacy parser for development logs (kept for backward compatibility). + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +The brain of the operation. +- **Double-Layer Analysis**: + - **Intrinsic Layer**: Gas used, Blob gas, Calldata efficiency. + - **Economic Layer**: USD costs, Protocol Revenue, Net Profit. +- **Attribution**: Breaks down cost into L1 Security, L2 Execution, and Protocol Overhead. + +--- + +## 🚀 Workflows + +### A. Run Full Experiment (Coordinator) +The `run_analytics_coordinator.ts` script orchestrates the entire lifecycle. + +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +npx tsx scripts/run_analytics_coordinator.ts --network sepolia +``` + +### B. Fetch Historical Data Only +Useful for auditing existing accounts without spending gas. +```bash +npx tsx scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### C. Traffic Generation Only +Generate a specific number of transactions for a specific group. +```bash +npx tsx packages/analytics/src/generators/cli.ts --group superpaymaster --runs 10 +``` + +--- + +## 📊 Data & Metrics + +We prioritize **Intrinsic Metrics** to ensure scientific validity independent of market volatility. + +| Metric | Definition | Source | +| :--- | :--- | :--- | +| **Gas Used** | Total gas consumed by the transaction | `receipt.gasUsed` | +| **L1 Fee** | Cost of posting data to L1 (for L2s) | Oracle Contract / Header | +| **Latency** | Time from `UserOp` submission to inclusion | Client-side Timestamp | +| **Steps** | Number of signatures/interactions required | Protocol Definition | + +--- + +## 📂 Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # [NEW] Traffic Generation Logic +│ ├── collectors/ # [NEW] Etherscan/RPC Fetchers +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── data/ # Raw JSON Data Store +└── reports/ # HTML/Markdown Reports +``` + +--- + +## 🕷️ Transaction Scraper + +A Puppeteer-based scraper to extract detailed gas and fee metrics from Optimism Etherscan. + +### Prerequisites + +- Node.js & pnpm +- Chrome browser (Puppeteer will attempt to install this automatically, but you can run `npx puppeteer browsers install chrome` if needed) + +### Running the Scraper + +The scraper reads transaction hashes from `data/gasless_data_collection.csv` and outputs enriched metrics to `data/gasless_metrics_detailed.csv`. + +```bash +pnpm tsx scripts/scrape-tx.ts +``` + +## 📂 Data Directory (Paper7 Ground Truth) + +- `data/gasless_data_collection.csv`: 输入文件,包含 `Timestamp,Label,TxHash`,用于抓取交易详情。 +- `data/gasless_data_collection_v2.csv`: 主网/测试网的高保真样本集合(包含 `GasUsed(L2)`, `L2ExecutionFee(Wei)`, `L1DataFee(Wei)` 等列),用于论文/报告里的“真实网络成本与可用性”对照。 +- `data/gasless_metrics_detailed.csv`: 抓取后的明细输出(L1 Fee, L2 Fee, Gas Used 等),主要由 `scripts/scrape-tx.ts` 生成。 + +--- + +## 🧪 Paper7 专属数据:Credit / Reputation / Liquidity Loop + +Paper7 需要一组**与通用 gasless 基线不同**的专属证据,用来证明 CommunityFi 的闭环语义成立(而不仅是“能跑通 gasless”): + +- **Reputation → Credit**:将贡献/声誉同步进 Registry,并观察信用额度随之变化 +- **Credit → Debt → Repay**:在 Paymaster/Registry 侧记录债务,再用 xPNTs 完成清算归零 +- **Liquidity(Baseline Liquidity)**:用可复现实验/仿真曲线展示“积分可用于偿债/赞助”对流动性速度的影响(作为机制层证据,不依赖市场价格) + +### 1) 如何运行(推荐) + +统一入口脚本(负责启动 Anvil、必要时自动部署并同步配置,然后跑各子任务): + +```bash +pnpm exec tsx scripts/paper7-exclusive-data.ts --network anvil --cycles 5 +``` + +等价的 shell 包装(更适合 CI/重复跑批): + +```bash +./packages/analytics/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### 2) 脚本目标与流程定位 + +- `scripts/paper7-exclusive-data.ts` + - **目标**:生成 Paper7 专属闭环数据(credit cycles + reputation→credit + liquidity simulation)。 + - **作用位置**:属于“可重复的受控实验层”,用 gas units 固定地刻画合约路径开销与状态变化,避免 ETH/USD 等市场变量污染结论。 +- `scripts/paper7_credit_loop.ts` + - **目标**:跑一次完整 **credit→debt→repay** 闭环(Anvil-only,依赖 `anvil_*` RPC)。 + - **产出**:每次运行写一个 `credit_cycle_*.json`。 +- `scripts/paper7_reputation_credit.ts` + - **目标**:跑一次 **reputation sync → registry credit update**,并记录关键读数与每笔交易 gasUsed。 + - **产出**:写 `reputation_credit.json`。 +- `liquidity_velocity_simulation.csv` + - **目标**:给论文提供“Baseline Liquidity 机制”的直观趋势证据(对比可用于 gas 清算 vs 不可清算时,积分存量随时间的衰减/累积差异)。 + +### 3) 数据产物(在哪里、是什么、怎么看) + +所有 Paper7 专属数据默认写入: + +`packages/analytics/data/paper7_exclusive//` + +典型结构如下: + +```text +paper7_exclusive// + credit_cycle_1.json + credit_cycle_2.json + ... + reputation_credit.json + liquidity_velocity_simulation.csv + anvil.log # 若自动启动/部署,保留日志便于审计 + deploy.log # 若触发自动部署,保留 forge 日志便于复现 + synced_config.anvil.json # 若触发自动同步,记录当次使用的合约地址快照 +``` + +#### A) `credit_cycle_*.json`(闭环清算) + +每个 cycle 都是一次独立账户的闭环验证,核心字段: + +- `creditLimitWei / creditLimitEth`:该账户在 Registry 的信用额度(用于赞助/欠款边界) +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`:欠款从 0 → 增加 → 清算归零 +- `gasUsed.*`:每一步合约调用的 gas units(`approve`, `setCreditTier`, `recordDebt`, `mint`) +- `tx.*`:对应交易哈希(便于回溯 receipts / debug) + +#### B) `reputation_credit.json`(声誉到信用映射) + +用于证明 Reputation sync 后,Registry 中的 `globalReputation` 与 `getCreditLimit` 发生预期变化,并给出每步 gas units: + +- `score`:ReputationSystem 计算出的 score +- `globalReputation`:Registry 聚合后的全局声誉 +- `creditLimitWei / creditLimitEth`:映射后的信用额度 +- `gasUsed.*`:`setRule`, `setReputationSource`, `setEntropyFactor`, `syncToRegistry` + +#### C) `liquidity_velocity_simulation.csv`(基线流动性趋势) + +列定义: + +- `day`:仿真步(天) +- `points_gas_redeemable`:积分可用于 gas 清算/赞助时的积分存量曲线 +- `points_baseline`:积分不可清算(仅基础用途)时的积分存量曲线 diff --git a/0.16.23/api/@aastar/community/classes/CommunityClient.md b/0.16.23/api/@aastar/community/classes/CommunityClient.md new file mode 100644 index 000000000..4dd7b639b --- /dev/null +++ b/0.16.23/api/@aastar/community/classes/CommunityClient.md @@ -0,0 +1,232 @@ +Defined in: [index.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L66) + +Community management client + +## Role Required + +ROLE_COMMUNITY (for most operations after launch) + +## Description + +Provides high-level APIs for community lifecycle operations + +## Permission Requirements: +- **Launch Community**: Requires GToken balance >= stakeAmount + entryBurn +- **Issue xPNTs**: Requires COMMUNITY role +- **Configure SBT**: Requires COMMUNITY role + community ownership + +## Typical Users: +- Community Administrators +- DAO Operators +- Protocol Partners + +## Constructors + +### Constructor + +> **new CommunityClient**(`publicClient`, `walletClient`, `addresses?`): `CommunityClient` + +Defined in: [index.ts:86](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L86) + +Initialize CommunityClient + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `publicClient` | [`PublicClient`](../../core/interfaces/PublicClient.md) | The public client for queries | +| `walletClient` | [`WalletClient`](../../core/interfaces/WalletClient.md) | The wallet client for transactions | +| `addresses?` | \{ `gtoken?`: `` `0x${string}` ``; `registry?`: `` `0x${string}` ``; `staking?`: `` `0x${string}` ``; \} | Optional contract address overrides | +| `addresses.gtoken?` | `` `0x${string}` `` | - | +| `addresses.registry?` | `` `0x${string}` `` | - | +| `addresses.staking?` | `` `0x${string}` `` | - | + +#### Returns + +`CommunityClient` + +## Methods + +### checkLaunchRequirements() + +> **checkLaunchRequirements**(`address?`, `requiredAmount?`): `Promise`\<[`RoleRequirement`](../../core/interfaces/RoleRequirement.md)\> + +Defined in: [index.ts:124](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L124) + +Check if user meets requirements to launch a community + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `address?` | `` `0x${string}` `` | User address to check (optional, defaults to wallet account) | +| `requiredAmount?` | `bigint` | Total GToken required (stake + burn) | + +#### Returns + +`Promise`\<[`RoleRequirement`](../../core/interfaces/RoleRequirement.md)\> + +Requirement check result + +#### Role Required + +None (pre-check before registration) + +#### Example + +```typescript +const check = await communityClient.checkLaunchRequirements( + myAddress, + parseEther("33") // 30 stake + 3 burn +); +if (!check.hasEnoughGToken) { + console.error(`❌ ${check.missingRequirements.join('\n')}`); + return; +} +``` + +*** + +### configureSBTRules() + +> **configureSBTRules**(`rules`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:307](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L307) + +Configure SBT minting rules for the community + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `rules` | [`SBTRuleConfig`](../interfaces/SBTRuleConfig.md) | SBT rule configuration | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash + +#### Role Required + +ROLE_COMMUNITY + +#### Permission + +Must be registered community admin + community ownership + +*** + +### getCommunityStats() + +> **getCommunityStats**(`communityId`): `Promise`\<[`CommunityStats`](../interfaces/CommunityStats.md)\> + +Defined in: [index.ts:334](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L334) + +Get community statistics + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `communityId` | `` `0x${string}` `` | Community address | + +#### Returns + +`Promise`\<[`CommunityStats`](../interfaces/CommunityStats.md)\> + +Community statistics + +#### Role Required + +None (public query) + +*** + +### issueXPNTs() + +> **issueXPNTs**(`params`): `Promise`\<\{ `txHash`: `` `0x${string}` ``; `xpntsAddress`: `` `0x${string}` ``; \}\> + +Defined in: [index.ts:255](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L255) + +Issue community-specific xPNTs token + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params` | [`XPNTsIssuanceParams`](../interfaces/XPNTsIssuanceParams.md) | xPNTs issuance parameters | + +#### Returns + +`Promise`\<\{ `txHash`: `` `0x${string}` ``; `xpntsAddress`: `` `0x${string}` ``; \}\> + +xPNTs contract address and transaction hash + +#### Role Required + +ROLE_COMMUNITY + +#### Permission + +Must be registered community admin + +*** + +### launchCommunity() + +> **launchCommunity**(`config`): `Promise`\<\{ `communityId`: `` `0x${string}` ``; `txHash`: `` `0x${string}` ``; \}\> + +Defined in: [index.ts:174](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L174) + +Launch a community with one-click operation + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `config` | [`CommunityLaunchConfig`](../interfaces/CommunityLaunchConfig.md) | Community configuration | + +#### Returns + +`Promise`\<\{ `communityId`: `` `0x${string}` ``; `txHash`: `` `0x${string}` ``; \}\> + +Community ID and transaction hash + +#### Role Required + +None (will register ROLE_COMMUNITY) + +#### Permission + +Requires GToken balance >= stakeAmount + entryBurn + +#### Description + +Combines: approve → stake → register → configure +- Auto-approves GToken for staking contract +- Registers caller as COMMUNITY role +- Stakes required amount +- **Pre-checks requirements before execution** + +#### Throws + +Error if requirements not met + +#### Example + +```typescript +const communityClient = new CommunityClient(publicClient, walletClient); + +try { + const { communityId, txHash } = await communityClient.launchCommunity({ + name: "MyDAO", + stakeAmount: parseEther("30"), + entryBurn: parseEther("3"), + logoURI: "ipfs://..." + }); + console.log(`✅ Community launched: ${communityId}`); +} catch (error) { + console.error(`❌ Failed: ${error.message}`); +} +``` diff --git a/0.16.23/api/@aastar/community/index.md b/0.16.23/api/@aastar/community/index.md new file mode 100644 index 000000000..41a7d85d0 --- /dev/null +++ b/0.16.23/api/@aastar/community/index.md @@ -0,0 +1,10 @@ +## Classes + +- [CommunityClient](classes/CommunityClient.md) + +## Interfaces + +- [CommunityLaunchConfig](interfaces/CommunityLaunchConfig.md) +- [CommunityStats](interfaces/CommunityStats.md) +- [SBTRuleConfig](interfaces/SBTRuleConfig.md) +- [XPNTsIssuanceParams](interfaces/XPNTsIssuanceParams.md) diff --git a/0.16.23/api/@aastar/community/interfaces/CommunityLaunchConfig.md b/0.16.23/api/@aastar/community/interfaces/CommunityLaunchConfig.md new file mode 100644 index 000000000..a48987361 --- /dev/null +++ b/0.16.23/api/@aastar/community/interfaces/CommunityLaunchConfig.md @@ -0,0 +1,67 @@ +Defined in: [index.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L11) + +Community configuration for launch + +## Properties + +### description? + +> `optional` **description**: `string` + +Defined in: [index.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L15) + +*** + +### ensName? + +> `optional` **ensName**: `string` + +Defined in: [index.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L13) + +*** + +### entryBurn? + +> `optional` **entryBurn**: `bigint` + +Defined in: [index.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L18) + +*** + +### logoURI? + +> `optional` **logoURI**: `string` + +Defined in: [index.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L16) + +*** + +### name + +> **name**: `string` + +Defined in: [index.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L12) + +*** + +### sbtRules? + +> `optional` **sbtRules**: [`SBTRuleConfig`](SBTRuleConfig.md) + +Defined in: [index.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L19) + +*** + +### stakeAmount + +> **stakeAmount**: `bigint` + +Defined in: [index.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L17) + +*** + +### website? + +> `optional` **website**: `string` + +Defined in: [index.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L14) diff --git a/0.16.23/api/@aastar/community/interfaces/CommunityStats.md b/0.16.23/api/@aastar/community/interfaces/CommunityStats.md new file mode 100644 index 000000000..6b762e3f2 --- /dev/null +++ b/0.16.23/api/@aastar/community/interfaces/CommunityStats.md @@ -0,0 +1,35 @@ +Defined in: [index.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L43) + +Community statistics + +## Properties + +### reputationAvg + +> **reputationAvg**: `number` + +Defined in: [index.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L47) + +*** + +### totalMembers + +> **totalMembers**: `number` + +Defined in: [index.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L44) + +*** + +### totalStaked + +> **totalStaked**: `bigint` + +Defined in: [index.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L45) + +*** + +### xpntsSupply + +> **xpntsSupply**: `bigint` + +Defined in: [index.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L46) diff --git a/0.16.23/api/@aastar/community/interfaces/SBTRuleConfig.md b/0.16.23/api/@aastar/community/interfaces/SBTRuleConfig.md new file mode 100644 index 000000000..b7cd0b98b --- /dev/null +++ b/0.16.23/api/@aastar/community/interfaces/SBTRuleConfig.md @@ -0,0 +1,27 @@ +Defined in: [index.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L25) + +SBT minting rules configuration + +## Properties + +### maxSupply + +> **maxSupply**: `bigint` + +Defined in: [index.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L27) + +*** + +### minStake + +> **minStake**: `bigint` + +Defined in: [index.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L26) + +*** + +### mintPrice + +> **mintPrice**: `bigint` + +Defined in: [index.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L28) diff --git a/0.16.23/api/@aastar/community/interfaces/XPNTsIssuanceParams.md b/0.16.23/api/@aastar/community/interfaces/XPNTsIssuanceParams.md new file mode 100644 index 000000000..e332e0436 --- /dev/null +++ b/0.16.23/api/@aastar/community/interfaces/XPNTsIssuanceParams.md @@ -0,0 +1,27 @@ +Defined in: [index.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L34) + +xPNTs issuance parameters + +## Properties + +### exchangeRate + +> **exchangeRate**: `bigint` + +Defined in: [index.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L37) + +*** + +### initialSupply + +> **initialSupply**: `bigint` + +Defined in: [index.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L36) + +*** + +### symbol + +> **symbol**: `string` + +Defined in: [index.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/community/src/index.ts#L35) diff --git a/0.16.23/api/@aastar/core/classes/BLSSigner.md b/0.16.23/api/@aastar/core/classes/BLSSigner.md new file mode 100644 index 000000000..6742d1790 --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/BLSSigner.md @@ -0,0 +1,129 @@ +Defined in: [packages/core/src/crypto/blsSigner.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L9) + +BLS Signer for Registry reputation updates and DVT operations + +Uses BLS12-381 curve for signature aggregation + +## Constructors + +### Constructor + +> **new BLSSigner**(`privateKeyHex`): `BLSSigner` + +Defined in: [packages/core/src/crypto/blsSigner.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `privateKeyHex` | `` `0x${string}` `` | + +#### Returns + +`BLSSigner` + +## Methods + +### getPublicKey() + +> **getPublicKey**(): `` `0x${string}` `` + +Defined in: [packages/core/src/crypto/blsSigner.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L31) + +Get BLS public key + +#### Returns + +`` `0x${string}` `` + +Public key as hex string + +*** + +### sign() + +> **sign**(`message`): `` `0x${string}` `` + +Defined in: [packages/core/src/crypto/blsSigner.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L21) + +Sign a message with BLS private key + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `message` | `` `0x${string}` `` | Message hash to sign | + +#### Returns + +`` `0x${string}` `` + +BLS signature as hex string + +*** + +### aggregatePublicKeys() + +> `static` **aggregatePublicKeys**(`pubKeys`): `` `0x${string}` `` + +Defined in: [packages/core/src/crypto/blsSigner.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L52) + +Aggregate multiple BLS public keys + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `pubKeys` | `` `0x${string}` ``[] | Array of BLS public keys | + +#### Returns + +`` `0x${string}` `` + +Aggregated public key (uncompressed G1 - 96 bytes for EVM) + +*** + +### aggregateSignatures() + +> `static` **aggregateSignatures**(`signatures`): `` `0x${string}` `` + +Defined in: [packages/core/src/crypto/blsSigner.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L41) + +Aggregate multiple BLS signatures + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `signatures` | `` `0x${string}` ``[] | Array of BLS signatures | + +#### Returns + +`` `0x${string}` `` + +Aggregated signature + +*** + +### verify() + +> `static` **verify**(`message`, `signature`, `publicKey`): `boolean` + +Defined in: [packages/core/src/crypto/blsSigner.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L65) + +Verify a BLS signature + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `message` | `` `0x${string}` `` | Message hash | +| `signature` | `` `0x${string}` `` | BLS signature | +| `publicKey` | `` `0x${string}` `` | BLS public key | + +#### Returns + +`boolean` + +True if signature is valid diff --git a/0.16.23/api/@aastar/core/classes/BaseClient.md b/0.16.23/api/@aastar/core/classes/BaseClient.md new file mode 100644 index 000000000..7cc78154a --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/BaseClient.md @@ -0,0 +1,171 @@ +Defined in: [packages/core/src/clients/BaseClient.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L5) + +## Extended by + +- [`CommunityClient`](../../enduser/classes/CommunityClient.md) +- [`UserClient`](../../enduser/classes/UserClient.md) +- [`UserLifecycle`](../../enduser/classes/UserLifecycle.md) +- [`PaymasterOperatorClient`](../../operator/classes/PaymasterOperatorClient.md) +- [`ProtocolClient`](../../operator/classes/ProtocolClient.md) + +## Constructors + +### Constructor + +> **new BaseClient**(`config`): `BaseClient` + +Defined in: [packages/core/src/clients/BaseClient.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`ClientConfig`](../interfaces/ClientConfig.md) | + +#### Returns + +`BaseClient` + +## Properties + +### client + +> **client**: [`WalletClient`](../interfaces/WalletClient.md) + +Defined in: [packages/core/src/clients/BaseClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L6) + +*** + +### entryPointAddress? + +> `protected` `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L12) + +*** + +### gTokenAddress? + +> `protected` `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L9) + +*** + +### gTokenStakingAddress? + +> `protected` `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L10) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L11) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../interfaces/PublicClient.md) + +Defined in: [packages/core/src/clients/BaseClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L7) + +*** + +### registryAddress? + +> `protected` `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L8) + +## Methods + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L34) + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`PublicClient`](../interfaces/PublicClient.md) \| [`WalletClient`](../interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +Defined in: [packages/core/src/clients/BaseClient.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L41) + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`PublicClient`](../interfaces/PublicClient.md) \| [`WalletClient`](../interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L73) + +#### Returns + +`` `0x${string}` `` + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L52) + +#### Returns + +`` `0x${string}` `` + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L59) + +#### Returns + +`` `0x${string}` `` + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L66) + +#### Returns + +`` `0x${string}` `` + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BaseClient.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BaseClient.ts#L45) + +#### Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/classes/BundlerClient.md b/0.16.23/api/@aastar/core/classes/BundlerClient.md new file mode 100644 index 000000000..d644c3cf9 --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/BundlerClient.md @@ -0,0 +1,119 @@ +Defined in: [packages/core/src/clients/BundlerClient.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L31) + +BundlerClient +Low-level JSON-RPC client for ERC-4337 Bundlers. + +## Constructors + +### Constructor + +> **new BundlerClient**(`url`, `entryPoint`): `BundlerClient` + +Defined in: [packages/core/src/clients/BundlerClient.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L32) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `url` | `string` | +| `entryPoint` | `` `0x${string}` `` | + +#### Returns + +`BundlerClient` + +## Properties + +### entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L34) + +*** + +### url + +> `readonly` **url**: `string` + +Defined in: [packages/core/src/clients/BundlerClient.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L33) + +## Methods + +### estimateUserOperationGas() + +> **estimateUserOperationGas**(`userOp`): `Promise`\<`any`\> + +Defined in: [packages/core/src/clients/BundlerClient.ts:115](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L115) + +eth_estimateUserOperationGas + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `userOp` | `Partial`\<[`UserOperationV07`](../interfaces/UserOperationV07.md)\> | + +#### Returns + +`Promise`\<`any`\> + +*** + +### getUserOperationByHash() + +> **getUserOperationByHash**(`hash`): `Promise`\<`any`\> + +Defined in: [packages/core/src/clients/BundlerClient.ts:129](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L129) + +eth_getUserOperationByHash + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `hash` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### getUserOperationReceipt() + +> **getUserOperationReceipt**(`hash`): `Promise`\<`any`\> + +Defined in: [packages/core/src/clients/BundlerClient.ts:122](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L122) + +eth_getUserOperationReceipt (v0.7 support prep) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `hash` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### sendUserOperation() + +> **sendUserOperation**(`userOp`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [packages/core/src/clients/BundlerClient.ts:108](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L108) + +eth_sendUserOperation + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `userOp` | [`UserOperationV07`](../interfaces/UserOperationV07.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/core/classes/ContractConfigManager.md b/0.16.23/api/@aastar/core/classes/ContractConfigManager.md new file mode 100644 index 000000000..4a504e2aa --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/ContractConfigManager.md @@ -0,0 +1,25 @@ +Defined in: [packages/core/src/config/ContractConfigManager.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L14) + +## Constructors + +### Constructor + +> **new ContractConfigManager**(): `ContractConfigManager` + +#### Returns + +`ContractConfigManager` + +## Methods + +### getConfig() + +> `static` **getConfig**(): [`SuperPaymasterConfig`](../interfaces/SuperPaymasterConfig.md) + +Defined in: [packages/core/src/config/ContractConfigManager.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L18) + +Get validated core configuration + +#### Returns + +[`SuperPaymasterConfig`](../interfaces/SuperPaymasterConfig.md) diff --git a/0.16.23/api/@aastar/core/classes/RequirementChecker.md b/0.16.23/api/@aastar/core/classes/RequirementChecker.md new file mode 100644 index 000000000..98fd9017f --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/RequirementChecker.md @@ -0,0 +1,158 @@ +Defined in: [packages/core/src/requirementChecker.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L43) + +Requirement Checker Utility + +## Description + +Centralized validation for all role requirements + +## Example + +```typescript +const checker = new RequirementChecker(publicClient); + +// Check community launch requirements +const result = await checker.checkRequirements({ + address: userAddress, + roleId: ROLE_COMMUNITY, + requiredGToken: parseEther("33"), + requireSBT: false +}); + +if (!result.hasEnoughGToken) { + console.error(result.missingRequirements.join('\n')); +} +``` + +## Constructors + +### Constructor + +> **new RequirementChecker**(`publicClient`, `addresses?`): `RequirementChecker` + +Defined in: [packages/core/src/requirementChecker.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L44) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `publicClient` | [`PublicClient`](../interfaces/PublicClient.md) | **`Internal`** | +| `addresses?` | \{ `apnts?`: `` `0x${string}` ``; `gtoken?`: `` `0x${string}` ``; `mysbt?`: `` `0x${string}` ``; `registry?`: `` `0x${string}` ``; \} | **`Internal`** | +| `addresses.apnts?` | `` `0x${string}` `` | - | +| `addresses.gtoken?` | `` `0x${string}` `` | - | +| `addresses.mysbt?` | `` `0x${string}` `` | - | +| `addresses.registry?` | `` `0x${string}` `` | - | + +#### Returns + +`RequirementChecker` + +## Methods + +### checkAPNTsBalance() + +> **checkAPNTsBalance**(`address`, `required`): `Promise`\<\{ `balance`: `bigint`; `hasEnough`: `boolean`; \}\> + +Defined in: [packages/core/src/requirementChecker.ts:183](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L183) + +Check aPNTs balance only (shortcut) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | +| `required` | `bigint` | + +#### Returns + +`Promise`\<\{ `balance`: `bigint`; `hasEnough`: `boolean`; \}\> + +*** + +### checkGTokenBalance() + +> **checkGTokenBalance**(`address`, `required`): `Promise`\<\{ `balance`: `bigint`; `hasEnough`: `boolean`; \}\> + +Defined in: [packages/core/src/requirementChecker.ts:162](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L162) + +Check GToken balance only (shortcut) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | +| `required` | `bigint` | + +#### Returns + +`Promise`\<\{ `balance`: `bigint`; `hasEnough`: `boolean`; \}\> + +*** + +### checkHasRole() + +> **checkHasRole**(`roleId`, `address`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/requirementChecker.ts:219](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L219) + +Check if user has specific role (shortcut) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### checkHasSBT() + +> **checkHasSBT**(`address`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/requirementChecker.ts:204](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L204) + +Check if user has MySBT (shortcut) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### checkRequirements() + +> **checkRequirements**(`params`): `Promise`\<[`RoleRequirement`](../interfaces/RoleRequirement.md)\> + +Defined in: [packages/core/src/requirementChecker.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/requirementChecker.ts#L62) + +Check all requirements for a user + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params` | \{ `address`: `` `0x${string}` ``; `requiredAPNTs?`: `bigint`; `requiredGToken?`: `bigint`; `requireSBT?`: `boolean`; `roleId?`: `` `0x${string}` ``; \} | Check parameters | +| `params.address` | `` `0x${string}` `` | - | +| `params.requiredAPNTs?` | `bigint` | - | +| `params.requiredGToken?` | `bigint` | - | +| `params.requireSBT?` | `boolean` | - | +| `params.roleId?` | `` `0x${string}` `` | - | + +#### Returns + +`Promise`\<[`RoleRequirement`](../interfaces/RoleRequirement.md)\> + +Detailed requirement status diff --git a/0.16.23/api/@aastar/core/classes/SepoliaFaucetAPI.md b/0.16.23/api/@aastar/core/classes/SepoliaFaucetAPI.md new file mode 100644 index 000000000..90acb92a2 --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/SepoliaFaucetAPI.md @@ -0,0 +1,710 @@ +Defined in: [packages/core/src/actions/faucet.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L36) + +SepoliaFaucetAPI provides orchestration for setting up test accounts on Sepolia/Anvil. + +## Constructors + +### Constructor + +> **new SepoliaFaucetAPI**(): `SepoliaFaucetAPI` + +#### Returns + +`SepoliaFaucetAPI` + +## Methods + +### adminDepositForUser() + +> `static` **adminDepositForUser**(`adminWallet`, `publicClient`, `paymasterAddr`, `target`, `tokenAddr`, `amount`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/faucet.ts:229](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L229) + +Admin mints tokens to self, approves Paymaster, and deposits FOR user. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `adminWallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `adminWallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `adminWallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `adminWallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `adminWallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `adminWallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `adminWallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `adminWallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `adminWallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `adminWallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `adminWallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `adminWallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `adminWallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `adminWallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `adminWallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `adminWallet.key` | `string` | A key for the client. | +| `adminWallet.name` | `string` | A name for the client. | +| `adminWallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `adminWallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `adminWallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `adminWallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `adminWallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `adminWallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.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' })` | +| `adminWallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `adminWallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `adminWallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `adminWallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `adminWallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `adminWallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `adminWallet.type` | `string` | The type of client. | +| `adminWallet.uid` | `string` | A unique ID for the client. | +| `adminWallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `adminWallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `adminWallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `adminWallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} | - | +| `publicClient.account` | `undefined` | The Account of the Client. | +| `publicClient.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `publicClient.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `publicClient.call` | (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `publicClient.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `publicClient.createAccessList` | (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `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', })` | +| `publicClient.createBlockFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `publicClient.createContractEventFilter` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`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)']), })` | +| `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', })` | +| `publicClient.createPendingTransactionFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `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', })` | +| `publicClient.estimateFeesPerGas` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`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: ... }` | +| `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'), })` | +| `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` | +| `publicClient.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `publicClient.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `publicClient.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `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'), })` | +| `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)` | +| `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()` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `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()` | +| `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` | +| `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()` | +| `publicClient.getBytecode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | **Deprecated** Use `getCode` instead. | +| `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` | +| `publicClient.getCode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.getContractEvents` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`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' })` | +| `publicClient.getEip712Domain` | (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> | 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: [], // }` | +| `publicClient.getEnsAddress` | (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsAvatar` | (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsName` | (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `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'` | +| `publicClient.getEnsText` | (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getFeeHistory` | (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> | 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], })` | +| `publicClient.getFilterChanges` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `publicClient.getFilterLogs` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `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()` | +| `publicClient.getLogs` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`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()` | +| `publicClient.getProof` | (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> | 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...'], })` | +| `publicClient.getStorageAt` | (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> | 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), })` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> | 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', })` | +| `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', })` | +| `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', })` | +| `publicClient.getTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.key` | `string` | A key for the client. | +| `publicClient.multicall` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`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' }]` | +| `publicClient.name` | `string` | A name for the client. | +| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `publicClient.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `publicClient.readContract` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`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` | +| `publicClient.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `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' })` | +| `publicClient.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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' })` | +| `publicClient.simulate` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. | +| `publicClient.simulateBlocks` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`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'), }], }] })` | +| `publicClient.simulateCalls` | \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`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'), }, ] })` | +| `publicClient.simulateContract` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> | 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', })` | +| `publicClient.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `publicClient.type` | `string` | The type of client. | +| `publicClient.uid` | `string` | A unique ID for the client. | +| `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` | +| `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) | +| `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) | +| `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) | +| `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) | +| `publicClient.waitForTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.watchBlockNumber` | (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchBlocks` | \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchContractEvent` | \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchEvent` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchPendingTransactions` | (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `paymasterAddr` | `` `0x${string}` `` | - | +| `target` | `` `0x${string}` `` | - | +| `tokenAddr` | `` `0x${string}` `` | - | +| `amount` | `bigint` | - | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### fundETH() + +> `static` **fundETH**(`adminWallet`, `publicClient`, `target`, `amount`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/faucet.ts:99](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L99) + +Funds the target with ETH if balance is below threshold. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `adminWallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `adminWallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `adminWallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `adminWallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `adminWallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `adminWallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `adminWallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `adminWallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `adminWallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `adminWallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `adminWallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `adminWallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `adminWallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `adminWallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `adminWallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `adminWallet.key` | `string` | A key for the client. | +| `adminWallet.name` | `string` | A name for the client. | +| `adminWallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `adminWallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `adminWallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `adminWallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `adminWallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `adminWallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.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' })` | +| `adminWallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `adminWallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `adminWallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `adminWallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `adminWallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `adminWallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `adminWallet.type` | `string` | The type of client. | +| `adminWallet.uid` | `string` | A unique ID for the client. | +| `adminWallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `adminWallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `adminWallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `adminWallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} | - | +| `publicClient.account` | `undefined` | The Account of the Client. | +| `publicClient.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `publicClient.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `publicClient.call` | (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `publicClient.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `publicClient.createAccessList` | (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `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', })` | +| `publicClient.createBlockFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `publicClient.createContractEventFilter` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`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)']), })` | +| `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', })` | +| `publicClient.createPendingTransactionFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `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', })` | +| `publicClient.estimateFeesPerGas` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`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: ... }` | +| `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'), })` | +| `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` | +| `publicClient.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `publicClient.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `publicClient.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `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'), })` | +| `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)` | +| `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()` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `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()` | +| `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` | +| `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()` | +| `publicClient.getBytecode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | **Deprecated** Use `getCode` instead. | +| `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` | +| `publicClient.getCode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.getContractEvents` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`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' })` | +| `publicClient.getEip712Domain` | (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> | 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: [], // }` | +| `publicClient.getEnsAddress` | (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsAvatar` | (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsName` | (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `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'` | +| `publicClient.getEnsText` | (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getFeeHistory` | (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> | 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], })` | +| `publicClient.getFilterChanges` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `publicClient.getFilterLogs` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `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()` | +| `publicClient.getLogs` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`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()` | +| `publicClient.getProof` | (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> | 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...'], })` | +| `publicClient.getStorageAt` | (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> | 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), })` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> | 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', })` | +| `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', })` | +| `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', })` | +| `publicClient.getTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.key` | `string` | A key for the client. | +| `publicClient.multicall` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`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' }]` | +| `publicClient.name` | `string` | A name for the client. | +| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `publicClient.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `publicClient.readContract` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`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` | +| `publicClient.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `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' })` | +| `publicClient.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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' })` | +| `publicClient.simulate` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. | +| `publicClient.simulateBlocks` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`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'), }], }] })` | +| `publicClient.simulateCalls` | \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`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'), }, ] })` | +| `publicClient.simulateContract` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> | 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', })` | +| `publicClient.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `publicClient.type` | `string` | The type of client. | +| `publicClient.uid` | `string` | A unique ID for the client. | +| `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` | +| `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) | +| `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) | +| `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) | +| `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) | +| `publicClient.waitForTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.watchBlockNumber` | (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchBlocks` | \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchContractEvent` | \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchEvent` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchPendingTransactions` | (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `target` | `` `0x${string}` `` | - | +| `amount` | `bigint` | - | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### mintTestTokens() + +> `static` **mintTestTokens**(`adminWallet`, `publicClient`, `tokenAddr`, `target`, `amount`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/faucet.ts:195](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L195) + +Mints tokens directly to the target. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `adminWallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `adminWallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `adminWallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `adminWallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `adminWallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `adminWallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `adminWallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `adminWallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `adminWallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `adminWallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `adminWallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `adminWallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `adminWallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `adminWallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `adminWallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `adminWallet.key` | `string` | A key for the client. | +| `adminWallet.name` | `string` | A name for the client. | +| `adminWallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `adminWallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `adminWallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `adminWallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `adminWallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `adminWallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.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' })` | +| `adminWallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `adminWallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `adminWallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `adminWallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `adminWallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `adminWallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `adminWallet.type` | `string` | The type of client. | +| `adminWallet.uid` | `string` | A unique ID for the client. | +| `adminWallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `adminWallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `adminWallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `adminWallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} | - | +| `publicClient.account` | `undefined` | The Account of the Client. | +| `publicClient.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `publicClient.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `publicClient.call` | (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `publicClient.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `publicClient.createAccessList` | (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `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', })` | +| `publicClient.createBlockFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `publicClient.createContractEventFilter` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`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)']), })` | +| `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', })` | +| `publicClient.createPendingTransactionFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `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', })` | +| `publicClient.estimateFeesPerGas` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`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: ... }` | +| `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'), })` | +| `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` | +| `publicClient.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `publicClient.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `publicClient.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `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'), })` | +| `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)` | +| `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()` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `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()` | +| `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` | +| `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()` | +| `publicClient.getBytecode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | **Deprecated** Use `getCode` instead. | +| `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` | +| `publicClient.getCode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.getContractEvents` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`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' })` | +| `publicClient.getEip712Domain` | (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> | 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: [], // }` | +| `publicClient.getEnsAddress` | (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsAvatar` | (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsName` | (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `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'` | +| `publicClient.getEnsText` | (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getFeeHistory` | (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> | 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], })` | +| `publicClient.getFilterChanges` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `publicClient.getFilterLogs` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `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()` | +| `publicClient.getLogs` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`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()` | +| `publicClient.getProof` | (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> | 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...'], })` | +| `publicClient.getStorageAt` | (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> | 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), })` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> | 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', })` | +| `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', })` | +| `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', })` | +| `publicClient.getTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.key` | `string` | A key for the client. | +| `publicClient.multicall` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`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' }]` | +| `publicClient.name` | `string` | A name for the client. | +| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `publicClient.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `publicClient.readContract` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`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` | +| `publicClient.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `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' })` | +| `publicClient.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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' })` | +| `publicClient.simulate` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. | +| `publicClient.simulateBlocks` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`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'), }], }] })` | +| `publicClient.simulateCalls` | \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`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'), }, ] })` | +| `publicClient.simulateContract` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> | 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', })` | +| `publicClient.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `publicClient.type` | `string` | The type of client. | +| `publicClient.uid` | `string` | A unique ID for the client. | +| `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` | +| `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) | +| `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) | +| `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) | +| `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) | +| `publicClient.waitForTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.watchBlockNumber` | (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchBlocks` | \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchContractEvent` | \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchEvent` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchPendingTransactions` | (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `tokenAddr` | `` `0x${string}` `` | - | +| `target` | `` `0x${string}` `` | - | +| `amount` | `bigint` | - | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### prepareTestAccount() + +> `static` **prepareTestAccount**(`adminWallet`, `publicClient`, `config`): `Promise`\<[`FaucetPreparationResult`](../type-aliases/FaucetPreparationResult.md)\> + +Defined in: [packages/core/src/actions/faucet.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L45) + +Orchestrates the complete setup for a test account. +1. Funds ETH +2. Registers ENDUSER role +3. Mints GTokens to user +4. Deposits to Paymaster V4 (if address provided) using Admin's tokens + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `adminWallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `adminWallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `adminWallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `adminWallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `adminWallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `adminWallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `adminWallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `adminWallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `adminWallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `adminWallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `adminWallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `adminWallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `adminWallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `adminWallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `adminWallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `adminWallet.key` | `string` | A key for the client. | +| `adminWallet.name` | `string` | A name for the client. | +| `adminWallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `adminWallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `adminWallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `adminWallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `adminWallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `adminWallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.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' })` | +| `adminWallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `adminWallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `adminWallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `adminWallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `adminWallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `adminWallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `adminWallet.type` | `string` | The type of client. | +| `adminWallet.uid` | `string` | A unique ID for the client. | +| `adminWallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `adminWallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `adminWallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `adminWallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} | - | +| `publicClient.account` | `undefined` | The Account of the Client. | +| `publicClient.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `publicClient.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `publicClient.call` | (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `publicClient.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `publicClient.createAccessList` | (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `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', })` | +| `publicClient.createBlockFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `publicClient.createContractEventFilter` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`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)']), })` | +| `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', })` | +| `publicClient.createPendingTransactionFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `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', })` | +| `publicClient.estimateFeesPerGas` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`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: ... }` | +| `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'), })` | +| `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` | +| `publicClient.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `publicClient.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `publicClient.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `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'), })` | +| `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)` | +| `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()` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `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()` | +| `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` | +| `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()` | +| `publicClient.getBytecode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | **Deprecated** Use `getCode` instead. | +| `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` | +| `publicClient.getCode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.getContractEvents` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`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' })` | +| `publicClient.getEip712Domain` | (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> | 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: [], // }` | +| `publicClient.getEnsAddress` | (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsAvatar` | (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsName` | (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `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'` | +| `publicClient.getEnsText` | (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getFeeHistory` | (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> | 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], })` | +| `publicClient.getFilterChanges` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `publicClient.getFilterLogs` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `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()` | +| `publicClient.getLogs` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`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()` | +| `publicClient.getProof` | (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> | 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...'], })` | +| `publicClient.getStorageAt` | (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> | 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), })` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> | 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', })` | +| `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', })` | +| `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', })` | +| `publicClient.getTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.key` | `string` | A key for the client. | +| `publicClient.multicall` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`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' }]` | +| `publicClient.name` | `string` | A name for the client. | +| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `publicClient.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `publicClient.readContract` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`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` | +| `publicClient.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `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' })` | +| `publicClient.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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' })` | +| `publicClient.simulate` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. | +| `publicClient.simulateBlocks` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`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'), }], }] })` | +| `publicClient.simulateCalls` | \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`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'), }, ] })` | +| `publicClient.simulateContract` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> | 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', })` | +| `publicClient.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `publicClient.type` | `string` | The type of client. | +| `publicClient.uid` | `string` | A unique ID for the client. | +| `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` | +| `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) | +| `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) | +| `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) | +| `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) | +| `publicClient.waitForTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.watchBlockNumber` | (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchBlocks` | \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchContractEvent` | \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchEvent` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchPendingTransactions` | (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `config` | [`FaucetConfig`](../type-aliases/FaucetConfig.md) | - | + +#### Returns + +`Promise`\<[`FaucetPreparationResult`](../type-aliases/FaucetPreparationResult.md)\> + +*** + +### registerEndUser() + +> `static` **registerEndUser**(`adminWallet`, `publicClient`, `registryAddr`, `target`, `gasToken`): `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/faucet.ts:128](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L128) + +Registers the ENDUSER role using Sponsor Mode (Admin pays stake). + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `adminWallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `adminWallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `adminWallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `adminWallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `adminWallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `adminWallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `adminWallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `adminWallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `adminWallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `adminWallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `adminWallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `adminWallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `adminWallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `adminWallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `adminWallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `adminWallet.key` | `string` | A key for the client. | +| `adminWallet.name` | `string` | A name for the client. | +| `adminWallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `adminWallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `adminWallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `adminWallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `adminWallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `adminWallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `adminWallet.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' })` | +| `adminWallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `adminWallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `adminWallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `adminWallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `adminWallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `adminWallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `adminWallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `adminWallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `adminWallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `adminWallet.type` | `string` | The type of client. | +| `adminWallet.uid` | `string` | A unique ID for the client. | +| `adminWallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `adminWallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `adminWallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `adminWallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `publicClient` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} | - | +| `publicClient.account` | `undefined` | The Account of the Client. | +| `publicClient.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `publicClient.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `publicClient.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `publicClient.call` | (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `publicClient.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `publicClient.createAccessList` | (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `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', })` | +| `publicClient.createBlockFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `publicClient.createContractEventFilter` | \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`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)']), })` | +| `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', })` | +| `publicClient.createPendingTransactionFilter` | () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `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' }` | +| `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', })` | +| `publicClient.estimateFeesPerGas` | \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`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: ... }` | +| `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'), })` | +| `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` | +| `publicClient.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `publicClient.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `publicClient.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `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'), })` | +| `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)` | +| `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()` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `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()` | +| `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` | +| `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()` | +| `publicClient.getBytecode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | **Deprecated** Use `getCode` instead. | +| `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` | +| `publicClient.getCode` | (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.getContractEvents` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`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' })` | +| `publicClient.getEip712Domain` | (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> | 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: [], // }` | +| `publicClient.getEnsAddress` | (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsAvatar` | (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getEnsName` | (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `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'` | +| `publicClient.getEnsText` | (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> | 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'` | +| `publicClient.getFeeHistory` | (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> | 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], })` | +| `publicClient.getFilterChanges` | \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `publicClient.getFilterLogs` | \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`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 })` | +| `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()` | +| `publicClient.getLogs` | \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`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()` | +| `publicClient.getProof` | (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> | 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...'], })` | +| `publicClient.getStorageAt` | (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> | 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), })` | +| `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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> | 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', })` | +| `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', })` | +| `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', })` | +| `publicClient.getTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.key` | `string` | A key for the client. | +| `publicClient.multicall` | \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`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' }]` | +| `publicClient.name` | `string` | A name for the client. | +| `publicClient.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `publicClient.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `publicClient.readContract` | \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`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` | +| `publicClient.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `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' })` | +| `publicClient.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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' })` | +| `publicClient.simulate` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> | **Deprecated** Use `simulateBlocks` instead. | +| `publicClient.simulateBlocks` | \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`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'), }], }] })` | +| `publicClient.simulateCalls` | \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`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'), }, ] })` | +| `publicClient.simulateContract` | \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> | 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', })` | +| `publicClient.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `publicClient.type` | `string` | The type of client. | +| `publicClient.uid` | `string` | A unique ID for the client. | +| `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` | +| `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) | +| `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) | +| `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) | +| `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) | +| `publicClient.waitForTransactionReceipt` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | 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', })` | +| `publicClient.watchBlockNumber` | (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchBlocks` | \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchContractEvent` | \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchEvent` | \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `publicClient.watchPendingTransactions` | (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) | 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), })` | +| `registryAddr` | `` `0x${string}` `` | - | +| `target` | `` `0x${string}` `` | - | +| `gasToken` | `` `0x${string}` `` | - | + +#### Returns + +`Promise`\<`boolean`\> diff --git a/0.16.23/api/@aastar/core/classes/StateValidator.md b/0.16.23/api/@aastar/core/classes/StateValidator.md new file mode 100644 index 000000000..5e6f6552d --- /dev/null +++ b/0.16.23/api/@aastar/core/classes/StateValidator.md @@ -0,0 +1,117 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L44) + +## Constructors + +### Constructor + +> **new StateValidator**(): `StateValidator` + +#### Returns + +`StateValidator` + +## Methods + +### getAccountBalances() + +> `static` **getAccountBalances**(`params`): `Promise`\<[`AccountBalance`](../interfaces/AccountBalance.md)[]\> + +Defined in: [packages/core/src/actions/StateValidator.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L58) + +Batch fetch balances for multiple accounts + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `addresses`: `` `0x${string}` ``[]; `aPNTsAddress?`: `` `0x${string}` ``; `chain`: [`Chain`](https://viem.sh/docs/index.html); `gTokenAddress?`: `` `0x${string}` ``; `rpcUrl`: `string`; `xPNTsAddress?`: `` `0x${string}` ``; \} | +| `params.addresses` | `` `0x${string}` ``[] | +| `params.aPNTsAddress?` | `` `0x${string}` `` | +| `params.chain` | [`Chain`](https://viem.sh/docs/index.html) | +| `params.gTokenAddress?` | `` `0x${string}` `` | +| `params.rpcUrl` | `string` | +| `params.xPNTsAddress?` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<[`AccountBalance`](../interfaces/AccountBalance.md)[]\> + +*** + +### validateDeployment() + +> `static` **validateDeployment**(`params`): `Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +Defined in: [packages/core/src/actions/StateValidator.ts:232](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L232) + +Deployment Validation + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | [`DeploymentValidationParams`](../interfaces/DeploymentValidationParams.md) | + +#### Returns + +`Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +*** + +### validateETHBalance() + +> `static` **validateETHBalance**(`params`): `Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +Defined in: [packages/core/src/actions/StateValidator.ts:153](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L153) + +ETH Balance Validation + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | [`BalanceValidationParams`](../interfaces/BalanceValidationParams.md) | + +#### Returns + +`Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +*** + +### validateRole() + +> `static` **validateRole**(`params`): `Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +Defined in: [packages/core/src/actions/StateValidator.ts:114](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L114) + +Role Validation + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | [`RoleValidationParams`](../interfaces/RoleValidationParams.md) | + +#### Returns + +`Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +*** + +### validateTokenBalance() + +> `static` **validateTokenBalance**(`params`): `Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> + +Defined in: [packages/core/src/actions/StateValidator.ts:189](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L189) + +Token Balance Validation + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | [`TokenBalanceValidationParams`](../interfaces/TokenBalanceValidationParams.md) | + +#### Returns + +`Promise`\<[`ValidationResult`](../interfaces/ValidationResult.md)\> diff --git a/0.16.23/api/@aastar/core/enumerations/EntryPointVersion.md b/0.16.23/api/@aastar/core/enumerations/EntryPointVersion.md new file mode 100644 index 000000000..ef53a025d --- /dev/null +++ b/0.16.23/api/@aastar/core/enumerations/EntryPointVersion.md @@ -0,0 +1,17 @@ +Defined in: [packages/core/src/actions/entryPoint.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L6) + +## Enumeration Members + +### V06 + +> **V06**: `"0.6"` + +Defined in: [packages/core/src/actions/entryPoint.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L7) + +*** + +### V07 + +> **V07**: `"0.7"` + +Defined in: [packages/core/src/actions/entryPoint.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L8) diff --git a/0.16.23/api/@aastar/core/enumerations/NodeType.md b/0.16.23/api/@aastar/core/enumerations/NodeType.md new file mode 100644 index 000000000..c4d0933b4 --- /dev/null +++ b/0.16.23/api/@aastar/core/enumerations/NodeType.md @@ -0,0 +1,33 @@ +Defined in: [packages/core/src/communities.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L8) + +## Enumeration Members + +### ANODE + +> **ANODE**: `2` + +Defined in: [packages/core/src/communities.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L11) + +*** + +### KMS + +> **KMS**: `3` + +Defined in: [packages/core/src/communities.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L12) + +*** + +### PAYMASTER\_AOA + +> **PAYMASTER\_AOA**: `0` + +Defined in: [packages/core/src/communities.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L9) + +*** + +### PAYMASTER\_SUPER + +> **PAYMASTER\_SUPER**: `1` + +Defined in: [packages/core/src/communities.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L10) diff --git a/0.16.23/api/@aastar/core/enumerations/RolePermissionLevel.md b/0.16.23/api/@aastar/core/enumerations/RolePermissionLevel.md new file mode 100644 index 000000000..f87754e2b --- /dev/null +++ b/0.16.23/api/@aastar/core/enumerations/RolePermissionLevel.md @@ -0,0 +1,43 @@ +Defined in: [packages/core/src/roles.ts:149](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L149) + +Role permission levels (for UI sorting/filtering) + +## Enumeration Members + +### COMMUNITY + +> **COMMUNITY**: `30` + +Defined in: [packages/core/src/roles.ts:153](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L153) + +*** + +### KMS + +> **KMS**: `80` + +Defined in: [packages/core/src/roles.ts:151](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L151) + +*** + +### OPERATOR + +> **OPERATOR**: `50` + +Defined in: [packages/core/src/roles.ts:152](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L152) + +*** + +### PROTOCOL + +> **PROTOCOL**: `100` + +Defined in: [packages/core/src/roles.ts:150](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L150) + +*** + +### USER + +> **USER**: `10` + +Defined in: [packages/core/src/roles.ts:154](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L154) diff --git a/0.16.23/api/@aastar/core/functions/accountActions.md b/0.16.23/api/@aastar/core/functions/accountActions.md new file mode 100644 index 000000000..8585386cb --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/accountActions.md @@ -0,0 +1,23 @@ +> **accountActions**(`address`): (`client`) => [`AccountActions`](../type-aliases/AccountActions.md) + +Defined in: [packages/core/src/actions/account.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L24) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`AccountActions`](../type-aliases/AccountActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`AccountActions`](../type-aliases/AccountActions.md) diff --git a/0.16.23/api/@aastar/core/functions/accountFactoryActions.md b/0.16.23/api/@aastar/core/functions/accountFactoryActions.md new file mode 100644 index 000000000..8f858d4c9 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/accountFactoryActions.md @@ -0,0 +1,24 @@ +> **accountFactoryActions**(`address`, `abi`): (`client`) => [`AccountFactoryActions`](../type-aliases/AccountFactoryActions.md) + +Defined in: [packages/core/src/actions/account.ts:158](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L158) + +## Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `address` | `` `0x${string}` `` | `undefined` | +| `abi` | `any` | `SimpleAccountFactoryABI` | + +## Returns + +> (`client`): [`AccountFactoryActions`](../type-aliases/AccountFactoryActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`AccountFactoryActions`](../type-aliases/AccountFactoryActions.md) diff --git a/0.16.23/api/@aastar/core/functions/aggregatorActions.md b/0.16.23/api/@aastar/core/functions/aggregatorActions.md new file mode 100644 index 000000000..bd690d73b --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/aggregatorActions.md @@ -0,0 +1,23 @@ +> **aggregatorActions**(`address`): (`client`) => [`AggregatorActions`](../type-aliases/AggregatorActions.md) + +Defined in: [packages/core/src/actions/aggregator.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L45) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`AggregatorActions`](../type-aliases/AggregatorActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`AggregatorActions`](../type-aliases/AggregatorActions.md) diff --git a/0.16.23/api/@aastar/core/functions/applyConfig.md b/0.16.23/api/@aastar/core/functions/applyConfig.md new file mode 100644 index 000000000..534307bd2 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/applyConfig.md @@ -0,0 +1,15 @@ +> **applyConfig**(`newConfig`): `void` + +Defined in: [packages/core/src/constants.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L48) + +Apply external configuration (for Node.js environment) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `newConfig` | `any` | + +## Returns + +`void` diff --git a/0.16.23/api/@aastar/core/functions/createAAStarPublicClient.md b/0.16.23/api/@aastar/core/functions/createAAStarPublicClient.md new file mode 100644 index 000000000..3fef20ea3 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/createAAStarPublicClient.md @@ -0,0 +1,16 @@ +> **createAAStarPublicClient**(`rpcUrl`, `chain`): [`PublicClient`](../interfaces/PublicClient.md) + +Defined in: [packages/core/src/clients.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients.ts#L8) + +Creates a standard AAStar public client for any given chain. + +## Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `rpcUrl` | `string` | `undefined` | +| `chain` | [`Chain`](https://viem.sh/docs/index.html) | `sepolia` | + +## Returns + +[`PublicClient`](../interfaces/PublicClient.md) diff --git a/0.16.23/api/@aastar/core/functions/dvtActions.md b/0.16.23/api/@aastar/core/functions/dvtActions.md new file mode 100644 index 000000000..562ff3608 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/dvtActions.md @@ -0,0 +1,23 @@ +> **dvtActions**(`address`): (`client`) => [`DVTActions`](../type-aliases/DVTActions.md) + +Defined in: [packages/core/src/actions/dvt.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L33) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`DVTActions`](../type-aliases/DVTActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`DVTActions`](../type-aliases/DVTActions.md) diff --git a/0.16.23/api/@aastar/core/functions/entryPointActions.md b/0.16.23/api/@aastar/core/functions/entryPointActions.md new file mode 100644 index 000000000..e3638929e --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/entryPointActions.md @@ -0,0 +1,23 @@ +> **entryPointActions**(`address`): (`client`) => [`EntryPointActions`](../type-aliases/EntryPointActions.md) + +Defined in: [packages/core/src/actions/entryPoint.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L19) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`EntryPointActions`](../type-aliases/EntryPointActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`EntryPointActions`](../type-aliases/EntryPointActions.md) diff --git a/0.16.23/api/@aastar/core/functions/gTokenActions.md b/0.16.23/api/@aastar/core/functions/gTokenActions.md new file mode 100644 index 000000000..f8d3af4fe --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/gTokenActions.md @@ -0,0 +1,23 @@ +> **gTokenActions**(`address?`): (`client`) => [`GTokenActions`](../type-aliases/GTokenActions.md) + +Defined in: [packages/core/src/actions/tokens.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L83) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address?` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`GTokenActions`](../type-aliases/GTokenActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`GTokenActions`](../type-aliases/GTokenActions.md) diff --git a/0.16.23/api/@aastar/core/functions/getAddressUrl.md b/0.16.23/api/@aastar/core/functions/getAddressUrl.md new file mode 100644 index 000000000..8e14d7b99 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getAddressUrl.md @@ -0,0 +1,25 @@ +> **getAddressUrl**(`network`, `address`): `string` + +Defined in: [packages/core/src/networks.ts:131](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L131) + +Get address URL on block explorer + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | +| `address` | `string` | Contract or wallet address | + +## Returns + +`string` + +Full address URL + +## Example + +```ts +const url = getAddressUrl('sepolia', '0xabc...'); +// 'https://sepolia.etherscan.io/address/0xabc...' +``` diff --git a/0.16.23/api/@aastar/core/functions/getAllCommunityConfigs.md b/0.16.23/api/@aastar/core/functions/getAllCommunityConfigs.md new file mode 100644 index 000000000..bd4982cab --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getAllCommunityConfigs.md @@ -0,0 +1,9 @@ +> **getAllCommunityConfigs**(): [`CommunityConfig`](../interfaces/CommunityConfig.md)[] + +Defined in: [packages/core/src/communities.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L84) + +Get all community configurations + +## Returns + +[`CommunityConfig`](../interfaces/CommunityConfig.md)[] diff --git a/0.16.23/api/@aastar/core/functions/getAllV2Contracts.md b/0.16.23/api/@aastar/core/functions/getAllV2Contracts.md new file mode 100644 index 000000000..e22c4bf31 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getAllV2Contracts.md @@ -0,0 +1,20 @@ +> **getAllV2Contracts**(): [`ContractVersion`](../interfaces/ContractVersion.md)[] + +Defined in: [packages/core/src/contract-versions.ts:264](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L264) + +Get all V2 contracts with VERSION interface + +## Returns + +[`ContractVersion`](../interfaces/ContractVersion.md)[] + +Array of all V2 contract versions + +## Example + +```ts +const allV2Contracts = getAllV2Contracts(); +for (const contract of allV2Contracts) { + console.log(`${contract.name} v${contract.version} at ${contract.address}`); +} +``` diff --git a/0.16.23/api/@aastar/core/functions/getBlockExplorer.md b/0.16.23/api/@aastar/core/functions/getBlockExplorer.md new file mode 100644 index 000000000..b9c915fa3 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getBlockExplorer.md @@ -0,0 +1,24 @@ +> **getBlockExplorer**(`network`): `""` \| `"https://sepolia.etherscan.io"` \| `"https://optimistic.etherscan.io"` \| `"https://optimism-sepolia.blockscout.com"` + +Defined in: [packages/core/src/networks.ts:97](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L97) + +Get block explorer URL + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | + +## Returns + +`""` \| `"https://sepolia.etherscan.io"` \| `"https://optimistic.etherscan.io"` \| `"https://optimism-sepolia.blockscout.com"` + +Block explorer base URL + +## Example + +```ts +const explorer = getBlockExplorer('sepolia'); +// 'https://sepolia.etherscan.io' +``` diff --git a/0.16.23/api/@aastar/core/functions/getChainId.md b/0.16.23/api/@aastar/core/functions/getChainId.md new file mode 100644 index 000000000..73cb321a3 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getChainId.md @@ -0,0 +1,24 @@ +> **getChainId**(`network`): `number` + +Defined in: [packages/core/src/networks.ts:147](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L147) + +Get chain ID for a network + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | + +## Returns + +`number` + +Chain ID number + +## Example + +```ts +const chainId = getChainId('sepolia'); +// 11155111 +``` diff --git a/0.16.23/api/@aastar/core/functions/getCommunities.md b/0.16.23/api/@aastar/core/functions/getCommunities.md new file mode 100644 index 000000000..b5634b576 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getCommunities.md @@ -0,0 +1,74 @@ +> **getCommunities**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:395](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L395) + +Get registered communities + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +Communities object + +### aastar + +> `readonly` **aastar**: `object` + +AAStar Community - Test community for development (registered: 2025-11-01) + +#### aastar.ensName + +> `readonly` **ensName**: `"aastar.eth"` = `'aastar.eth'` + +#### aastar.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.aPNTs` + +#### aastar.name + +> `readonly` **name**: `"AAStar"` = `'AAStar'` + +#### aastar.owner + +> `readonly` **owner**: `"0x411BD567E46C0781248dbB6a9211891C032885e5"` = `COMMUNITY_OWNERS.aastarOwner` + +#### aastar.stake + +> `readonly` **stake**: `"50"` = `'50'` + +### breadCommunity + +> `readonly` **breadCommunity**: `object` + +BreadCommunity - Test community for development (registered: 2025-11-03) + +#### breadCommunity.ensName + +> `readonly` **ensName**: `"bread.eth"` = `'bread.eth'` + +#### breadCommunity.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.bPNTs` + +#### breadCommunity.name + +> `readonly` **name**: `"BreadCommunity"` = `'BreadCommunity'` + +#### breadCommunity.owner + +> `readonly` **owner**: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"` = `COMMUNITY_OWNERS.breadCommunityOwner` + +#### breadCommunity.stake + +> `readonly` **stake**: `"50"` = `'50'` + +## Example + +```ts +const communities = getCommunities('sepolia'); +console.log(communities.aastar.owner); +``` diff --git a/0.16.23/api/@aastar/core/functions/getCommunity.md b/0.16.23/api/@aastar/core/functions/getCommunity.md new file mode 100644 index 000000000..7d463b42a --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getCommunity.md @@ -0,0 +1,25 @@ +> **getCommunity**(`network`, `communityName`): \{ `ensName`: `"aastar.eth"`; `gasToken`: `` `0x${string}` ``; `name`: `"AAStar"`; `owner`: `"0x411BD567E46C0781248dbB6a9211891C032885e5"`; `stake`: `"50"`; \} \| \{ `ensName`: `"bread.eth"`; `gasToken`: `` `0x${string}` ``; `name`: `"BreadCommunity"`; `owner`: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"`; `stake`: `"50"`; \} + +Defined in: [packages/core/src/contracts.ts:412](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L412) + +Get a specific community + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | +| `communityName` | `"aastar"` \| `"breadCommunity"` | Community name (aastar, builderDao) | + +## Returns + +\{ `ensName`: `"aastar.eth"`; `gasToken`: `` `0x${string}` ``; `name`: `"AAStar"`; `owner`: `"0x411BD567E46C0781248dbB6a9211891C032885e5"`; `stake`: `"50"`; \} \| \{ `ensName`: `"bread.eth"`; `gasToken`: `` `0x${string}` ``; `name`: `"BreadCommunity"`; `owner`: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"`; `stake`: `"50"`; \} + +Community information + +## Example + +```ts +const aastar = getCommunity('sepolia', 'aastar'); +console.log(aastar.gasToken); // aPNTs address +``` diff --git a/0.16.23/api/@aastar/core/functions/getCommunityConfig.md b/0.16.23/api/@aastar/core/functions/getCommunityConfig.md new file mode 100644 index 000000000..feb8b40d9 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getCommunityConfig.md @@ -0,0 +1,15 @@ +> **getCommunityConfig**(`address`): [`CommunityConfig`](../interfaces/CommunityConfig.md) \| `undefined` + +Defined in: [packages/core/src/communities.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L77) + +Get community configuration by address + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `string` | + +## Returns + +[`CommunityConfig`](../interfaces/CommunityConfig.md) \| `undefined` diff --git a/0.16.23/api/@aastar/core/functions/getContract.md b/0.16.23/api/@aastar/core/functions/getContract.md new file mode 100644 index 000000000..c655e3fcb --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getContract.md @@ -0,0 +1,25 @@ +> **getContract**(`network`, `category`, `name`): `string` + +Defined in: [packages/core/src/contracts.ts:151](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L151) + +Get a specific contract address + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | +| `category` | [`ContractCategory`](../type-aliases/ContractCategory.md) | Contract category | +| `name` | `string` | Contract name | + +## Returns + +`string` + +Contract address + +## Example + +```ts +const address = getContract('sepolia', 'core', 'superPaymaster'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getContractNetworks.md b/0.16.23/api/@aastar/core/functions/getContractNetworks.md new file mode 100644 index 000000000..f74a4d6ec --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getContractNetworks.md @@ -0,0 +1,18 @@ +> **getContractNetworks**(): `"sepolia"`[] + +Defined in: [packages/core/src/contracts.ts:325](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L325) + +Get all supported contract network names + +## Returns + +`"sepolia"`[] + +Array of supported network names + +## Example + +```ts +const networks = getContractNetworks(); +// ['sepolia'] +``` diff --git a/0.16.23/api/@aastar/core/functions/getContracts.md b/0.16.23/api/@aastar/core/functions/getContracts.md new file mode 100644 index 000000000..a5b004228 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getContracts.md @@ -0,0 +1,192 @@ +> **getContracts**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:130](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L130) + +Get all contracts for a specific network + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name (e.g., 'sepolia') | + +## Returns + +`object` + +All contract addresses for the network + +### communities + +> `readonly` **communities**: `object` + +#### communities.aastar + +> `readonly` **aastar**: `object` + +AAStar Community - Test community for development (registered: 2025-11-01) + +#### communities.aastar.ensName + +> `readonly` **ensName**: `"aastar.eth"` = `'aastar.eth'` + +#### communities.aastar.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.aPNTs` + +#### communities.aastar.name + +> `readonly` **name**: `"AAStar"` = `'AAStar'` + +#### communities.aastar.owner + +> `readonly` **owner**: `"0x411BD567E46C0781248dbB6a9211891C032885e5"` = `COMMUNITY_OWNERS.aastarOwner` + +#### communities.aastar.stake + +> `readonly` **stake**: `"50"` = `'50'` + +#### communities.breadCommunity + +> `readonly` **breadCommunity**: `object` + +BreadCommunity - Test community for development (registered: 2025-11-03) + +#### communities.breadCommunity.ensName + +> `readonly` **ensName**: `"bread.eth"` = `'bread.eth'` + +#### communities.breadCommunity.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.bPNTs` + +#### communities.breadCommunity.name + +> `readonly` **name**: `"BreadCommunity"` = `'BreadCommunity'` + +#### communities.breadCommunity.owner + +> `readonly` **owner**: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"` = `COMMUNITY_OWNERS.breadCommunityOwner` + +#### communities.breadCommunity.stake + +> `readonly` **stake**: `"50"` = `'50'` + +### core + +> `readonly` **core**: `object` = `CORE_ADDRESSES` + +#### core.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` = `APNTS_ADDRESS` + +#### core.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +#### core.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` = `ENTRY_POINT_ADDRESS` + +#### core.gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +#### core.gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +#### core.mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +#### core.paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +#### core.paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +#### core.registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +#### core.superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +#### core.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +### monitoring + +> `readonly` **monitoring**: `object` = `MONITORING_ADDRESSES` + +#### monitoring.blsAggregator + +> `readonly` **blsAggregator**: `` `0x${string}` `` = `BLS_AGGREGATOR_ADDRESS` + +#### monitoring.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +### official + +> `readonly` **official**: `object` = `OFFICIAL_ADDRESSES` + +#### official.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` + +### paymaster + +> `readonly` **paymaster**: `object` = `PAYMASTER_ADDRESSES` + +#### paymaster.paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `` `0x${string}` `` + +#### paymaster.paymasterV4\_1iImplementation + +> `readonly` **paymasterV4\_1iImplementation**: `` `0x${string}` `` = `PAYMASTER_V4_IMPL_ADDRESS` + +### testAccounts + +> `readonly` **testAccounts**: `object` = `TEST_ACCOUNT_ADDRESSES` + +#### testAccounts.simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` + +### testTokens + +> `readonly` **testTokens**: `object` = `TEST_TOKEN_ADDRESSES` + +#### testTokens.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +#### testTokens.bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +#### testTokens.mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` + +### tokens + +> `readonly` **tokens**: `object` = `TOKEN_ADDRESSES` + +#### tokens.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +## Example + +```ts +const contracts = getContracts('sepolia'); +console.log(contracts.core.superPaymaster); +``` diff --git a/0.16.23/api/@aastar/core/functions/getCoreContracts.md b/0.16.23/api/@aastar/core/functions/getCoreContracts.md new file mode 100644 index 000000000..87fc3c036 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getCoreContracts.md @@ -0,0 +1,69 @@ +> **getCoreContracts**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:184](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L184) + +Get core system contracts + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`object` + +Core contract addresses + +### aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` = `APNTS_ADDRESS` + +### dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +### entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` = `ENTRY_POINT_ADDRESS` + +### gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +### gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +### mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +### paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +### paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +### registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +### superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +### xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +## Example + +```ts +const core = getCoreContracts('sepolia'); +console.log(core.superPaymaster); +console.log(core.registry); +``` diff --git a/0.16.23/api/@aastar/core/functions/getDeploymentDate.md b/0.16.23/api/@aastar/core/functions/getDeploymentDate.md new file mode 100644 index 000000000..a902975f1 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getDeploymentDate.md @@ -0,0 +1,25 @@ +> **getDeploymentDate**(`network`, `contractName`): `string` \| `undefined` + +Defined in: [packages/core/src/contracts.ts:376](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L376) + +Get contract deployment date + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | +| `contractName` | `string` | Contract name | + +## Returns + +`string` \| `undefined` + +Deployment date string (YYYY-MM-DD) + +## Example + +```ts +const date = getDeploymentDate('sepolia', 'superPaymaster'); +// '2025-10-25' +``` diff --git a/0.16.23/api/@aastar/core/functions/getEntryPoint.md b/0.16.23/api/@aastar/core/functions/getEntryPoint.md new file mode 100644 index 000000000..b0da0be5c --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getEntryPoint.md @@ -0,0 +1,23 @@ +> **getEntryPoint**(`network`): `string` + +Defined in: [packages/core/src/contracts.ts:293](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L293) + +Get EntryPoint v0.7 address + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`string` + +EntryPoint address + +## Example + +```ts +const entryPoint = getEntryPoint('sepolia'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getNetwork.md b/0.16.23/api/@aastar/core/functions/getNetwork.md new file mode 100644 index 000000000..77ef162ba --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getNetwork.md @@ -0,0 +1,24 @@ +> **getNetwork**(`network`): \{ `blockExplorer`: `"https://sepolia.etherscan.io"`; `chainId`: `11155111`; `name`: `"Sepolia"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Sepolia ETH"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://rpc.sepolia.org"`; \} \| \{ `blockExplorer`: `""`; `chainId`: `31337`; `name`: `"Anvil"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"ETH"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"http://127.0.0.1:8545"`; \} \| \{ `blockExplorer`: `"https://optimistic.etherscan.io"`; `chainId`: `10`; `name`: `"Optimism"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Ether"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://mainnet.optimism.io"`; \} \| \{ `blockExplorer`: `"https://optimism-sepolia.blockscout.com"`; `chainId`: `11155420`; `name`: `"Optimism Sepolia"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Sepolia Ether"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://sepolia.optimism.io"`; \} + +Defined in: [packages/core/src/networks.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L66) + +Get network configuration + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | + +## Returns + +\{ `blockExplorer`: `"https://sepolia.etherscan.io"`; `chainId`: `11155111`; `name`: `"Sepolia"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Sepolia ETH"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://rpc.sepolia.org"`; \} \| \{ `blockExplorer`: `""`; `chainId`: `31337`; `name`: `"Anvil"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"ETH"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"http://127.0.0.1:8545"`; \} \| \{ `blockExplorer`: `"https://optimistic.etherscan.io"`; `chainId`: `10`; `name`: `"Optimism"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Ether"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://mainnet.optimism.io"`; \} \| \{ `blockExplorer`: `"https://optimism-sepolia.blockscout.com"`; `chainId`: `11155420`; `name`: `"Optimism Sepolia"`; `nativeCurrency`: \{ `decimals`: `18`; `name`: `"Sepolia Ether"`; `symbol`: `"ETH"`; \}; `rpcUrl`: `"https://sepolia.optimism.io"`; \} + +Network configuration + +## Example + +```ts +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +``` diff --git a/0.16.23/api/@aastar/core/functions/getPaymasterV4_1.md b/0.16.23/api/@aastar/core/functions/getPaymasterV4_1.md new file mode 100644 index 000000000..5256f1317 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getPaymasterV4_1.md @@ -0,0 +1,23 @@ +> **getPaymasterV4\_1**(`network`): `string` + +Defined in: [packages/core/src/contracts.ts:232](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L232) + +Get PaymasterV4_1 address (AOA mode) + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`string` + +PaymasterV4_1 address + +## Example + +```ts +const paymaster = getPaymasterV4_1('sepolia'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getRoleName.md b/0.16.23/api/@aastar/core/functions/getRoleName.md new file mode 100644 index 000000000..98ac5fea7 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getRoleName.md @@ -0,0 +1,15 @@ +> **getRoleName**(`roleHash`): `string` + +Defined in: [packages/core/src/roles.ts:142](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L142) + +Get human-readable role name + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleHash` | `` `0x${string}` `` | + +## Returns + +`string` diff --git a/0.16.23/api/@aastar/core/functions/getRpcUrl.md b/0.16.23/api/@aastar/core/functions/getRpcUrl.md new file mode 100644 index 000000000..d5ae7b7f1 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getRpcUrl.md @@ -0,0 +1,23 @@ +> **getRpcUrl**(`network`): `"https://rpc.sepolia.org"` \| `"http://127.0.0.1:8545"` \| `"https://mainnet.optimism.io"` \| `"https://sepolia.optimism.io"` + +Defined in: [packages/core/src/networks.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L81) + +Get RPC URL for a network + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | + +## Returns + +`"https://rpc.sepolia.org"` \| `"http://127.0.0.1:8545"` \| `"https://mainnet.optimism.io"` \| `"https://sepolia.optimism.io"` + +Public RPC URL + +## Example + +```ts +const rpcUrl = getRpcUrl('sepolia'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getSimpleAccountFactory.md b/0.16.23/api/@aastar/core/functions/getSimpleAccountFactory.md new file mode 100644 index 000000000..429c030b9 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getSimpleAccountFactory.md @@ -0,0 +1,23 @@ +> **getSimpleAccountFactory**(`network`): `string` + +Defined in: [packages/core/src/contracts.ts:263](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L263) + +Get SimpleAccountFactory address + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`string` + +SimpleAccountFactory address + +## Example + +```ts +const factory = getSimpleAccountFactory('sepolia'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getSuperPaymasterV2.md b/0.16.23/api/@aastar/core/functions/getSuperPaymasterV2.md new file mode 100644 index 000000000..f651c3cf4 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getSuperPaymasterV2.md @@ -0,0 +1,23 @@ +> **getSuperPaymasterV2**(`network`): `string` + +Defined in: [packages/core/src/contracts.ts:278](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L278) + +Get SuperPaymaster V2 address (AOA+ mode) + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`string` + +SuperPaymaster V2 address + +## Example + +```ts +const superPaymaster = getSuperPaymasterV2('sepolia'); +``` diff --git a/0.16.23/api/@aastar/core/functions/getTestAccounts.md b/0.16.23/api/@aastar/core/functions/getTestAccounts.md new file mode 100644 index 000000000..582aa6afa --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getTestAccounts.md @@ -0,0 +1,28 @@ +> **getTestAccounts**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:248](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L248) + +Get test account contracts (SimpleAccountFactory, etc.) + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`object` + +Test account contract addresses + +### simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` + +## Example + +```ts +const testAccounts = getTestAccounts('sepolia'); +console.log(testAccounts.simpleAccountFactory); +``` diff --git a/0.16.23/api/@aastar/core/functions/getTestTokenContracts.md b/0.16.23/api/@aastar/core/functions/getTestTokenContracts.md new file mode 100644 index 000000000..7891d8193 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getTestTokenContracts.md @@ -0,0 +1,36 @@ +> **getTestTokenContracts**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:217](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L217) + +Get test token contracts (for development & testing) + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`object` + +Test token contract addresses + +### aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +### bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +### mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` + +## Example + +```ts +const testTokens = getTestTokenContracts('sepolia'); +console.log(testTokens.mockUSDT); +``` diff --git a/0.16.23/api/@aastar/core/functions/getTokenContracts.md b/0.16.23/api/@aastar/core/functions/getTokenContracts.md new file mode 100644 index 000000000..39e7576d6 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getTokenContracts.md @@ -0,0 +1,29 @@ +> **getTokenContracts**(`network`): `object` + +Defined in: [packages/core/src/contracts.ts:201](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L201) + +Get token system contracts + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"sepolia"` | Network name | + +## Returns + +`object` + +Token contract addresses + +### xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +## Example + +```ts +const tokens = getTokenContracts('sepolia'); +console.log(tokens.xPNTsFactory); +console.log(tokens.mySBT); +``` diff --git a/0.16.23/api/@aastar/core/functions/getTxUrl.md b/0.16.23/api/@aastar/core/functions/getTxUrl.md new file mode 100644 index 000000000..7d679027e --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getTxUrl.md @@ -0,0 +1,25 @@ +> **getTxUrl**(`network`, `txHash`): `string` + +Defined in: [packages/core/src/networks.ts:114](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L114) + +Get transaction URL on block explorer + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `"anvil"` \| `"optimism"` \| `"sepolia"` \| `"op-sepolia"` | Network name | +| `txHash` | `string` | Transaction hash | + +## Returns + +`string` + +Full transaction URL + +## Example + +```ts +const url = getTxUrl('sepolia', '0x123...'); +// 'https://sepolia.etherscan.io/tx/0x123...' +``` diff --git a/0.16.23/api/@aastar/core/functions/getV2ContractByAddress.md b/0.16.23/api/@aastar/core/functions/getV2ContractByAddress.md new file mode 100644 index 000000000..b3403ab1f --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getV2ContractByAddress.md @@ -0,0 +1,26 @@ +> **getV2ContractByAddress**(`address`): [`ContractVersion`](../interfaces/ContractVersion.md) \| `undefined` + +Defined in: [packages/core/src/contract-versions.ts:322](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L322) + +Get V2 contract by address + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `address` | `string` | Contract address (case-insensitive) | + +## Returns + +[`ContractVersion`](../interfaces/ContractVersion.md) \| `undefined` + +Contract version info or undefined + +## Example + +```ts +const contract = getV2ContractByAddress('0xB97A20aca3D6770Deca299a1aD9DAFb12d1e5eCf'); +if (contract) { + console.log(`Found: ${contract.name} v${contract.version}`); +} +``` diff --git a/0.16.23/api/@aastar/core/functions/getV2ContractByName.md b/0.16.23/api/@aastar/core/functions/getV2ContractByName.md new file mode 100644 index 000000000..a13a623e4 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getV2ContractByName.md @@ -0,0 +1,26 @@ +> **getV2ContractByName**(`name`): [`ContractVersion`](../interfaces/ContractVersion.md) \| `undefined` + +Defined in: [packages/core/src/contract-versions.ts:303](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L303) + +Get V2 contract by name + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `name` | `string` | Contract name | + +## Returns + +[`ContractVersion`](../interfaces/ContractVersion.md) \| `undefined` + +Contract version info or undefined + +## Example + +```ts +const contract = getV2ContractByName('SuperPaymasterV2'); +if (contract) { + console.log(`Version: ${contract.version}`); +} +``` diff --git a/0.16.23/api/@aastar/core/functions/getV2ContractsByDate.md b/0.16.23/api/@aastar/core/functions/getV2ContractsByDate.md new file mode 100644 index 000000000..1447d820c --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/getV2ContractsByDate.md @@ -0,0 +1,24 @@ +> **getV2ContractsByDate**(`date`): [`ContractVersion`](../interfaces/ContractVersion.md)[] + +Defined in: [packages/core/src/contract-versions.ts:356](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L356) + +Get all V2 contracts deployed on a specific date + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `date` | `string` | Deployment date (YYYY-MM-DD) | + +## Returns + +[`ContractVersion`](../interfaces/ContractVersion.md)[] + +Array of contracts deployed on that date + +## Example + +```ts +const contracts = getV2ContractsByDate('2025-11-01'); +console.log(`${contracts.length} contracts deployed on 2025-11-01`); +``` diff --git a/0.16.23/api/@aastar/core/functions/isContractNetworkSupported.md b/0.16.23/api/@aastar/core/functions/isContractNetworkSupported.md new file mode 100644 index 000000000..2782f7fe2 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/isContractNetworkSupported.md @@ -0,0 +1,25 @@ +> **isContractNetworkSupported**(`network`): `network is "sepolia"` + +Defined in: [packages/core/src/contracts.ts:310](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L310) + +Check if a network is supported for contracts + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `network` | `string` | Network name to check | + +## Returns + +`network is "sepolia"` + +True if network is supported + +## Example + +```ts +if (isContractNetworkSupported('sepolia')) { + const contracts = getContracts('sepolia'); +} +``` diff --git a/0.16.23/api/@aastar/core/functions/isRegisteredCommunity.md b/0.16.23/api/@aastar/core/functions/isRegisteredCommunity.md new file mode 100644 index 000000000..fbbea9e1d --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/isRegisteredCommunity.md @@ -0,0 +1,15 @@ +> **isRegisteredCommunity**(`address`): `boolean` + +Defined in: [packages/core/src/communities.ts:91](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L91) + +Check if address is a registered community + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `string` | + +## Returns + +`boolean` diff --git a/0.16.23/api/@aastar/core/functions/isV2Contract.md b/0.16.23/api/@aastar/core/functions/isV2Contract.md new file mode 100644 index 000000000..d70dc55aa --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/isV2Contract.md @@ -0,0 +1,25 @@ +> **isV2Contract**(`address`): `boolean` + +Defined in: [packages/core/src/contract-versions.ts:340](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L340) + +Check if an address is a V2 contract + +## Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `address` | `string` | Contract address to check | + +## Returns + +`boolean` + +True if address is a V2 contract + +## Example + +```ts +if (isV2Contract('0xB97A20aca3D6770Deca299a1aD9DAFb12d1e5eCf')) { + console.log('This is a V2 contract with VERSION interface'); +} +``` diff --git a/0.16.23/api/@aastar/core/functions/paymasterActions.md b/0.16.23/api/@aastar/core/functions/paymasterActions.md new file mode 100644 index 000000000..2ce127ca6 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/paymasterActions.md @@ -0,0 +1,23 @@ +> **paymasterActions**(`address`): (`client`) => [`PaymasterActions`](../type-aliases/PaymasterActions.md) + +Defined in: [packages/core/src/actions/paymaster.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L78) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`PaymasterActions`](../type-aliases/PaymasterActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`PaymasterActions`](../type-aliases/PaymasterActions.md) diff --git a/0.16.23/api/@aastar/core/functions/paymasterFactoryActions.md b/0.16.23/api/@aastar/core/functions/paymasterFactoryActions.md new file mode 100644 index 000000000..5f0f5f92b --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/paymasterFactoryActions.md @@ -0,0 +1,23 @@ +> **paymasterFactoryActions**(`address`): (`client`) => [`PaymasterFactoryActions`](../type-aliases/PaymasterFactoryActions.md) + +Defined in: [packages/core/src/actions/factory.ts:422](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L422) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`PaymasterFactoryActions`](../type-aliases/PaymasterFactoryActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`PaymasterFactoryActions`](../type-aliases/PaymasterFactoryActions.md) diff --git a/0.16.23/api/@aastar/core/functions/registryActions.md b/0.16.23/api/@aastar/core/functions/registryActions.md new file mode 100644 index 000000000..3480383e0 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/registryActions.md @@ -0,0 +1,23 @@ +> **registryActions**(`address`): (`client`) => [`RegistryActions`](../type-aliases/RegistryActions.md) + +Defined in: [packages/core/src/actions/registry.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L101) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`RegistryActions`](../type-aliases/RegistryActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`RegistryActions`](../type-aliases/RegistryActions.md) diff --git a/0.16.23/api/@aastar/core/functions/reputationActions.md b/0.16.23/api/@aastar/core/functions/reputationActions.md new file mode 100644 index 000000000..4448fe3f8 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/reputationActions.md @@ -0,0 +1,23 @@ +> **reputationActions**(`address`): (`client`) => [`ReputationActions`](../type-aliases/ReputationActions.md) + +Defined in: [packages/core/src/actions/reputation.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L81) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`ReputationActions`](../type-aliases/ReputationActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`ReputationActions`](../type-aliases/ReputationActions.md) diff --git a/0.16.23/api/@aastar/core/functions/sbtActions.md b/0.16.23/api/@aastar/core/functions/sbtActions.md new file mode 100644 index 000000000..3f08893d0 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/sbtActions.md @@ -0,0 +1,23 @@ +> **sbtActions**(`address`): (`client`) => [`SBTActions`](../type-aliases/SBTActions.md) + +Defined in: [packages/core/src/actions/sbt.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L101) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`SBTActions`](../type-aliases/SBTActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`SBTActions`](../type-aliases/SBTActions.md) diff --git a/0.16.23/api/@aastar/core/functions/stakingActions.md b/0.16.23/api/@aastar/core/functions/stakingActions.md new file mode 100644 index 000000000..b6495a49f --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/stakingActions.md @@ -0,0 +1,23 @@ +> **stakingActions**(`address`): (`client`) => [`StakingActions`](../type-aliases/StakingActions.md) + +Defined in: [packages/core/src/actions/staking.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L77) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`StakingActions`](../type-aliases/StakingActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`StakingActions`](../type-aliases/StakingActions.md) diff --git a/0.16.23/api/@aastar/core/functions/superPaymasterActions.md b/0.16.23/api/@aastar/core/functions/superPaymasterActions.md new file mode 100644 index 000000000..98b1c4553 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/superPaymasterActions.md @@ -0,0 +1,23 @@ +> **superPaymasterActions**(`address`): (`client`) => [`SuperPaymasterActions`](../type-aliases/SuperPaymasterActions.md) + +Defined in: [packages/core/src/actions/superPaymaster.ts:114](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L114) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`SuperPaymasterActions`](../type-aliases/SuperPaymasterActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`SuperPaymasterActions`](../type-aliases/SuperPaymasterActions.md) diff --git a/0.16.23/api/@aastar/core/functions/tokenActions.md b/0.16.23/api/@aastar/core/functions/tokenActions.md new file mode 100644 index 000000000..7851ad6fe --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/tokenActions.md @@ -0,0 +1,23 @@ +> **tokenActions**(`address?`): (`client`) => [`TokenActions`](../type-aliases/TokenActions.md) + +Defined in: [packages/core/src/actions/tokens.ts:457](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L457) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address?` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`TokenActions`](../type-aliases/TokenActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`TokenActions`](../type-aliases/TokenActions.md) diff --git a/0.16.23/api/@aastar/core/functions/xPNTsFactoryActions.md b/0.16.23/api/@aastar/core/functions/xPNTsFactoryActions.md new file mode 100644 index 000000000..d08abebdf --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/xPNTsFactoryActions.md @@ -0,0 +1,23 @@ +> **xPNTsFactoryActions**(`address`): (`client`) => [`XPNTsFactoryActions`](../type-aliases/XPNTsFactoryActions.md) + +Defined in: [packages/core/src/actions/factory.ts:86](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L86) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`XPNTsFactoryActions`](../type-aliases/XPNTsFactoryActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`XPNTsFactoryActions`](../type-aliases/XPNTsFactoryActions.md) diff --git a/0.16.23/api/@aastar/core/functions/xPNTsTokenActions.md b/0.16.23/api/@aastar/core/functions/xPNTsTokenActions.md new file mode 100644 index 000000000..671967262 --- /dev/null +++ b/0.16.23/api/@aastar/core/functions/xPNTsTokenActions.md @@ -0,0 +1,23 @@ +> **xPNTsTokenActions**(`address?`): (`client`) => [`XPNTsTokenActions`](../type-aliases/XPNTsTokenActions.md) + +Defined in: [packages/core/src/actions/tokens.ts:194](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L194) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `address?` | `` `0x${string}` `` | + +## Returns + +> (`client`): [`XPNTsTokenActions`](../type-aliases/XPNTsTokenActions.md) + +### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | \{ `account`: `undefined`; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `call`: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\>; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `createAccessList`: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\>; `createBlockFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\>; `createContractEventFilter`: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\>; `createEventFilter`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\>; `createPendingTransactionFilter`: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\>; `estimateContractGas`: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\>; `estimateFeesPerGas`: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\>; `estimateGas`: (`args`) => `Promise`\<`bigint`\>; `estimateMaxPriorityFeePerGas`: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getBalance`: (`args`) => `Promise`\<`bigint`\>; `getBlobBaseFee`: () => `Promise`\<`bigint`\>; `getBlock`: \<`includeTransactions`, `blockTag`\>(`args?`) => `Promise`\<\{ `baseFeePerGas`: `bigint` \| `null`; `blobGasUsed`: `bigint`; `difficulty`: `bigint`; `excessBlobGas`: `bigint`; `extraData`: `` `0x${string}` ``; `gasLimit`: `bigint`; `gasUsed`: `bigint`; `hash`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `logsBloom`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `miner`: `` `0x${string}` ``; `mixHash`: `` `0x${string}` ``; `nonce`: `blockTag` *extends* `"pending"` ? `null` : `` `0x${string}` ``; `number`: `blockTag` *extends* `"pending"` ? `null` : `bigint`; `parentBeaconBlockRoot?`: `` `0x${string}` ``; `parentHash`: `` `0x${string}` ``; `receiptsRoot`: `` `0x${string}` ``; `sealFields`: `` `0x${string}` ``[]; `sha3Uncles`: `` `0x${string}` ``; `size`: `bigint`; `stateRoot`: `` `0x${string}` ``; `timestamp`: `bigint`; `totalDifficulty`: `bigint` \| `null`; `transactions`: `includeTransactions` *extends* `true` ? (\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId?`: ... \| ...; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"legacy"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip2930"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip1559"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly ...[]; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip4844"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: ... *extends* ... ? ... : ...; `blockNumber`: ... *extends* ... ? ... : ...; `chainId`: `number`; `from`: `` `0x${(...)}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${(...)}` ``; `input`: `` `0x${(...)}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${(...)}` ``; `s`: `` `0x${(...)}` ``; `to`: ... \| ...; `transactionIndex`: ... *extends* ... ? ... : ...; `type`: `"eip7702"`; `typeHex`: ... \| ...; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\>; `getBlockNumber`: (`args?`) => `Promise`\<`bigint`\>; `getBlockTransactionCount`: (`args?`) => `Promise`\<`number`\>; `getBytecode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getChainId`: () => `Promise`\<`number`\>; `getCode`: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\>; `getContractEvents`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getEip712Domain`: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAddress`: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\>; `getEnsAvatar`: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\>; `getEnsName`: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\>; `getEnsResolver`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `getEnsText`: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\>; `getFeeHistory`: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\>; `getFilterChanges`: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getFilterLogs`: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\>; `getGasPrice`: () => `Promise`\<`bigint`\>; `getLogs`: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\>; `getProof`: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\>; `getStorageAt`: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\>; `getTransaction`: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\>; `getTransactionConfirmations`: (`args`) => `Promise`\<`bigint`\>; `getTransactionCount`: (`args`) => `Promise`\<`number`\>; `getTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `key`: `string`; `multicall`: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\>; `name`: `string`; `pollingInterval`: `number`; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `readContract`: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `simulate`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateBlocks`: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateCalls`: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\>; `simulateContract`: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `uninstallFilter`: (`args`) => `Promise`\<`boolean`\>; `verifyHash`: (`args`) => `Promise`\<`boolean`\>; `verifyMessage`: (`args`) => `Promise`\<`boolean`\>; `verifySiweMessage`: (`args`) => `Promise`\<`boolean`\>; `verifyTypedData`: (`args`) => `Promise`\<`boolean`\>; `waitForTransactionReceipt`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `watchBlockNumber`: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html); `watchBlocks`: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html); `watchContractEvent`: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html); `watchEvent`: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html); `watchPendingTransactions`: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html); \} \| \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: ... \}; paymasterService?: \{ supported: ... \}; unstable\_addSubAccount?: \{ keyTypes: ...; supported: ... \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & \{ chainId?: ... \}, ParameterTypeToParameters\<(...) extends (...) ? (...) : (...)\>\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ... \| ... *extends* ... ? ... : ...\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | + +### Returns + +[`XPNTsTokenActions`](../type-aliases/XPNTsTokenActions.md) diff --git a/0.16.23/api/@aastar/core/index.md b/0.16.23/api/@aastar/core/index.md new file mode 100644 index 000000000..fd865832a --- /dev/null +++ b/0.16.23/api/@aastar/core/index.md @@ -0,0 +1,223 @@ +## Enumerations + +- [EntryPointVersion](enumerations/EntryPointVersion.md) +- [NodeType](enumerations/NodeType.md) +- [RolePermissionLevel](enumerations/RolePermissionLevel.md) + +## Classes + +- [BaseClient](classes/BaseClient.md) +- [BLSSigner](classes/BLSSigner.md) +- [BundlerClient](classes/BundlerClient.md) +- [ContractConfigManager](classes/ContractConfigManager.md) +- [RequirementChecker](classes/RequirementChecker.md) +- [SepoliaFaucetAPI](classes/SepoliaFaucetAPI.md) +- [StateValidator](classes/StateValidator.md) + +## Interfaces + +- [AccountBalance](interfaces/AccountBalance.md) +- [BalanceValidationParams](interfaces/BalanceValidationParams.md) +- [BundlerResponse](interfaces/BundlerResponse.md) +- [ClientConfig](interfaces/ClientConfig.md) +- [CommunityConfig](interfaces/CommunityConfig.md) +- [ContractVersion](interfaces/ContractVersion.md) +- [DeploymentValidationParams](interfaces/DeploymentValidationParams.md) +- [PublicClient](interfaces/PublicClient.md) +- [RoleConfig](interfaces/RoleConfig.md) +- [RoleRequirement](interfaces/RoleRequirement.md) +- [RoleValidationParams](interfaces/RoleValidationParams.md) +- [SuperPaymasterConfig](interfaces/SuperPaymasterConfig.md) +- [TokenBalanceValidationParams](interfaces/TokenBalanceValidationParams.md) +- [TransactionOptions](interfaces/TransactionOptions.md) +- [UserOperationV07](interfaces/UserOperationV07.md) +- [ValidationParams](interfaces/ValidationParams.md) +- [ValidationResult](interfaces/ValidationResult.md) +- [WalletClient](interfaces/WalletClient.md) + +## Type Aliases + +- [AccountActions](type-aliases/AccountActions.md) +- [AccountFactoryActions](type-aliases/AccountFactoryActions.md) +- [AggregatorActions](type-aliases/AggregatorActions.md) +- [BusinessResult](type-aliases/BusinessResult.md) +- [ContractCategory](type-aliases/ContractCategory.md) +- [ContractNetwork](type-aliases/ContractNetwork.md) +- [DVTActions](type-aliases/DVTActions.md) +- [EntryPointActions](type-aliases/EntryPointActions.md) +- [ERC20Actions](type-aliases/ERC20Actions.md) +- [FaucetConfig](type-aliases/FaucetConfig.md) +- [FaucetPreparationResult](type-aliases/FaucetPreparationResult.md) +- [GTokenActions](type-aliases/GTokenActions.md) +- [NetworkContracts](type-aliases/NetworkContracts.md) +- [OperatorConfig](type-aliases/OperatorConfig.md) +- [PaymasterActions](type-aliases/PaymasterActions.md) +- [PaymasterFactoryActions](type-aliases/PaymasterFactoryActions.md) +- [RegistryActions](type-aliases/RegistryActions.md) +- [ReputationActions](type-aliases/ReputationActions.md) +- [ReputationBreakdown](type-aliases/ReputationBreakdown.md) +- [ReputationRule](type-aliases/ReputationRule.md) +- [RoleConfigDetailed](type-aliases/RoleConfigDetailed.md) +- [SBTActions](type-aliases/SBTActions.md) +- [SBTData](type-aliases/SBTData.md) +- [SBTMembership](type-aliases/SBTMembership.md) +- [SlashRecord](type-aliases/SlashRecord.md) +- [StakingActions](type-aliases/StakingActions.md) +- [SuperPaymasterActions](type-aliases/SuperPaymasterActions.md) +- [SupportedNetwork](type-aliases/SupportedNetwork.md) +- [TokenActions](type-aliases/TokenActions.md) +- [XPNTsFactoryActions](type-aliases/XPNTsFactoryActions.md) +- [XPNTsTokenActions](type-aliases/XPNTsTokenActions.md) + +## Variables + +- [AASTAR\_COMMUNITY](variables/AASTAR_COMMUNITY.md) +- [ALL\_ADDRESSES](variables/ALL_ADDRESSES.md) +- [ALL\_ROLES](variables/ALL_ROLES.md) +- [APNTS\_ADDRESS](variables/APNTS_ADDRESS.md) +- [BLS\_AGGREGATOR\_ADDRESS](variables/BLS_AGGREGATOR_ADDRESS.md) +- [BLS\_VALIDATOR\_ADDRESS](variables/BLS_VALIDATOR_ADDRESS.md) +- [BLSAggregatorABI](variables/BLSAggregatorABI.md) +- [BLSAggregatorArtifact](variables/BLSAggregatorArtifact.md) +- [BLSHelpers](variables/BLSHelpers.md) +- [BLSValidatorABI](variables/BLSValidatorABI.md) +- [BLSValidatorArtifact](variables/BLSValidatorArtifact.md) +- [BPS\_DENOMINATOR](variables/BPS_DENOMINATOR.md) +- [BRANDING](variables/BRANDING.md) +- [BREAD\_COMMUNITY](variables/BREAD_COMMUNITY.md) +- [CHAIN\_MAINNET](variables/CHAIN_MAINNET.md) +- [CHAIN\_SEPOLIA](variables/CHAIN_SEPOLIA.md) +- [COMMUNITIES](variables/COMMUNITIES.md) +- [COMMUNITY\_OWNERS](variables/COMMUNITY_OWNERS.md) +- [CONTRACT\_METADATA](variables/CONTRACT_METADATA.md) +- [CONTRACT\_SRC\_HASH](variables/CONTRACT_SRC_HASH.md) +- [CONTRACTS](variables/CONTRACTS.md) +- [CORE\_ADDRESSES](variables/CORE_ADDRESSES.md) +- [DEFAULT\_ADMIN\_ROLE](variables/DEFAULT_ADMIN_ROLE.md) +- [DEFAULT\_APNTS\_PRICE\_USD](variables/DEFAULT_APNTS_PRICE_USD.md) +- [DEFAULT\_CALL\_GAS\_LIMIT](variables/DEFAULT_CALL_GAS_LIMIT.md) +- [DEFAULT\_GAS\_TOKEN\_MINT\_AMOUNT](variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md) +- [DEFAULT\_PRE\_VERIFICATION\_GAS](variables/DEFAULT_PRE_VERIFICATION_GAS.md) +- [DEFAULT\_TIMEOUT\_MS](variables/DEFAULT_TIMEOUT_MS.md) +- [DEFAULT\_TOKEN\_NAME](variables/DEFAULT_TOKEN_NAME.md) +- [DEFAULT\_TOKEN\_SYMBOL](variables/DEFAULT_TOKEN_SYMBOL.md) +- [DEFAULT\_USDT\_MINT\_AMOUNT](variables/DEFAULT_USDT_MINT_AMOUNT.md) +- [DEFAULT\_VERIFICATION\_GAS\_LIMIT](variables/DEFAULT_VERIFICATION_GAS_LIMIT.md) +- [DVT\_VALIDATOR\_ADDRESS](variables/DVT_VALIDATOR_ADDRESS.md) +- [DVTValidatorABI](variables/DVTValidatorABI.md) +- [DVTValidatorArtifact](variables/DVTValidatorArtifact.md) +- [ENTRY\_POINT\_ADDRESS](variables/ENTRY_POINT_ADDRESS.md) +- [EntryPointABI](variables/EntryPointABI.md) +- [EntryPointArtifact](variables/EntryPointArtifact.md) +- [FAUCET\_API\_URL](variables/FAUCET_API_URL.md) +- [GTOKEN\_ADDRESS](variables/GTOKEN_ADDRESS.md) +- [GTOKEN\_STAKING\_ADDRESS](variables/GTOKEN_STAKING_ADDRESS.md) +- [GTokenABI](variables/GTokenABI.md) +- [GTokenArtifact](variables/GTokenArtifact.md) +- [GTokenStakingABI](variables/GTokenStakingABI.md) +- [GTokenStakingArtifact](variables/GTokenStakingArtifact.md) +- [INITIAL\_ROLE\_STAKES](variables/INITIAL_ROLE_STAKES.md) +- [LINKS](variables/LINKS.md) +- [MAX\_SERVICE\_FEE](variables/MAX_SERVICE_FEE.md) +- [MONITORING\_ADDRESSES](variables/MONITORING_ADDRESSES.md) +- [MySBTABI](variables/MySBTABI.md) +- [MySBTArtifact](variables/MySBTArtifact.md) +- [NETWORKS](variables/NETWORKS.md) +- [NODE\_STAKE\_AMOUNTS](variables/NODE_STAKE_AMOUNTS.md) +- [OFFICIAL\_ADDRESSES](variables/OFFICIAL_ADDRESSES.md) +- [PAYMASTER\_ADDRESSES](variables/PAYMASTER_ADDRESSES.md) +- [PAYMASTER\_FACTORY\_ADDRESS](variables/PAYMASTER_FACTORY_ADDRESS.md) +- [PAYMASTER\_V4\_ADDRESS](variables/PAYMASTER_V4_ADDRESS.md) +- [PAYMASTER\_V4\_IMPL\_ADDRESS](variables/PAYMASTER_V4_IMPL_ADDRESS.md) +- [PaymasterABI](variables/PaymasterABI.md) +- [PaymasterArtifact](variables/PaymasterArtifact.md) +- [PaymasterFactoryABI](variables/PaymasterFactoryABI.md) +- [PaymasterFactoryArtifact](variables/PaymasterFactoryArtifact.md) +- [REGISTRY\_ADDRESS](variables/REGISTRY_ADDRESS.md) +- [RegistryABI](variables/RegistryABI.md) +- [RegistryArtifact](variables/RegistryArtifact.md) +- [REPUTATION\_SYSTEM\_ADDRESS](variables/REPUTATION_SYSTEM_ADDRESS.md) +- [ReputationSystemABI](variables/ReputationSystemABI.md) +- [ReputationSystemArtifact](variables/ReputationSystemArtifact.md) +- [ROLE\_ANODE](variables/ROLE_ANODE.md) +- [ROLE\_COMMUNITY](variables/ROLE_COMMUNITY.md) +- [ROLE\_DVT](variables/ROLE_DVT.md) +- [ROLE\_ENDUSER](variables/ROLE_ENDUSER.md) +- [ROLE\_KMS](variables/ROLE_KMS.md) +- [ROLE\_NAMES](variables/ROLE_NAMES.md) +- [ROLE\_PAYMASTER\_AOA](variables/ROLE_PAYMASTER_AOA.md) +- [ROLE\_PAYMASTER\_SUPER](variables/ROLE_PAYMASTER_SUPER.md) +- [ROLE\_PERMISSION\_LEVELS](variables/ROLE_PERMISSION_LEVELS.md) +- [SBT\_ADDRESS](variables/SBT_ADDRESS.md) +- [SEPOLIA\_CONTRACTS](variables/SEPOLIA_CONTRACTS.md) +- [SEPOLIA\_V2\_VERSIONS](variables/SEPOLIA_V2_VERSIONS.md) +- [SERVICE\_FEE\_RATE](variables/SERVICE_FEE_RATE.md) +- [SimpleAccountABI](variables/SimpleAccountABI.md) +- [SimpleAccountArtifact](variables/SimpleAccountArtifact.md) +- [SimpleAccountFactoryABI](variables/SimpleAccountFactoryABI.md) +- [SimpleAccountFactoryArtifact](variables/SimpleAccountFactoryArtifact.md) +- [SUPER\_PAYMASTER\_ADDRESS](variables/SUPER_PAYMASTER_ADDRESS.md) +- [SuperPaymasterABI](variables/SuperPaymasterABI.md) +- [SuperPaymasterArtifact](variables/SuperPaymasterArtifact.md) +- [TEST\_ACCOUNT\_ADDRESSES](variables/TEST_ACCOUNT_ADDRESSES.md) +- [TEST\_ACCOUNT\_POOL\_SIZE](variables/TEST_ACCOUNT_POOL_SIZE.md) +- [TEST\_COMMUNITIES](variables/TEST_COMMUNITIES.md) +- [TEST\_TOKEN\_ADDRESSES](variables/TEST_TOKEN_ADDRESSES.md) +- [TOKEN\_ADDRESSES](variables/TOKEN_ADDRESSES.md) +- [V2\_SUMMARY](variables/V2_SUMMARY.md) +- [XPNTS\_FACTORY\_ADDRESS](variables/XPNTS_FACTORY_ADDRESS.md) +- [xPNTsFactoryABI](variables/xPNTsFactoryABI.md) +- [xPNTsFactoryArtifact](variables/xPNTsFactoryArtifact.md) +- [xPNTsTokenABI](variables/xPNTsTokenABI.md) +- [xPNTsTokenArtifact](variables/xPNTsTokenArtifact.md) + +## Functions + +- [accountActions](functions/accountActions.md) +- [accountFactoryActions](functions/accountFactoryActions.md) +- [aggregatorActions](functions/aggregatorActions.md) +- [applyConfig](functions/applyConfig.md) +- [createAAStarPublicClient](functions/createAAStarPublicClient.md) +- [dvtActions](functions/dvtActions.md) +- [entryPointActions](functions/entryPointActions.md) +- [getAddressUrl](functions/getAddressUrl.md) +- [getAllCommunityConfigs](functions/getAllCommunityConfigs.md) +- [getAllV2Contracts](functions/getAllV2Contracts.md) +- [getBlockExplorer](functions/getBlockExplorer.md) +- [getChainId](functions/getChainId.md) +- [getCommunities](functions/getCommunities.md) +- [getCommunity](functions/getCommunity.md) +- [getCommunityConfig](functions/getCommunityConfig.md) +- [getContract](functions/getContract.md) +- [getContractNetworks](functions/getContractNetworks.md) +- [getContracts](functions/getContracts.md) +- [getCoreContracts](functions/getCoreContracts.md) +- [getDeploymentDate](functions/getDeploymentDate.md) +- [getEntryPoint](functions/getEntryPoint.md) +- [getNetwork](functions/getNetwork.md) +- [getPaymasterV4\_1](functions/getPaymasterV4_1.md) +- [getRoleName](functions/getRoleName.md) +- [getRpcUrl](functions/getRpcUrl.md) +- [getSimpleAccountFactory](functions/getSimpleAccountFactory.md) +- [getSuperPaymasterV2](functions/getSuperPaymasterV2.md) +- [getTestAccounts](functions/getTestAccounts.md) +- [getTestTokenContracts](functions/getTestTokenContracts.md) +- [getTokenContracts](functions/getTokenContracts.md) +- [getTxUrl](functions/getTxUrl.md) +- [getV2ContractByAddress](functions/getV2ContractByAddress.md) +- [getV2ContractByName](functions/getV2ContractByName.md) +- [getV2ContractsByDate](functions/getV2ContractsByDate.md) +- [gTokenActions](functions/gTokenActions.md) +- [isContractNetworkSupported](functions/isContractNetworkSupported.md) +- [isRegisteredCommunity](functions/isRegisteredCommunity.md) +- [isV2Contract](functions/isV2Contract.md) +- [paymasterActions](functions/paymasterActions.md) +- [paymasterFactoryActions](functions/paymasterFactoryActions.md) +- [registryActions](functions/registryActions.md) +- [reputationActions](functions/reputationActions.md) +- [sbtActions](functions/sbtActions.md) +- [stakingActions](functions/stakingActions.md) +- [superPaymasterActions](functions/superPaymasterActions.md) +- [tokenActions](functions/tokenActions.md) +- [xPNTsFactoryActions](functions/xPNTsFactoryActions.md) +- [xPNTsTokenActions](functions/xPNTsTokenActions.md) diff --git a/0.16.23/api/@aastar/core/interfaces/AccountBalance.md b/0.16.23/api/@aastar/core/interfaces/AccountBalance.md new file mode 100644 index 000000000..8a0f77434 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/AccountBalance.md @@ -0,0 +1,41 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L36) + +## Properties + +### address + +> **address**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L37) + +*** + +### aPNTs + +> **aPNTs**: `bigint` + +Defined in: [packages/core/src/actions/StateValidator.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L40) + +*** + +### eth + +> **eth**: `bigint` + +Defined in: [packages/core/src/actions/StateValidator.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L38) + +*** + +### gToken + +> **gToken**: `bigint` + +Defined in: [packages/core/src/actions/StateValidator.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L39) + +*** + +### xPNTs + +> **xPNTs**: `bigint` + +Defined in: [packages/core/src/actions/StateValidator.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L41) diff --git a/0.16.23/api/@aastar/core/interfaces/BalanceValidationParams.md b/0.16.23/api/@aastar/core/interfaces/BalanceValidationParams.md new file mode 100644 index 000000000..1e8f43a28 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/BalanceValidationParams.md @@ -0,0 +1,51 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L17) + +Interface definitions + +## Extends + +- [`ValidationParams`](ValidationParams.md) + +## Extended by + +- [`TokenBalanceValidationParams`](TokenBalanceValidationParams.md) + +## Properties + +### address + +> **address**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L18) + +*** + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/actions/StateValidator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L8) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`chain`](ValidationParams.md#chain) + +*** + +### minBalance? + +> `optional` **minBalance**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L19) + +*** + +### rpcUrl + +> **rpcUrl**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L7) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`rpcUrl`](ValidationParams.md#rpcurl) diff --git a/0.16.23/api/@aastar/core/interfaces/BundlerResponse.md b/0.16.23/api/@aastar/core/interfaces/BundlerResponse.md new file mode 100644 index 000000000..dd03e8f9c --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/BundlerResponse.md @@ -0,0 +1,51 @@ +Defined in: [packages/core/src/clients/BundlerClient.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L16) + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | + +## Properties + +### error? + +> `optional` **error**: `object` + +Defined in: [packages/core/src/clients/BundlerClient.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L20) + +#### code + +> **code**: `number` + +#### data? + +> `optional` **data**: `any` + +#### message + +> **message**: `string` + +*** + +### id + +> **id**: `number` + +Defined in: [packages/core/src/clients/BundlerClient.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L18) + +*** + +### jsonrpc + +> **jsonrpc**: `"2.0"` + +Defined in: [packages/core/src/clients/BundlerClient.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L17) + +*** + +### result? + +> `optional` **result**: `T` + +Defined in: [packages/core/src/clients/BundlerClient.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L19) diff --git a/0.16.23/api/@aastar/core/interfaces/ClientConfig.md b/0.16.23/api/@aastar/core/interfaces/ClientConfig.md new file mode 100644 index 000000000..ee41198ed --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/ClientConfig.md @@ -0,0 +1,103 @@ +Defined in: [packages/core/src/clients/types.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L7) + +Base configuration for all L2 Business Clients + +## Extended by + +- [`CommunityClientConfig`](../../enduser/interfaces/CommunityClientConfig.md) +- [`UserClientConfig`](../../enduser/interfaces/UserClientConfig.md) +- [`UserLifecycleConfig`](../../enduser/interfaces/UserLifecycleConfig.md) +- [`OperatorClientConfig`](../../operator/interfaces/OperatorClientConfig.md) +- [`ProtocolClientConfig`](../../operator/interfaces/ProtocolClientConfig.md) + +## Properties + +### client + +> **client**: [`WalletClient`](WalletClient.md) + +Defined in: [packages/core/src/clients/types.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L12) + +Viem WalletClient for write operations. +Must have an account attached. + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L47) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L46) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L32) + +GToken contract address. +Required for operations involving token approvals and transfers. + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L38) + +GTokenStaking contract address. +Required for role registration that involves staking. + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L44) + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](PublicClient.md) + +Defined in: [packages/core/src/clients/types.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L20) + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L26) + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/types.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L45) diff --git a/0.16.23/api/@aastar/core/interfaces/CommunityConfig.md b/0.16.23/api/@aastar/core/interfaces/CommunityConfig.md new file mode 100644 index 000000000..6e5e7e491 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/CommunityConfig.md @@ -0,0 +1,81 @@ +Defined in: [packages/core/src/communities.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L15) + +## Properties + +### address + +> **address**: `string` + +Defined in: [packages/core/src/communities.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L18) + +*** + +### allowPermissionlessMint + +> **allowPermissionlessMint**: `boolean` + +Defined in: [packages/core/src/communities.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L23) + +*** + +### ensName + +> **ensName**: `string` + +Defined in: [packages/core/src/communities.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L17) + +*** + +### isActive + +> **isActive**: `boolean` + +Defined in: [packages/core/src/communities.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L22) + +*** + +### name + +> **name**: `string` + +Defined in: [packages/core/src/communities.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L16) + +*** + +### nodeType + +> **nodeType**: [`NodeType`](../enumerations/NodeType.md) + +Defined in: [packages/core/src/communities.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L21) + +*** + +### registeredAt + +> **registeredAt**: `number` + +Defined in: [packages/core/src/communities.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L25) + +*** + +### stakedAmount + +> **stakedAmount**: `string` + +Defined in: [packages/core/src/communities.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L24) + +*** + +### supportedSBTs + +> **supportedSBTs**: `string`[] + +Defined in: [packages/core/src/communities.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L20) + +*** + +### xPNTsToken + +> **xPNTsToken**: `string` + +Defined in: [packages/core/src/communities.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L19) diff --git a/0.16.23/api/@aastar/core/interfaces/ContractVersion.md b/0.16.23/api/@aastar/core/interfaces/ContractVersion.md new file mode 100644 index 000000000..ecb1fe5cd --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/ContractVersion.md @@ -0,0 +1,63 @@ +Defined in: [packages/core/src/contract-versions.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L24) + +Contract version information + +## Properties + +### address + +> **address**: `string` + +Defined in: [packages/core/src/contract-versions.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L34) + +Contract address on network + +*** + +### deployedAt + +> **deployedAt**: `string` + +Defined in: [packages/core/src/contract-versions.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L32) + +Deployment date (YYYY-MM-DD) + +*** + +### features? + +> `optional` **features**: `string`[] + +Defined in: [packages/core/src/contract-versions.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L36) + +Key features in this version + +*** + +### name + +> **name**: `string` + +Defined in: [packages/core/src/contract-versions.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L26) + +Contract name + +*** + +### version + +> **version**: `string` + +Defined in: [packages/core/src/contract-versions.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L28) + +Semantic version string (e.g., "2.0.0") + +*** + +### versionCode + +> **versionCode**: `number` + +Defined in: [packages/core/src/contract-versions.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L30) + +Numeric version code (e.g., 20000) diff --git a/0.16.23/api/@aastar/core/interfaces/DeploymentValidationParams.md b/0.16.23/api/@aastar/core/interfaces/DeploymentValidationParams.md new file mode 100644 index 000000000..3a9e9c97b --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/DeploymentValidationParams.md @@ -0,0 +1,39 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L26) + +Interface definitions + +## Extends + +- [`ValidationParams`](ValidationParams.md) + +## Properties + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/actions/StateValidator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L8) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`chain`](ValidationParams.md#chain) + +*** + +### contractAddress + +> **contractAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L27) + +*** + +### rpcUrl + +> **rpcUrl**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L7) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`rpcUrl`](ValidationParams.md#rpcurl) diff --git a/0.16.23/api/@aastar/core/interfaces/PublicClient.md b/0.16.23/api/@aastar/core/interfaces/PublicClient.md new file mode 100644 index 000000000..459221cf0 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/PublicClient.md @@ -0,0 +1,3151 @@ +Defined in: [packages/core/src/clients/doc-types.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/doc-types.ts#L7) + +Public Client Interface +Standardized interface for reading from the blockchain. + +## Extends + +- [`PublicClient`](https://viem.sh/docs/index.html) + +## Properties + +### account + +> **account**: `undefined` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:73 + +The Account of the Client. + +#### Inherited from + +`ViemPublicClient.account` + +*** + +### batch? + +> `optional` **batch**: `object` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:75 + +Flags for batch settings. + +#### multicall? + +> `optional` **multicall**: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} + +Toggle to enable `eth_call` multicall aggregation. + +##### Type Declaration + +`boolean` + +\{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} + +#### Inherited from + +`ViemPublicClient.batch` + +*** + +### cacheTime + +> **cacheTime**: `number` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:77 + +Time (in ms) that cached data will remain in memory. + +#### Inherited from + +`ViemPublicClient.cacheTime` + +*** + +### call() + +> **call**: (`parameters`) => `Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:89 + +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) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`CallParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`\> | + +#### Returns + +`Promise`\<[`CallReturnType`](https://viem.sh/docs/index.html)\> + +The call data. [CallReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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', +}) +``` + +#### Inherited from + +`ViemPublicClient.call` + +*** + +### ccipRead? + +> `optional` **ccipRead**: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:79 + +[CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. + +#### Type Declaration + +`false` + +\{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} + +#### request()? + +> `optional` **request**: (`parameters`) => `Promise`\<`` `0x${string}` ``\> + +A function that will be called to make the offchain CCIP lookup request. + +##### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`CcipRequestParameters`](https://viem.sh/docs/index.html) | + +##### Returns + +`Promise`\<`` `0x${string}` ``\> + +##### See + +https://eips.ethereum.org/EIPS/eip-3668#client-lookup-protocol + +#### Inherited from + +`ViemPublicClient.ccipRead` + +*** + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) \| `undefined` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:81 + +Chain for the client. + +#### Inherited from + +`ViemPublicClient.chain` + +*** + +### createAccessList() + +> **createAccessList**: (`parameters`) => `Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:113 + +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` + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`CreateAccessListParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`\> | + +#### Returns + +`Promise`\<\{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `gasUsed`: `bigint`; \}\> + +The call data. [CreateAccessListReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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', +}) +``` + +#### Inherited from + +`ViemPublicClient.createAccessList` + +*** + +### createBlockFilter() + +> **createBlockFilter**: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:133 + +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) + +#### Returns + +`Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"block"`; \}\> + +Filter. [CreateBlockFilterReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' } +``` + +#### Inherited from + +`ViemPublicClient.createBlockFilter` + +*** + +### createContractEventFilter() + +> **createContractEventFilter**: \<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:154 + +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 + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `eventName` *extends* `string` \| `undefined` | - | +| `args` *extends* `Record`\<`string`, `unknown`\> \| readonly `unknown`[] \| `undefined` | - | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`CreateContractEventFilterParameters`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\> | [CreateContractEventFilterParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`CreateContractEventFilterReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `args`, `strict`, `fromBlock`, `toBlock`\>\> + +[`Filter`](https://viem.sh/docs/glossary/types#filter). [CreateContractEventFilterReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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)']), +}) +``` + +#### Inherited from + +`ViemPublicClient.createContractEventFilter` + +*** + +### createEventFilter() + +> **createEventFilter**: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\>(`args?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:176 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abiEvent` *extends* `AbiEvent` \| `undefined` | `undefined` | +| `abiEvents` *extends* readonly `unknown`[] \| readonly `AbiEvent`[] \| `undefined` | `abiEvent` *extends* `AbiEvent` ? \[`abiEvent`\<`abiEvent`\>\] : `undefined` | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `_EventName` *extends* `string` \| `undefined` | [`MaybeAbiEventName`](https://viem.sh/docs/index.html)\<`abiEvent`\> | +| `_Args` *extends* `Record`\<`string`, `unknown`\> \| readonly `unknown`[] \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args?` | [`CreateEventFilterParameters`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`, `_EventName`, `_Args`\> | [CreateEventFilterParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ \[K in string \| number \| symbol\]: Filter\<"event", abiEvents, \_EventName, \_Args, strict, fromBlock, toBlock\>\[K\] \}\> + +[`Filter`](https://viem.sh/docs/glossary/types#filter). [CreateEventFilterReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const filter = await client.createEventFilter({ + address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2', +}) +``` + +#### Inherited from + +`ViemPublicClient.createEventFilter` + +*** + +### createPendingTransactionFilter() + +> **createPendingTransactionFilter**: () => `Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:196 + +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) + +#### Returns + +`Promise`\<\{ `id`: `` `0x${string}` ``; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\; `type`: `"transaction"`; \}\> + +[`Filter`](https://viem.sh/docs/glossary/types#filter). [CreateBlockFilterReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' } +``` + +#### Inherited from + +`ViemPublicClient.createPendingTransactionFilter` + +*** + +### estimateContractGas() + +> **estimateContractGas**: \<`chain`, `abi`, `functionName`, `args`\>(`args`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:223 + +Estimates the gas required to successfully execute a contract write function call. + +- Docs: https://viem.sh/docs/contract/estimateContractGas + +#### Type Parameters + +| Type Parameter | +| ------ | +| `chain` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | +| `abi` *extends* `Abi` \| readonly `unknown`[] | +| `functionName` *extends* `string` | +| `args` *extends* `unknown` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`EstimateContractGasParameters`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, `chain`\> | [EstimateContractGasParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +The gas estimate (in wei). [EstimateContractGasReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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', +}) +``` + +#### Inherited from + +`ViemPublicClient.estimateContractGas` + +*** + +### estimateFeesPerGas() + +> **estimateFeesPerGas**: \<`chainOverride`, `type`\>(`args?`) => `Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:685 + +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 + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `type` *extends* [`FeeValuesType`](https://viem.sh/docs/index.html) | `"eip1559"` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args?` | [`EstimateFeesPerGasParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `type`\> | + +#### Returns + +`Promise`\<[`EstimateFeesPerGasReturnType`](https://viem.sh/docs/index.html)\<`type`\>\> + +An estimate (in wei) for the fees per gas. [EstimateFeesPerGasReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const maxPriorityFeePerGas = await client.estimateFeesPerGas() +// { maxFeePerGas: ..., maxPriorityFeePerGas: ... } +``` + +#### Inherited from + +`ViemPublicClient.estimateFeesPerGas` + +*** + +### estimateGas() + +> **estimateGas**: (`args`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:247 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`EstimateGasParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`\> | [EstimateGasParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +The gas estimate (in wei). [EstimateGasReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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'), +}) +``` + +#### Inherited from + +`ViemPublicClient.estimateGas` + +*** + +### estimateMaxPriorityFeePerGas() + +> **estimateMaxPriorityFeePerGas**: \<`chainOverride`\>(`args?`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:877 + +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 + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args?` | \{ `chain`: `chainOverride` \| `null`; \} | +| `args.chain?` | `chainOverride` \| `null` | + +#### Returns + +`Promise`\<`bigint`\> + +An estimate (in wei) for the max priority fee per gas. [EstimateMaxPriorityFeePerGasReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const maxPriorityFeePerGas = await client.estimateMaxPriorityFeePerGas() +// 10000000n +``` + +#### Inherited from + +`ViemPublicClient.estimateMaxPriorityFeePerGas` + +*** + +### experimental\_blockTag? + +> `optional` **experimental\_blockTag**: [`BlockTag`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:83 + +Default block tag to use for RPC requests. + +#### Inherited from + +`ViemPublicClient.experimental_blockTag` + +*** + +### extend() + +> **extend**: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:69 + +#### Type Parameters + +| Type Parameter | +| ------ | +| `client` *extends* `object` & [`ExactPartial`](https://viem.sh/docs/index.html)\<[`ExtendableProtectedActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`\>\> | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `fn` | (`client`) => `client` | + +#### Returns + +[`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `undefined`, [`PublicRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`PublicActions`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`\>\> + +#### Inherited from + +`ViemPublicClient.extend` + +*** + +### fillTransaction() + +> **fillTransaction**: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:271 + +Fills a transaction request with the necessary fields to be signed over. + +- Docs: https://viem.sh/docs/actions/public/fillTransaction + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `accountOverride` *extends* `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`FillTransactionParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\> | + +#### Returns + +`Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> + +The filled transaction. [FillTransactionReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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'), +}) +``` + +#### Inherited from + +`ViemPublicClient.fillTransaction` + +*** + +### getBalance() + +> **getBalance**: (`args`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:306 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetBalanceParameters`](https://viem.sh/docs/index.html) | [GetBalanceParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +The balance of the address in wei. [GetBalanceReturnType](https://viem.sh/docs/index.html) + +#### Remarks + +You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther). + +```ts +const balance = await getBalance(client, { + address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + blockTag: 'safe' +}) +const balanceAsEther = formatEther(balance) +// "6.942" +``` + +#### Example + +```ts +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) +``` + +#### Inherited from + +`ViemPublicClient.getBalance` + +*** + +### getBlobBaseFee() + +> **getBlobBaseFee**: () => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:327 + +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) + +#### Returns + +`Promise`\<`bigint`\> + +The blob base fee (in wei). [GetBlobBaseFeeReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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() +``` + +#### Inherited from + +`ViemPublicClient.getBlobBaseFee` + +*** + +### getBlock() + +> **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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:350 + +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`. + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `includeTransactions` *extends* `boolean` | `false` | +| `blockTag` *extends* [`BlockTag`](https://viem.sh/docs/index.html) | `"latest"` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args?` | [`GetBlockParameters`](https://viem.sh/docs/index.html)\<`includeTransactions`, `blockTag`\> | [GetBlockParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`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`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \})[] : `` `0x${string}` ``[]; `transactionsRoot`: `` `0x${string}` ``; `uncles`: `` `0x${string}` ``[]; `withdrawals?`: [`Withdrawal`](https://viem.sh/docs/index.html)[]; `withdrawalsRoot?`: `` `0x${string}` ``; \}\> + +Information about the block. [GetBlockReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const block = await client.getBlock() +``` + +#### Inherited from + +`ViemPublicClient.getBlock` + +*** + +### getBlockNumber() + +> **getBlockNumber**: (`args?`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:372 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args?` | [`GetBlockNumberParameters`](https://viem.sh/docs/index.html) | [GetBlockNumberParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +The number of the block. [GetBlockNumberReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const blockNumber = await client.getBlockNumber() +// 69420n +``` + +#### Inherited from + +`ViemPublicClient.getBlockNumber` + +*** + +### getBlockTransactionCount() + +> **getBlockTransactionCount**: (`args?`) => `Promise`\<`number`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:394 + +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`. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args?` | [`GetBlockTransactionCountParameters`](https://viem.sh/docs/index.html) | [GetBlockTransactionCountParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`number`\> + +The block transaction count. [GetBlockTransactionCountReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const count = await client.getBlockTransactionCount() +``` + +#### Inherited from + +`ViemPublicClient.getBlockTransactionCount` + +*** + +### ~~getBytecode()~~ + +> **getBytecode**: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:396 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`GetCodeParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> + +#### Deprecated + +Use `getCode` instead. + +#### Inherited from + +`ViemPublicClient.getBytecode` + +*** + +### getChainId() + +> **getChainId**: () => `Promise`\<`number`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:416 + +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) + +#### Returns + +`Promise`\<`number`\> + +The current chain ID. [GetChainIdReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const chainId = await client.getChainId() +// 1 +``` + +#### Inherited from + +`ViemPublicClient.getChainId` + +*** + +### getCode() + +> **getCode**: (`args`) => `Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:438 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetCodeParameters`](https://viem.sh/docs/index.html) | GetBytecodeParameters | + +#### Returns + +`Promise`\<[`GetCodeReturnType`](https://viem.sh/docs/index.html)\> + +The contract's bytecode. GetBytecodeReturnType + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const code = await client.getCode({ + address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', +}) +``` + +#### Inherited from + +`ViemPublicClient.getCode` + +*** + +### getContractEvents() + +> **getContractEvents**: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:464 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `eventName` *extends* `string` \| `undefined` | `undefined` | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`GetContractEventsParameters`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\> | + +#### Returns + +`Promise`\<[`GetContractEventsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +A list of event logs. [GetContractEventsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' +}) +``` + +#### Inherited from + +`ViemPublicClient.getContractEvents` + +*** + +### getEip712Domain() + +> **getEip712Domain**: (`args`) => `Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:497 + +Reads the EIP-712 domain from a contract, based on the ERC-5267 specification. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`GetEip712DomainParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetEip712DomainReturnType`](https://viem.sh/docs/index.html)\> + +The EIP-712 domain, fields, and extensions. [GetEip712DomainReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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: [], +// } +``` + +#### Inherited from + +`ViemPublicClient.getEip712Domain` + +*** + +### getEnsAddress() + +> **getEnsAddress**: (`args`) => `Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:526 + +Gets address for ENS name. + +- Docs: https://viem.sh/docs/ens/actions/getEnsAddress +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `coinType?`: `bigint`; `gatewayUrls?`: `string`[]; `name`: `string`; `strict?`: `boolean`; `universalResolverAddress?`: `` `0x${string}` ``; \} | [GetEnsAddressParameters](https://viem.sh/docs/index.html) | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.coinType?` | `bigint` | ENSIP-9 compliant coinType (chain) to get ENS address for. To get the `coinType` for a chain id, use the `toCoinType` function: `import { toCoinType } from 'viem' import { base } from 'viem/chains' const coinType = toCoinType(base.id)` **Default** `60n` | +| `args.gatewayUrls?` | `string`[] | Universal Resolver gateway URLs to use for resolving CCIP-read requests. | +| `args.name` | `string` | Name to get the address for. | +| `args.strict?` | `boolean` | Whether or not to throw errors propagated from the ENS Universal Resolver Contract. | +| `args.universalResolverAddress?` | `` `0x${string}` `` | Address of ENS Universal Resolver Contract. | + +#### Returns + +`Promise`\<[`GetEnsAddressReturnType`](https://viem.sh/docs/index.html)\> + +Address for ENS name or `null` if not found. [GetEnsAddressReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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' +``` + +#### Inherited from + +`ViemPublicClient.getEnsAddress` + +*** + +### getEnsAvatar() + +> **getEnsAvatar**: (`args`) => `Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:555 + +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 + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `assetGatewayUrls?`: [`AssetGatewayUrls`](https://viem.sh/docs/index.html); `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `gatewayUrls?`: `string`[]; `name`: `string`; `strict?`: `boolean`; `universalResolverAddress?`: `` `0x${string}` ``; \} | [GetEnsAvatarParameters](https://viem.sh/docs/index.html) | +| `args.assetGatewayUrls?` | [`AssetGatewayUrls`](https://viem.sh/docs/index.html) | Gateway urls to resolve IPFS and/or Arweave assets. | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.gatewayUrls?` | `string`[] | Universal Resolver gateway URLs to use for resolving CCIP-read requests. | +| `args.name` | `string` | ENS name to get Text for. | +| `args.strict?` | `boolean` | Whether or not to throw errors propagated from the ENS Universal Resolver Contract. | +| `args.universalResolverAddress?` | `` `0x${string}` `` | Address of ENS Universal Resolver Contract. | + +#### Returns + +`Promise`\<[`GetEnsAvatarReturnType`](https://viem.sh/docs/index.html)\> + +Avatar URI or `null` if not found. [GetEnsAvatarReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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' +``` + +#### Inherited from + +`ViemPublicClient.getEnsAvatar` + +*** + +### getEnsName() + +> **getEnsName**: (`args`) => `Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:581 + +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 + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `address`: `` `0x${string}` ``; `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `coinType?`: `bigint`; `gatewayUrls?`: `string`[]; `strict?`: `boolean`; `universalResolverAddress?`: `` `0x${string}` ``; \} | [GetEnsNameParameters](https://viem.sh/docs/index.html) | +| `args.address` | `` `0x${string}` `` | Address to get ENS name for. | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.coinType?` | `bigint` | ENSIP-9 compliant coinType (chain) to get ENS name for. To get the `coinType` for a chain id, use the `toCoinType` function: `import { toCoinType } from 'viem' import { base } from 'viem/chains' const coinType = toCoinType(base.id)` **Default** `60n` | +| `args.gatewayUrls?` | `string`[] | Universal Resolver gateway URLs to use for resolving CCIP-read requests. | +| `args.strict?` | `boolean` | Whether or not to throw errors propagated from the ENS Universal Resolver Contract. | +| `args.universalResolverAddress?` | `` `0x${string}` `` | Address of ENS Universal Resolver Contract. | + +#### Returns + +`Promise`\<[`GetEnsNameReturnType`](https://viem.sh/docs/index.html)\> + +Name or `null` if not found. [GetEnsNameReturnType](https://viem.sh/docs/index.html) + +#### Remarks + +Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name. + +#### Example + +```ts +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' +``` + +#### Inherited from + +`ViemPublicClient.getEnsName` + +*** + +### getEnsResolver() + +> **getEnsResolver**: (`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:610 + +Gets resolver for ENS name. + +- Docs: https://viem.sh/docs/ens/actions/getEnsResolver +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `name`: `string`; `universalResolverAddress?`: `` `0x${string}` ``; \} | [GetEnsResolverParameters](https://viem.sh/docs/index.html) | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.name` | `string` | Name to get the address for. | +| `args.universalResolverAddress?` | `` `0x${string}` `` | Address of ENS Universal Resolver Contract. | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Address for ENS resolver. [GetEnsResolverReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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' +``` + +#### Inherited from + +`ViemPublicClient.getEnsResolver` + +*** + +### getEnsText() + +> **getEnsText**: (`args`) => `Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:640 + +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 + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `gatewayUrls?`: `string`[]; `key`: `string`; `name`: `string`; `strict?`: `boolean`; `universalResolverAddress?`: `` `0x${string}` ``; \} | [GetEnsTextParameters](https://viem.sh/docs/index.html) | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.gatewayUrls?` | `string`[] | Universal Resolver gateway URLs to use for resolving CCIP-read requests. | +| `args.key` | `string` | Text record to retrieve. | +| `args.name` | `string` | ENS name to get Text for. | +| `args.strict?` | `boolean` | Whether or not to throw errors propagated from the ENS Universal Resolver Contract. | +| `args.universalResolverAddress?` | `` `0x${string}` `` | Address of ENS Universal Resolver Contract. | + +#### Returns + +`Promise`\<[`GetEnsTextReturnType`](https://viem.sh/docs/index.html)\> + +Address for ENS resolver. [GetEnsTextReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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' +``` + +#### Inherited from + +`ViemPublicClient.getEnsText` + +*** + +### getFeeHistory() + +> **getFeeHistory**: (`args`) => `Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:663 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetFeeHistoryParameters`](https://viem.sh/docs/index.html) | [GetFeeHistoryParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetFeeHistoryReturnType`](https://viem.sh/docs/index.html)\> + +The gas estimate (in wei). [GetFeeHistoryReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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], +}) +``` + +#### Inherited from + +`ViemPublicClient.getFeeHistory` + +*** + +### getFilterChanges() + +> **getFilterChanges**: \<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:764 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `filterType` *extends* [`FilterType`](https://viem.sh/docs/index.html) | - | +| `abi` *extends* `Abi` \| readonly `unknown`[] \| `undefined` | - | +| `eventName` *extends* `string` \| `undefined` | - | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetFilterChangesParameters`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\> | [GetFilterChangesParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetFilterChangesReturnType`](https://viem.sh/docs/index.html)\<`filterType`, `abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +Logs or hashes. [GetFilterChangesReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +// 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 }) +``` + +```ts +// 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 }) +``` + +```ts +// 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 }) +``` + +```ts +// 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 }) +``` + +#### Inherited from + +`ViemPublicClient.getFilterChanges` + +*** + +### getFilterLogs() + +> **getFilterLogs**: \<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>(`args`) => `Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:791 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] \| `undefined` | - | +| `eventName` *extends* `string` \| `undefined` | - | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetFilterLogsParameters`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\> | [GetFilterLogsParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetFilterLogsReturnType`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, `fromBlock`, `toBlock`\>\> + +A list of event logs. [GetFilterLogsReturnType](https://viem.sh/docs/index.html) + +#### Remarks + +`getFilterLogs` is only compatible with **event filters**. + +#### Example + +```ts +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 }) +``` + +#### Inherited from + +`ViemPublicClient.getFilterLogs` + +*** + +### getGasPrice() + +> **getGasPrice**: () => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:810 + +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) + +#### Returns + +`Promise`\<`bigint`\> + +The gas price (in wei). [GetGasPriceReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const gasPrice = await client.getGasPrice() +``` + +#### Inherited from + +`ViemPublicClient.getGasPrice` + +*** + +### getLogs() + +> **getLogs**: \<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>(`args?`) => `Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:831 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abiEvent` *extends* `AbiEvent` \| `undefined` | `undefined` | +| `abiEvents` *extends* readonly `unknown`[] \| readonly `AbiEvent`[] \| `undefined` | `abiEvent` *extends* `AbiEvent` ? \[`abiEvent`\<`abiEvent`\>\] : `undefined` | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | +| `fromBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `toBlock` *extends* `bigint` \| [`BlockTag`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args?` | [`GetLogsParameters`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\> | [GetLogsParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetLogsReturnType`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, `fromBlock`, `toBlock`\>\> + +A list of event logs. [GetLogsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http, parseAbiItem } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const logs = await client.getLogs() +``` + +#### Inherited from + +`ViemPublicClient.getLogs` + +*** + +### getProof() + +> **getProof**: (`args`) => `Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:856 + +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) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`GetProofParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetProofReturnType`](https://viem.sh/docs/index.html)\> + +Proof data. [GetProofReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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...'], +}) +``` + +#### Inherited from + +`ViemPublicClient.getProof` + +*** + +### getStorageAt() + +> **getStorageAt**: (`args`) => `Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:901 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetStorageAtParameters`](https://viem.sh/docs/index.html) | [GetStorageAtParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`GetStorageAtReturnType`](https://viem.sh/docs/index.html)\> + +The value of the storage slot. [GetStorageAtReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.getStorageAt` + +*** + +### getTransaction() + +> **getTransaction**: \<`blockTag`\>(`args`) => `Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:924 + +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) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `blockTag` *extends* [`BlockTag`](https://viem.sh/docs/index.html) | `"latest"` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetTransactionParameters`](https://viem.sh/docs/index.html)\<`blockTag`\> | [GetTransactionParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId?`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"legacy"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity?`: `undefined`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice`: `bigint`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip2930"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip1559"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas`: `bigint`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip4844"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \} \| \{ `accessList`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList`: [`SignedAuthorizationList`](https://viem.sh/docs/index.html); `blobVersionedHashes?`: `undefined`; `blockHash`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `` `0x${string}` ``; `blockNumber`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `bigint`; `chainId`: `number`; `from`: `` `0x${string}` ``; `gas`: `bigint`; `gasPrice?`: `undefined`; `hash`: `` `0x${string}` ``; `input`: `` `0x${string}` ``; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas`: `bigint`; `maxPriorityFeePerGas`: `bigint`; `nonce`: `number`; `r`: `` `0x${string}` ``; `s`: `` `0x${string}` ``; `to`: `` `0x${string}` `` \| `null`; `transactionIndex`: `blockTag` *extends* `"pending"` ? `true` : `false` *extends* `true` ? `null` : `number`; `type`: `"eip7702"`; `typeHex`: `` `0x${string}` `` \| `null`; `v`: `bigint`; `value`: `bigint`; `yParity`: `number`; \}\> + +The transaction information. [GetTransactionReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const transaction = await client.getTransaction({ + hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', +}) +``` + +#### Inherited from + +`ViemPublicClient.getTransaction` + +*** + +### getTransactionConfirmations() + +> **getTransactionConfirmations**: (`args`) => `Promise`\<`bigint`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:947 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetTransactionConfirmationsParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`\> | [GetTransactionConfirmationsParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. [GetTransactionConfirmationsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const confirmations = await client.getTransactionConfirmations({ + hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', +}) +``` + +#### Inherited from + +`ViemPublicClient.getTransactionConfirmations` + +*** + +### getTransactionCount() + +> **getTransactionCount**: (`args`) => `Promise`\<`number`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:969 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetTransactionCountParameters`](https://viem.sh/docs/index.html) | [GetTransactionCountParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`number`\> + +The number of transactions an account has sent. [GetTransactionCountReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const transactionCount = await client.getTransactionCount({ + address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +#### Inherited from + +`ViemPublicClient.getTransactionCount` + +*** + +### getTransactionReceipt() + +> **getTransactionReceipt**: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:992 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`GetTransactionReceiptParameters`](https://viem.sh/docs/index.html) | [GetTransactionReceiptParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +The transaction receipt. [GetTransactionReceiptReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const transactionReceipt = await client.getTransactionReceipt({ + hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', +}) +``` + +#### Inherited from + +`ViemPublicClient.getTransactionReceipt` + +*** + +### key + +> **key**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:85 + +A key for the client. + +#### Inherited from + +`ViemPublicClient.key` + +*** + +### multicall() + +> **multicall**: \<`contracts`, `allowFailure`\>(`args`) => `Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1030 + +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 + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `contracts` *extends* readonly `unknown`[] | - | +| `allowFailure` *extends* `boolean` | `true` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`MulticallParameters`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\> | [MulticallParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`MulticallReturnType`](https://viem.sh/docs/index.html)\<`contracts`, `allowFailure`\>\> + +An array of results with accompanying status. [MulticallReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' }] +``` + +#### Inherited from + +`ViemPublicClient.multicall` + +*** + +### name + +> **name**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:87 + +A name for the client. + +#### Inherited from + +`ViemPublicClient.name` + +*** + +### pollingInterval + +> **pollingInterval**: `number` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:89 + +Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. + +#### Inherited from + +`ViemPublicClient.pollingInterval` + +*** + +### prepareTransactionRequest() + +> **prepareTransactionRequest**: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\, "from"\> & (DeriveChain\<(...), (...)\> extends Chain ? \{ chain: ... \} : \{ chain?: ... \}) & (DeriveAccount\<(...), (...)\> extends Account ? \{ account: ...; from: ... \} : \{ account?: ...; from?: ... \}), IsNever\<(...) \| (...) \| (...) \| (...) \| (...)\> extends true ? unknown : ExactPartial\<(...) \| (...) \| (...) \| (...) \| (...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1069 + +Prepares a transaction request for signing. + +- Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `request` *extends* [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"legacy"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip2930"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip1559"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes?`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: [`Kzg`](https://viem.sh/docs/index.html); `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: [`AuthorizationList`](https://viem.sh/docs/index.html)\<`number`, `boolean`\>; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip7702"`; `value?`: `bigint`; \}, `"from"`\> & `object` & `object` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `accountOverride` *extends* `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`PrepareTransactionRequestParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`, `request`\> | [PrepareTransactionRequestParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\, "from"\> & (DeriveChain\<(...), (...)\> extends Chain ? \{ chain: ... \} : \{ chain?: ... \}) & (DeriveAccount\<(...), (...)\> extends Account ? \{ account: ...; from: ... \} : \{ account?: ...; from?: ... \}), IsNever\<(...) \| (...) \| (...) \| (...) \| (...)\> extends true ? unknown : ExactPartial\<(...) \| (...) \| (...) \| (...) \| (...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\> + +The transaction request. [PrepareTransactionRequestReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +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, +}) +``` + +```ts +// 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, +}) +``` + +#### Inherited from + +`ViemPublicClient.prepareTransactionRequest` + +*** + +### readContract() + +> **readContract**: \<`abi`, `functionName`, `args`\>(`args`) => `Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1101 + +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 + +#### Type Parameters + +| Type Parameter | +| ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | +| `functionName` *extends* `string` | +| `args` *extends* `unknown` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`ReadContractParameters`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\> | [ReadContractParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`ReadContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`\>\> + +The response from the contract. Type is inferred. [ReadContractReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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 +``` + +#### Inherited from + +`ViemPublicClient.readContract` + +*** + +### request + +> **request**: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`PublicRpcSchema`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:91 + +Request function wrapped with friendly error handling + +#### Inherited from + +`ViemPublicClient.request` + +*** + +### sendRawTransaction() + +> **sendRawTransaction**: (`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1126 + +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/) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SendRawTransactionParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The transaction hash. [SendRawTransactionReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' +}) +``` + +#### Inherited from + +`ViemPublicClient.sendRawTransaction` + +*** + +### sendRawTransactionSync() + +> **sendRawTransactionSync**: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1151 + +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) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SendRawTransactionSyncParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +The transaction receipt. [SendRawTransactionSyncReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' +}) +``` + +#### Inherited from + +`ViemPublicClient.sendRawTransactionSync` + +*** + +### ~~simulate()~~ + +> **simulate**: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1155 + +#### Type Parameters + +| Type Parameter | +| ------ | +| `calls` *extends* readonly `unknown`[] | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SimulateBlocksParameters`](https://viem.sh/docs/index.html)\<`calls`\> | + +#### Returns + +`Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +#### Deprecated + +Use `simulateBlocks` instead. + +#### Inherited from + +`ViemPublicClient.simulate` + +*** + +### simulateBlocks() + +> **simulateBlocks**: \<`calls`\>(`args`) => `Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1198 + +Simulates a set of calls on block(s) with optional block and state overrides. + +#### Type Parameters + +| Type Parameter | +| ------ | +| `calls` *extends* readonly `unknown`[] | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SimulateBlocksParameters`](https://viem.sh/docs/index.html)\<`calls`\> | + +#### Returns + +`Promise`\<[`SimulateBlocksReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +Simulated blocks. SimulateReturnType + +#### Example + +```ts +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'), + }], + }] +}) +``` + +#### Inherited from + +`ViemPublicClient.simulateBlocks` + +*** + +### simulateCalls() + +> **simulateCalls**: \<`calls`\>(`args`) => `Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1231 + +Simulates a set of calls. + +#### Type Parameters + +| Type Parameter | +| ------ | +| `calls` *extends* readonly `unknown`[] | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SimulateCallsParameters`](https://viem.sh/docs/index.html)\<`calls`\> | + +#### Returns + +`Promise`\<[`SimulateCallsReturnType`](https://viem.sh/docs/index.html)\<`calls`\>\> + +Results. [SimulateCallsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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'), + }, + ] +}) +``` + +#### Inherited from + +`ViemPublicClient.simulateCalls` + +*** + +### simulateContract() + +> **simulateContract**: \<`abi`, `functionName`, `args`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1262 + +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 + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `functionName` *extends* `string` | - | +| `args` *extends* `unknown` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | - | +| `accountOverride` *extends* `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SimulateContractParameters`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\> | [SimulateContractParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`SimulateContractReturnType`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`, `accountOverride`\>\> + +The simulation result and write request. [SimulateContractReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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', +}) +``` + +#### Inherited from + +`ViemPublicClient.simulateContract` + +*** + +### transport + +> **transport**: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:93 + +The RPC transport + +#### Inherited from + +`ViemPublicClient.transport` + +*** + +### type + +> **type**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:95 + +The type of client. + +#### Inherited from + +`ViemPublicClient.type` + +*** + +### uid + +> **uid**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:97 + +A unique ID for the client. + +#### Inherited from + +`ViemPublicClient.uid` + +*** + +### uninstallFilter() + +> **uninstallFilter**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1325 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`UninstallFilterParameters`](https://viem.sh/docs/index.html) | [UninstallFilterParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +A boolean indicating if the Filter was successfully uninstalled. [UninstallFilterReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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 +``` + +#### Inherited from + +`ViemPublicClient.uninstallFilter` + +*** + +### verifyHash() + +> **verifyHash**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1271 + +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) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`VerifyHashParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +Whether or not the signature is valid. [VerifyHashReturnType](https://viem.sh/docs/index.html) + +#### Inherited from + +`ViemPublicClient.verifyHash` + +*** + +### verifyMessage() + +> **verifyMessage**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1282 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `address`: `` `0x${string}` ``; `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `chain?`: [`Chain`](https://viem.sh/docs/index.html) \| `null`; `erc6492VerifierAddress?`: `` `0x${string}` ``; `factory?`: `` `0x${string}` ``; `factoryData?`: `` `0x${string}` ``; `message`: [`SignableMessage`](https://viem.sh/docs/index.html); `multicallAddress?`: `` `0x${string}` ``; `signature`: `` `0x${string}` `` \| `Uint8Array` \| [`Signature`](https://viem.sh/docs/index.html); `universalSignatureVerifierAddress?`: `` `0x${string}` ``; \} | - | +| `args.address` | `` `0x${string}` `` | The address that signed the original message. | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.chain?` | [`Chain`](https://viem.sh/docs/index.html) \| `null` | The chain to use. | +| `args.erc6492VerifierAddress?` | `` `0x${string}` `` | The address of the ERC-6492 signature verifier contract. | +| `args.factory?` | `` `0x${string}` `` | - | +| `args.factoryData?` | `` `0x${string}` `` | - | +| `args.message` | [`SignableMessage`](https://viem.sh/docs/index.html) | The message to be verified. | +| `args.multicallAddress?` | `` `0x${string}` `` | Multicall3 address for ERC-8010 verification. | +| `args.signature` | `` `0x${string}` `` \| `Uint8Array` \| [`Signature`](https://viem.sh/docs/index.html) | The signature that was generated by signing the message with the address's private key. | +| `args.universalSignatureVerifierAddress?` | `` `0x${string}` `` | **Deprecated** use `erc6492VerifierAddress` instead. | + +#### Returns + +`Promise`\<`boolean`\> + +Whether or not the signature is valid. [VerifyMessageReturnType](https://viem.sh/docs/index.html) + +#### Inherited from + +`ViemPublicClient.verifyMessage` + +*** + +### verifySiweMessage() + +> **verifySiweMessage**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1293 + +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) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{ `address?`: `` `0x${string}` ``; `blockNumber?`: `bigint`; `blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `domain?`: `string`; `message`: `string`; `nonce?`: `string`; `scheme?`: `string`; `signature`: `` `0x${string}` ``; `time?`: `Date`; \} | - | +| `args.address?` | `` `0x${string}` `` | Ethereum address to check against. | +| `args.blockNumber?` | `bigint` | The balance of the account at a block number. | +| `args.blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | The balance of the account at a block tag. **Default** `'latest'` | +| `args.domain?` | `string` | [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) authority to check against. | +| `args.message` | `string` | EIP-4361 formatted message. | +| `args.nonce?` | `string` | Random string to check against. | +| `args.scheme?` | `string` | [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) URI scheme to check against. | +| `args.signature` | `` `0x${string}` `` | Signature to check against. | +| `args.time?` | `Date` | Current time to check optional `expirationTime` and `notBefore` fields. **Default** `new Date()` | + +#### Returns + +`Promise`\<`boolean`\> + +Whether or not the signature is valid. [VerifySiweMessageReturnType](https://viem.sh/docs/index.html) + +#### Inherited from + +`ViemPublicClient.verifySiweMessage` + +*** + +### verifyTypedData() + +> **verifyTypedData**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1302 + +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) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`VerifyTypedDataParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +Whether or not the signature is valid. [VerifyTypedDataReturnType](https://viem.sh/docs/index.html) + +#### Inherited from + +`ViemPublicClient.verifyTypedData` + +*** + +### waitForTransactionReceipt() + +> **waitForTransactionReceipt**: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1364 + +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). + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WaitForTransactionReceiptParameters`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`\> | [WaitForTransactionReceiptParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +The transaction receipt. [WaitForTransactionReceiptReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +import { createPublicClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createPublicClient({ + chain: mainnet, + transport: http(), +}) +const transactionReceipt = await client.waitForTransactionReceipt({ + hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d', +}) +``` + +#### Inherited from + +`ViemPublicClient.waitForTransactionReceipt` + +*** + +### watchBlockNumber() + +> **watchBlockNumber**: (`args`) => [`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1389 + +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. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchBlockNumberParameters`](https://viem.sh/docs/index.html) | [WatchBlockNumberParameters](https://viem.sh/docs/index.html) | + +#### Returns + +[`WatchBlockNumberReturnType`](https://viem.sh/docs/index.html) + +A function that can be invoked to stop watching for new block numbers. [WatchBlockNumberReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.watchBlockNumber` + +*** + +### watchBlocks() + +> **watchBlocks**: \<`includeTransactions`, `blockTag`\>(`args`) => [`WatchBlocksReturnType`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1414 + +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. + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `includeTransactions` *extends* `boolean` | `false` | +| `blockTag` *extends* [`BlockTag`](https://viem.sh/docs/index.html) | `"latest"` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchBlocksParameters`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `includeTransactions`, `blockTag`\> | [WatchBlocksParameters](https://viem.sh/docs/index.html) | + +#### Returns + +[`WatchBlocksReturnType`](https://viem.sh/docs/index.html) + +A function that can be invoked to stop watching for new block numbers. [WatchBlocksReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.watchBlocks` + +*** + +### watchContractEvent() + +> **watchContractEvent**: \<`abi`, `eventName`, `strict`\>(`args`) => [`WatchContractEventReturnType`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1444 + +Watches and returns emitted contract event logs. + +- Docs: https://viem.sh/docs/contract/watchContractEvent + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `eventName` *extends* `string` | - | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchContractEventParameters`](https://viem.sh/docs/index.html)\<`abi`, `eventName`, `strict`, [`Transport`](https://viem.sh/docs/index.html)\> | [WatchContractEventParameters](https://viem.sh/docs/index.html) | + +#### Returns + +[`WatchContractEventReturnType`](https://viem.sh/docs/index.html) + +A function that can be invoked to stop watching for new event logs. [WatchContractEventReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.watchContractEvent` + +*** + +### watchEvent() + +> **watchEvent**: \<`abiEvent`, `abiEvents`, `strict`\>(`args`) => [`WatchEventReturnType`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1476 + +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. + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abiEvent` *extends* `AbiEvent` \| `undefined` | `undefined` | +| `abiEvents` *extends* readonly `unknown`[] \| readonly `AbiEvent`[] \| `undefined` | `abiEvent` *extends* `AbiEvent` ? \[`abiEvent`\<`abiEvent`\>\] : `undefined` | +| `strict` *extends* `boolean` \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchEventParameters`](https://viem.sh/docs/index.html)\<`abiEvent`, `abiEvents`, `strict`, [`Transport`](https://viem.sh/docs/index.html)\> | [WatchEventParameters](https://viem.sh/docs/index.html) | + +#### Returns + +[`WatchEventReturnType`](https://viem.sh/docs/index.html) + +A function that can be invoked to stop watching for new Event Logs. [WatchEventReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.watchEvent` + +*** + +### watchPendingTransactions() + +> **watchPendingTransactions**: (`args`) => [`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/public.d.ts:1505 + +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. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchPendingTransactionsParameters`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html)\> | [WatchPendingTransactionsParameters](https://viem.sh/docs/index.html) | + +#### Returns + +[`WatchPendingTransactionsReturnType`](https://viem.sh/docs/index.html) + +A function that can be invoked to stop watching for new pending transaction hashes. [WatchPendingTransactionsReturnType](https://viem.sh/docs/index.html) + +#### 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 + +```ts +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), +}) +``` + +#### Inherited from + +`ViemPublicClient.watchPendingTransactions` diff --git a/0.16.23/api/@aastar/core/interfaces/RoleConfig.md b/0.16.23/api/@aastar/core/interfaces/RoleConfig.md new file mode 100644 index 000000000..ad2034cb5 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/RoleConfig.md @@ -0,0 +1,83 @@ +Defined in: [packages/core/src/roles.ts:102](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L102) + +Role configuration structure (matches Registry.sol RoleConfig struct) + +## Properties + +### description + +> **description**: `string` + +Defined in: [packages/core/src/roles.ts:112](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L112) + +*** + +### entryBurn + +> **entryBurn**: `bigint` + +Defined in: [packages/core/src/roles.ts:104](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L104) + +*** + +### exitFeePercent + +> **exitFeePercent**: `bigint` + +Defined in: [packages/core/src/roles.ts:109](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L109) + +*** + +### isActive + +> **isActive**: `boolean` + +Defined in: [packages/core/src/roles.ts:111](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L111) + +*** + +### minExitFee + +> **minExitFee**: `bigint` + +Defined in: [packages/core/src/roles.ts:110](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L110) + +*** + +### minStake + +> **minStake**: `bigint` + +Defined in: [packages/core/src/roles.ts:103](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L103) + +*** + +### slashBase + +> **slashBase**: `number` + +Defined in: [packages/core/src/roles.ts:106](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L106) + +*** + +### slashIncrement + +> **slashIncrement**: `number` + +Defined in: [packages/core/src/roles.ts:107](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L107) + +*** + +### slashMax + +> **slashMax**: `number` + +Defined in: [packages/core/src/roles.ts:108](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L108) + +*** + +### slashThreshold + +> **slashThreshold**: `number` + +Defined in: [packages/core/src/roles.ts:105](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L105) diff --git a/0.16.23/api/@aastar/core/interfaces/RoleRequirement.md b/0.16.23/api/@aastar/core/interfaces/RoleRequirement.md new file mode 100644 index 000000000..606e87b73 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/RoleRequirement.md @@ -0,0 +1,43 @@ +Defined in: [packages/core/src/roles.ts:118](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L118) + +Role requirement check result + +## Properties + +### hasEnoughAPNTs + +> **hasEnoughAPNTs**: `boolean` + +Defined in: [packages/core/src/roles.ts:121](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L121) + +*** + +### hasEnoughGToken + +> **hasEnoughGToken**: `boolean` + +Defined in: [packages/core/src/roles.ts:120](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L120) + +*** + +### hasRole + +> **hasRole**: `boolean` + +Defined in: [packages/core/src/roles.ts:119](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L119) + +*** + +### hasSBT + +> **hasSBT**: `boolean` + +Defined in: [packages/core/src/roles.ts:122](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L122) + +*** + +### missingRequirements + +> **missingRequirements**: `string`[] + +Defined in: [packages/core/src/roles.ts:123](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L123) diff --git a/0.16.23/api/@aastar/core/interfaces/RoleValidationParams.md b/0.16.23/api/@aastar/core/interfaces/RoleValidationParams.md new file mode 100644 index 000000000..3c7e169b4 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/RoleValidationParams.md @@ -0,0 +1,55 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L11) + +Interface definitions + +## Extends + +- [`ValidationParams`](ValidationParams.md) + +## Properties + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/actions/StateValidator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L8) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`chain`](ValidationParams.md#chain) + +*** + +### registryAddress + +> **registryAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L12) + +*** + +### roleId + +> **roleId**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L13) + +*** + +### rpcUrl + +> **rpcUrl**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L7) + +#### Inherited from + +[`ValidationParams`](ValidationParams.md).[`rpcUrl`](ValidationParams.md#rpcurl) + +*** + +### userAddress + +> **userAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L14) diff --git a/0.16.23/api/@aastar/core/interfaces/SuperPaymasterConfig.md b/0.16.23/api/@aastar/core/interfaces/SuperPaymasterConfig.md new file mode 100644 index 000000000..d6b661c59 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/SuperPaymasterConfig.md @@ -0,0 +1,57 @@ +Defined in: [packages/core/src/config/ContractConfigManager.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L4) + +## Properties + +### entryPoint + +> **entryPoint**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L11) + +*** + +### gToken + +> **gToken**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L6) + +*** + +### gTokenStaking + +> **gTokenStaking**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L7) + +*** + +### paymasterFactory + +> **paymasterFactory**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L9) + +*** + +### paymasterV4 + +> **paymasterV4**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L10) + +*** + +### registry + +> **registry**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L5) + +*** + +### superPaymaster + +> **superPaymaster**: `` `0x${string}` `` + +Defined in: [packages/core/src/config/ContractConfigManager.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/config/ContractConfigManager.ts#L8) diff --git a/0.16.23/api/@aastar/core/interfaces/TokenBalanceValidationParams.md b/0.16.23/api/@aastar/core/interfaces/TokenBalanceValidationParams.md new file mode 100644 index 000000000..ffee99cee --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/TokenBalanceValidationParams.md @@ -0,0 +1,63 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L22) + +Interface definitions + +## Extends + +- [`BalanceValidationParams`](BalanceValidationParams.md) + +## Properties + +### address + +> **address**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L18) + +#### Inherited from + +[`BalanceValidationParams`](BalanceValidationParams.md).[`address`](BalanceValidationParams.md#address) + +*** + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/actions/StateValidator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L8) + +#### Inherited from + +[`BalanceValidationParams`](BalanceValidationParams.md).[`chain`](BalanceValidationParams.md#chain) + +*** + +### minBalance? + +> `optional` **minBalance**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L19) + +#### Inherited from + +[`BalanceValidationParams`](BalanceValidationParams.md).[`minBalance`](BalanceValidationParams.md#minbalance) + +*** + +### rpcUrl + +> **rpcUrl**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L7) + +#### Inherited from + +[`BalanceValidationParams`](BalanceValidationParams.md).[`rpcUrl`](BalanceValidationParams.md#rpcurl) + +*** + +### tokenAddress + +> **tokenAddress**: `` `0x${string}` `` + +Defined in: [packages/core/src/actions/StateValidator.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L23) diff --git a/0.16.23/api/@aastar/core/interfaces/TransactionOptions.md b/0.16.23/api/@aastar/core/interfaces/TransactionOptions.md new file mode 100644 index 000000000..126cefdfa --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/TransactionOptions.md @@ -0,0 +1,24 @@ +Defined in: [packages/core/src/clients/types.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L53) + +Common options for transaction methods + +## Properties + +### account? + +> `optional` **account**: `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/clients/types.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L58) + +Override the account to use for the transaction. +If not provided, uses the account from the WalletClient. + +*** + +### value? + +> `optional` **value**: `bigint` + +Defined in: [packages/core/src/clients/types.ts:63](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L63) + +Optional value to send with the transaction (in wei) diff --git a/0.16.23/api/@aastar/core/interfaces/UserOperationV07.md b/0.16.23/api/@aastar/core/interfaces/UserOperationV07.md new file mode 100644 index 000000000..094300f3f --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/UserOperationV07.md @@ -0,0 +1,73 @@ +Defined in: [packages/core/src/clients/BundlerClient.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L4) + +## Properties + +### accountGasLimits + +> **accountGasLimits**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L9) + +*** + +### callData + +> **callData**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L8) + +*** + +### gasFees + +> **gasFees**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L11) + +*** + +### initCode + +> **initCode**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L7) + +*** + +### nonce + +> **nonce**: `bigint` + +Defined in: [packages/core/src/clients/BundlerClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L6) + +*** + +### paymasterAndData + +> **paymasterAndData**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L12) + +*** + +### preVerificationGas + +> **preVerificationGas**: `bigint` + +Defined in: [packages/core/src/clients/BundlerClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L10) + +*** + +### sender + +> **sender**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L5) + +*** + +### signature + +> **signature**: `` `0x${string}` `` + +Defined in: [packages/core/src/clients/BundlerClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/BundlerClient.ts#L13) diff --git a/0.16.23/api/@aastar/core/interfaces/ValidationParams.md b/0.16.23/api/@aastar/core/interfaces/ValidationParams.md new file mode 100644 index 000000000..b7f116436 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/ValidationParams.md @@ -0,0 +1,25 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L6) + +Interface definitions + +## Extended by + +- [`RoleValidationParams`](RoleValidationParams.md) +- [`BalanceValidationParams`](BalanceValidationParams.md) +- [`DeploymentValidationParams`](DeploymentValidationParams.md) + +## Properties + +### chain + +> **chain**: [`Chain`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/actions/StateValidator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L8) + +*** + +### rpcUrl + +> **rpcUrl**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L7) diff --git a/0.16.23/api/@aastar/core/interfaces/ValidationResult.md b/0.16.23/api/@aastar/core/interfaces/ValidationResult.md new file mode 100644 index 000000000..45011b05f --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/ValidationResult.md @@ -0,0 +1,25 @@ +Defined in: [packages/core/src/actions/StateValidator.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L30) + +## Properties + +### data? + +> `optional` **data**: `any` + +Defined in: [packages/core/src/actions/StateValidator.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L33) + +*** + +### message? + +> `optional` **message**: `string` + +Defined in: [packages/core/src/actions/StateValidator.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L32) + +*** + +### valid + +> **valid**: `boolean` + +Defined in: [packages/core/src/actions/StateValidator.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/StateValidator.ts#L31) diff --git a/0.16.23/api/@aastar/core/interfaces/WalletClient.md b/0.16.23/api/@aastar/core/interfaces/WalletClient.md new file mode 100644 index 000000000..c8810c2b9 --- /dev/null +++ b/0.16.23/api/@aastar/core/interfaces/WalletClient.md @@ -0,0 +1,1846 @@ +Defined in: [packages/core/src/clients/doc-types.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/doc-types.ts#L13) + +Wallet Client Interface +Standardized interface for interacting with Ethereum wallets and accounts. + +## Extends + +- [`WalletClient`](https://viem.sh/docs/index.html)\<`TTransport`, `TChain`, `TAccount`\> + +## Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `TTransport` *extends* [`Transport`](https://viem.sh/docs/index.html) | [`Transport`](https://viem.sh/docs/index.html) | +| `TChain` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | +| `TAccount` *extends* [`Account`](https://viem.sh/docs/index.html) \| `undefined` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | + +## Properties + +### account + +> **account**: `TAccount` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:73 + +The Account of the Client. + +#### Inherited from + +`ViemWalletClient.account` + +*** + +### addChain() + +> **addChain**: (`args`) => `Promise`\<`void`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:53 + +Adds an EVM chain to the wallet. + +- Docs: https://viem.sh/docs/actions/wallet/addChain +- JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`AddChainParameters`](https://viem.sh/docs/index.html) | [AddChainParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { optimism } from 'viem/chains' + +const client = createWalletClient({ + transport: custom(window.ethereum), +}) +await client.addChain({ chain: optimism }) +``` + +#### Inherited from + +`ViemWalletClient.addChain` + +*** + +### batch? + +> `optional` **batch**: `object` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:75 + +Flags for batch settings. + +#### multicall? + +> `optional` **multicall**: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} + +Toggle to enable `eth_call` multicall aggregation. + +##### Type Declaration + +`boolean` + +\{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} + +#### Inherited from + +`ViemWalletClient.batch` + +*** + +### cacheTime + +> **cacheTime**: `number` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:77 + +Time (in ms) that cached data will remain in memory. + +#### Inherited from + +`ViemWalletClient.cacheTime` + +*** + +### ccipRead? + +> `optional` **ccipRead**: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:79 + +[CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. + +#### Type Declaration + +`false` + +\{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} + +#### request()? + +> `optional` **request**: (`parameters`) => `Promise`\<`` `0x${string}` ``\> + +A function that will be called to make the offchain CCIP lookup request. + +##### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`CcipRequestParameters`](https://viem.sh/docs/index.html) | + +##### Returns + +`Promise`\<`` `0x${string}` ``\> + +##### See + +https://eips.ethereum.org/EIPS/eip-3668#client-lookup-protocol + +#### Inherited from + +`ViemWalletClient.ccipRead` + +*** + +### chain + +> **chain**: `TChain` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:81 + +Chain for the client. + +#### Inherited from + +`ViemWalletClient.chain` + +*** + +### deployContract() + +> **deployContract**: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:79 + +Deploys a contract to the network, given bytecode and constructor arguments. + +- Docs: https://viem.sh/docs/contract/deployContract +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts + +#### Type Parameters + +| Type Parameter | +| ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`DeployContractParameters`](https://viem.sh/docs/index.html)\<`abi`, `TChain`, `TAccount`, `chainOverride`\> | [DeployContractParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. [DeployContractReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, http } from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + account: privateKeyToAccount('0x…'), + chain: mainnet, + transport: http(), +}) +const hash = await client.deployContract({ + abi: [], + account: '0x…, + bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', +}) +``` + +#### Inherited from + +`ViemWalletClient.deployContract` + +*** + +### experimental\_blockTag? + +> `optional` **experimental\_blockTag**: [`BlockTag`](https://viem.sh/docs/index.html) + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:83 + +Default block tag to use for RPC requests. + +#### Inherited from + +`ViemWalletClient.experimental_blockTag` + +*** + +### extend() + +> **extend**: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<`TTransport`, `TChain`, `TAccount`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:69 + +#### Type Parameters + +| Type Parameter | +| ------ | +| `client` *extends* `object` & [`ExactPartial`](https://viem.sh/docs/index.html)\<[`ExtendableProtectedActions`](https://viem.sh/docs/index.html)\<`TTransport`, `TChain`, `TAccount`\>\> | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `fn` | (`client`) => `client` | + +#### Returns + +[`Client`](https://viem.sh/docs/index.html)\<`TTransport`, `TChain`, `TAccount`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`\>\> + +#### Inherited from + +`ViemWalletClient.extend` + +*** + +### fillTransaction() + +> **fillTransaction**: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `chainOverride`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:103 + +Fills a transaction request with the necessary fields to be signed over. + +- Docs: https://viem.sh/docs/actions/public/fillTransaction + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `accountOverride` *extends* `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`FillTransactionParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `accountOverride`\> | + +#### Returns + +`Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `chainOverride`\>\> + +The filled transaction. [FillTransactionReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const result = await client.fillTransaction({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: parseEther('1'), +}) +``` + +#### Inherited from + +`ViemWalletClient.fillTransaction` + +*** + +### getAddresses() + +> **getAddresses**: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:122 + +Returns a list of account addresses owned by the wallet or client. + +- Docs: https://viem.sh/docs/actions/wallet/getAddresses +- JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) + +#### Returns + +`Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> + +List of account addresses owned by the wallet or client. [GetAddressesReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const accounts = await client.getAddresses() +``` + +#### Inherited from + +`ViemWalletClient.getAddresses` + +*** + +### getCallsStatus() + +> **getCallsStatus**: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:143 + +Returns the status of a call batch that was sent via `sendCalls`. + +- Docs: https://viem.sh/docs/actions/wallet/getCallsStatus +- JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`GetCallsStatusParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Status of the calls. [GetCallsStatusReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' }) +``` + +#### Inherited from + +`ViemWalletClient.getCallsStatus` + +*** + +### getCapabilities() + +> **getCapabilities**: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ("address" \| "p256" \| "webcrypto-p256" \| "webauthn-p256")\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:166 + +Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). + +- Docs: https://viem.sh/docs/actions/wallet/getCapabilities +- JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Type Parameters + +| Type Parameter | +| ------ | +| `chainId` *extends* `number` \| `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters?` | [`GetCapabilitiesParameters`](https://viem.sh/docs/index.html)\<`chainId`\> | + +#### Returns + +`Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ("address" \| "p256" \| "webcrypto-p256" \| "webauthn-p256")\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> + +The wallet's capabilities. [GetCapabilitiesReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +const capabilities = await client.getCapabilities({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +#### Inherited from + +`ViemWalletClient.getCapabilities` + +*** + +### getChainId() + +> **getChainId**: () => `Promise`\<`number`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:186 + +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) + +#### Returns + +`Promise`\<`number`\> + +The current chain ID. [GetChainIdReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, http } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const chainId = await client.getChainId() +// 1 +``` + +#### Inherited from + +`ViemWalletClient.getChainId` + +*** + +### getPermissions() + +> **getPermissions**: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:205 + +Gets the wallets current permissions. + +- Docs: https://viem.sh/docs/actions/wallet/getPermissions +- JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) + +#### Returns + +`Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> + +The wallet permissions. [GetPermissionsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const permissions = await client.getPermissions() +``` + +#### Inherited from + +`ViemWalletClient.getPermissions` + +*** + +### key + +> **key**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:85 + +A key for the client. + +#### Inherited from + +`ViemWalletClient.key` + +*** + +### name + +> **name**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:87 + +A name for the client. + +#### Inherited from + +`ViemWalletClient.name` + +*** + +### pollingInterval + +> **pollingInterval**: `number` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:89 + +Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. + +#### Inherited from + +`ViemWalletClient.pollingInterval` + +*** + +### prepareAuthorization() + +> **prepareAuthorization**: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:247 + +Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. +This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). + +With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `parameters` | [`PrepareAuthorizationParameters`](https://viem.sh/docs/index.html)\<`TAccount`\> | [PrepareAuthorizationParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> + +The prepared Authorization object. [PrepareAuthorizationReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, http } from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: http(), +}) + +const authorization = await client.prepareAuthorization({ + account: privateKeyToAccount('0x..'), + contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +```ts +// 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: http(), +}) + +const authorization = await client.prepareAuthorization({ + contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +#### Inherited from + +`ViemWalletClient.prepareAuthorization` + +*** + +### prepareTransactionRequest() + +> **prepareTransactionRequest**: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\, "from"\> & (DeriveChain\<(...), (...)\> extends Chain ? \{ chain: ... \} : \{ chain?: ... \}) & (DeriveAccount\<(...), (...)\> extends Account ? \{ account: ...; from: ... \} : \{ account?: ...; from?: ... \}), IsNever\<(...) \| (...) \| (...) \| (...) \| (...)\> extends true ? unknown : ExactPartial\<(...) \| (...) \| (...) \| (...) \| (...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:286 + +Prepares a transaction request for signing. + +- Docs: https://viem.sh/docs/actions/wallet/prepareTransactionRequest + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `request` *extends* [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"legacy"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip2930"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip1559"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes?`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: [`Kzg`](https://viem.sh/docs/index.html); `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: [`AuthorizationList`](https://viem.sh/docs/index.html)\<`number`, `boolean`\>; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip7702"`; `value?`: `bigint`; \}, `"from"`\> & `object` & `object` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | +| `accountOverride` *extends* `` `0x${string}` `` \| [`Account`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`PrepareTransactionRequestParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `accountOverride`, `request`\> | [PrepareTransactionRequestParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\, "from"\> & (DeriveChain\<(...), (...)\> extends Chain ? \{ chain: ... \} : \{ chain?: ... \}) & (DeriveAccount\<(...), (...)\> extends Account ? \{ account: ...; from: ... \} : \{ account?: ...; from?: ... \}), IsNever\<(...) \| (...) \| (...) \| (...) \| (...)\> extends true ? unknown : ExactPartial\<(...) \| (...) \| (...) \| (...) \| (...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\> + +The transaction request. [PrepareTransactionRequestReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +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, +}) +``` + +```ts +// 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, +}) +``` + +#### Inherited from + +`ViemWalletClient.prepareTransactionRequest` + +*** + +### request + +> **request**: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:91 + +Request function wrapped with friendly error handling + +#### Inherited from + +`ViemWalletClient.request` + +*** + +### requestAddresses() + +> **requestAddresses**: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:309 + +Requests a list of accounts managed by a wallet. + +- Docs: https://viem.sh/docs/actions/wallet/requestAddresses +- JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) + +Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). + +This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. + +#### Returns + +`Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> + +List of accounts managed by a wallet [RequestAddressesReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const accounts = await client.requestAddresses() +``` + +#### Inherited from + +`ViemWalletClient.requestAddresses` + +*** + +### requestPermissions() + +> **requestPermissions**: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:331 + +Requests permissions for a wallet. + +- Docs: https://viem.sh/docs/actions/wallet/requestPermissions +- JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | \{\[`key`: `string`\]: `Record`\<`string`, `any`\>; `eth_accounts`: `Record`\<`string`, `any`\>; \} | [RequestPermissionsParameters](https://viem.sh/docs/index.html) | +| `args.eth_accounts` | `Record`\<`string`, `any`\> | - | + +#### Returns + +`Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> + +The wallet permissions. [RequestPermissionsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const permissions = await client.requestPermissions({ + eth_accounts: {} +}) +``` + +#### Inherited from + +`ViemWalletClient.requestPermissions` + +*** + +### sendCalls() + +> **sendCalls**: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:364 + +Requests the connected wallet to send a batch of calls. + +- Docs: https://viem.sh/docs/actions/wallet/sendCalls +- JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `calls` *extends* readonly `unknown`[] | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`SendCallsParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `calls`\> | + +#### Returns + +`Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> + +Transaction identifier. [SendCallsReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +const id = await client.sendCalls({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + calls: [ + { + data: '0xdeadbeef', + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + }, + { + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 69420n, + }, + ], +}) +``` + +#### Inherited from + +`ViemWalletClient.sendCalls` + +*** + +### sendCallsSync() + +> **sendCallsSync**: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:397 + +Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. + +- Docs: https://viem.sh/docs/actions/wallet/sendCallsSync +- JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `calls` *extends* readonly `unknown`[] | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`SendCallsSyncParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `calls`\> | + +#### Returns + +`Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Calls status. [SendCallsSyncReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +const status = await client.sendCallsSync({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + calls: [ + { + data: '0xdeadbeef', + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + }, + { + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 69420n, + }, + ], +}) +``` + +#### Inherited from + +`ViemWalletClient.sendCallsSync` + +*** + +### sendRawTransaction() + +> **sendRawTransaction**: (`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:422 + +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/) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SendRawTransactionParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The transaction hash. [SendRawTransactionReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' +}) +``` + +#### Inherited from + +`ViemWalletClient.sendRawTransaction` + +*** + +### sendRawTransactionSync() + +> **sendRawTransactionSync**: (`args`) => `Promise`\<[`ExtractChainFormatterReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `"transactionReceipt"`, [`TransactionReceipt`](https://viem.sh/docs/index.html)\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:448 + +Sends a **signed** transaction to the network synchronously, +and waits for the transaction to be included in a block. + +- Docs: https://viem.sh/docs/actions/wallet/sendRawTransactionSync +- JSON-RPC Method: [`eth_sendRawTransactionSync`](https://eips.ethereum.org/EIPS/eip-7966) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | [`SendRawTransactionSyncParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`ExtractChainFormatterReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `"transactionReceipt"`, [`TransactionReceipt`](https://viem.sh/docs/index.html)\>\> + +The transaction receipt. [SendRawTransactionSyncReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +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' +}) +``` + +#### Inherited from + +`ViemWalletClient.sendRawTransactionSync` + +*** + +### sendTransaction() + +> **sendTransaction**: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:491 + +Creates, signs, and sends a new transaction to the network. + +- Docs: https://viem.sh/docs/actions/wallet/sendTransaction +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions +- JSON-RPC Methods: + - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) + - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `request` *extends* [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"legacy"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip2930"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip1559"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes?`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: [`Kzg`](https://viem.sh/docs/index.html); `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: [`AuthorizationList`](https://viem.sh/docs/index.html)\<`number`, `boolean`\>; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip7702"`; `value?`: `bigint`; \}, `"from"`\> & `object` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SendTransactionParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `request`\> | [SendTransactionParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. [SendTransactionReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const hash = await client.sendTransaction({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 1000000000000000000n, +}) +``` + +```ts +// 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: http(), +}) +const hash = await client.sendTransaction({ + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 1000000000000000000n, +}) +``` + +#### Inherited from + +`ViemWalletClient.sendTransaction` + +*** + +### sendTransactionSync() + +> **sendTransactionSync**: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`ExtractChainFormatterReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `"transactionReceipt"`, [`TransactionReceipt`](https://viem.sh/docs/index.html)\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:535 + +Creates, signs, and sends a new transaction to the network synchronously. +Returns the transaction receipt. + +- Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions +- JSON-RPC Methods: + - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) + - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `request` *extends* [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"legacy"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip2930"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip1559"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes?`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: [`Kzg`](https://viem.sh/docs/index.html); `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: [`AuthorizationList`](https://viem.sh/docs/index.html)\<`number`, `boolean`\>; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip7702"`; `value?`: `bigint`; \}, `"from"`\> & `object` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SendTransactionSyncParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `request`\> | [SendTransactionParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`ExtractChainFormatterReturnType`](https://viem.sh/docs/index.html)\<`TChain`, `"transactionReceipt"`, [`TransactionReceipt`](https://viem.sh/docs/index.html)\>\> + +The transaction receipt. [SendTransactionReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const receipt = await client.sendTransactionSync({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 1000000000000000000n, +}) +``` + +```ts +// 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: http(), +}) +const receipt = await client.sendTransactionSync({ + to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', + value: 1000000000000000000n, +}) +``` + +#### Inherited from + +`ViemWalletClient.sendTransactionSync` + +*** + +### showCallsStatus() + +> **showCallsStatus**: (`parameters`) => `Promise`\<`void`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:557 + +Requests for the wallet to show information about a call batch +that was sent via `sendCalls`. + +- Docs: https://viem.sh/docs/actions/wallet/showCallsStatus +- JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `parameters` | [`ShowCallsStatusParameters`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`void`\> + +Displays status of the calls in wallet. [ShowCallsStatusReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +await client.showCallsStatus({ id: '0xdeadbeef' }) +``` + +#### Inherited from + +`ViemWalletClient.showCallsStatus` + +*** + +### signAuthorization() + +> **signAuthorization**: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:600 + +Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. + +With the calculated signature, you can: +- use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, +- use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `parameters` | [`SignAuthorizationParameters`](https://viem.sh/docs/index.html)\<`TAccount`\> | [SignAuthorizationParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> + +The signed Authorization object. [SignAuthorizationReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, http } from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: http(), +}) + +const signature = await client.signAuthorization({ + account: privateKeyToAccount('0x..'), + contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +```ts +// 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: http(), +}) + +const signature = await client.signAuthorization({ + contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', +}) +``` + +#### Inherited from + +`ViemWalletClient.signAuthorization` + +*** + +### signMessage() + +> **signMessage**: (`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:644 + +Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. + +- Docs: https://viem.sh/docs/actions/wallet/signMessage +- JSON-RPC Methods: + - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) + - Local Accounts: Signs locally. No JSON-RPC request. + +With the calculated signature, you can: +- use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, +- use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SignMessageParameters`](https://viem.sh/docs/index.html)\<`TAccount`\> | [SignMessageParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The signed message. [SignMessageReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const signature = await client.signMessage({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + message: 'hello world', +}) +``` + +```ts +// 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: http(), +}) +const signature = await client.signMessage({ + message: 'hello world', +}) +``` + +#### Inherited from + +`ViemWalletClient.signMessage` + +*** + +### signTransaction() + +> **signTransaction**: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:688 + +Signs a transaction. + +- Docs: https://viem.sh/docs/actions/wallet/signTransaction +- JSON-RPC Methods: + - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) + - Local Accounts: Signs locally. No JSON-RPC request. + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | - | +| `request` *extends* [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: `undefined`; `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"legacy"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `bigint`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `undefined`; `maxPriorityFeePerGas?`: `undefined`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip2930"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip1559"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs?`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: `undefined`; `blobs`: readonly `` `0x${string}` ``[] \| readonly `Uint8Array`[]; `blobVersionedHashes?`: readonly `` `0x${string}` ``[]; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: [`Kzg`](https://viem.sh/docs/index.html); `maxFeePerBlobGas?`: `bigint`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: readonly [`BlobSidecar`](https://viem.sh/docs/index.html)\<`` `0x${string}` ``\>[]; `to`: `` `0x${string}` `` \| `null`; `type?`: `"eip4844"`; `value?`: `bigint`; \}, `"from"`\> \| [`Omit`](https://viem.sh/docs/index.html)\<\{ `accessList?`: [`AccessList`](https://viem.sh/docs/index.html); `authorizationList?`: [`AuthorizationList`](https://viem.sh/docs/index.html)\<`number`, `boolean`\>; `blobs?`: `undefined`; `blobVersionedHashes?`: `undefined`; `data?`: `` `0x${string}` ``; `from?`: `` `0x${string}` ``; `gas?`: `bigint`; `gasPrice?`: `undefined`; `kzg?`: `undefined`; `maxFeePerBlobGas?`: `undefined`; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `nonce?`: `number`; `sidecars?`: `undefined`; `to?`: `` `0x${string}` `` \| `null`; `type?`: `"eip7702"`; `value?`: `bigint`; \}, `"from"`\> | [`UnionOmit`](https://viem.sh/docs/index.html)\<[`ExtractChainFormatterParameters`](https://viem.sh/docs/index.html)\<[`DeriveChain`](https://viem.sh/docs/index.html)\<`TChain`, `chainOverride`\>, `"transactionRequest"`, [`TransactionRequest`](https://viem.sh/docs/index.html)\>, `"from"`\> | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SignTransactionParameters`](https://viem.sh/docs/index.html)\<`TChain`, `TAccount`, `chainOverride`, `request`\> | [SignTransactionParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> + +The signed message. [SignTransactionReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +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, +}) +const signature = await client.signTransaction(request) +``` + +```ts +// 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, +}) +const signature = await client.signTransaction(request) +``` + +#### Inherited from + +`ViemWalletClient.signTransaction` + +*** + +### signTypedData() + +> **signTypedData**: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:785 + +Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. + +- Docs: https://viem.sh/docs/actions/wallet/signTypedData +- JSON-RPC Methods: + - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) + - Local Accounts: Signs locally. No JSON-RPC request. + +#### Type Parameters + +| Type Parameter | +| ------ | +| `typedData` *extends* \{\[`key`: `string`\]: readonly `TypedDataParameter`[]; \[`key`: `` `string[${string}]` ``\]: `undefined`; \[`key`: `` `function[${string}]` ``\]: `undefined`; \[`key`: `` `address[${string}]` ``\]: `undefined`; \[`key`: `` `bool[${string}]` ``\]: `undefined`; \[`key`: `` `bytes[${string}]` ``\]: `undefined`; \[`key`: `` `bytes10[${string}]` ``\]: `undefined`; \[`key`: `` `bytes1[${string}]` ``\]: `undefined`; \[`key`: `` `bytes2[${string}]` ``\]: `undefined`; \[`key`: `` `bytes3[${string}]` ``\]: `undefined`; \[`key`: `` `bytes4[${string}]` ``\]: `undefined`; \[`key`: `` `bytes5[${string}]` ``\]: `undefined`; \[`key`: `` `bytes6[${string}]` ``\]: `undefined`; \[`key`: `` `bytes7[${string}]` ``\]: `undefined`; \[`key`: `` `bytes8[${string}]` ``\]: `undefined`; \[`key`: `` `bytes9[${string}]` ``\]: `undefined`; \[`key`: `` `bytes11[${string}]` ``\]: `undefined`; \[`key`: `` `bytes12[${string}]` ``\]: `undefined`; \[`key`: `` `bytes13[${string}]` ``\]: `undefined`; \[`key`: `` `bytes14[${string}]` ``\]: `undefined`; \[`key`: `` `bytes15[${string}]` ``\]: `undefined`; \[`key`: `` `bytes16[${string}]` ``\]: `undefined`; \[`key`: `` `bytes17[${string}]` ``\]: `undefined`; \[`key`: `` `bytes18[${string}]` ``\]: `undefined`; \[`key`: `` `bytes19[${string}]` ``\]: `undefined`; \[`key`: `` `bytes20[${string}]` ``\]: `undefined`; \[`key`: `` `bytes21[${string}]` ``\]: `undefined`; \[`key`: `` `bytes22[${string}]` ``\]: `undefined`; \[`key`: `` `bytes23[${string}]` ``\]: `undefined`; \[`key`: `` `bytes24[${string}]` ``\]: `undefined`; \[`key`: `` `bytes25[${string}]` ``\]: `undefined`; \[`key`: `` `bytes26[${string}]` ``\]: `undefined`; \[`key`: `` `bytes27[${string}]` ``\]: `undefined`; \[`key`: `` `bytes28[${string}]` ``\]: `undefined`; \[`key`: `` `bytes29[${string}]` ``\]: `undefined`; \[`key`: `` `bytes30[${string}]` ``\]: `undefined`; \[`key`: `` `bytes31[${string}]` ``\]: `undefined`; \[`key`: `` `bytes32[${string}]` ``\]: `undefined`; \[`key`: `` `int[${string}]` ``\]: `undefined`; \[`key`: `` `int8[${string}]` ``\]: `undefined`; \[`key`: `` `int16[${string}]` ``\]: `undefined`; \[`key`: `` `int24[${string}]` ``\]: `undefined`; \[`key`: `` `int32[${string}]` ``\]: `undefined`; \[`key`: `` `int40[${string}]` ``\]: `undefined`; \[`key`: `` `int48[${string}]` ``\]: `undefined`; \[`key`: `` `int56[${string}]` ``\]: `undefined`; \[`key`: `` `int64[${string}]` ``\]: `undefined`; \[`key`: `` `int72[${string}]` ``\]: `undefined`; \[`key`: `` `int80[${string}]` ``\]: `undefined`; \[`key`: `` `int88[${string}]` ``\]: `undefined`; \[`key`: `` `int96[${string}]` ``\]: `undefined`; \[`key`: `` `int104[${string}]` ``\]: `undefined`; \[`key`: `` `int112[${string}]` ``\]: `undefined`; \[`key`: `` `int120[${string}]` ``\]: `undefined`; \[`key`: `` `int128[${string}]` ``\]: `undefined`; \[`key`: `` `int136[${string}]` ``\]: `undefined`; \[`key`: `` `int144[${string}]` ``\]: `undefined`; \[`key`: `` `int152[${string}]` ``\]: `undefined`; \[`key`: `` `int160[${string}]` ``\]: `undefined`; \[`key`: `` `int168[${string}]` ``\]: `undefined`; \[`key`: `` `int176[${string}]` ``\]: `undefined`; \[`key`: `` `int184[${string}]` ``\]: `undefined`; \[`key`: `` `int192[${string}]` ``\]: `undefined`; \[`key`: `` `int200[${string}]` ``\]: `undefined`; \[`key`: `` `int208[${string}]` ``\]: `undefined`; \[`key`: `` `int216[${string}]` ``\]: `undefined`; \[`key`: `` `int224[${string}]` ``\]: `undefined`; \[`key`: `` `int232[${string}]` ``\]: `undefined`; \[`key`: `` `int240[${string}]` ``\]: `undefined`; \[`key`: `` `int248[${string}]` ``\]: `undefined`; \[`key`: `` `int256[${string}]` ``\]: `undefined`; \[`key`: `` `uint[${string}]` ``\]: `undefined`; \[`key`: `` `uint8[${string}]` ``\]: `undefined`; \[`key`: `` `uint16[${string}]` ``\]: `undefined`; \[`key`: `` `uint24[${string}]` ``\]: `undefined`; \[`key`: `` `uint32[${string}]` ``\]: `undefined`; \[`key`: `` `uint40[${string}]` ``\]: `undefined`; \[`key`: `` `uint48[${string}]` ``\]: `undefined`; \[`key`: `` `uint56[${string}]` ``\]: `undefined`; \[`key`: `` `uint64[${string}]` ``\]: `undefined`; \[`key`: `` `uint72[${string}]` ``\]: `undefined`; \[`key`: `` `uint80[${string}]` ``\]: `undefined`; \[`key`: `` `uint88[${string}]` ``\]: `undefined`; \[`key`: `` `uint96[${string}]` ``\]: `undefined`; \[`key`: `` `uint104[${string}]` ``\]: `undefined`; \[`key`: `` `uint112[${string}]` ``\]: `undefined`; \[`key`: `` `uint120[${string}]` ``\]: `undefined`; \[`key`: `` `uint128[${string}]` ``\]: `undefined`; \[`key`: `` `uint136[${string}]` ``\]: `undefined`; \[`key`: `` `uint144[${string}]` ``\]: `undefined`; \[`key`: `` `uint152[${string}]` ``\]: `undefined`; \[`key`: `` `uint160[${string}]` ``\]: `undefined`; \[`key`: `` `uint168[${string}]` ``\]: `undefined`; \[`key`: `` `uint176[${string}]` ``\]: `undefined`; \[`key`: `` `uint184[${string}]` ``\]: `undefined`; \[`key`: `` `uint192[${string}]` ``\]: `undefined`; \[`key`: `` `uint200[${string}]` ``\]: `undefined`; \[`key`: `` `uint208[${string}]` ``\]: `undefined`; \[`key`: `` `uint216[${string}]` ``\]: `undefined`; \[`key`: `` `uint224[${string}]` ``\]: `undefined`; \[`key`: `` `uint232[${string}]` ``\]: `undefined`; \[`key`: `` `uint240[${string}]` ``\]: `undefined`; \[`key`: `` `uint248[${string}]` ``\]: `undefined`; \[`key`: `` `uint256[${string}]` ``\]: `undefined`; `address?`: `undefined`; `bool?`: `undefined`; `bytes?`: `undefined`; `bytes1?`: `undefined`; `bytes10?`: `undefined`; `bytes11?`: `undefined`; `bytes12?`: `undefined`; `bytes13?`: `undefined`; `bytes14?`: `undefined`; `bytes15?`: `undefined`; `bytes16?`: `undefined`; `bytes17?`: `undefined`; `bytes18?`: `undefined`; `bytes19?`: `undefined`; `bytes2?`: `undefined`; `bytes20?`: `undefined`; `bytes21?`: `undefined`; `bytes22?`: `undefined`; `bytes23?`: `undefined`; `bytes24?`: `undefined`; `bytes25?`: `undefined`; `bytes26?`: `undefined`; `bytes27?`: `undefined`; `bytes28?`: `undefined`; `bytes29?`: `undefined`; `bytes3?`: `undefined`; `bytes30?`: `undefined`; `bytes31?`: `undefined`; `bytes32?`: `undefined`; `bytes4?`: `undefined`; `bytes5?`: `undefined`; `bytes6?`: `undefined`; `bytes7?`: `undefined`; `bytes8?`: `undefined`; `bytes9?`: `undefined`; `int104?`: `undefined`; `int112?`: `undefined`; `int120?`: `undefined`; `int128?`: `undefined`; `int136?`: `undefined`; `int144?`: `undefined`; `int152?`: `undefined`; `int16?`: `undefined`; `int160?`: `undefined`; `int168?`: `undefined`; `int176?`: `undefined`; `int184?`: `undefined`; `int192?`: `undefined`; `int200?`: `undefined`; `int208?`: `undefined`; `int216?`: `undefined`; `int224?`: `undefined`; `int232?`: `undefined`; `int24?`: `undefined`; `int240?`: `undefined`; `int248?`: `undefined`; `int256?`: `undefined`; `int32?`: `undefined`; `int40?`: `undefined`; `int48?`: `undefined`; `int56?`: `undefined`; `int64?`: `undefined`; `int72?`: `undefined`; `int8?`: `undefined`; `int80?`: `undefined`; `int88?`: `undefined`; `int96?`: `undefined`; `string?`: `undefined`; `uint104?`: `undefined`; `uint112?`: `undefined`; `uint120?`: `undefined`; `uint128?`: `undefined`; `uint136?`: `undefined`; `uint144?`: `undefined`; `uint152?`: `undefined`; `uint16?`: `undefined`; `uint160?`: `undefined`; `uint168?`: `undefined`; `uint176?`: `undefined`; `uint184?`: `undefined`; `uint192?`: `undefined`; `uint200?`: `undefined`; `uint208?`: `undefined`; `uint216?`: `undefined`; `uint224?`: `undefined`; `uint232?`: `undefined`; `uint24?`: `undefined`; `uint240?`: `undefined`; `uint248?`: `undefined`; `uint256?`: `undefined`; `uint32?`: `undefined`; `uint40?`: `undefined`; `uint48?`: `undefined`; `uint56?`: `undefined`; `uint64?`: `undefined`; `uint72?`: `undefined`; `uint8?`: `undefined`; `uint80?`: `undefined`; `uint88?`: `undefined`; `uint96?`: `undefined`; \} \| \{\[`key`: `string`\]: `unknown`; \} | +| `primaryType` *extends* `string` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SignTypedDataParameters`](https://viem.sh/docs/index.html)\<`typedData`, `primaryType`, `TAccount`\> | [SignTypedDataParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +The signed data. [SignTypedDataReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const signature = await client.signTypedData({ + account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', + domain: { + name: 'Ether Mail', + version: '1', + chainId: 1, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + types: { + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, +}) +``` + +```ts +// 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: http(), +}) +const signature = await client.signTypedData({ + domain: { + name: 'Ether Mail', + version: '1', + chainId: 1, + verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', + }, + types: { + Person: [ + { name: 'name', type: 'string' }, + { name: 'wallet', type: 'address' }, + ], + Mail: [ + { name: 'from', type: 'Person' }, + { name: 'to', type: 'Person' }, + { name: 'contents', type: 'string' }, + ], + }, + primaryType: 'Mail', + message: { + from: { + name: 'Cow', + wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', + }, + to: { + name: 'Bob', + wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', + }, + contents: 'Hello, Bob!', + }, +}) +``` + +#### Inherited from + +`ViemWalletClient.signTypedData` + +*** + +### switchChain() + +> **switchChain**: (`args`) => `Promise`\<`void`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:806 + +Switch the target chain in a wallet. + +- Docs: https://viem.sh/docs/actions/wallet/switchChain +- JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`SwitchChainParameters`](https://viem.sh/docs/index.html) | [SwitchChainParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`void`\> + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet, optimism } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +await client.switchChain({ id: optimism.id }) +``` + +#### Inherited from + +`ViemWalletClient.switchChain` + +*** + +### transport + +> **transport**: `ReturnType`\<`TTransport`\>\[`"config"`\] & `ReturnType`\<`TTransport`\>\[`"value"`\] + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:93 + +The RPC transport + +#### Inherited from + +`ViemWalletClient.transport` + +*** + +### type + +> **type**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:95 + +The type of client. + +#### Inherited from + +`ViemWalletClient.type` + +*** + +### uid + +> **uid**: `string` + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/createClient.d.ts:97 + +A unique ID for the client. + +#### Inherited from + +`ViemWalletClient.uid` + +*** + +### waitForCallsStatus() + +> **waitForCallsStatus**: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:828 + +Waits for the status & receipts of a call bundle that was sent via `sendCalls`. + +- Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus +- JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `parameters` | [`WaitForCallsStatusParameters`](https://viem.sh/docs/index.html) | [WaitForCallsStatusParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"pending"` \| `"success"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> + +Status & receipts of the call bundle. [WaitForCallsStatusReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) + +const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' }) +``` + +#### Inherited from + +`ViemWalletClient.waitForCallsStatus` + +*** + +### watchAsset() + +> **watchAsset**: (`args`) => `Promise`\<`boolean`\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:855 + +Adds an EVM chain to the wallet. + +- Docs: https://viem.sh/docs/actions/wallet/watchAsset +- JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WatchAssetParams`](https://viem.sh/docs/index.html) | [WatchAssetParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +Boolean indicating if the token was successfully added. [WatchAssetReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const success = await client.watchAsset({ + type: 'ERC20', + options: { + address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', + decimals: 18, + symbol: 'WETH', + }, +}) +``` + +#### Inherited from + +`ViemWalletClient.watchAsset` + +*** + +### writeContract() + +> **writeContract**: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:903 + +Executes a write function on a contract. + +- Docs: https://viem.sh/docs/contract/writeContract +- Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts + +A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. + +Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). + +__Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `functionName` *extends* `string` | - | +| `args` *extends* `unknown` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WriteContractParameters`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, `TChain`, `TAccount`, `chainOverride`\> | [WriteContractParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). [WriteContractReturnType](https://viem.sh/docs/index.html) + +#### Examples + +```ts +import { createWalletClient, custom, parseAbi } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const hash = await client.writeContract({ + address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', + abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), + functionName: 'mint', + args: [69420], +}) +``` + +```ts +// With Validation +import { createWalletClient, custom, parseAbi } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const { request } = await client.simulateContract({ + address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', + abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), + functionName: 'mint', + args: [69420], +} +const hash = await client.writeContract(request) +``` + +#### Inherited from + +`ViemWalletClient.writeContract` + +*** + +### writeContractSync() + +> **writeContractSync**: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +Defined in: node\_modules/.pnpm/viem@2.43.3\_typescript@5.7.2\_zod@3.25.76/node\_modules/viem/\_types/clients/decorators/wallet.d.ts:934 + +Executes a write function on a contract synchronously. +Returns the transaction receipt. + +- Docs: https://viem.sh/docs/contract/writeContract + +A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. + +Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). + +__Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ + +#### Type Parameters + +| Type Parameter | Default type | +| ------ | ------ | +| `abi` *extends* `Abi` \| readonly `unknown`[] | - | +| `functionName` *extends* `string` | - | +| `args` *extends* `unknown` | - | +| `chainOverride` *extends* [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | `undefined` | + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `args` | [`WriteContractSyncParameters`](https://viem.sh/docs/index.html)\<`abi`, `functionName`, `args`, `TChain`, `TAccount`, `chainOverride`\> | [WriteContractSyncParameters](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> + +A [Transaction Receipt](https://viem.sh/docs/glossary/terms#receipt). [WriteContractSyncReturnType](https://viem.sh/docs/index.html) + +#### Example + +```ts +import { createWalletClient, custom, parseAbi } from 'viem' +import { mainnet } from 'viem/chains' + +const client = createWalletClient({ + chain: mainnet, + transport: custom(window.ethereum), +}) +const receipt = await client.writeContractSync({ + address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', + abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), + functionName: 'mint', + args: [69420], +}) +``` + +#### Inherited from + +`ViemWalletClient.writeContractSync` diff --git a/0.16.23/api/@aastar/core/type-aliases/AccountActions.md b/0.16.23/api/@aastar/core/type-aliases/AccountActions.md new file mode 100644 index 000000000..79f996206 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/AccountActions.md @@ -0,0 +1,135 @@ +> **AccountActions** = `object` + +Defined in: [packages/core/src/actions/account.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L7) + +## Properties + +### addDeposit() + +> **addDeposit**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/account.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### entryPoint() + +> **entryPoint**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/account.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L11) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### execute() + +> **execute**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/account.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `dest`: `Address`; `func`: [`Hex`](https://viem.sh/docs/index.html); `value`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.dest` | `Address` | +| `args.func` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.value` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### executeBatch() + +> **executeBatch**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/account.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `dest`: `Address`[]; `func`: [`Hex`](https://viem.sh/docs/index.html)[]; `value`: `bigint`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.dest` | `Address`[] | +| `args.func` | [`Hex`](https://viem.sh/docs/index.html)[] | +| `args.value` | `bigint`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getDeposit() + +> **getDeposit**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/account.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L14) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getNonce() + +> **getNonce**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/account.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L10) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/account.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L15) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### withdrawDepositTo() + +> **withdrawDepositTo**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/account.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `withdrawAddress`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.withdrawAddress` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> diff --git a/0.16.23/api/@aastar/core/type-aliases/AccountFactoryActions.md b/0.16.23/api/@aastar/core/type-aliases/AccountFactoryActions.md new file mode 100644 index 000000000..edc7fbfe5 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/AccountFactoryActions.md @@ -0,0 +1,45 @@ +> **AccountFactoryActions** = `object` + +Defined in: [packages/core/src/actions/account.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L19) + +## Properties + +### createAccount() + +> **createAccount**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/account.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L20) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `gas?`: `bigint`; `owner`: `Address`; `salt`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.gas?` | `bigint` | +| `args.owner` | `Address` | +| `args.salt` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getAddress() + +> **getAddress**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/account.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/account.ts#L21) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; `salt`: `bigint`; \} | +| `args.owner` | `Address` | +| `args.salt` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/AggregatorActions.md b/0.16.23/api/@aastar/core/type-aliases/AggregatorActions.md new file mode 100644 index 000000000..71dbcb63e --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/AggregatorActions.md @@ -0,0 +1,365 @@ +> **AggregatorActions** = `object` + +Defined in: [packages/core/src/actions/aggregator.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L6) + +## Properties + +### aggregatedSignatures() + +> **aggregatedSignatures**: (`args`) => `Promise`\<\{ `aggregatedSig`: [`Hex`](https://viem.sh/docs/index.html); `messageHash`: [`Hex`](https://viem.sh/docs/index.html); `timestamp`: `bigint`; `verified`: `boolean`; \}\> + +Defined in: [packages/core/src/actions/aggregator.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L24) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; \} | +| `args.index` | `bigint` | + +#### Returns + +`Promise`\<\{ `aggregatedSig`: [`Hex`](https://viem.sh/docs/index.html); `messageHash`: [`Hex`](https://viem.sh/docs/index.html); `timestamp`: `bigint`; `verified`: `boolean`; \}\> + +*** + +### blsPublicKeys() + +> **blsPublicKeys**: (`args`) => `Promise`\<\{ `isActive`: `boolean`; `publicKey`: [`Hex`](https://viem.sh/docs/index.html); \}\> + +Defined in: [packages/core/src/actions/aggregator.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `validator`: `Address`; \} | +| `args.validator` | `Address` | + +#### Returns + +`Promise`\<\{ `isActive`: `boolean`; `publicKey`: [`Hex`](https://viem.sh/docs/index.html); \}\> + +*** + +### defaultThreshold() + +> **defaultThreshold**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/aggregator.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L14) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### DVT\_VALIDATOR() + +> **DVT\_VALIDATOR**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/aggregator.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L29) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### executedProposals() + +> **executedProposals**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/aggregator.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L20) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `proposalId`: `bigint`; \} | +| `args.proposalId` | `bigint` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### executeProposal() + +> **executeProposal**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L18) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `callData`: [`Hex`](https://viem.sh/docs/index.html); `proof`: [`Hex`](https://viem.sh/docs/index.html); `proposalId`: `bigint`; `requiredThreshold`: `bigint`; `target`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.callData` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.proposalId` | `bigint` | +| `args.requiredThreshold` | `bigint` | +| `args.target` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### MAX\_VALIDATORS() + +> **MAX\_VALIDATORS**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/aggregator.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L34) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### minThreshold() + +> **minThreshold**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/aggregator.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L15) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/aggregator.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L37) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### proposalNonces() + +> **proposalNonces**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/aggregator.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L21) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `proposalId`: `bigint`; \} | +| `args.proposalId` | `bigint` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### registerBLSPublicKey() + +> **registerBLSPublicKey**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `publicKey`: [`Hex`](https://viem.sh/docs/index.html); `validator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.publicKey` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.validator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/aggregator.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L31) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L39) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setDefaultThreshold() + +> **setDefaultThreshold**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newThreshold`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newThreshold` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setDVTValidator() + +> **setDVTValidator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `dv`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.dv` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setMinThreshold() + +> **setMinThreshold**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newThreshold`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newThreshold` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setSuperPaymaster() + +> **setSuperPaymaster**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L28) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `paymaster`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.paymaster` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### SUPERPAYMASTER() + +> **SUPERPAYMASTER**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/aggregator.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L30) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L38) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### verifyAndExecute() + +> **verifyAndExecute**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/aggregator.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L19) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `epoch`: `bigint`; `newScores`: `bigint`[]; `operator`: `Address`; `proof`: [`Hex`](https://viem.sh/docs/index.html); `proposalId`: `bigint`; `repUsers`: `Address`[]; `slashLevel`: `number`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.epoch` | `bigint` | +| `args.newScores` | `bigint`[] | +| `args.operator` | `Address` | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.proposalId` | `bigint` | +| `args.repUsers` | `Address`[] | +| `args.slashLevel` | `number` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/aggregator.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/aggregator.ts#L42) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/BusinessResult.md b/0.16.23/api/@aastar/core/type-aliases/BusinessResult.md new file mode 100644 index 000000000..9eb56692a --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/BusinessResult.md @@ -0,0 +1,12 @@ +> **BusinessResult**\<`T`\> = `Promise`\<`T`\> + +Defined in: [packages/core/src/clients/types.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/clients/types.ts#L70) + +Generic result wrapper for business operations +Currently just returns the type directly, but can be expanded for metadata. + +## Type Parameters + +| Type Parameter | +| ------ | +| `T` | diff --git a/0.16.23/api/@aastar/core/type-aliases/ContractCategory.md b/0.16.23/api/@aastar/core/type-aliases/ContractCategory.md new file mode 100644 index 000000000..ed8b0f875 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ContractCategory.md @@ -0,0 +1,5 @@ +> **ContractCategory** = `"core"` \| `"tokens"` \| `"testTokens"` \| `"testAccounts"` \| `"paymaster"` \| `"monitoring"` \| `"official"` \| `"communities"` + +Defined in: [packages/core/src/contracts.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L25) + +Contract category types diff --git a/0.16.23/api/@aastar/core/type-aliases/ContractNetwork.md b/0.16.23/api/@aastar/core/type-aliases/ContractNetwork.md new file mode 100644 index 000000000..d00d24f44 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ContractNetwork.md @@ -0,0 +1,5 @@ +> **ContractNetwork** = keyof *typeof* [`CONTRACTS`](../variables/CONTRACTS.md) + +Defined in: [packages/core/src/contracts.ts:111](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L111) + +Supported network types for contracts diff --git a/0.16.23/api/@aastar/core/type-aliases/DVTActions.md b/0.16.23/api/@aastar/core/type-aliases/DVTActions.md new file mode 100644 index 000000000..278101838 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/DVTActions.md @@ -0,0 +1,267 @@ +> **DVTActions** = `object` + +Defined in: [packages/core/src/actions/dvt.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L6) + +## Properties + +### addValidator() + +> **addValidator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L17) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `v`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.v` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### BLS\_AGGREGATOR() + +> **BLS\_AGGREGATOR**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/dvt.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L21) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### createSlashProposal() + +> **createSlashProposal**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `level`: `number`; `operator`: `Address`; `reason`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.level` | `number` | +| `args.operator` | `Address` | +| `args.reason` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### executeSlashWithProof() + +> **executeSlashWithProof**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L10) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `epoch`: `bigint`; `newScores`: `bigint`[]; `proof`: [`Hex`](https://viem.sh/docs/index.html); `proposalId`: `bigint`; `repUsers`: `Address`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.epoch` | `bigint` | +| `args.newScores` | `bigint`[] | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.proposalId` | `bigint` | +| `args.repUsers` | `Address`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### isValidator() + +> **isValidator**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/dvt.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L16) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### markProposalExecuted() + +> **markProposalExecuted**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L11) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `id`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.id` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### nextProposalId() + +> **nextProposalId**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/dvt.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L13) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/dvt.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L25) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### proposals() + +> **proposals**: (`args`) => `Promise`\<\{ `executed`: `boolean`; `operator`: `Address`; `reason`: `string`; `slashLevel`: `number`; \}\> + +Defined in: [packages/core/src/actions/dvt.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `proposalId`: `bigint`; \} | +| `args.proposalId` | `bigint` | + +#### Returns + +`Promise`\<\{ `executed`: `boolean`; `operator`: `Address`; `reason`: `string`; `slashLevel`: `number`; \}\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/dvt.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L22) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setBLSAggregator() + +> **setBLSAggregator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L20) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `aggregator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.aggregator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### signSlashProposal() + +> **signSlashProposal**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `proposalId`: `bigint`; `signature`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.proposalId` | `bigint` | +| `args.signature` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/dvt.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/dvt.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/dvt.ts#L30) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/ERC20Actions.md b/0.16.23/api/@aastar/core/type-aliases/ERC20Actions.md new file mode 100644 index 000000000..cccbb123a --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ERC20Actions.md @@ -0,0 +1,187 @@ +> **ERC20Actions** = `object` + +Defined in: [packages/core/src/actions/tokens.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L7) + +## Properties + +### allowance() + +> **allowance**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/tokens.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; `spender`: `Address`; `token`: `Address`; \} | +| `args.owner` | `Address` | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### approve() + +> **approve**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/tokens.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `spender`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### balanceOf() + +> **balanceOf**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/tokens.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account`: `Address`; `token`: `Address`; \} | +| `args.account` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### decimals() + +> **decimals**: (`args`) => `Promise`\<`number`\> + +Defined in: [packages/core/src/actions/tokens.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L16) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`number`\> + +*** + +### name() + +> **name**: (`args`) => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/tokens.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> + +*** + +### symbol() + +> **symbol**: (`args`) => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/tokens.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L15) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> + +*** + +### totalSupply() + +> **totalSupply**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/tokens.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### transfer() + +> **transfer**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/tokens.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L10) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### transferFrom() + +> **transferFrom**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/tokens.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L11) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `from`: `Address`; `to`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.from` | `Address` | +| `args.to` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> diff --git a/0.16.23/api/@aastar/core/type-aliases/EntryPointActions.md b/0.16.23/api/@aastar/core/type-aliases/EntryPointActions.md new file mode 100644 index 000000000..bb580e67b --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/EntryPointActions.md @@ -0,0 +1,90 @@ +> **EntryPointActions** = `object` + +Defined in: [packages/core/src/actions/entryPoint.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L11) + +## Properties + +### balanceOf() + +> **balanceOf**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/entryPoint.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L12) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account`: `Address`; \} | +| `args.account` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### depositTo() + +> **depositTo**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/entryPoint.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account`: `Address`; `amount`: `bigint`; `txAccount?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account` | `Address` | +| `args.amount` | `bigint` | +| `args.txAccount?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### entryPointAddress + +> **entryPointAddress**: `Address` + +Defined in: [packages/core/src/actions/entryPoint.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L16) + +*** + +### getDepositInfo() + +> **getDepositInfo**: (`args`) => `Promise`\<\{ `deposit`: `bigint`; `stake`: `bigint`; `staked`: `boolean`; `unstakeDelaySec`: `number`; `withdrawTime`: `number`; \}\> + +Defined in: [packages/core/src/actions/entryPoint.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L15) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account`: `Address`; \} | +| `args.account` | `Address` | + +#### Returns + +`Promise`\<\{ `deposit`: `bigint`; `stake`: `bigint`; `staked`: `boolean`; `unstakeDelaySec`: `number`; `withdrawTime`: `number`; \}\> + +*** + +### getNonce() + +> **getNonce**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/entryPoint.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/entryPoint.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `key`: `bigint`; `sender`: `Address`; \} | +| `args.key` | `bigint` | +| `args.sender` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/FaucetConfig.md b/0.16.23/api/@aastar/core/type-aliases/FaucetConfig.md new file mode 100644 index 000000000..98567973c --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/FaucetConfig.md @@ -0,0 +1,51 @@ +> **FaucetConfig** = `object` + +Defined in: [packages/core/src/actions/faucet.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L24) + +## Properties + +### ethAmount? + +> `optional` **ethAmount**: `bigint` + +Defined in: [packages/core/src/actions/faucet.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L29) + +*** + +### paymasterV4? + +> `optional` **paymasterV4**: `Address` + +Defined in: [packages/core/src/actions/faucet.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L28) + +*** + +### registry + +> **registry**: `Address` + +Defined in: [packages/core/src/actions/faucet.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L27) + +*** + +### targetAA + +> **targetAA**: `Address` + +Defined in: [packages/core/src/actions/faucet.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L25) + +*** + +### token + +> **token**: `Address` + +Defined in: [packages/core/src/actions/faucet.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L26) + +*** + +### tokenAmount? + +> `optional` **tokenAmount**: `bigint` + +Defined in: [packages/core/src/actions/faucet.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L30) diff --git a/0.16.23/api/@aastar/core/type-aliases/FaucetPreparationResult.md b/0.16.23/api/@aastar/core/type-aliases/FaucetPreparationResult.md new file mode 100644 index 000000000..1b8795269 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/FaucetPreparationResult.md @@ -0,0 +1,35 @@ +> **FaucetPreparationResult** = `object` + +Defined in: [packages/core/src/actions/faucet.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L17) + +## Properties + +### ethFunded + +> **ethFunded**: `boolean` + +Defined in: [packages/core/src/actions/faucet.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L18) + +*** + +### paymasterDeposited + +> **paymasterDeposited**: `boolean` + +Defined in: [packages/core/src/actions/faucet.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L21) + +*** + +### roleRegistered + +> **roleRegistered**: `boolean` + +Defined in: [packages/core/src/actions/faucet.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L19) + +*** + +### tokenMinted + +> **tokenMinted**: `boolean` + +Defined in: [packages/core/src/actions/faucet.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/faucet.ts#L20) diff --git a/0.16.23/api/@aastar/core/type-aliases/GTokenActions.md b/0.16.23/api/@aastar/core/type-aliases/GTokenActions.md new file mode 100644 index 000000000..8502ff5a2 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/GTokenActions.md @@ -0,0 +1,151 @@ +> **GTokenActions** = [`ERC20Actions`](ERC20Actions.md) & `object` + +Defined in: [packages/core/src/actions/tokens.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L20) + +## Type Declaration + +### burn() + +> **burn**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### burnFrom() + +> **burnFrom**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `from`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.from` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### cap() + +> **cap**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### mint() + +> **mint**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### owner() + +> **owner**: (`args`) => `Promise`\<`Address`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +### remainingMintableSupply() + +> **remainingMintableSupply**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### version() + +> **version**: (`args`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/NetworkContracts.md b/0.16.23/api/@aastar/core/type-aliases/NetworkContracts.md new file mode 100644 index 000000000..fb7d27fcf --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/NetworkContracts.md @@ -0,0 +1,5 @@ +> **NetworkContracts** = *typeof* [`SEPOLIA_CONTRACTS`](../variables/SEPOLIA_CONTRACTS.md) + +Defined in: [packages/core/src/contracts.ts:116](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L116) + +Contract addresses for a specific network diff --git a/0.16.23/api/@aastar/core/type-aliases/OperatorConfig.md b/0.16.23/api/@aastar/core/type-aliases/OperatorConfig.md new file mode 100644 index 000000000..9fb84dd13 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/OperatorConfig.md @@ -0,0 +1,83 @@ +> **OperatorConfig** = `object` + +Defined in: [packages/core/src/actions/superPaymaster.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L14) + +## Properties + +### aPNTsBalance + +> **aPNTsBalance**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L15) + +*** + +### exchangeRate + +> **exchangeRate**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L16) + +*** + +### isConfigured + +> **isConfigured**: `boolean` + +Defined in: [packages/core/src/actions/superPaymaster.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L17) + +*** + +### isPaused + +> **isPaused**: `boolean` + +Defined in: [packages/core/src/actions/superPaymaster.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L18) + +*** + +### minTxInterval + +> **minTxInterval**: `number` + +Defined in: [packages/core/src/actions/superPaymaster.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L21) + +*** + +### reputation + +> **reputation**: `number` + +Defined in: [packages/core/src/actions/superPaymaster.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L20) + +*** + +### totalSpent + +> **totalSpent**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L23) + +*** + +### totalTxSponsored + +> **totalTxSponsored**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L24) + +*** + +### treasury + +> **treasury**: `Address` + +Defined in: [packages/core/src/actions/superPaymaster.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L22) + +*** + +### xPNTsToken + +> **xPNTsToken**: `Address` + +Defined in: [packages/core/src/actions/superPaymaster.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L19) diff --git a/0.16.23/api/@aastar/core/type-aliases/PaymasterActions.md b/0.16.23/api/@aastar/core/type-aliases/PaymasterActions.md new file mode 100644 index 000000000..2b1a81235 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/PaymasterActions.md @@ -0,0 +1,781 @@ +> **PaymasterActions** = `object` + +Defined in: [packages/core/src/actions/paymaster.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L6) + +## Properties + +### addDeposit() + +> **addDeposit**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L62) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `value?`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.value?` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### addStake() + +> **addStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:64](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L64) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `unstakeDelaySec`: `number`; `value?`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.unstakeDelaySec` | `number` | +| `args.value?` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### balances() + +> **balances**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L10) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; `user`: `Address`; \} | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### cachedPrice() + +> **cachedPrice**: () => `Promise`\<\{ `price`: `bigint`; `updatedAt`: `number`; \}\> + +Defined in: [packages/core/src/actions/paymaster.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L34) + +#### Returns + +`Promise`\<\{ `price`: `bigint`; `updatedAt`: `number`; \}\> + +*** + +### calculateCost() + +> **calculateCost**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L37) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `gasCost`: `bigint`; `token`: `Address`; `useRealtime`: `boolean`; \} | +| `args.gasCost` | `bigint` | +| `args.token` | `Address` | +| `args.useRealtime` | `boolean` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### deactivateFromRegistry() + +> **deactivateFromRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L42) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### depositFor() + +> **depositFor**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `token`: `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### entryPoint() + +> **entryPoint**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/paymaster.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L69) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### ethUsdPriceFeed() + +> **ethUsdPriceFeed**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/paymaster.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L46) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getRealtimeTokenCost() + +> **getRealtimeTokenCost**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L36) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `gasCost`: `bigint`; `token`: `Address`; \} | +| `args.gasCost` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### initialize() + +> **initialize**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L22) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `_entryPoint`: `Address`; `_ethUsdPriceFeed`: `Address`; `_maxGasCostCap`: `bigint`; `_owner`: `Address`; `_priceStalenessThreshold`: `bigint`; `_serviceFeeRate`: `bigint`; `_treasury`: `Address`; `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args._entryPoint` | `Address` | +| `args._ethUsdPriceFeed` | `Address` | +| `args._maxGasCostCap` | `bigint` | +| `args._owner` | `Address` | +| `args._priceStalenessThreshold` | `bigint` | +| `args._serviceFeeRate` | `bigint` | +| `args._treasury` | `Address` | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### isActiveInRegistry() + +> **isActiveInRegistry**: () => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/paymaster.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L40) + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### isRegistrySet() + +> **isRegistrySet**: () => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/paymaster.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L41) + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### MAX\_ETH\_USD\_PRICE() + +> **MAX\_ETH\_USD\_PRICE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L55) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MAX\_GAS\_TOKENS() + +> **MAX\_GAS\_TOKENS**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L57) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MAX\_SBTS() + +> **MAX\_SBTS**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L58) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MAX\_SERVICE\_FEE() + +> **MAX\_SERVICE\_FEE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L59) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### maxGasCostCap() + +> **maxGasCostCap**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L48) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MIN\_ETH\_USD\_PRICE() + +> **MIN\_ETH\_USD\_PRICE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:56](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L56) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### oracleDecimals() + +> **oracleDecimals**: () => `Promise`\<`number`\> + +Defined in: [packages/core/src/actions/paymaster.ts:51](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L51) + +#### Returns + +`Promise`\<`number`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/paymaster.ts:72](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L72) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### pause() + +> **pause**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### paused() + +> **paused**: () => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/paymaster.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L31) + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### postOp() + +> **postOp**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L19) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `actualGasCost`: `bigint`; `actualUserOpFeePerGas`: `bigint`; `context`: [`Hex`](https://viem.sh/docs/index.html); `mode`: `number`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.actualGasCost` | `bigint` | +| `args.actualUserOpFeePerGas` | `bigint` | +| `args.context` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.mode` | `number` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### priceStalenessThreshold() + +> **priceStalenessThreshold**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L49) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### registry() + +> **registry**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/paymaster.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L43) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L74) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### serviceFeeRate() + +> **serviceFeeRate**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L47) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### setCachedPrice() + +> **setCachedPrice**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `price`: `bigint`; `timestamp`: `number`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.price` | `bigint` | +| `args.timestamp` | `number` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setMaxGasCostCap() + +> **setMaxGasCostCap**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L25) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `_maxGasCostCap`: `bigint`; `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args._maxGasCostCap` | `bigint` | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setPriceStalenessThreshold() + +> **setPriceStalenessThreshold**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `_priceStalenessThreshold`: `bigint`; `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args._priceStalenessThreshold` | `bigint` | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setServiceFeeRate() + +> **setServiceFeeRate**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L24) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `_serviceFeeRate`: `bigint`; `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args._serviceFeeRate` | `bigint` | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setTokenPrice() + +> **setTokenPrice**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L13) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `price`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.price` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setTreasury() + +> **setTreasury**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L23) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `treasury`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.treasury` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### tokenDecimals() + +> **tokenDecimals**: (`args`) => `Promise`\<`number`\> + +Defined in: [packages/core/src/actions/paymaster.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L52) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`number`\> + +*** + +### tokenPrices() + +> **tokenPrices**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/paymaster.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L15) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L73) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### treasury() + +> **treasury**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/paymaster.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L50) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### unlockStake() + +> **unlockStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L65) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### unpause() + +> **unpause**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updatePrice() + +> **updatePrice**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L35) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### validatePaymasterUserOp() + +> **validatePaymasterUserOp**: (`args`) => `Promise`\<\{ `context`: [`Hex`](https://viem.sh/docs/index.html); `validationData`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/paymaster.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L18) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `maxCost`: `bigint`; `userOp`: `any`; `userOpHash`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.maxCost` | `bigint` | +| `args.userOp` | `any` | +| `args.userOpHash` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `context`: [`Hex`](https://viem.sh/docs/index.html); `validationData`: `bigint`; \}\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/paymaster.ts:75](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L75) + +#### Returns + +`Promise`\<`string`\> + +*** + +### withdraw() + +> **withdraw**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### withdrawStake() + +> **withdrawStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `to`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.to` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### withdrawTo() + +> **withdrawTo**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/paymaster.ts:63](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/paymaster.ts#L63) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> diff --git a/0.16.23/api/@aastar/core/type-aliases/PaymasterFactoryActions.md b/0.16.23/api/@aastar/core/type-aliases/PaymasterFactoryActions.md new file mode 100644 index 000000000..a11526f13 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/PaymasterFactoryActions.md @@ -0,0 +1,409 @@ +> **PaymasterFactoryActions** = `object` + +Defined in: [packages/core/src/actions/factory.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L48) + +## Properties + +### addImplementation() + +> **addImplementation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:64](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L64) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `impl`: `Address`; `version`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.impl` | `Address` | +| `args.version` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### calculateAddress() + +> **calculateAddress**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L54) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; \} | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### defaultVersion() + +> **defaultVersion**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/factory.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L81) + +#### Returns + +`Promise`\<`string`\> + +*** + +### deployPaymaster() + +> **deployPaymaster**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L50) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `initData?`: [`Hex`](https://viem.sh/docs/index.html); `version?`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.initData?` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.version?` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### deployPaymasterDeterministic() + +> **deployPaymasterDeterministic**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:51](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L51) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `initData`: [`Hex`](https://viem.sh/docs/index.html); `salt`: [`Hex`](https://viem.sh/docs/index.html); `version`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.initData` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.salt` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.version` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### ENTRY\_POINT() + +> **ENTRY\_POINT**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L74) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getAllPaymasters() + +> **getAllPaymasters**: () => `Promise`\<`Address`[]\> + +Defined in: [packages/core/src/actions/factory.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L59) + +#### Returns + +`Promise`\<`Address`[]\> + +*** + +### getImplementation() + +> **getImplementation**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:68](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L68) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `version`: `string`; \} | +| `args.version` | `string` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getImplementationV4() + +> **getImplementationV4**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L69) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getOperatorByPaymaster() + +> **getOperatorByPaymaster**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L57) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `paymaster`: `Address`; \} | +| `args.paymaster` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getPaymaster() + +> **getPaymaster**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L55) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; \} | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getPaymasterByOperator() + +> **getPaymasterByOperator**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:56](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L56) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; \} | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getPaymasterCount() + +> **getPaymasterCount**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/factory.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L58) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### hasPaymaster() + +> **hasPaymaster**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/factory.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L60) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; \} | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### isPaymasterDeployed() + +> **isPaymasterDeployed**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/factory.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L61) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; \} | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L77) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L73) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### setDefaultVersion() + +> **setDefaultVersion**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `version`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.version` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setImplementationV4() + +> **setImplementationV4**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L67) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `impl`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.impl` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRegistry() + +> **setRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L70) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `registry`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.registry` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### totalDeployed() + +> **totalDeployed**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/factory.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L82) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L78) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### upgradeImplementation() + +> **upgradeImplementation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L65) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `impl`: `Address`; `version`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.impl` | `Address` | +| `args.version` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/factory.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L83) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/RegistryActions.md b/0.16.23/api/@aastar/core/type-aliases/RegistryActions.md new file mode 100644 index 000000000..d9b4f1467 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/RegistryActions.md @@ -0,0 +1,1065 @@ +> **RegistryActions** = `object` + +Defined in: [packages/core/src/actions/registry.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L21) + +## Properties + +### accountToUser() + +> **accountToUser**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L74) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account`: `Address`; \} | +| `args.account` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### addLevelThreshold() + +> **addLevelThreshold**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L43) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `threshold`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.threshold` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### adminConfigureRole() + +> **adminConfigureRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L24) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `entryBurn`: `bigint`; `exitFeePercent`: `bigint`; `minExitFee`: `bigint`; `minStake`: `bigint`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.entryBurn` | `bigint` | +| `args.exitFeePercent` | `bigint` | +| `args.minExitFee` | `bigint` | +| `args.minStake` | `bigint` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### batchUpdateGlobalReputation() + +> **batchUpdateGlobalReputation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L44) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `epoch`: `bigint`; `newScores`: `bigint`[]; `proof`: [`Hex`](https://viem.sh/docs/index.html); `proposalId`: `bigint`; `users`: `Address`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.epoch` | `bigint` | +| `args.newScores` | `bigint`[] | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.proposalId` | `bigint` | +| `args.users` | `Address`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### blsAggregator() + +> **blsAggregator**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L55) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### blsValidator() + +> **blsValidator**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L54) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### calculateExitFee() + +> **calculateExitFee**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L73) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `amount`: `bigint`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.amount` | `bigint` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### communityByENS() + +> **communityByENS**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L38) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `ensName`: `string`; \} | +| `args.ensName` | `string` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### communityByName() + +> **communityByName**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L37) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `name`: `string`; \} | +| `args.name` | `string` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### configureRole() + +> **configureRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L23) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `config`: [`RoleConfigDetailed`](RoleConfigDetailed.md); `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.config` | [`RoleConfigDetailed`](RoleConfigDetailed.md) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### createNewRole() + +> **createNewRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L25) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `config`: [`RoleConfigDetailed`](RoleConfigDetailed.md); `roleId`: [`Hex`](https://viem.sh/docs/index.html); `roleOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.config` | [`RoleConfigDetailed`](RoleConfigDetailed.md) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### creditTierConfig() + +> **creditTierConfig**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:71](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L71) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tierIndex`: `bigint`; \} | +| `args.tierIndex` | `bigint` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### exitRole() + +> **exitRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L33) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getCreditLimit() + +> **getCreditLimit**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getRoleConfig() + +> **getRoleConfig**: (`args`) => `Promise`\<[`RoleConfigDetailed`](RoleConfigDetailed.md)\> + +Defined in: [packages/core/src/actions/registry.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`RoleConfigDetailed`](RoleConfigDetailed.md)\> + +*** + +### getRoleMembers() + +> **getRoleMembers**: (`args`) => `Promise`\<`Address`[]\> + +Defined in: [packages/core/src/actions/registry.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`Address`[]\> + +*** + +### getRoleUserCount() + +> **getRoleUserCount**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L65) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getUserRoles() + +> **getUserRoles**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)[]\> + +Defined in: [packages/core/src/actions/registry.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L67) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)[]\> + +*** + +### globalReputation() + +> **globalReputation**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L42) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### grantRole() + +> **grantRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L94) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### GTOKEN\_STAKING() + +> **GTOKEN\_STAKING**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L58) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### hasRole() + +> **hasRole**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/registry.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### isReputationSource() + +> **isReputationSource**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/registry.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L60) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `source`: `Address`; \} | +| `args.source` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### lastReputationEpoch() + +> **lastReputationEpoch**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L61) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### levelThresholds() + +> **levelThresholds**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:72](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L72) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `levelIndex`: `bigint`; \} | +| `args.levelIndex` | `bigint` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MYSBT() + +> **MYSBT**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:56](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L56) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:89](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L89) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### registerRole() + +> **registerRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `data`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.data` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### registerRoleSelf() + +> **registerRoleSelf**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `data`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.data` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:91](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L91) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### reputationSource() + +> **reputationSource**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L59) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### revokeRole() + +> **revokeRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:95](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L95) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_ANODE() + +> **ROLE\_ANODE**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:86](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L86) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_COMMUNITY() + +> **ROLE\_COMMUNITY**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:80](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L80) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_DVT() + +> **ROLE\_DVT**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L84) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_ENDUSER() + +> **ROLE\_ENDUSER**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L81) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_KMS() + +> **ROLE\_KMS**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L85) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_PAYMASTER\_AOA() + +> **ROLE\_PAYMASTER\_AOA**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L83) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### ROLE\_PAYMASTER\_SUPER() + +> **ROLE\_PAYMASTER\_SUPER**: () => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L82) + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### roleConfigs() + +> **roleConfigs**: (`args`) => `Promise`\<[`RoleConfigDetailed`](RoleConfigDetailed.md)\> + +Defined in: [packages/core/src/actions/registry.ts:64](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L64) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`RoleConfigDetailed`](RoleConfigDetailed.md)\> + +*** + +### roleLockDurations() + +> **roleLockDurations**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L77) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### roleMembers() + +> **roleMembers**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:68](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L68) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.index` | `bigint` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### roleMetadata() + +> **roleMetadata**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L34) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### roleOwners() + +> **roleOwners**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:75](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L75) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### roleStakes() + +> **roleStakes**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:76](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L76) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### safeMintForRole() + +> **safeMintForRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L28) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `data`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.data` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setBLSAggregator() + +> **setBLSAggregator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L48) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `aggregator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.aggregator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setBLSValidator() + +> **setBLSValidator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L47) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `validator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.validator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setMySBT() + +> **setMySBT**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L49) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `sbt`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.sbt` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setReputationSource() + +> **setReputationSource**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L52) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `source`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.source` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRoleLockDuration() + +> **setRoleLockDuration**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L31) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `duration`: `bigint`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.duration` | `bigint` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRoleOwner() + +> **setRoleOwner**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L32) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setStaking() + +> **setStaking**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:51](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L51) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `staking`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.staking` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setSuperPaymaster() + +> **setSuperPaymaster**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L50) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `paymaster`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.paymaster` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### SUPER\_PAYMASTER() + +> **SUPER\_PAYMASTER**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/registry.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L57) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:90](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L90) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### userRoleCount() + +> **userRoleCount**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/registry.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L70) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### userRoles() + +> **userRoles**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/registry.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L69) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; `user`: `Address`; \} | +| `args.index` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/registry.ts:98](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L98) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/ReputationActions.md b/0.16.23/api/@aastar/core/type-aliases/ReputationActions.md new file mode 100644 index 000000000..140723519 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ReputationActions.md @@ -0,0 +1,665 @@ +> **ReputationActions** = `object` + +Defined in: [packages/core/src/actions/reputation.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L20) + +## Properties + +### batchSyncToRegistry() + +> **batchSyncToRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L53) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `users`: `Address`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.users` | `Address`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### batchUpdateScores() + +> **batchUpdateScores**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L52) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `scores`: `bigint`[]; `users`: `Address`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.scores` | `bigint`[] | +| `args.users` | `Address`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### boostedCollections() + +> **boostedCollections**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/reputation.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L48) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; \} | +| `args.index` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### calculateReputation() + +> **calculateReputation**: (`args`) => `Promise`\<\{ `communityScore`: `bigint`; `globalScore`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/reputation.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L36) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `timestamp`: `bigint`; `user`: `Address`; \} | +| `args.community` | `Address` | +| `args.timestamp` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<\{ `communityScore`: `bigint`; `globalScore`: `bigint`; \}\> + +*** + +### communityActiveRules() + +> **communityActiveRules**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L31) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `index`: `bigint`; \} | +| `args.community` | `Address` | +| `args.index` | `bigint` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### communityReputations() + +> **communityReputations**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L40) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `user`: `Address`; \} | +| `args.community` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### communityRules() + +> **communityRules**: (`args`) => `Promise`\<[`ReputationRule`](ReputationRule.md)\> + +Defined in: [packages/core/src/actions/reputation.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.community` | `Address` | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`ReputationRule`](ReputationRule.md)\> + +*** + +### computeScore() + +> **computeScore**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L35) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `activities`: `bigint`[][]; `communities`: `Address`[]; `ruleIds`: [`Hex`](https://viem.sh/docs/index.html)[][]; `user`: `Address`; \} | +| `args.activities` | `bigint`[][] | +| `args.communities` | `Address`[] | +| `args.ruleIds` | [`Hex`](https://viem.sh/docs/index.html)[][] | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### defaultRule() + +> **defaultRule**: () => `Promise`\<[`ReputationRule`](ReputationRule.md)\> + +Defined in: [packages/core/src/actions/reputation.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L32) + +#### Returns + +`Promise`\<[`ReputationRule`](ReputationRule.md)\> + +*** + +### disableRule() + +> **disableRule**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L25) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### enableRule() + +> **enableRule**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L24) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### entropyFactors() + +> **entropyFactors**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L49) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getActiveRules() + +> **getActiveRules**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)[]\> + +Defined in: [packages/core/src/actions/reputation.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)[]\> + +*** + +### getCommunityScore() + +> **getCommunityScore**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L39) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getEntropyFactor() + +> **getEntropyFactor**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L67) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getReputationBreakdown() + +> **getReputationBreakdown**: (`args`) => `Promise`\<[`ReputationBreakdown`](ReputationBreakdown.md)\> + +Defined in: [packages/core/src/actions/reputation.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L37) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `timestamp`: `bigint`; `user`: `Address`; \} | +| `args.community` | `Address` | +| `args.timestamp` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`ReputationBreakdown`](ReputationBreakdown.md)\> + +*** + +### getReputationRule() + +> **getReputationRule**: (`args`) => `Promise`\<[`ReputationRule`](ReputationRule.md)\> + +Defined in: [packages/core/src/actions/reputation.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L23) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`ReputationRule`](ReputationRule.md)\> + +*** + +### getRuleCount() + +> **getRuleCount**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L28) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getUserScore() + +> **getUserScore**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L38) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### isRuleActive() + +> **isRuleActive**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/reputation.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### nftCollectionBoost() + +> **nftCollectionBoost**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L45) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `collection`: `Address`; \} | +| `args.collection` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### nftHoldStart() + +> **nftHoldStart**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/reputation.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L46) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `collection`: `Address`; `user`: `Address`; \} | +| `args.collection` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/reputation.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L73) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/reputation.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L70) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:75](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L75) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setCommunityReputation() + +> **setCommunityReputation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; `score`: `bigint`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | +| `args.score` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setEntropyFactor() + +> **setEntropyFactor**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; `factor`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | +| `args.factor` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setNFTBoost() + +> **setNFTBoost**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L44) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `boost`: `bigint`; `collection`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.boost` | `bigint` | +| `args.collection` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRegistry() + +> **setRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L65) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `registry`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.registry` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setReputationRule() + +> **setReputationRule**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L22) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `rule`: [`ReputationRule`](ReputationRule.md); `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.rule` | [`ReputationRule`](ReputationRule.md) | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRule() + +> **setRule**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `base`: `bigint`; `bonus`: `bigint`; `desc`: `string`; `max`: `bigint`; `ruleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.base` | `bigint` | +| `args.bonus` | `bigint` | +| `args.desc` | `string` | +| `args.max` | `bigint` | +| `args.ruleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### syncToRegistry() + +> **syncToRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L54) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `activities`: `bigint`[][]; `communities`: `Address`[]; `epoch`: `bigint`; `proof`: [`Hex`](https://viem.sh/docs/index.html); `ruleIds`: [`Hex`](https://viem.sh/docs/index.html)[][]; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.activities` | `bigint`[][] | +| `args.communities` | `Address`[] | +| `args.epoch` | `bigint` | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.ruleIds` | [`Hex`](https://viem.sh/docs/index.html)[][] | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L74) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updateNFTHoldStart() + +> **updateNFTHoldStart**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/reputation.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L47) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `collection`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.collection` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/reputation.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L78) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/ReputationBreakdown.md b/0.16.23/api/@aastar/core/type-aliases/ReputationBreakdown.md new file mode 100644 index 000000000..966c4afd6 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ReputationBreakdown.md @@ -0,0 +1,35 @@ +> **ReputationBreakdown** = `object` + +Defined in: [packages/core/src/actions/reputation.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L13) + +## Properties + +### activityBonus + +> **activityBonus**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L16) + +*** + +### baseScore + +> **baseScore**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L14) + +*** + +### multiplier + +> **multiplier**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L17) + +*** + +### nftBonus + +> **nftBonus**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L15) diff --git a/0.16.23/api/@aastar/core/type-aliases/ReputationRule.md b/0.16.23/api/@aastar/core/type-aliases/ReputationRule.md new file mode 100644 index 000000000..a0f6bf1d3 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/ReputationRule.md @@ -0,0 +1,35 @@ +> **ReputationRule** = `object` + +Defined in: [packages/core/src/actions/reputation.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L6) + +## Properties + +### activityBonus + +> **activityBonus**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L8) + +*** + +### baseScore + +> **baseScore**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L7) + +*** + +### description + +> **description**: `string` + +Defined in: [packages/core/src/actions/reputation.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L10) + +*** + +### maxBonus + +> **maxBonus**: `bigint` + +Defined in: [packages/core/src/actions/reputation.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/reputation.ts#L9) diff --git a/0.16.23/api/@aastar/core/type-aliases/RoleConfigDetailed.md b/0.16.23/api/@aastar/core/type-aliases/RoleConfigDetailed.md new file mode 100644 index 000000000..5a504d970 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/RoleConfigDetailed.md @@ -0,0 +1,99 @@ +> **RoleConfigDetailed** = `object` + +Defined in: [packages/core/src/actions/registry.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L6) + +## Properties + +### description + +> **description**: `string` + +Defined in: [packages/core/src/actions/registry.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L16) + +*** + +### entryBurn + +> **entryBurn**: `bigint` + +Defined in: [packages/core/src/actions/registry.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L8) + +*** + +### exitFeePercent + +> **exitFeePercent**: `number` + +Defined in: [packages/core/src/actions/registry.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L13) + +*** + +### isActive + +> **isActive**: `boolean` + +Defined in: [packages/core/src/actions/registry.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L14) + +*** + +### minExitFee + +> **minExitFee**: `bigint` + +Defined in: [packages/core/src/actions/registry.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L15) + +*** + +### minStake + +> **minStake**: `bigint` + +Defined in: [packages/core/src/actions/registry.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L7) + +*** + +### owner + +> **owner**: `Address` + +Defined in: [packages/core/src/actions/registry.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L17) + +*** + +### roleLockDuration + +> **roleLockDuration**: `bigint` + +Defined in: [packages/core/src/actions/registry.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L18) + +*** + +### slashBase + +> **slashBase**: `number` + +Defined in: [packages/core/src/actions/registry.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L10) + +*** + +### slashInc + +> **slashInc**: `number` + +Defined in: [packages/core/src/actions/registry.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L11) + +*** + +### slashMax + +> **slashMax**: `number` + +Defined in: [packages/core/src/actions/registry.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L12) + +*** + +### slashThreshold + +> **slashThreshold**: `number` + +Defined in: [packages/core/src/actions/registry.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/registry.ts#L9) diff --git a/0.16.23/api/@aastar/core/type-aliases/SBTActions.md b/0.16.23/api/@aastar/core/type-aliases/SBTActions.md new file mode 100644 index 000000000..b7ad8383d --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SBTActions.md @@ -0,0 +1,918 @@ +> **SBTActions** = `object` + +Defined in: [packages/core/src/actions/sbt.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L22) + +## Properties + +### airdropMint() + +> **airdropMint**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L24) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleData`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleData` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### approve() + +> **approve**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `to`: `Address`; `tokenId`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.to` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### balanceOf() + +> **balanceOf**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L37) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; \} | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### burnSBT() + +> **burnSBT**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:56](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L56) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### daoMultisig() + +> **daoMultisig**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L83) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### deactivateAllMemberships() + +> **deactivateAllMemberships**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L62) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### deactivateMembership() + +> **deactivateMembership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L61) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getActiveMemberships() + +> **getActiveMemberships**: (`args`) => `Promise`\<`Address`[]\> + +Defined in: [packages/core/src/actions/sbt.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`Address`[]\> + +*** + +### getApproved() + +> **getApproved**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L43) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getCommunityMembership() + +> **getCommunityMembership**: (`args`) => `Promise`\<[`SBTMembership`](SBTMembership.md)\> + +Defined in: [packages/core/src/actions/sbt.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L28) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `tokenId`: `bigint`; \} | +| `args.community` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`SBTMembership`](SBTMembership.md)\> + +*** + +### getMemberships() + +> **getMemberships**: (`args`) => `Promise`\<[`SBTMembership`](SBTMembership.md)[]\> + +Defined in: [packages/core/src/actions/sbt.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`SBTMembership`](SBTMembership.md)[]\> + +*** + +### getSBTData() + +> **getSBTData**: (`args`) => `Promise`\<[`SBTData`](SBTData.md)\> + +Defined in: [packages/core/src/actions/sbt.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`SBTData`](SBTData.md)\> + +*** + +### getUserSBT() + +> **getUserSBT**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### GTOKEN() + +> **GTOKEN**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:93](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L93) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### GTOKEN\_STAKING() + +> **GTOKEN\_STAKING**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:92](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L92) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### isApprovedForAll() + +> **isApprovedForAll**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/sbt.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L44) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; `owner`: `Address`; \} | +| `args.operator` | `Address` | +| `args.owner` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### lastActivityTime() + +> **lastActivityTime**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `tokenId`: `bigint`; \} | +| `args.community` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### leaveCommunity() + +> **leaveCommunity**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L60) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### membershipIndex() + +> **membershipIndex**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L34) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `tokenId`: `bigint`; \} | +| `args.community` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### minLockAmount() + +> **minLockAmount**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L74) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### mintFee() + +> **mintFee**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:72](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L72) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### mintForRole() + +> **mintForRole**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L25) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleData`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleData` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### name() + +> **name**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/sbt.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L47) + +#### Returns + +`Promise`\<`string`\> + +*** + +### nextTokenId() + +> **nextTokenId**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L52) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:96](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L96) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### ownerOf() + +> **ownerOf**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L38) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### pause() + +> **pause**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L78) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### paused() + +> **paused**: () => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/sbt.ts:80](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L80) + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### recordActivity() + +> **recordActivity**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:65](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L65) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:91](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L91) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:98](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L98) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### reputationCalculator() + +> **reputationCalculator**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/sbt.ts:68](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L68) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### safeTransferFrom() + +> **safeTransferFrom**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L39) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `data?`: [`Hex`](https://viem.sh/docs/index.html); `from`: `Address`; `to`: `Address`; `tokenId`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.data?` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.from` | `Address` | +| `args.to` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### sbtData() + +> **sbtData**: (`args`) => `Promise`\<[`SBTData`](SBTData.md)\> + +Defined in: [packages/core/src/actions/sbt.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L33) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`SBTData`](SBTData.md)\> + +*** + +### setApprovalForAll() + +> **setApprovalForAll**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L42) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `approved`: `boolean`; `operator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.approved` | `boolean` | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setBaseURI() + +> **setBaseURI**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L57) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `baseURI`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.baseURI` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setDAOMultisig() + +> **setDAOMultisig**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L84) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `multisig`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.multisig` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setMinLockAmount() + +> **setMinLockAmount**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:75](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L75) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setMintFee() + +> **setMintFee**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L73) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `fee`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.fee` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRegistry() + +> **setRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L85) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `registry`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.registry` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setReputationCalculator() + +> **setReputationCalculator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L69) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `calculator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.calculator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### supportsInterface() + +> **supportsInterface**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/sbt.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L53) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `interfaceId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.interfaceId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### symbol() + +> **symbol**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/sbt.ts:48](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L48) + +#### Returns + +`Promise`\<`string`\> + +*** + +### tokenURI() + +> **tokenURI**: (`args`) => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/sbt.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L49) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `tokenId`: `bigint`; \} | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<`string`\> + +*** + +### transferFrom() + +> **transferFrom**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L40) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `from`: `Address`; `to`: `Address`; `tokenId`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.from` | `Address` | +| `args.to` | `Address` | +| `args.tokenId` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:97](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L97) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### unpause() + +> **unpause**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/sbt.ts:79](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L79) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### userToSBT() + +> **userToSBT**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/sbt.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L32) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### verifyCommunityMembership() + +> **verifyCommunityMembership**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/sbt.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L31) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `user`: `Address`; \} | +| `args.community` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/sbt.ts:88](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L88) + +#### Returns + +`Promise`\<`string`\> + +*** + +### weeklyActivity() + +> **weeklyActivity**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/sbt.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L67) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `tokenId`: `bigint`; `week`: `bigint`; \} | +| `args.community` | `Address` | +| `args.tokenId` | `bigint` | +| `args.week` | `bigint` | + +#### Returns + +`Promise`\<`boolean`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/SBTData.md b/0.16.23/api/@aastar/core/type-aliases/SBTData.md new file mode 100644 index 000000000..c351acd14 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SBTData.md @@ -0,0 +1,35 @@ +> **SBTData** = `object` + +Defined in: [packages/core/src/actions/sbt.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L14) + +## Properties + +### firstCommunity + +> **firstCommunity**: `Address` + +Defined in: [packages/core/src/actions/sbt.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L16) + +*** + +### holder + +> **holder**: `Address` + +Defined in: [packages/core/src/actions/sbt.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L15) + +*** + +### mintedAt + +> **mintedAt**: `bigint` + +Defined in: [packages/core/src/actions/sbt.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L17) + +*** + +### totalCommunities + +> **totalCommunities**: `bigint` + +Defined in: [packages/core/src/actions/sbt.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L18) diff --git a/0.16.23/api/@aastar/core/type-aliases/SBTMembership.md b/0.16.23/api/@aastar/core/type-aliases/SBTMembership.md new file mode 100644 index 000000000..dde1f87de --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SBTMembership.md @@ -0,0 +1,43 @@ +> **SBTMembership** = `object` + +Defined in: [packages/core/src/actions/sbt.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L6) + +## Properties + +### community + +> **community**: `Address` + +Defined in: [packages/core/src/actions/sbt.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L7) + +*** + +### isActive + +> **isActive**: `boolean` + +Defined in: [packages/core/src/actions/sbt.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L10) + +*** + +### joinedAt + +> **joinedAt**: `bigint` + +Defined in: [packages/core/src/actions/sbt.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L8) + +*** + +### lastActiveTime + +> **lastActiveTime**: `bigint` + +Defined in: [packages/core/src/actions/sbt.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L9) + +*** + +### metadata + +> **metadata**: `string` + +Defined in: [packages/core/src/actions/sbt.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/sbt.ts#L11) diff --git a/0.16.23/api/@aastar/core/type-aliases/SlashRecord.md b/0.16.23/api/@aastar/core/type-aliases/SlashRecord.md new file mode 100644 index 000000000..5d1127ddb --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SlashRecord.md @@ -0,0 +1,43 @@ +> **SlashRecord** = `object` + +Defined in: [packages/core/src/actions/superPaymaster.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L6) + +## Properties + +### amount + +> **amount**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L8) + +*** + +### level + +> **level**: `number` + +Defined in: [packages/core/src/actions/superPaymaster.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L11) + +*** + +### reason + +> **reason**: `string` + +Defined in: [packages/core/src/actions/superPaymaster.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L10) + +*** + +### reputationLoss + +> **reputationLoss**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L9) + +*** + +### timestamp + +> **timestamp**: `bigint` + +Defined in: [packages/core/src/actions/superPaymaster.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L7) diff --git a/0.16.23/api/@aastar/core/type-aliases/StakingActions.md b/0.16.23/api/@aastar/core/type-aliases/StakingActions.md new file mode 100644 index 000000000..1c5404911 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/StakingActions.md @@ -0,0 +1,577 @@ +> **StakingActions** = `object` + +Defined in: [packages/core/src/actions/staking.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L6) + +## Properties + +### authorizedSlashers() + +> **authorizedSlashers**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/staking.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L59) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `slasher`: `Address`; \} | +| `args.slasher` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### availableBalance() + +> **availableBalance**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/staking.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L35) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getLockedStake() + +> **getLockedStake**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/staking.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getStakeInfo() + +> **getStakeInfo**: (`args`) => `Promise`\<\{ `amount`: `bigint`; `slashedAmount`: `bigint`; `stakedAt`: `bigint`; `unstakeRequestedAt`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/staking.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L19) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.operator` | `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `amount`: `bigint`; `slashedAmount`: `bigint`; `stakedAt`: `bigint`; `unstakeRequestedAt`: `bigint`; \}\> + +*** + +### getStakingBalance() + +> **getStakingBalance**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/staking.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L25) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getTotalStaked() + +> **getTotalStaked**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/staking.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L61) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getUserRoleLocks() + +> **getUserRoleLocks**: (`args`) => `Promise`\<`object`[]\> + +Defined in: [packages/core/src/actions/staking.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`object`[]\> + +*** + +### GTOKEN() + +> **GTOKEN**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/staking.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L74) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### hasRoleLock() + +> **hasRoleLock**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/staking.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L34) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### lockStake() + +> **lockStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L8) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `entryBurn`: `bigint`; `payer`: `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `stakeAmount`: `bigint`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.entryBurn` | `bigint` | +| `args.payer` | `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.stakeAmount` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/staking.ts:63](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L63) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### previewExitFee() + +> **previewExitFee**: (`args`) => `Promise`\<\{ `fee`: `bigint`; `netAmount`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/staking.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L36) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<\{ `fee`: `bigint`; `netAmount`: `bigint`; \}\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/staking.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L73) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L67) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### roleExitConfigs() + +> **roleExitConfigs**: (`args`) => `Promise`\<\{ `feePercent`: `bigint`; `minFee`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/staking.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L57) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `feePercent`: `bigint`; `minFee`: `bigint`; \}\> + +*** + +### roleLocks() + +> **roleLocks**: (`args`) => `Promise`\<\{ `amount`: `bigint`; `entryBurn`: `bigint`; `lockedAt`: `number`; `metadata`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); \}\> + +Defined in: [packages/core/src/actions/staking.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L50) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<\{ `amount`: `bigint`; `entryBurn`: `bigint`; `lockedAt`: `number`; `metadata`: [`Hex`](https://viem.sh/docs/index.html); `roleId`: [`Hex`](https://viem.sh/docs/index.html); \}\> + +*** + +### setAuthorizedSlasher() + +> **setAuthorizedSlasher**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L16) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `authorized`: `boolean`; `slasher`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.authorized` | `boolean` | +| `args.slasher` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRegistry() + +> **setRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L39) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `registry`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.registry` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRoleExitFee() + +> **setRoleExitFee**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L40) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `feePercent`: `bigint`; `minFee`: `bigint`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.feePercent` | `bigint` | +| `args.minFee` | `bigint` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setTreasury() + +> **setTreasury**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `treasury`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.treasury` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### slash() + +> **slash**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `reason`: `string`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.reason` | `string` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### slashByDVT() + +> **slashByDVT**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L15) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `operator`: `Address`; `penaltyAmount`: `bigint`; `reason`: `string`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.operator` | `Address` | +| `args.penaltyAmount` | `bigint` | +| `args.reason` | `string` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### stakes() + +> **stakes**: (`args`) => `Promise`\<\{ `amount`: `bigint`; `slashedAmount`: `bigint`; `stakedAt`: `bigint`; `unstakeRequestedAt`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/staking.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L44) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<\{ `amount`: `bigint`; `slashedAmount`: `bigint`; `stakedAt`: `bigint`; `unstakeRequestedAt`: `bigint`; \}\> + +*** + +### topUpStake() + +> **topUpStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `payer`: `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `stakeAmount`: `bigint`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.payer` | `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.stakeAmount` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### totalStaked() + +> **totalStaked**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/staking.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L60) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### treasury() + +> **treasury**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/staking.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L62) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### unlockAndTransfer() + +> **unlockAndTransfer**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L11) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### unlockStake() + +> **unlockStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L10) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `roleId`: [`Hex`](https://viem.sh/docs/index.html); `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.roleId` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### userActiveRoles() + +> **userActiveRoles**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/staking.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L58) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; `user`: `Address`; \} | +| `args.index` | `bigint` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/staking.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/staking.ts#L70) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/SuperPaymasterActions.md b/0.16.23/api/@aastar/core/type-aliases/SuperPaymasterActions.md new file mode 100644 index 000000000..eaded052a --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SuperPaymasterActions.md @@ -0,0 +1,1044 @@ +> **SuperPaymasterActions** = `object` + +Defined in: [packages/core/src/actions/superPaymaster.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L27) + +## Properties + +### addStake() + +> **addStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L36) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `unstakeDelaySec`: `number`; `value`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.unstakeDelaySec` | `number` | +| `args.value` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### APNTS\_TOKEN() + +> **APNTS\_TOKEN**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:89](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L89) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### aPNTsPriceUSD() + +> **aPNTsPriceUSD**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L81) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### BLS\_AGGREGATOR() + +> **BLS\_AGGREGATOR**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:91](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L91) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### BPS\_DENOMINATOR() + +> **BPS\_DENOMINATOR**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:103](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L103) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### cachedPrice() + +> **cachedPrice**: () => `Promise`\<\{ `decimals`: `number`; `price`: `bigint`; `roundId`: `bigint`; `updatedAt`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:80](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L80) + +#### Returns + +`Promise`\<\{ `decimals`: `number`; `price`: `bigint`; `roundId`: `bigint`; `updatedAt`: `bigint`; \}\> + +*** + +### configureOperator() + +> **configureOperator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `exchangeRate`: `bigint`; `opTreasury`: `Address`; `xPNTsToken`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.exchangeRate` | `bigint` | +| `args.opTreasury` | `Address` | +| `args.xPNTsToken` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### deposit() + +> **deposit**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### depositETH() + +> **depositETH**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `value`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.value` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### depositFor() + +> **depositFor**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L31) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `targetOperator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.targetOperator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### entryPoint() + +> **entryPoint**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:95](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L95) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### ETH\_USD\_PRICE\_FEED() + +> **ETH\_USD\_PRICE\_FEED**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:92](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L92) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### executeSlashWithBLS() + +> **executeSlashWithBLS**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L45) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `level`: `number`; `operator`: `Address`; `proof`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.level` | `number` | +| `args.operator` | `Address` | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getAvailableCredit() + +> **getAvailableCredit**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L73) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; `user`: `Address`; \} | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getDeposit() + +> **getDeposit**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L74) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getLatestSlash() + +> **getLatestSlash**: (`args`) => `Promise`\<[`SlashRecord`](SlashRecord.md)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:75](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L75) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; \} | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`SlashRecord`](SlashRecord.md)\> + +*** + +### getSlashCount() + +> **getSlashCount**: (`args`) => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:76](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L76) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; \} | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getSlashHistory() + +> **getSlashHistory**: (`args`) => `Promise`\<[`SlashRecord`](SlashRecord.md)[]\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L77) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; \} | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`SlashRecord`](SlashRecord.md)[]\> + +*** + +### MAX\_ETH\_USD\_PRICE() + +> **MAX\_ETH\_USD\_PRICE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:97](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L97) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MAX\_PROTOCOL\_FEE() + +> **MAX\_PROTOCOL\_FEE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:96](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L96) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### MIN\_ETH\_USD\_PRICE() + +> **MIN\_ETH\_USD\_PRICE**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:98](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L98) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### onTransferReceived() + +> **onTransferReceived**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:66](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L66) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `data`: [`Hex`](https://viem.sh/docs/index.html); `from`: `Address`; `operator`: `Address`; `value`: `bigint`; \} | +| `args.data` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.from` | `Address` | +| `args.operator` | `Address` | +| `args.value` | `bigint` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +*** + +### operators() + +> **operators**: (`args`) => `Promise`\<[`OperatorConfig`](OperatorConfig.md)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:72](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L72) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; \} | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`OperatorConfig`](OperatorConfig.md)\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:106](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L106) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### PAYMASTER\_DATA\_OFFSET() + +> **PAYMASTER\_DATA\_OFFSET**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:99](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L99) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### PRICE\_CACHE\_DURATION() + +> **PRICE\_CACHE\_DURATION**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:100](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L100) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### priceStalenessThreshold() + +> **priceStalenessThreshold**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L85) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### protocolFeeBPS() + +> **protocolFeeBPS**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L82) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### protocolRevenue() + +> **protocolRevenue**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L83) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### RATE\_OFFSET() + +> **RATE\_OFFSET**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L101) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:90](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L90) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:108](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L108) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### sbtHolders() + +> **sbtHolders**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:86](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L86) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `user`: `Address`; \} | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### setAPNTSPrice() + +> **setAPNTSPrice**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L53) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newPrice`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newPrice` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setAPNTsToken() + +> **setAPNTsToken**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L61) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setBLSAggregator() + +> **setBLSAggregator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L62) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `aggregator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.aggregator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setOperatorLimits() + +> **setOperatorLimits**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L43) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `minTxInterval`: `number`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.minTxInterval` | `number` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setOperatorPaused() + +> **setOperatorPaused**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L42) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `operator`: `Address`; `paused`: `boolean`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.operator` | `Address` | +| `args.paused` | `boolean` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setProtocolFee() + +> **setProtocolFee**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L58) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newFeeBPS`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newFeeBPS` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setTreasury() + +> **setTreasury**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:59](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L59) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `treasury`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.treasury` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setXPNTsFactory() + +> **setXPNTsFactory**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L60) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `factory`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.factory` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### slashHistory() + +> **slashHistory**: (`args`) => `Promise`\<[`SlashRecord`](SlashRecord.md)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L78) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; `operator`: `Address`; \} | +| `args.index` | `bigint` | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`SlashRecord`](SlashRecord.md)\> + +*** + +### slashOperator() + +> **slashOperator**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L46) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `level`: `number`; `operator`: `Address`; `penaltyAmount`: `bigint`; `reason`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.level` | `number` | +| `args.operator` | `Address` | +| `args.penaltyAmount` | `bigint` | +| `args.reason` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### totalTrackedBalance() + +> **totalTrackedBalance**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L84) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:107](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L107) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### treasury() + +> **treasury**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:93](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L93) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### unlockStake() + +> **unlockStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L37) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updateBlockedStatus() + +> **updateBlockedStatus**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L49) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `operator`: `Address`; `statuses`: `boolean`[]; `users`: `Address`[]; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.operator` | `Address` | +| `args.statuses` | `boolean`[] | +| `args.users` | `Address`[] | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updatePrice() + +> **updatePrice**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L54) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updatePriceDVT() + +> **updatePriceDVT**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:55](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L55) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `price`: `bigint`; `proof`: [`Hex`](https://viem.sh/docs/index.html); `updatedAt`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.price` | `bigint` | +| `args.proof` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.updatedAt` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updateReputation() + +> **updateReputation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L44) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newScore`: `bigint`; `operator`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newScore` | `bigint` | +| `args.operator` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### updateSBTStatus() + +> **updateSBTStatus**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L50) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `status`: `boolean`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.status` | `boolean` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### userOpState() + +> **userOpState**: (`args`) => `Promise`\<\{ `isBlocked`: `boolean`; `lastTimestamp`: `number`; \}\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:79](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L79) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `operator`: `Address`; `user`: `Address`; \} | +| `args.operator` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<\{ `isBlocked`: `boolean`; `lastTimestamp`: `number`; \}\> + +*** + +### validatePaymasterUserOp() + +> **validatePaymasterUserOp**: (`args`) => `Promise`\<\{ `context`: [`Hex`](https://viem.sh/docs/index.html); `validationData`: `bigint`; \}\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L69) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `maxCost`: `bigint`; `userOp`: `any`; `userOpHash`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.maxCost` | `bigint` | +| `args.userOp` | `any` | +| `args.userOpHash` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<\{ `context`: [`Hex`](https://viem.sh/docs/index.html); `validationData`: `bigint`; \}\> + +*** + +### VALIDATION\_BUFFER\_BPS() + +> **VALIDATION\_BUFFER\_BPS**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:102](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L102) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:111](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L111) + +#### Returns + +`Promise`\<`string`\> + +*** + +### withdraw() + +> **withdraw**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L33) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### withdrawProtocolRevenue() + +> **withdrawProtocolRevenue**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:63](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L63) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### withdrawStake() + +> **withdrawStake**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L38) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `to`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.to` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### withdrawTo() + +> **withdrawTo**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L32) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### xpntsFactory() + +> **xpntsFactory**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/superPaymaster.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/superPaymaster.ts#L94) + +#### Returns + +`Promise`\<`Address`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/SupportedNetwork.md b/0.16.23/api/@aastar/core/type-aliases/SupportedNetwork.md new file mode 100644 index 000000000..f2e1e2fd1 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/SupportedNetwork.md @@ -0,0 +1,3 @@ +> **SupportedNetwork** = keyof *typeof* [`NETWORKS`](../variables/NETWORKS.md) + +Defined in: [packages/core/src/networks.ts:52](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L52) diff --git a/0.16.23/api/@aastar/core/type-aliases/TokenActions.md b/0.16.23/api/@aastar/core/type-aliases/TokenActions.md new file mode 100644 index 000000000..994505c4c --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/TokenActions.md @@ -0,0 +1,3 @@ +> **TokenActions** = [`GTokenActions`](GTokenActions.md) & [`XPNTsTokenActions`](XPNTsTokenActions.md) + +Defined in: [packages/core/src/actions/tokens.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L81) diff --git a/0.16.23/api/@aastar/core/type-aliases/XPNTsFactoryActions.md b/0.16.23/api/@aastar/core/type-aliases/XPNTsFactoryActions.md new file mode 100644 index 000000000..3f0188e98 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/XPNTsFactoryActions.md @@ -0,0 +1,443 @@ +> **XPNTsFactoryActions** = `object` + +Defined in: [packages/core/src/actions/factory.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L7) + +## Properties + +### communityToToken() + +> **communityToToken**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L23) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### createToken() + +> **createToken**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L10) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; `name`: `string`; `symbol`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | +| `args.name` | `string` | +| `args.symbol` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### deployedTokens() + +> **deployedTokens**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L22) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `index`: `bigint`; \} | +| `args.index` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### deployForCommunity() + +> **deployForCommunity**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L11) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `community`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### deployxPNTsToken() + +> **deployxPNTsToken**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L9) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `communityENS`: `string`; `communityName`: `string`; `exchangeRate`: `bigint`; `name`: `string`; `paymasterAOA`: `Address`; `symbol`: `string`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.communityENS` | `string` | +| `args.communityName` | `string` | +| `args.exchangeRate` | `bigint` | +| `args.name` | `string` | +| `args.paymasterAOA` | `Address` | +| `args.symbol` | `string` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### getAllTokens() + +> **getAllTokens**: () => `Promise`\<`Address`[]\> + +Defined in: [packages/core/src/actions/factory.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L19) + +#### Returns + +`Promise`\<`Address`[]\> + +*** + +### getCommunityByToken() + +> **getCommunityByToken**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L18) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getDeployedCount() + +> **getDeployedCount**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/factory.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L20) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getImplementation() + +> **getImplementation**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L30) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getTokenAddress() + +> **getTokenAddress**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L14) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### getTokenCount() + +> **getTokenCount**: () => `Promise`\<`bigint`\> + +Defined in: [packages/core/src/actions/factory.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L21) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### hasToken() + +> **hasToken**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/factory.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L16) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### isTokenDeployed() + +> **isTokenDeployed**: (`args`) => `Promise`\<`boolean`\> + +Defined in: [packages/core/src/actions/factory.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L17) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; \} | +| `args.community` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### owner() + +> **owner**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L39) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### predictAddress() + +> **predictAddress**: (`args`) => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L15) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `community`: `Address`; `salt?`: `bigint`; \} | +| `args.community` | `Address` | +| `args.salt?` | `bigint` | + +#### Returns + +`Promise`\<`Address`\> + +*** + +### REGISTRY() + +> **REGISTRY**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L33) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### renounceOwnership() + +> **renounceOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setImplementation() + +> **setImplementation**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L29) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `impl`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.impl` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setRegistry() + +> **setRegistry**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `registry`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.registry` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setSuperPaymaster() + +> **setSuperPaymaster**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L28) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `paymaster`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.paymaster` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### setSuperPaymasterAddress() + +> **setSuperPaymasterAddress**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L27) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `paymaster`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.paymaster` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### SUPER\_PAYMASTER() + +> **SUPER\_PAYMASTER**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L35) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### SUPERPAYMASTER() + +> **SUPERPAYMASTER**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L34) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### tokenImplementation() + +> **tokenImplementation**: () => `Promise`\<`Address`\> + +Defined in: [packages/core/src/actions/factory.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L36) + +#### Returns + +`Promise`\<`Address`\> + +*** + +### transferOwnership() + +> **transferOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +Defined in: [packages/core/src/actions/factory.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L40) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +*** + +### version() + +> **version**: () => `Promise`\<`string`\> + +Defined in: [packages/core/src/actions/factory.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/factory.ts#L44) + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/type-aliases/XPNTsTokenActions.md b/0.16.23/api/@aastar/core/type-aliases/XPNTsTokenActions.md new file mode 100644 index 000000000..780ad8a22 --- /dev/null +++ b/0.16.23/api/@aastar/core/type-aliases/XPNTsTokenActions.md @@ -0,0 +1,518 @@ +> **XPNTsTokenActions** = [`ERC20Actions`](ERC20Actions.md) & `object` + +Defined in: [packages/core/src/actions/tokens.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/actions/tokens.ts#L33) + +## Type Declaration + +### addAutoApprovedSpender() + +> **addAutoApprovedSpender**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `spender`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### autoApprovedSpenders() + +> **autoApprovedSpenders**: (`args`) => `Promise`\<`boolean`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `spender`: `Address`; `token`: `Address`; \} | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +### burn() + +> **burn**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### burnFrom() + +> **burnFrom**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `from`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.from` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### burnFromWithOpHash() + +> **burnFromWithOpHash**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `from`: `Address`; `token`: `Address`; `userOpHash`: [`Hex`](https://viem.sh/docs/index.html); \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.from` | `Address` | +| `args.token` | `Address` | +| `args.userOpHash` | [`Hex`](https://viem.sh/docs/index.html) | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### communityENS() + +> **communityENS**: (`args`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> + +### communityName() + +> **communityName**: (`args`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> + +### communityOwner() + +> **communityOwner**: (`args`) => `Promise`\<`Address`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +### debts() + +> **debts**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; `user`: `Address`; \} | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### DOMAIN\_SEPARATOR() + +> **DOMAIN\_SEPARATOR**: (`args`) => `Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hex`](https://viem.sh/docs/index.html)\> + +### eip712Domain() + +> **eip712Domain**: (`args`) => `Promise`\<`any`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`any`\> + +### emergencyRevokePaymaster() + +> **emergencyRevokePaymaster**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### exchangeRate() + +> **exchangeRate**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### FACTORY() + +> **FACTORY**: (`args`) => `Promise`\<`Address`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +### getDebt() + +> **getDebt**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; `user`: `Address`; \} | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### getMetadata() + +> **getMetadata**: (`args`) => `Promise`\<\{ `communityENS`: `string`; `communityName`: `string`; `communityOwner`: `Address`; `name`: `string`; `symbol`: `string`; \}\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<\{ `communityENS`: `string`; `communityName`: `string`; `communityOwner`: `Address`; `name`: `string`; `symbol`: `string`; \}\> + +### MAX\_SINGLE\_TX\_LIMIT() + +> **MAX\_SINGLE\_TX\_LIMIT**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### mint() + +> **mint**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `to`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.to` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### needsApproval() + +> **needsApproval**: (`args`) => `Promise`\<`boolean`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `amount`: `bigint`; `owner`: `Address`; `spender`: `Address`; `token`: `Address`; \} | +| `args.amount` | `bigint` | +| `args.owner` | `Address` | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +### nonces() + +> **nonces**: (`args`) => `Promise`\<`bigint`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `owner`: `Address`; `token`: `Address`; \} | +| `args.owner` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`bigint`\> + +### permit() + +> **permit**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `deadline`: `bigint`; `owner`: `Address`; `r`: [`Hex`](https://viem.sh/docs/index.html); `s`: [`Hex`](https://viem.sh/docs/index.html); `spender`: `Address`; `token`: `Address`; `v`: `number`; `value`: `bigint`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.deadline` | `bigint` | +| `args.owner` | `Address` | +| `args.r` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.s` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.spender` | `Address` | +| `args.token` | `Address` | +| `args.v` | `number` | +| `args.value` | `bigint` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### recordDebt() + +> **recordDebt**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amountXPNTs`: `bigint`; `token`: `Address`; `user`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amountXPNTs` | `bigint` | +| `args.token` | `Address` | +| `args.user` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### removeAutoApprovedSpender() + +> **removeAutoApprovedSpender**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `spender`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.spender` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### repayDebt() + +> **repayDebt**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### setSuperPaymasterAddress() + +> **setSuperPaymasterAddress**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `spAddress`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.spAddress` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### SUPERPAYMASTER\_ADDRESS() + +> **SUPERPAYMASTER\_ADDRESS**: (`args`) => `Promise`\<`Address`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`Address`\> + +### transferAndCall() + +> **transferAndCall**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `amount`: `bigint`; `data?`: [`Hex`](https://viem.sh/docs/index.html); `to`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.amount` | `bigint` | +| `args.data?` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.to` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### transferCommunityOwnership() + +> **transferCommunityOwnership**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newOwner`: `Address`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newOwner` | `Address` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### updateExchangeRate() + +> **updateExchangeRate**: (`args`) => `Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `account?`: [`Account`](https://viem.sh/docs/index.html) \| `Address`; `newRate`: `bigint`; `token`: `Address`; \} | +| `args.account?` | [`Account`](https://viem.sh/docs/index.html) \| `Address` | +| `args.newRate` | `bigint` | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<[`Hash`](https://viem.sh/docs/index.html)\> + +### usedOpHashes() + +> **usedOpHashes**: (`args`) => `Promise`\<`boolean`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `opHash`: [`Hex`](https://viem.sh/docs/index.html); `token`: `Address`; \} | +| `args.opHash` | [`Hex`](https://viem.sh/docs/index.html) | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`boolean`\> + +### version() + +> **version**: (`args`) => `Promise`\<`string`\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `token`: `Address`; \} | +| `args.token` | `Address` | + +#### Returns + +`Promise`\<`string`\> diff --git a/0.16.23/api/@aastar/core/variables/AASTAR_COMMUNITY.md b/0.16.23/api/@aastar/core/variables/AASTAR_COMMUNITY.md new file mode 100644 index 000000000..833aad945 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/AASTAR_COMMUNITY.md @@ -0,0 +1,8 @@ +> `const` **AASTAR\_COMMUNITY**: [`CommunityConfig`](../interfaces/CommunityConfig.md) + +Defined in: [packages/core/src/communities.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L34) + +AAstar Community +- SuperPaymaster shared mode (AOA+) +- Uses aPNTs for gas payments +- MySBT for identity verification diff --git a/0.16.23/api/@aastar/core/variables/ALL_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/ALL_ADDRESSES.md new file mode 100644 index 000000000..be6f58f85 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ALL_ADDRESSES.md @@ -0,0 +1,75 @@ +> `const` **ALL\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:110](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L110) + +All Addresses Combined (for reference) + +## Type Declaration + +### aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +### blsAggregator + +> `readonly` **blsAggregator**: `` `0x${string}` `` = `BLS_AGGREGATOR_ADDRESS` + +### bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +### dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +### entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` + +### gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +### gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +### mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` + +### mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +### paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +### paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +### paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `` `0x${string}` `` + +### paymasterV4\_1iImplementation + +> `readonly` **paymasterV4\_1iImplementation**: `` `0x${string}` `` = `PAYMASTER_V4_IMPL_ADDRESS` + +### registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +### simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` + +### superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +### xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/ALL_ROLES.md b/0.16.23/api/@aastar/core/variables/ALL_ROLES.md new file mode 100644 index 000000000..29011f530 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ALL_ROLES.md @@ -0,0 +1,5 @@ +> `const` **ALL\_ROLES**: readonly \[`` `0x${string}` ``, `` `0x${string}` ``, `` `0x${string}` ``, `` `0x${string}` ``, `` `0x${string}` ``, `` `0x${string}` ``, `` `0x${string}` ``\] + +Defined in: [packages/core/src/roles.ts:236](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L236) + +All defined roles array (for iteration) diff --git a/0.16.23/api/@aastar/core/variables/APNTS_ADDRESS.md b/0.16.23/api/@aastar/core/variables/APNTS_ADDRESS.md new file mode 100644 index 000000000..8d625ed24 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/APNTS_ADDRESS.md @@ -0,0 +1,3 @@ +> **APNTS\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L43) diff --git a/0.16.23/api/@aastar/core/variables/BLSAggregatorABI.md b/0.16.23/api/@aastar/core/variables/BLSAggregatorABI.md new file mode 100644 index 000000000..faf3efeaa --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLSAggregatorABI.md @@ -0,0 +1,3 @@ +> `const` **BLSAggregatorABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L84) diff --git a/0.16.23/api/@aastar/core/variables/BLSAggregatorArtifact.md b/0.16.23/api/@aastar/core/variables/BLSAggregatorArtifact.md new file mode 100644 index 000000000..1179d1f34 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLSAggregatorArtifact.md @@ -0,0 +1,13 @@ +> `const` **BLSAggregatorArtifact**: `object` = `BLSAggregatorABIData` + +Defined in: [packages/core/src/abis/index.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L85) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a03461014057601f61292f38819003918201601f19168301916001600160401b03831184841017610144578084926060946040528339810103126101405761004781610158565b90610060604061005960208401610158565b9201610158565b90331561012d575f8054336001600160a01b0319821681178355604051959290916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055600360085560076009556001600160a01b0316801561011a57608052600280546001600160a01b039283166001600160a01b031991821617909155600380549390921692169190911790556127c2908161016d8239608051818181611b70015261214a0152f35b634726455360e11b5f525f60045260245ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036101405756fe60a0806040526004361015610012575f80fd5b5f905f3560e01c90816306433b1b146121205750806322c70bbb14611ea25780632399c309146112cf578063300b0b35146112645780633b60288a1461123557806353f10a4b1461121757806354fd4d50146111b25780635ae48ba41461117e5780635e1a03a2146106425780636578b0cc146105de578063714897df146105c2578063715018a6146105445780637f39a939146104815780638da5cb5b1461044e578063a74c1ca814610424578063bc8efe75146103f0578063c5246bf5146102c8578063c85501bb146102aa578063e79e973914610246578063f2fde38b146101765763f42cc34e14610105575f80fd5b346101735760206003193601126101735760406101679173ffffffffffffffffffffffffffffffffffffffff61013961216e565b16815260046020522060ff600161014f836122c0565b92015416604051928392604084526040840190612360565b90151560208301520390f35b80fd5b50346101735760206003193601126101735773ffffffffffffffffffffffffffffffffffffffff6101a561216e565b6101ad612486565b16801561021a5773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b50346101735760206003193601126101735773ffffffffffffffffffffffffffffffffffffffff61027561216e565b61027d612486565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600254161760025580f35b50346101735780600319360112610173576020600854604051908152f35b5034610173576020600319360112610173576004356102e5612486565b600854811061039257600d811161032e577fb06a54caabe58475c86c2bf9df3f2f06dd1213e9e10659c293117fe4893b274b60406009548151908152836020820152a160095580f35b6040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5468726573686f6c64203e204d61780000000000000000000000000000000000604482015280606481015b0390fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f42656c6f77206d696e5468726573686f6c6400000000000000000000000000006044820152fd5b5034610173578060031936011261017357602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b50346101735760206003193601126101735760406020916004358152600783522054604051908152f35b503461017357806003193601126101735773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346101735760206003193601126101735760043561049e612486565b600281106104e657600d811161032e577fb06a54caabe58475c86c2bf9df3f2f06dd1213e9e10659c293117fe4893b274b60406008548151908152836020820152a160085580f35b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4d696e207468726573686f6c6420746f6f206c6f7700000000000000000000006044820152fd5b503461017357806003193601126101735761055d612486565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101735780600319360112610173576020604051600d8152f35b50346101735760206003193601126101735773ffffffffffffffffffffffffffffffffffffffff61060d61216e565b610615612486565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600354161760035580f35b50346101735760a06003193601126101735761065c612191565b60443567ffffffffffffffff8111610e945761067c9036906004016121b4565b9160843567ffffffffffffffff81116110015761069d9036906004016121b4565b9290946106a86124d2565b73ffffffffffffffffffffffffffffffffffffffff600354163314158061115d575b6111315773ffffffffffffffffffffffffffffffffffffffff8316156110ef576004358152600660205260ff6040822054166110c1576008546064351061106357600d60643511611005576107203686846123a1565b602081519101206040516020810191600435835273ffffffffffffffffffffffffffffffffffffffff86166040830152606082015260643560808201524660a082015260a0815261077260c08261229d565b51902093860193608087860312610de057863567ffffffffffffffff8111610e9457856107a091890161250b565b94602088013567ffffffffffffffff8111610dd157816107c1918a0161250b565b90604089013567ffffffffffffffff811161100157906107e2918a0161250b565b97604051926020840152602083526107fb60408461229d565b6108036125b2565b926108ae6067604051809360403661010084013780518160200161014084015e5181017f0100000000000000000000000000000000000000000000000000000000000000610140820152886101428201537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e6101438201527f554c5f23000000000000000000000000000000000000000000000000000000006101638201520301610100830161268d565b806020528061010083015260016101208301537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e6101218301527f554c5f23000000000000000000000000000000000000000000000000000000006101418301526020866045610100850160025afa60203d141615610ffd5785518252600260016020845b80518518610100870152019161096060ff1986610954846101208301612638565b0301610100870161268d565b83520191600983146109785791602060019192610933565b505050610a369060406101008201526020610120820152604061014082015260016101a08201526f1a0111ea397fe69a4b1ba7b6434bacd76101c08201527f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab6101e08201526109eb8161010081016126a5565b6109fc6040820161010083016126a5565b610a0d6080820161010083016126a5565b610a1e60c0820161010083016126a5565b610a2885826126c3565b8461010001906080016126c3565b6101008361020081600d5afa6101003d141615610ff057885192610a626020808c01958c010185612529565b81518151149182610fdd575b82610fca575b82610fb7575b82610fa4575b82610f91575b82610f7e575b82610f6b575b505015610f4357606001358084915b610ec957506064358110610e985750608086805181010312610e9457906020610b04610b0f93608060405199610ad68b612264565b848101518b526040810151858c0152606081015160408c0152015160608a0152828082518301019101612529565b988051010190612529565b9260609360405195610b21868861229d565b60028752601f19860198845b8a8110610e7d575060405199610b43888c61229d565b60028b52855b818110610e6557505090610c0091610b5f61258e565b6f17f1d3a73197d7942695638c4fa9ac0f81527fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb60208201526f08b3f481e3aaa0f1a09e30ed741d8ae460408201527ffcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e189820152610bdc8a6125ee565b52610be6896125ee565b50610bf08b6125ee565b52610bfa8a6125ee565b506126e8565b610c0987612628565b52610c1386612628565b50610c1d88612628565b52610c2787612628565b50849285519660405196890395845b868a8214610c67579061010060206001930198608060208d85610180020192828d51855e8d01015191015e01610c36565b5050888a6020878b846101800290600f5afa9160203d14915114161615610e5857845115610e305784806040518486823780858101838152039082885af1903d15610e2a57503d90610cb882612385565b91610cc6604051938461229d565b82523d86602084013e5b15610de457506004358452600660205260408420600160ff198254161790558373ffffffffffffffffffffffffffffffffffffffff6003541680610d71575b505073ffffffffffffffffffffffffffffffffffffffff91610d329136916123a1565b602081519101209160405192835216907ff75669458e39b3e450bebdf8e3f8396a4ca0b4057017be244aa5af43321b2807602060043592a36001805580f35b803b15610de0578180916024604051809481937f424a3d7700000000000000000000000000000000000000000000000000000000835260043560048401525af18015610dd55715610d0f5781610dc69161229d565b610dd1578385610d0f565b8380fd5b6040513d84823e3d90fd5b5080fd5b61038e906040519182917f0418cb660000000000000000000000000000000000000000000000000000000083526004356004840152604060248401526044830190612360565b90610cd0565b6004857f729d0f6b000000000000000000000000000000000000000000000000000000008152fd5b634df45e2f85526004601cfd5b808c60208093610e736125b2565b9201015201610b49565b602090610e8861258e565b82828c01015201610b2d565b8280fd5b7fd6022e8e000000000000000000000000000000000000000000000000000000008452600452606435602452604483fd5b5f19810190808211610f165716905f198114610ee9576001019080610aa1565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6004847f729d0f6b000000000000000000000000000000000000000000000000000000008152fd5b60e0919250810151910151145f80610a92565b915060c082015160c08201511491610a8c565b915060a082015160a08201511491610a86565b9150608082015160808201511491610a80565b9150606082015160608201511491610a7a565b9150604082015160408201511491610a74565b9150602082015160208201511491610a6e565b63c55e5e3384526004601cfd5b8580fd5b8480fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f5468726573686f6c642065786365656473206d617800000000000000000000006044820152fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f5468726573686f6c642062656c6f77206d696e696d756d0000000000000000006044820152fd5b807f4eec80e60000000000000000000000000000000000000000000000000000000060249252600435600452fd5b8073ffffffffffffffffffffffffffffffffffffffff847fd08525e9000000000000000000000000000000000000000000000000000000006024945216600452fd5b807fd86ad9cf000000000000000000000000000000000000000000000000000000006024925233600452fd5b5073ffffffffffffffffffffffffffffffffffffffff8154163314156106ca565b5034610173578060031936011261017357602073ffffffffffffffffffffffffffffffffffffffff60025416604051908152f35b5034610173578060031936011261017357506112136040516111d560408261229d565b601381527f424c5341676772656761746f722d332e322e31000000000000000000000000006020820152604051918291602083526020830190612360565b0390f35b50346101735780600319360112610173576020600954604051908152f35b50346101735760206003193601126101735760ff60406020926004358152600684522054166040519015158152f35b50346101735760206003193601126101735760406112b9916004358152600560205220611290816122c0565b9060028101549060ff600460038301549201541690604051948594608086526080860190612360565b9260208501526040840152151560608301520390f35b5034611c835760e0600319360112611c83576112e9612191565b9060443560ff81168103611c835760643567ffffffffffffffff8111611c83576113179036906004016121e2565b909160843567ffffffffffffffff8111611c83576113399036906004016121e2565b94909160c43567ffffffffffffffff8111611c835761135c9036906004016121b4565b9790946113676124d2565b73ffffffffffffffffffffffffffffffffffffffff6003541633141580611e81575b611e55576004355f52600660205260ff60405f20541680611e4a575b611e1c576040516020810190600435825273ffffffffffffffffffffffffffffffffffffffff8416604082015260ff8516606082015260e060808201526114288161140c6113f98c876101008501916123f7565b601f198382030160a08401528d8b612449565b60a43560c08301524660e083015203601f19810183528261229d565b5190209560095499808201976080838a0312611c8357823567ffffffffffffffff8111611c83578961145b91850161250b565b90602084013567ffffffffffffffff8111611c83578a61147c91860161250b565b9960408501359067ffffffffffffffff8211611c835761149d91860161250b565b9c604051916020830152602082526114b660408361229d565b6114be6125b2565b91604051610100810191604036843761156960678383519361014082019481602001865e5181017f01000000000000000000000000000000000000000000000000000000000000006101408201525f6101428201537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e6101438201527f554c5f230000000000000000000000000000000000000000000000000000000061016382015203018461268d565b9283602052838152610120830193600185537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e6101218501527f554c5f230000000000000000000000000000000000000000000000000000000061014185015260205f60458460025afa60203d141615611c83575f518452600260016020865b805185188652019161160a60ff1988611602848c612638565b03018661268d565b835201916009831461162257916020600191926115e9565b50505060406116aa9260206116c296838552525260016101a08401526f1a0111ea397fe69a4b1ba7b6434bacd76101c08401527f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab6101e084015261168683826126a5565b61169360408401826126a5565b6116a060808401826126a5565b60c08301906126a5565b6116b484826126c3565b8361010001906080016126c3565b6101008261020081600d5afa6101003d141615611e0f578d916116ee6020845181860195010184612529565b81518151149182611dfc575b82611de9575b82611dd6575b82611dc3575b82611db0575b82611d9d575b82611d8a575b505015611c87575f6060860135805b611d3d5750818110611d0f575050608082805181010312611c8357604051989c989a9993949293909161175f8c612264565b60208101518c52604081015160208d0152606081015160408d01526080015160608c015280518101602001906020019061179891612529565b978051016020016117a891612529565b606099604051986117b98c8b61229d565b60028a525f5b601f198d018110611ce05750908b95949392916117df6040519d8e61229d565b60028d525f5b601f1988018110611cbc5750906118999161188f8e6118898e61180661258e565b6f17f1d3a73197d7942695638c4fa9ac0f81527fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb60208201526f08b3f481e3aaa0f1a09e30ed741d8ae460408201527ffcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e18d820152611883826125ee565b526125ee565b506125ee565b52610bfa8d6125ee565b6118a28a612628565b526118ac89612628565b506118b68b612628565b526118c08a612628565b50879b8851996040516080528d5f905b9e8c8214611913579c809e9f60208d9e9f019c8d928461018002608051019351608090855e0301602001519060800190610100915e6001018a9e9d9c9b9a6118d0565b50508c8b8d60205f8361018002608051600f5afa9160203d14915114161615611caf575f5115611c875783611b59575b5050505073ffffffffffffffffffffffffffffffffffffffff8416611a1a575b5050505050600435611977575b6001805580f35b6004358152600660205260408120600160ff198254161790558073ffffffffffffffffffffffffffffffffffffffff60035416806119b7575b5050611970565b803b15611a17578180916024604051809481937f424a3d7700000000000000000000000000000000000000000000000000000000835260043560048401525af18015610dd557156119b05781611a0c9161229d565b6101735780826119b0565b50fd5b600360ff86161015611b2c579085929173ffffffffffffffffffffffffffffffffffffffff60025416803b156110015773ffffffffffffffffffffffffffffffffffffffff8587611ab382968b9660ff996040519a8b998a9889977f079d2d42000000000000000000000000000000000000000000000000000000008952166004880152166024860152604485015260648401916123d7565b03925af18015610dd557611b17575b505073ffffffffffffffffffffffffffffffffffffffff9060ff6040519316835216907f85137418138b73abf7daf3f3556f050e536be403436e0ee7649eaee69d1faaca602060043592a38180808080611963565b81611b219161229d565b610e94578284611ac2565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526021600452fd5b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803b15611c8357611bea5f8094611c17611bfc604051988997889687957f1b02e44f000000000000000000000000000000000000000000000000000000008752600435600488015260a060248801528d60a48801916123f7565b91600319868403016044870152612449565b60a43560648401526003198382030160848401528a8c6123d7565b03925af18015611c7857611c62575b5060407f5ce6898a418ad55caa812016e4cdd4a200158714e584a9627d17df3369316ef39181519060a43582526020820152a186808080611943565b611c6f9197505f9061229d565b5f956040611c26565b6040513d5f823e3d90fd5b5f80fd5b7f729d0f6b000000000000000000000000000000000000000000000000000000005f5260045ffd5b634df45e2f5f526004601cfd5b8d9e9f9b9c9d906020918282611cd06125b2565b92010152019e9d9c9b9a9e6117e5565b808b929f9b60209d9e9897969594939d8093611cfa61258e565b92010152019d9091929394959b9a999d6117bf565b7fd6022e8e000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b5f19810190808211611d5d5716905f198114611d5d57600101908061172d565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b60e0919250810151910151145f8061171e565b915060c082015160c08201511491611718565b915060a082015160a08201511491611712565b915060808201516080820151149161170c565b9150606082015160608201511491611706565b9150604082015160408201511491611700565b91506020820151602082015114916116fa565b63c55e5e335f526004601cfd5b7f4eec80e6000000000000000000000000000000000000000000000000000000005f5260043560045260245ffd5b5060043515156113a5565b7fd86ad9cf000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b5073ffffffffffffffffffffffffffffffffffffffff5f5416331415611389565b34611c83576040600319360112611c8357611ebb61216e565b60243567ffffffffffffffff8111611c8357611edb9036906004016121b4565b9190611ee5612486565b603083036120f857604051926040840184811067ffffffffffffffff8211176120cb57604052611f163682846123a1565b845273ffffffffffffffffffffffffffffffffffffffff6020850193600185521692835f52600460205260405f20945194855167ffffffffffffffff81116120cb57611f628254612213565b601f811161207a575b506020601f8211600114611ff4579080600193927f472da4d064218fa97032725fbcff922201fa643fed0765b5ffe0ceef63d7b3dc98995f92611fe9575b50505f1982851b9260031b1c19161781555b019051151560ff60ff198354169116179055611fe46040519283926020845260208401916123d7565b0390a2005b015190508980611fa9565b601f19821690835f52805f20915f5b81811061206257509183917f472da4d064218fa97032725fbcff922201fa643fed0765b5ffe0ceef63d7b3dc999a6001969587951061204a575b505050811b018155611fbb565b01515f1960f88460031b161c1916905589808061203d565b9192602060018192868e015181550194019201612003565b81811115611f6b57825f5260205f20601f830160051c90602084106120c3575b81601f9101920160051c03905f5b8281106120b6575050611f6b565b5f828201556001016120a8565b5f915061209a565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f88a808ec000000000000000000000000000000000000000000000000000000005f5260045ffd5b34611c83575f600319360112611c835760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203611c8357565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203611c8357565b9181601f84011215611c835782359167ffffffffffffffff8311611c835760208381860195010111611c8357565b9181601f84011215611c835782359167ffffffffffffffff8311611c83576020808501948460051b010111611c8357565b90600182811c9216801561225a575b602083101461222d57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691612222565b6080810190811067ffffffffffffffff8211176120cb57604052565b610100810190811067ffffffffffffffff8211176120cb57604052565b90601f601f19910116810190811067ffffffffffffffff8211176120cb57604052565b9060405191825f8254926122d384612213565b808452936001811690811561233e57506001146122fa575b506122f89250038361229d565b565b90505f9291925260205f20905f915b8183106123225750509060206122f8928201015f6122eb565b6020919350806001915483858901015201910190918492612309565b602093506122f895925060ff1991501682840152151560051b8201015f6122eb565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b67ffffffffffffffff81116120cb57601f01601f191660200190565b9291926123ad82612385565b916123bb604051938461229d565b829481845281830111611c83578281602093845f960137010152565b601f8260209493601f1993818652868601375f8582860101520116010190565b916020908281520191905f905b8082106124115750505090565b90919283359073ffffffffffffffffffffffffffffffffffffffff8216809203611c8357602081600193829352019401920190612404565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311611c835760209260051b809284830137010190565b73ffffffffffffffffffffffffffffffffffffffff5f541633036124a657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6002600154146124e3576002600155565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9080601f83011215611c8357816020612526933591016123a1565b90565b9081610100910312611c835760e06040519161254483612280565b805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c0840152015160e082015290565b6040519061259b82612264565b5f6060838281528260208201528260408201520152565b604051906125bf82612280565b5f60e0838281528260208201528260408201528260608201528260808201528260a08201528260c08201520152565b8051156125fb5760200190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8051600110156125fb5760400190565b9081537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e60018201527f554c5f2300000000000000000000000000000000000000000000000000000000602182015260250190565b6020915f9160025afa60203d141615611c83575f5190565b906101006040928383606083015e60055afa60403d141615611c8357565b9060806101009260115afa6101003d1416156126db57565b6389083b915f526004601cfd5b6126f061258e565b506040810180516060830191825191801580612784575b61277d577f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab8311156127755760ff60015b16016f1a0111ea397fe69a4b1ba7b6434bacd70390527f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab03905290565b60ff5f612738565b5050505090565b50821561270756fea26469706673582212203246b35261e5d236579f5dba729cd9ff8271475dbfa222de86a10e0dfcec9db864736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/BLSHelpers.md b/0.16.23/api/@aastar/core/variables/BLSHelpers.md new file mode 100644 index 000000000..afdefb14b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLSHelpers.md @@ -0,0 +1,80 @@ +> `const` **BLSHelpers**: `object` + +Defined in: [packages/core/src/crypto/blsSigner.ts:76](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/crypto/blsSigner.ts#L76) + +Helper functions for creating BLS proofs for Registry and BLSAggregator operations + +## Type Declaration + +### createReputationUpdateMessage() + +> **createReputationUpdateMessage**(`users`, `scores`, `epoch`): `` `0x${string}` `` + +Create message hash for reputation update + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `users` | `` `0x${string}` ``[] | +| `scores` | `bigint`[] | +| `epoch` | `bigint` | + +#### Returns + +`` `0x${string}` `` + +### createSlashProposalMessage() + +> **createSlashProposalMessage**(`proposalId`): `` `0x${string}` `` + +Create message hash for slash proposal + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `proposalId` | `bigint` | + +#### Returns + +`` `0x${string}` `` + +### encodeBLSProof() + +> **encodeBLSProof**(`aggregatedPublicKey`, `aggregatedSignature`, `messageMappingG2`, `signerMask`): `` `0x${string}` `` + +Encode BLS proof for Registry/Aggregator (v3 format) +Proof structure: (bytes pkG1, bytes sigG2, bytes msgG2, uint256 signerMask) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `aggregatedPublicKey` | `` `0x${string}` `` | +| `aggregatedSignature` | `` `0x${string}` `` | +| `messageMappingG2` | `` `0x${string}` `` | +| `signerMask` | `bigint` | + +#### Returns + +`` `0x${string}` `` + +### encodeReputationProof() + +> **encodeReputationProof**(`signature`, `publicKey`, `signerMask`): `` `0x${string}` `` + +Encode Reputation Proof (for test compatibility) +Matches format: (signature, publicKey, signerMask) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `signature` | `` `0x${string}` `` | +| `publicKey` | `` `0x${string}` `` | +| `signerMask` | `bigint` | + +#### Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/variables/BLSValidatorABI.md b/0.16.23/api/@aastar/core/variables/BLSValidatorABI.md new file mode 100644 index 000000000..70229bdda --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLSValidatorABI.md @@ -0,0 +1,3 @@ +> `const` **BLSValidatorABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:87](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L87) diff --git a/0.16.23/api/@aastar/core/variables/BLSValidatorArtifact.md b/0.16.23/api/@aastar/core/variables/BLSValidatorArtifact.md new file mode 100644 index 000000000..1a1af0292 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLSValidatorArtifact.md @@ -0,0 +1,13 @@ +> `const` **BLSValidatorArtifact**: `object` = `BLSValidatorABIData` + +Defined in: [packages/core/src/abis/index.ts:88](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L88) + +## Type Declaration + +### abi + +> **abi**: `object`[] + +### bytecode + +> **bytecode**: `string` = `"0x60808060405234601557610ae4908161001a8239f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c806354fd4d50146100bb5763b8e72af61461002f575f80fd5b346100b75760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100b75760043567ffffffffffffffff81116100b75761007e90369060040161016a565b6024359067ffffffffffffffff82116100b7576020926100a56100ad93369060040161016a565b9290916103ca565b6040519015158152f35b5f80fd5b346100b7575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100b75760406100f481610206565b906012825260208201917f424c5356616c696461746f722d302e332e32000000000000000000000000000083527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8351948593602085525180918160208701528686015e5f85828601015201168101030190f35b9181601f840112156100b75782359167ffffffffffffffff83116100b757602083818601950101116100b757565b60405190610100820182811067ffffffffffffffff8211176101b957604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051906080820182811067ffffffffffffffff8211176101b957604052565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff8211176101b957604052565b92919267ffffffffffffffff82116101b95761028d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011601610206565b93828552828201116100b757815f926020928387013784010152565b9080601f830112156100b7578160206102c49335910161024a565b90565b90816101009103126100b75760e06102dd610198565b91805183526020810151602084015260408101516040840152606081015160608401526080810151608084015260a081015160a084015260c081015160c0840152015160e082015290565b6103306101e6565b905f82525f60208301525f60408301525f6060830152565b610350610198565b905f82525f60208301525f60408301525f60608301525f60808301525f60a08301525f60c08301525f60e0830152565b80511561038d5760200190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b80516001101561038d5760400190565b93929060c081106109a75781156109a75784016080858203126100b757843567ffffffffffffffff81116100b757816104049187016102a9565b94602081013567ffffffffffffffff81116100b757826104259183016102a9565b91604082013567ffffffffffffffff81116100b75761044492016102a9565b926080868051810103126100b7576104a86104986104b09360806104666101e6565b9960208101518b52604081015160208c0152606081015160408c0152015160608a0152602080825183010191016102c7565b94602080825183010191016102c7565b92369161024a565b6104b8610348565b90604051610100810191604036843761056360678383519361014082019481602001865e5181017f01000000000000000000000000000000000000000000000000000000000000006101408201525f6101428201537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e6101438201527f554c5f23000000000000000000000000000000000000000000000000000000006101638201520301846109af565b9283602052838152610120830193600185536101218401907f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e82526101418501917f554c5f2300000000000000000000000000000000000000000000000000000000835260205f60458660025afa60203d1416156100b7575f51865290916045916101458701919060026020895b8051881889520190808b537f424c53313233383147325f584d443a5348412d3235365f535357555f524f5f4e83527f554c5f2300000000000000000000000000000000000000000000000000000000845260205f878a60025afa60203d1416156100b7575f518252600101956009871461066f5795906020906105f1565b5050505050505060406106fb92602061071396838552525260016101a08401526f1a0111ea397fe69a4b1ba7b6434bacd76101c08401527f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab6101e08401526106d783826109c7565b6106e460408401826109c7565b6106f160808401826109c7565b60c08301906109c7565b61070583826109e5565b8261010001906080016109e5565b6101008161020081600d5afa6101003d14161561099a5780518251149081610987575b81610974575b81610961575b8161094e575b8161093b575b81610928575b81610916575b501561090f5761076a6060610206565b60028152936040925f5b8481106108f857506107866060610206565b93600285525f5b8181106108e157505090610845916107a3610328565b6f17f1d3a73197d7942695638c4fa9ac0f81527fc3688c4f9774b905a14e3a3f171bac586c55e83ff97a1aeffb3af00adb22c6bb60208201526f08b3f481e3aaa0f1a09e30ed741d8ae460408201527ffcf5e095d5d00af600db18cb2c04b3edd03cc744a2888ae40caa232946c5e7e1606082015261082188610380565b5261082b87610380565b5061083585610380565b5261083f84610380565b50610a0a565b61084e856103ba565b52610858846103ba565b50610862826103ba565b5261086c816103ba565b508291835192604051948303915f5b828682146108ac5790610100602060019301946080602084610180028c0192828951855e8901015191015e0161087b565b505094602092505f9150846101800290600f5afa9160203d149151141616156108d4575f5190565b634df45e2f5f526004601cfd5b6020906108ec610348565b8282890101520161078d565b602090610903610328565b82828a01015201610774565b505f925050565b60e09150015160e0820151145f61075a565b905060c081015160c08301511490610754565b905060a081015160a0830151149061074e565b9050608081015160808301511490610748565b9050606081015160608301511490610742565b905060408101516040830151149061073c565b9050602081015160208301511490610736565b63c55e5e335f526004601cfd5b505f93505050565b6020915f9160025afa60203d1416156100b7575f5190565b906101006040928383606083015e60055afa60403d1416156100b757565b9060806101009260115afa6101003d1416156109fd57565b6389083b915f526004601cfd5b610a12610328565b506040810180516060830191825191801580610aa6575b610a9f577f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab831115610a975760ff60015b16016f1a0111ea397fe69a4b1ba7b6434bacd70390527f64774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab03905290565b60ff5f610a5a565b5050505090565b508215610a2956fea26469706673582212201009eff984a0e8599c516f860f3f2d5ebe1d257bb06b20ba0d4f59e9b88dcdd664736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md b/0.16.23/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md new file mode 100644 index 000000000..7703e8a08 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md @@ -0,0 +1,3 @@ +> **BLS\_AGGREGATOR\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L39) diff --git a/0.16.23/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md b/0.16.23/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md new file mode 100644 index 000000000..0b3710a56 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md @@ -0,0 +1,3 @@ +> **BLS\_VALIDATOR\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L40) diff --git a/0.16.23/api/@aastar/core/variables/BPS_DENOMINATOR.md b/0.16.23/api/@aastar/core/variables/BPS_DENOMINATOR.md new file mode 100644 index 000000000..c99c74688 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BPS_DENOMINATOR.md @@ -0,0 +1,3 @@ +> `const` **BPS\_DENOMINATOR**: `10000` = `10000` + +Defined in: [packages/core/src/constants.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L82) diff --git a/0.16.23/api/@aastar/core/variables/BRANDING.md b/0.16.23/api/@aastar/core/variables/BRANDING.md new file mode 100644 index 000000000..d0281896b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BRANDING.md @@ -0,0 +1,67 @@ +> `const` **BRANDING**: `object` + +Defined in: [packages/core/src/branding.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/branding.ts#L5) + +AAStar Community Branding Configuration + +## Type Declaration + +### colors + +> `readonly` **colors**: `object` + +#### colors.error + +> `readonly` **error**: `"#F44336"` = `"#F44336"` + +#### colors.gray100 + +> `readonly` **gray100**: `"#F3F4F6"` = `"#F3F4F6"` + +#### colors.gray50 + +> `readonly` **gray50**: `"#F9FAFB"` = `"#F9FAFB"` + +#### colors.gray700 + +> `readonly` **gray700**: `"#374151"` = `"#374151"` + +#### colors.gray800 + +> `readonly` **gray800**: `"#1F2937"` = `"#1F2937"` + +#### colors.gray900 + +> `readonly` **gray900**: `"#111827"` = `"#111827"` + +#### colors.primary + +> `readonly` **primary**: `"#FF6B35"` = `"#FF6B35"` + +#### colors.primaryLight + +> `readonly` **primaryLight**: `"#FF8C42"` = `"#FF8C42"` + +#### colors.secondary + +> `readonly` **secondary**: `"#4A90E2"` = `"#4A90E2"` + +#### colors.secondaryDark + +> `readonly` **secondaryDark**: `"#357ABD"` = `"#357ABD"` + +#### colors.success + +> `readonly` **success**: `"#4CAF50"` = `"#4CAF50"` + +#### colors.warning + +> `readonly` **warning**: `"#FFC107"` = `"#FFC107"` + +### icon + +> `readonly` **icon**: `"https://www.aastar.io/favicon.ico"` = `"https://www.aastar.io/favicon.ico"` + +### logo + +> `readonly` **logo**: `"https://raw.githubusercontent.com/jhfnetboy/MarkDownImg/main/img/202505031325963.png"` = `"https://raw.githubusercontent.com/jhfnetboy/MarkDownImg/main/img/202505031325963.png"` diff --git a/0.16.23/api/@aastar/core/variables/BREAD_COMMUNITY.md b/0.16.23/api/@aastar/core/variables/BREAD_COMMUNITY.md new file mode 100644 index 000000000..db1231b77 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/BREAD_COMMUNITY.md @@ -0,0 +1,8 @@ +> `const` **BREAD\_COMMUNITY**: [`CommunityConfig`](../interfaces/CommunityConfig.md) + +Defined in: [packages/core/src/communities.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L53) + +Bread Community +- Independent AOA Paymaster mode +- Uses bPNTs for gas payments +- MySBT for identity verification diff --git a/0.16.23/api/@aastar/core/variables/CHAIN_MAINNET.md b/0.16.23/api/@aastar/core/variables/CHAIN_MAINNET.md new file mode 100644 index 000000000..b2eef4a33 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CHAIN_MAINNET.md @@ -0,0 +1,3 @@ +> `const` **CHAIN\_MAINNET**: `1` = `1` + +Defined in: [packages/core/src/constants.ts:96](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L96) diff --git a/0.16.23/api/@aastar/core/variables/CHAIN_SEPOLIA.md b/0.16.23/api/@aastar/core/variables/CHAIN_SEPOLIA.md new file mode 100644 index 000000000..156fe87b6 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CHAIN_SEPOLIA.md @@ -0,0 +1,3 @@ +> `const` **CHAIN\_SEPOLIA**: `11155111` = `11155111` + +Defined in: [packages/core/src/constants.ts:95](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L95) diff --git a/0.16.23/api/@aastar/core/variables/COMMUNITIES.md b/0.16.23/api/@aastar/core/variables/COMMUNITIES.md new file mode 100644 index 000000000..4e6458f08 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/COMMUNITIES.md @@ -0,0 +1,5 @@ +> `const` **COMMUNITIES**: `Record`\<`string`, [`CommunityConfig`](../interfaces/CommunityConfig.md)\> + +Defined in: [packages/core/src/communities.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/communities.ts#L69) + +All communities indexed by address diff --git a/0.16.23/api/@aastar/core/variables/COMMUNITY_OWNERS.md b/0.16.23/api/@aastar/core/variables/COMMUNITY_OWNERS.md new file mode 100644 index 000000000..5cf81699c --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/COMMUNITY_OWNERS.md @@ -0,0 +1,15 @@ +> `const` **COMMUNITY\_OWNERS**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:93](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L93) + +Community Owner Addresses + +## Type Declaration + +### aastarOwner + +> `readonly` **aastarOwner**: `"0x411BD567E46C0781248dbB6a9211891C032885e5"` = `'0x411BD567E46C0781248dbB6a9211891C032885e5'` + +### breadCommunityOwner + +> `readonly` **breadCommunityOwner**: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"` = `'0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA'` diff --git a/0.16.23/api/@aastar/core/variables/CONTRACTS.md b/0.16.23/api/@aastar/core/variables/CONTRACTS.md new file mode 100644 index 000000000..a1b7f90cc --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CONTRACTS.md @@ -0,0 +1,179 @@ +> `const` **CONTRACTS**: `object` + +Defined in: [packages/core/src/contracts.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L101) + +All supported networks + +## Type Declaration + +### sepolia + +> `readonly` **sepolia**: `object` = `SEPOLIA_CONTRACTS` + +#### sepolia.communities + +> `readonly` **communities**: `object` + +#### sepolia.communities.aastar + +> `readonly` **aastar**: `object` + +AAStar Community - Test community for development (registered: 2025-11-01) + +#### sepolia.communities.aastar.ensName + +> `readonly` **ensName**: `"aastar.eth"` = `'aastar.eth'` + +#### sepolia.communities.aastar.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.aPNTs` + +#### sepolia.communities.aastar.name + +> `readonly` **name**: `"AAStar"` = `'AAStar'` + +#### sepolia.communities.aastar.owner + +> `readonly` **owner**: `"0x411BD567E46C0781248dbB6a9211891C032885e5"` = `COMMUNITY_OWNERS.aastarOwner` + +#### sepolia.communities.aastar.stake + +> `readonly` **stake**: `"50"` = `'50'` + +#### sepolia.communities.breadCommunity + +> `readonly` **breadCommunity**: `object` + +BreadCommunity - Test community for development (registered: 2025-11-03) + +#### sepolia.communities.breadCommunity.ensName + +> `readonly` **ensName**: `"bread.eth"` = `'bread.eth'` + +#### sepolia.communities.breadCommunity.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.bPNTs` + +#### sepolia.communities.breadCommunity.name + +> `readonly` **name**: `"BreadCommunity"` = `'BreadCommunity'` + +#### sepolia.communities.breadCommunity.owner + +> `readonly` **owner**: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"` = `COMMUNITY_OWNERS.breadCommunityOwner` + +#### sepolia.communities.breadCommunity.stake + +> `readonly` **stake**: `"50"` = `'50'` + +#### sepolia.core + +> `readonly` **core**: `object` = `CORE_ADDRESSES` + +#### sepolia.core.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` = `APNTS_ADDRESS` + +#### sepolia.core.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +#### sepolia.core.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` = `ENTRY_POINT_ADDRESS` + +#### sepolia.core.gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +#### sepolia.core.gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +#### sepolia.core.mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +#### sepolia.core.paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +#### sepolia.core.paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +#### sepolia.core.registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +#### sepolia.core.superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +#### sepolia.core.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +#### sepolia.monitoring + +> `readonly` **monitoring**: `object` = `MONITORING_ADDRESSES` + +#### sepolia.monitoring.blsAggregator + +> `readonly` **blsAggregator**: `` `0x${string}` `` = `BLS_AGGREGATOR_ADDRESS` + +#### sepolia.monitoring.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +#### sepolia.official + +> `readonly` **official**: `object` = `OFFICIAL_ADDRESSES` + +#### sepolia.official.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` + +#### sepolia.paymaster + +> `readonly` **paymaster**: `object` = `PAYMASTER_ADDRESSES` + +#### sepolia.paymaster.paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `` `0x${string}` `` + +#### sepolia.paymaster.paymasterV4\_1iImplementation + +> `readonly` **paymasterV4\_1iImplementation**: `` `0x${string}` `` = `PAYMASTER_V4_IMPL_ADDRESS` + +#### sepolia.testAccounts + +> `readonly` **testAccounts**: `object` = `TEST_ACCOUNT_ADDRESSES` + +#### sepolia.testAccounts.simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` + +#### sepolia.testTokens + +> `readonly` **testTokens**: `object` = `TEST_TOKEN_ADDRESSES` + +#### sepolia.testTokens.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +#### sepolia.testTokens.bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +#### sepolia.testTokens.mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` + +#### sepolia.tokens + +> `readonly` **tokens**: `object` = `TOKEN_ADDRESSES` + +#### sepolia.tokens.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/CONTRACT_METADATA.md b/0.16.23/api/@aastar/core/variables/CONTRACT_METADATA.md new file mode 100644 index 000000000..b5874c485 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CONTRACT_METADATA.md @@ -0,0 +1,67 @@ +> `const` **CONTRACT\_METADATA**: `object` + +Defined in: [packages/core/src/contracts.ts:332](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L332) + +Contract deployment metadata + +## Type Declaration + +### sepolia + +> `readonly` **sepolia**: `object` + +#### sepolia.deploymentDates + +> `readonly` **deploymentDates**: `object` + +#### sepolia.deploymentDates.aPNTs + +> `readonly` **aPNTs**: `"2025-10-30"` = `'2025-10-30'` + +#### sepolia.deploymentDates.blsAggregator + +> `readonly` **blsAggregator**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.dvtValidator + +> `readonly` **dvtValidator**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.gToken + +> `readonly` **gToken**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.gTokenStaking + +> `readonly` **gTokenStaking**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.mySBT + +> `readonly` **mySBT**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.paymasterFactory + +> `readonly` **paymasterFactory**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `"2025-10-15"` = `'2025-10-15'` + +#### sepolia.deploymentDates.registry + +> `readonly` **registry**: `"2025-11-02"` = `'2025-11-02'` + +#### sepolia.deploymentDates.superPaymaster + +> `readonly` **superPaymaster**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.deploymentDates.xPNTsFactory + +> `readonly` **xPNTsFactory**: `"2025-11-01"` = `'2025-11-01'` + +#### sepolia.lastUpdated + +> `readonly` **lastUpdated**: `"2025-11-02"` = `'2025-11-02'` + +#### sepolia.networkId + +> `readonly` **networkId**: `11155111` = `11155111` diff --git a/0.16.23/api/@aastar/core/variables/CONTRACT_SRC_HASH.md b/0.16.23/api/@aastar/core/variables/CONTRACT_SRC_HASH.md new file mode 100644 index 000000000..e57412fc3 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CONTRACT_SRC_HASH.md @@ -0,0 +1,5 @@ +> **CONTRACT\_SRC\_HASH**: `any` + +Defined in: [packages/core/src/constants.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L28) + +Contract Addresses (Priority: ENV > Local Config > Canonical Defaults) diff --git a/0.16.23/api/@aastar/core/variables/CORE_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/CORE_ADDRESSES.md new file mode 100644 index 000000000..405b204ce --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/CORE_ADDRESSES.md @@ -0,0 +1,51 @@ +> `const` **CORE\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L29) + +Core System Addresses + +## Type Declaration + +### aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` = `APNTS_ADDRESS` + +### dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +### entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` = `ENTRY_POINT_ADDRESS` + +### gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +### gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +### mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +### paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +### paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +### registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +### superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +### xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md b/0.16.23/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md new file mode 100644 index 000000000..84ba4046d --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md @@ -0,0 +1,17 @@ +> `const` **DEFAULT\_ADMIN\_ROLE**: [`Hash`](https://viem.sh/docs/index.html) = `'0x0000000000000000000000000000000000000000000000000000000000000000'` + +Defined in: [packages/core/src/roles.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L16) + +Default Admin Role (OpenZeppelin AccessControl) + +## Description + +Highest privilege, can grant/revoke all roles + +## Permission + +Protocol governance only + +## Source + +OpenZeppelin AccessControl DEFAULT_ADMIN_ROLE diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md b/0.16.23/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md new file mode 100644 index 000000000..a27acf647 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_APNTS\_PRICE\_USD**: `"0.02"` = `"0.02"` + +Defined in: [packages/core/src/constants.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L94) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md b/0.16.23/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md new file mode 100644 index 000000000..adf2c4f59 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_CALL\_GAS\_LIMIT**: `100000n` = `100000n` + +Defined in: [packages/core/src/constants.ts:100](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L100) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md b/0.16.23/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md new file mode 100644 index 000000000..5039d63a4 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_GAS\_TOKEN\_MINT\_AMOUNT**: `"100"` = `"100"` + +Defined in: [packages/core/src/constants.ts:83](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L83) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md b/0.16.23/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md new file mode 100644 index 000000000..9aee65ffc --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_PRE\_VERIFICATION\_GAS**: `50000n` = `50000n` + +Defined in: [packages/core/src/constants.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L101) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md b/0.16.23/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md new file mode 100644 index 000000000..8d0aef0c1 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_TIMEOUT\_MS**: `30000` = `30000` + +Defined in: [packages/core/src/constants.ts:102](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L102) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md b/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md new file mode 100644 index 000000000..0435c7a50 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_TOKEN\_NAME**: `"Governance Token"` = `'Governance Token'` + +Defined in: [packages/core/src/constants.ts:98](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L98) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md b/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md new file mode 100644 index 000000000..8ec2ee5d5 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_TOKEN\_SYMBOL**: `"GT"` = `'GT'` + +Defined in: [packages/core/src/constants.ts:97](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L97) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md b/0.16.23/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md new file mode 100644 index 000000000..8c85d82fd --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_USDT\_MINT\_AMOUNT**: `"10"` = `"10"` + +Defined in: [packages/core/src/constants.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L84) diff --git a/0.16.23/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md b/0.16.23/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md new file mode 100644 index 000000000..fca2bcb39 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md @@ -0,0 +1,3 @@ +> `const` **DEFAULT\_VERIFICATION\_GAS\_LIMIT**: `200000n` = `200000n` + +Defined in: [packages/core/src/constants.ts:99](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L99) diff --git a/0.16.23/api/@aastar/core/variables/DVTValidatorABI.md b/0.16.23/api/@aastar/core/variables/DVTValidatorABI.md new file mode 100644 index 000000000..82622e25a --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DVTValidatorABI.md @@ -0,0 +1,3 @@ +> `const` **DVTValidatorABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L81) diff --git a/0.16.23/api/@aastar/core/variables/DVTValidatorArtifact.md b/0.16.23/api/@aastar/core/variables/DVTValidatorArtifact.md new file mode 100644 index 000000000..4ac76b96a --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DVTValidatorArtifact.md @@ -0,0 +1,13 @@ +> `const` **DVTValidatorArtifact**: `object` = `DVTValidatorABIData` + +Defined in: [packages/core/src/abis/index.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L82) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a0346100cf57601f610f8038819003918201601f19168301916001600160401b038311848410176100d3578084926020946040528339810103126100cf57516001600160a01b038116908190036100cf5733156100bc575f8054336001600160a01b0319821681178355604051939290916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36001600455608052610e9890816100e8823960805181610b3f0152f35b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe6080806040526004361015610012575f80fd5b5f905f3560e01c908163013cf08b14610b635750806306433b1b14610b1357806308f41334146108b65780632ab09d1414610898578063424a3d77146107a75780634d238c8e1461073857806354fd4d5014610696578063715018a6146106185780638da5cb5b146105e55780638e24bc9a1461026c578063bc95910114610208578063c06f58e8146101d4578063f2fde38b146101045763facd743b146100b8575f80fd5b346101015760206003193601126101015760ff604060209273ffffffffffffffffffffffffffffffffffffffff6100ed610df3565b168152600284522054166040519015158152f35b80fd5b50346101015760206003193601126101015773ffffffffffffffffffffffffffffffffffffffff610133610df3565b61013b610e16565b1680156101a85773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b5034610101578060031936011261010157602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101015760206003193601126101015773ffffffffffffffffffffffffffffffffffffffff610237610df3565b61023f610e16565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600154161760015580f35b503461010157606060031936011261010157610286610df3565b60243560ff81168082036105e15760443567ffffffffffffffff81116105dd576102b4903690600401610dc5565b949094338252600260205260ff604083205416156105b557600454947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff861461058857600190818701600455868452600360205273ffffffffffffffffffffffffffffffffffffffff60408520911695867fffffffffffffffffffffffff00000000000000000000000000000000000000008354161782557fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff74ff000000000000000000000000000000000000000083549260a01b169116178155019167ffffffffffffffff821161055b576103aa8354610c92565b601f8111610509575b5090816020978795949391601f8411600114610444579289949281927f876b000c101c27e7aaff6a3254ea503d0e9bf516112d43803bd82989b1355235979592610439575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790555b604051908152a3604051908152f35b013590505f806103f8565b917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe084168584528a8420935b8181106104ef57509260019285927f876b000c101c27e7aaff6a3254ea503d0e9bf516112d43803bd82989b135523598968d9896106104b7575b505050811b01905561042a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88560031b161c199101351690555f80806104aa565b8284013585558a9850600190940193918b01918b01610470565b828111156103b3579683825260208220601f840160051c9060208510610553575b810198601f0160051c03825b818110610545575050966103b3565b80846001928c015501610536565b83915061052a565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6004827f2ec5b449000000000000000000000000000000000000000000000000000000008152fd5b8480fd5b8380fd5b503461010157806003193601126101015773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b5034610101578060031936011261010157610631610e16565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101015780600319360112610101576040516040810181811067ffffffffffffffff82111761070b576107079250604052601281527f44565456616c696461746f722d302e332e3200000000000000000000000000006020820152604051918291602083526020830190610d51565b0390f35b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50346101015760206003193601126101015773ffffffffffffffffffffffffffffffffffffffff610767610df3565b61076f610e16565b16815260026020526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905580f35b50346101015760206003193601126101015760043573ffffffffffffffffffffffffffffffffffffffff60015416330361083a5780825260036020526002604083200160017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790557f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f8280a280f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f6e6c7920424c532041676772656761746f72000000000000000000000000006044820152fd5b50346101015780600319360112610101576020600454604051908152f35b5034610aaf5760a0600319360112610aaf5760043560243567ffffffffffffffff8111610aaf576108eb903690600401610d94565b60443567ffffffffffffffff8111610aaf5761090b903690600401610d94565b91909260843567ffffffffffffffff8111610aaf5761092e903690600401610dc5565b949091865f52600360205260405f209360ff600286015416610aeb5773ffffffffffffffffffffffffffffffffffffffff60015416945497853b15610aaf57819060ff6040519a7f2399c309000000000000000000000000000000000000000000000000000000008c5260e48c019260048d015273ffffffffffffffffffffffffffffffffffffffff811660248d015260a01c1660448b015260e060648b015252610104880191905f905b808210610ab3575050506003198782030160848801528481527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8511610aaf578660208196947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8a5f9b8c988698889b60051b809289830137019460643560a489015260031987898803010160c489015281878701526040860137878580838701010152011601010301925af18015610aa457610a96575080f35b610aa291505f90610ce3565b005b6040513d5f823e3d90fd5b5f80fd5b90919283359073ffffffffffffffffffffffffffffffffffffffff8216809203610aaf576020816001938293520194019201906109d9565b7f997a3f56000000000000000000000000000000000000000000000000000000005f5260045ffd5b34610aaf575f600319360112610aaf57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610aaf576020600319360112610aaf576004355f52600360205260405f2090815490600183015f90805490610b9882610c92565b8085529160018116908115610c4d5750600114610c10575b505060ff60028195610bc785610c04950386610ce3565b01541691604051948473ffffffffffffffffffffffffffffffffffffffff879616865260a01c166020850152608060408501526080840190610d51565b90151560608301520390f35b5f908152602081209092505b818310610c33575050810160200160ff6002610bb0565b600181602092949394548385880101520191019190610c1c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208087019190915292151560051b8501909201925060ff915060029050610bb0565b90600182811c92168015610cd9575b6020831014610cac57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691610ca1565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610d2457604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9181601f84011215610aaf5782359167ffffffffffffffff8311610aaf576020808501948460051b010111610aaf57565b9181601f84011215610aaf5782359167ffffffffffffffff8311610aaf5760208381860195010111610aaf57565b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610aaf57565b73ffffffffffffffffffffffffffffffffffffffff5f54163303610e3657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffdfea26469706673582212203c109cfaafc36e5fe2ac49a746f73f7df035a32881c425f5a6ea9da4652ee34764736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md b/0.16.23/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md new file mode 100644 index 000000000..4d75d43e1 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md @@ -0,0 +1,3 @@ +> **DVT\_VALIDATOR\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L41) diff --git a/0.16.23/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md b/0.16.23/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md new file mode 100644 index 000000000..3eddcdac5 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md @@ -0,0 +1,3 @@ +> **ENTRY\_POINT\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L42) diff --git a/0.16.23/api/@aastar/core/variables/EntryPointABI.md b/0.16.23/api/@aastar/core/variables/EntryPointABI.md new file mode 100644 index 000000000..a2c61008e --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/EntryPointABI.md @@ -0,0 +1,3 @@ +> `const` **EntryPointABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:57](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L57) diff --git a/0.16.23/api/@aastar/core/variables/EntryPointArtifact.md b/0.16.23/api/@aastar/core/variables/EntryPointArtifact.md new file mode 100644 index 000000000..f76cc0bd0 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/EntryPointArtifact.md @@ -0,0 +1,13 @@ +> `const` **EntryPointArtifact**: `object` = `EntryPointABIData` + +Defined in: [packages/core/src/abis/index.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L58) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `never`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs?`: `undefined`; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: (\{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components`: (\{ `components`: ...[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x6101806040523461019557604051610018604082610199565b600781526020810190664552433433333760c81b82526040519161003d604084610199565b600183526020830191603160f81b8352610056816101bc565b6101205261006384610363565b61014052519020918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526100cc60c082610199565b5190206080523060c0526040516104ee8082016001600160401b038111838210176101815782916150f7833903905ff080156101765761016052604051614c4f90816104a8823960805181612d20015260a05181612ddd015260c05181612cf1015260e05181612d6f01526101005181612d95015261012051816114eb0152610140518161151401526101605181818161137e01528181611b27015281816148670152614aba0152f35b6040513d5f823e3d90fd5b634e487b7160e01b5f52604160045260245ffd5b5f80fd5b601f909101601f19168101906001600160401b0382119082101761018157604052565b908151602081105f14610236575090601f8151116101f65760208151910151602082106101e7571790565b5f198260200360031b1b161790565b604460209160405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b6001600160401b03811161018157600254600181811c91168015610359575b602082101461034557601f8111610306575b50602092601f82116001146102a557928192935f9261029a575b50508160011b915f199060031b1c19161760025560ff90565b015190505f80610281565b601f1982169360025f52805f20915f5b8681106102ee57508360019596106102d6575b505050811b0160025560ff90565b01515f1960f88460031b161c191690555f80806102c8565b919260206001819286850151815501940192016102b5565b818111156102675760025f5260205f20601f80840160051c809201920160051c03905f5b828110610338575050610267565b5f8282015560010161032a565b634e487b7160e01b5f52602260045260245ffd5b90607f1690610255565b908151602081105f1461038e575090601f8151116101f65760208151910151602082106101e7571790565b6001600160401b03811161018157600354600181811c9116801561049d575b602082101461034557601f811161045e575b50602092601f82116001146103fd57928192935f926103f2575b50508160011b915f199060031b1c19161760035560ff90565b015190505f806103d9565b601f1982169360035f52805f20915f5b868110610446575083600195961061042e575b505050811b0160035560ff90565b01515f1960f88460031b161c191690555f8080610420565b9192602060018192868501518155019401920161040d565b818111156103bf5760035f5260205f20601f80840160051c809201920160051c03905f5b8281106104905750506103bf565b5f82820155600101610482565b90607f16906103ad56fe6101606040526004361015610024575b3615610019575f80fd5b610022336129fc565b005b5f610140525f3560e01c806242dc5314611ec057806301ffc9a714611d8c5780630396cb6014611b4b57806309ccb88014611b055780630bd28e3b14611a8757806313c65a6e14611a6a578063154e58dc14611a2d5780631b2e01b8146119c2578063205c2878146118ab57806322cdde4c1461186357806335567e1a146117d45780635287ce12146116df57806370a082311461169f578063765e827f146115f257806384b0196e146114d0578063850aaf62146114295780639b249f69146112fd578063b0a398d1146112db578063b760faf9146112bf578063bb9fe6bf14611187578063c23a5cea14610fdf5763dbed18e00361000f5734610d795761012c36612545565b6101005260e05233321480610fd6575b15610fa8576101405190815b60e0518110610db2575061015b8261288b565b61012052610140516080526101405160c0525b60e05160c05110610279577fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f9726101405161014051a161014051608081905290815b60e05181106101cc576101c58361010051613f53565b6101405180f35b6102216101dc8260e05185612aaa565b6001600160a01b036101f060208301612b3e565b167f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d6101405161014051a280612aea565b9061014051915b80831061023a575050506001016101af565b90919460019061026761024e88858761293c565b61025d608051610120516129a9565b5190608051613967565b01958160805101608052019190610228565b61028860c05160e05183612aaa565b6001600160a01b036102a9602061029f8480612aea565b60a0529301612b3e565b61014051911691905b60a05181106102d65750505060a05160805101608052600160c0510160c05261016e565b6102e78160805101610120516129a9565b516102f58260a0518561293c565b61014051915a8151926001600160a01b0361030f82612b3e565b168452602081810135908501526fffffffffffffffffffffffffffffffff6080808301358281166060880152811c604087015260a083013560c0808801919091528301359182166101008701521c61012085015261037060e0820182612b52565b9081610ce5575b50506040519361038682612747565b6020850152846040526040810151946effffffffffffffffffffffffffffff8660c08401511760608401511760808401511760a084015117610100840151176101208401511711610c985750604081015160608201510160808201510160a08201510160c082015101610100820151029485604086015284516001600160a01b0360e0818351169261042c898d61042060408b018b612b52565b929091608051016147c5565b0151169661014051978015610c67575b8751604081015190516001600160a01b03169061014051506040519a8b8960208d01519260208301937f19822f7c000000000000000000000000000000000000000000000000000000008552602484019261049693614bd2565b03601f1981018d526104a8908d612465565b61014051908c5190846101405190602095f161014051519a3d602003610c5c575b60405215610b82575015610b1d575b50506001600160a01b03825116602083015190610140515260016020526040610140512077ffffffffffffffffffffffffffffffffffffffffffffffff8260401c165f5260205267ffffffffffffffff60405f2091825492610539846126b0565b90551603610acd575a840311610a7d5760e001516060906001600160a01b03166107c7575b6001600160a01b03949260a0859360809360606105869801520135905a90030191015261453e565b929091168603610777576106d557506105a66001600160a01b039161453e565b92909116610685576105bb57506001016102b2565b6106355760a49060405190631101335b60e11b825260805101600482015260406024820152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f7420647560648201527f65000000000000000000000000000000000000000000000000000000000000006084820152fd5b60849060405190631101335b60e11b825260805101600482015260406024820152602060448201527f41413337207061796d617374657220696e76616c20626c6f636b2072616e67656064820152fd5b60848360405190631101335b60e11b825260805101600482015260406024820152601460448201527f41413334207369676e6174757265206572726f720000000000000000000000006064820152fd5b8260849161072a5760405190631101335b60e11b825260805101600482015260406024820152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152fd5b60405190631101335b60e11b825260805101600482015260406024820152601e60448201527f41413237206f7574736964652076616c696420626c6f636b2072616e676500006064820152fd5b60848460405190631101335b60e11b825260805101600482015260406024820152601460448201527f41413234207369676e6174757265206572726f720000000000000000000000006064820152fd5b9897969594505a988351996107ee6001600160a01b0360e08d015116604087015190614bf4565b15610a2d5760807f52b7512c000000000000000000000000000000000000000000000000000000009798999a9b01516040516108518161084360208a015160408b015190602084019d8e528960248501614bd2565b03601f198101835282612465565b865160806001600160a01b0360e08301511691015161014051918b61014051928551926101405191f1983d908161014051843e519482519a604084019b8c5191156109ab5760401490811591610997575b506109125750601f601f199101160191826040525a9003116108c557509461055e565b8088631101335b60e11b6084935260805101600482015260406024820152602060448201527f41413336206f76657220706d566572696669636174696f6e4761734c696d69746064820152fd5b8b61099361091e612cba565b6040519384937f65c8fd4d0000000000000000000000000000000000000000000000000000000085526080510160048501526024840152601d60648401527f41413335206d616c666f726d6564207061796d61737465722064617461000000608484015260a0604484015260a48301906125ad565b0390fd5b601f199150601f011681018214155f6108a2565b828e6109936109b8612cba565b6040519384937f65c8fd4d0000000000000000000000000000000000000000000000000000000085526080510160048501526024840152600d60648401527f4141333320726576657274656400000000000000000000000000000000000000608484015260a0604484015260a48301906125ad565b60848760405190631101335b60e11b825260805101600482015260406024820152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152fd5b60848760405190631101335b60e11b825260805101600482015260406024820152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152fd5b60848860405190631101335b60e11b825260805101600482015260406024820152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152fd5b610b2691614bf4565b15610b32578b806104d8565b60848860405190631101335b60e11b825260805101600482015260406024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152fd5b8b903b610bd95760849060405190631101335b60e11b825260805101600482015260406024820152601960448201527f41413230206163636f756e74206e6f74206465706c6f796564000000000000006064820152fd5b610be1612cba565b906109936040519283927f65c8fd4d00000000000000000000000000000000000000000000000000000000845260805101600484015260606024840152600d60648401527f4141323320726576657274656400000000000000000000000000000000000000608484015260a0604484015260a48301906125ad565b6101405191506104c9565b6101408051849052516020819052604090205490985081811115610c915750610140515b9761043c565b8103610c8b565b8088631101335b60e11b6084935260805101600482015260406024820152601860448201527f41413934206761732076616c756573206f766572666c6f7700000000000000006064820152fd5b60348210610d805781601411610d795780359160248110610d7957603411610d79576024810135608090811c60a0880152601490910135811c90860152606081901c15610d3b5760601c60e08501528980610377565b6001600160a01b03907fd8ccb29200000000000000000000000000000000000000000000000000000000610140515260601c16600452602461014051fd5b6101405180fd5b507f120aaab5000000000000000000000000000000000000000000000000000000006101405152600452602461014051fd5b610dbf8160e05184612aaa565b92610dca8480612aea565b91906001600160a01b03610de060208801612b3e565b169560018714610f765786610dfd575b5050019250600101610148565b806040610e0b920190612b52565b91873b15610d7957916040519283917f2dd8113300000000000000000000000000000000000000000000000000000000835286604484016040600486015252606483019160648860051b8501019281610140517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee182360301915b8b8210610f1c57505050505081610ead916003198580950301602485015261014051956129dc565b0381610140518a5af19081610f01575b50610ef457847f86a9f750000000000000000000000000000000000000000000000000000000006101405152600452602461014051fd5b929350839260015f610df0565b61014051610f0e91612465565b61014051610d79575f610ebd565b9193967fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c90879294969703018552863584811215610d79576020610f6560019385839401612bf3565b980195019201889695949391610e85565b867f86a9f750000000000000000000000000000000000000000000000000000000006101405152600452602461014051fd5b7fab143c06000000000000000000000000000000000000000000000000000000006101405152600461014051fd5b50333b1561013c565b34610d79576020600319360112610d7957610ff86124da565b33610140515261014051602052600160406101405120019081549165ffffffffffff6dffffffffffffffffffffffffffff8460081c169361104960ff821663ffffffff8360781c1687801515612a55565b60981c1680156111525742811161111d575080547fffffffffffffff000000000000000000000000000000000000000000000000ff169055604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a261014051808080856001600160a01b0386165af16110d96126ea565b90156110e6576101405180f35b610993906040519384937f0dcf087c0000000000000000000000000000000000000000000000000000000085523360048601612719565b7f561d331200000000000000000000000000000000000000000000000000000000610140515260045242602452604461014051fd5b7ffbd021d600000000000000000000000000000000000000000000000000000000610140515260045242602452604461014051fd5b34610d795761014051600319360112610d7957336101405152610140516020526001604061014051200180546111ef63ffffffff8260781c16918260ff6dffffffffffffffffffffffffffff8360081c169216916111e9838383811515612a55565b82612a55565b65ffffffffffff4216019065ffffffffffff821161128c5780547fffffffffffffff000000000000ffffffffffffffffffffffffffffffffffff001678ffffffffffff00000000000000000000000000000000000000609884901b1617905560405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a90602090a26101405180f35b7f4e487b710000000000000000000000000000000000000000000000000000000061014051526011600452602461014051fd5b6020600319360112610d79576101c56112d66124da565b6129fc565b34610d795761014051600319360112610d79576020610140515c604051908152f35b34610d79576020600319360112610d795760043567ffffffffffffffff8111610d7957602061133361136e9236906004016124f0565b60405193849283927f570e1a3600000000000000000000000000000000000000000000000000000000845285600485015260248401916129dc565b0381610140516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165af1801561141b576001600160a01b039161014051916113ec575b507f6ca7b80600000000000000000000000000000000000000000000000000000000610140515216600452602461014051fd5b61140e915060203d602011611414575b6114068183612465565b8101906129bd565b826113b9565b503d6113fc565b6040513d61014051823e3d90fd5b34610d79576040600319360112610d79576114426124da565b60243567ffffffffffffffff8111610d79576114629036906004016124f0565b604051929181908437820190610140518252610140519280610140519303915af461148b6126ea565b906109936040519283927f99410554000000000000000000000000000000000000000000000000000000008452151560048401526040602484015260448301906125ad565b34610d795761014051600319360112610d795761159061150f7f0000000000000000000000000000000000000000000000000000000000000000614242565b6115387f00000000000000000000000000000000000000000000000000000000000000006143b8565b6040519060209061159e9061154d8385612465565b6101405184525f3681376040519586957f0f00000000000000000000000000000000000000000000000000000000000000875260e08588015260e08701906125ad565b9085820360408701526125ad565b4660608501523060808501526101405160a085015283810360c0850152818084519283815201930191610140515b8281106115db57505050500390f35b8351855286955093810193928101926001016115cc565b34610d795761160036612545565b91909133321480611696575b15610fa85761161a8361288b565b611625818585612f1b565b5061014051927fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f9728480a161014051915b858310611666576101c58585613f53565b90919360019061168c61167a87898761293c565b61168488866129a9565b519088613967565b0194019190611655565b50333b1561160c565b34610d79576020600319360112610d79576001600160a01b036116c06124da565b1661014051526101405160205260206040610140512054604051908152f35b34610d79576020600319360112610d79576001600160a01b036117006124da565b60405161170c816123e3565b6101405181526101405160208201526101405160408201526101405160608201526080610140519101521661014051526101405160205260a06040610140512065ffffffffffff60405161175f816123e3565b63ffffffff60018454948584520154916dffffffffffffffffffffffffffff6020820160ff8516151581526040830190828660081c1682528660806060860195878960781c168752019660981c1686526040519788525115156020880152511660408601525116606084015251166080820152f35b34610d79576040600319360112610d795760206117ef6124da565b6001600160a01b036117ff61251e565b91166101405152600182526040610140512077ffffffffffffffffffffffffffffffffffffffffffffffff82165f52825260405f20547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006040519260401b16178152f35b34610d79576020600319360112610d795760043567ffffffffffffffff8111610d79576101206003198236030112610d79576118a3602091600401612747565b604051908152f35b34610d79576040600319360112610d79576118c46124da565b60243590336101405152610140516020526040610140512082815480821161198e57906118f0916126dd565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a261014051808080856001600160a01b0386165af161194a6126ea565b9015611957576101405180f35b610993906040519384937f9f3d69330000000000000000000000000000000000000000000000000000000085523360048601612719565b7f25c3f46e000000000000000000000000000000000000000000000000000000006101405152600452602452604461014051fd5b34610d79576040600319360112610d79576119db6124da565b6001600160a01b036119eb61251e565b91166101405152600160205277ffffffffffffffffffffffffffffffffffffffffffffffff6040610140512091165f52602052602060405f2054604051908152f35b34610d795761014051600319360112610d795760206040517f29a0bca4af4be3421398da00295e58e6d7de38cb492214754cb6a47507dd6f8e8152f35b34610d795761014051600319360112610d795760206118a3612ce7565b34610d79576020600319360112610d795760043577ffffffffffffffffffffffffffffffffffffffffffffffff81168103610d7957336101405152600160205277ffffffffffffffffffffffffffffffffffffffffffffffff6040610140512091165f5260205260405f20611afc81546126b0565b90556101405180f35b34610d795761014051600319360112610d795760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b6020600319360112610d795760043563ffffffff8116808203610d795733610140515261014051602052611d546dffffffffffffffffffffffffffff6040610140512093611bb960018601549163ffffffff8360781c1690611bb082828915156125ec565b818710156125ec565b60081c1692611bf1611bcb348661262d565b94611bd98134881515612667565b346dffffffffffffffffffffffffffff871115612667565b5460405190611bff826123e3565b815265ffffffffffff602082019160018352604081016dffffffffffffffffffffffffffff87168152606082019086825260016080840193610140518552336101405152610140516020526040610140512090518155019451151560ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008754169116178555517fffffffffffffffffffffffffffffffffff0000000000000000000000000000ff6effffffffffffffffffffffffffff008087549360081b16169116178455517fffffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffff72ffffffff0000000000000000000000000000008086549360781b1616911617835551167fffffffffffffff000000000000ffffffffffffffffffffffffffffffffffffff78ffffffffffff0000000000000000000000000000000000000083549260981b169116179055565b60405191825260208201527fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c0160403392a26101405180f35b34610d79576020600319360112610d79576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103610d7957807fd9934b3f0000000000000000000000000000000000000000000000000000000060209214908115611e96575b8115611e6c575b8115611e42575b8115611e18575b506040519015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501482611e0d565b7f3e84f0210000000000000000000000000000000000000000000000000000000081149150611e06565b7fcf28ef970000000000000000000000000000000000000000000000000000000081149150611dff565b7f283f54890000000000000000000000000000000000000000000000000000000081149150611df8565b346122ba576102006003193601126122ba5760043567ffffffffffffffff81116122ba57366023820112156122ba57611f039036906024816004013591016124a4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc36016101c081126122ba5761014060405191611f3f836123e3565b126122ba57604051611f508161242c565b6024356001600160a01b03811681036122ba57815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c0820152610104356001600160a01b03811681036122ba5760e082015261012435610100820152610144356101208201528152602081019161016435835260408201906101843582526101a435606084015260808301916101c43583526101e43567ffffffffffffffff81116122ba5761200f9036906004016124f0565b955a903033036123bb578651606081015195603f5a0260061c61271060a084015189010111612393575f96815191826122f3575b50505050509061205b915a90038551019636916124a4565b925a93855161010081015161012082015148018082105f146122eb5750975b61209a6001600160a01b0360e08401511694518203606084015190613ff3565b01925f9281612196575050516001600160a01b0316945b5a900301019485029051928184105f1461214f575050600381101561211c576002036120ee57602092816118a392936120e9816140e0565b614012565b7fdeadaa51000000000000000000000000000000000000000000000000000000006101405152602061014051fd5b7f4e487b710000000000000000000000000000000000000000000000000000000061014051526021600452602461014051fd5b8161217892959496939603906001600160a01b03165f525f60205260405f209081540180915590565b50600384101561211c5782612191926020951590614079565b6118a3565b9096918782516121a9575b5050506120b1565b90919293505a9260038810156122be57600288036121df575b505060a06121d6925a900391015190613ff3565b908880806121a1565b60a083015191803b156122ba578b925f928361223b938c8b88604051998a98899788957f7c627b2100000000000000000000000000000000000000000000000000000000875260048701526080602487015260848601906125ad565b9202604484015260648301520393f190816122a5575b5061229b57610993612261612cba565b6040519182917fad7954bc0000000000000000000000000000000000000000000000000000000083526020600484015260248301906125ad565b60a06121d66121c2565b5f6122af91612465565b5f610140528a612251565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b90509761207a565b915f929183809360206001600160a01b03885116910192f115612319575b808080612043565b61205b939295506040519161232c612cba565b908151612345575b505050604052600193909188612311565b7f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a20190519160206001600160a01b03855116940151612388604051928392836125d2565b0390a3888080612334565b7fdeaddead000000000000000000000000000000000000000000000000000000005f5260205ffd5b7f9fbdaa09000000000000000000000000000000000000000000000000000000005f5260045ffd5b60a0810190811067ffffffffffffffff8211176123ff57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610140810190811067ffffffffffffffff8211176123ff57604052565b6060810190811067ffffffffffffffff8211176123ff57604052565b90601f601f19910116810190811067ffffffffffffffff8211176123ff57604052565b67ffffffffffffffff81116123ff57601f01601f191660200190565b9291926124b082612488565b916124be6040519384612465565b8294818452818301116122ba578281602093845f960137010152565b600435906001600160a01b03821682036122ba57565b9181601f840112156122ba5782359167ffffffffffffffff83116122ba57602083818601950101116122ba57565b6024359077ffffffffffffffffffffffffffffffffffffffffffffffff821682036122ba57565b9060406003198301126122ba5760043567ffffffffffffffff81116122ba5760040182601f820112156122ba5780359267ffffffffffffffff84116122ba576020808301928560051b0101116122ba5791906024356001600160a01b03811681036122ba5790565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6040906125e99392815281602082015201906125ad565b90565b156125f5575050565b9063ffffffff80927fe1823bce000000000000000000000000000000000000000000000000000000005f52166004521660245260445ffd5b9190820180921161263a57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b15612670575050565b6dffffffffffffffffffffffffffff92507f0e10009c000000000000000000000000000000000000000000000000000000005f526004521660245260445ffd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461263a5760010190565b9190820391821161263a57565b3d15612714573d906126fb82612488565b916127096040519384612465565b82523d5f602084013e565b606090565b90926001600160a01b03608093816125e99796168452166020830152604082015281606082015201906125ad565b60429061275381612e1b565b61275b612ce7565b9161276581612b3e565b91801561285657905b60c061277d6060830183612b52565b9081604051918237209161279d61279760e0830183612b52565b90614488565b92604051946001600160a01b0360208701977f29a0bca4af4be3421398da00295e58e6d7de38cb492214754cb6a47507dd6f8e895216604087015260208301356060870152608086015260a085015260808101358285015260a081013560e08501520135610100830152610120820152610120815261281e61014082612465565b519020604051917f19010000000000000000000000000000000000000000000000000000000000008352600283015260228201522090565b506128646040820182612b52565b9081604051918237209061276e565b67ffffffffffffffff81116123ff5760051b60200190565b9061289582612873565b6128a26040519182612465565b828152601f196128b28294612873565b01905f5b8281106128c257505050565b6020906040516128d1816123e3565b6040516128dd8161242c565b5f81525f848201525f60408201525f60608201525f60808201525f60a08201525f60c08201525f60e08201525f6101008201525f61012082015281525f838201525f60408201525f60608201525f6080820152828285010152016128b6565b919081101561297c5760051b810135907ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee1813603018212156122ba570190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b805182101561297c5760209160051b010190565b908160209103126122ba57516001600160a01b03811681036122ba5790565b601f8260209493601f1993818652868601375f8582860101520116010190565b7f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206001600160a01b03612a4934856001600160a01b03165f525f60205260405f209081540180915590565b936040519485521692a2565b15612a5f57505050565b906dffffffffffffffffffffffffffff63ffffffff927f8421e8e5000000000000000000000000000000000000000000000000000000005f521660045216602452151560445260645ffd5b919081101561297c5760051b810135907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1813603018212156122ba570190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156122ba570180359067ffffffffffffffff82116122ba57602001918160051b360383136122ba57565b356001600160a01b03811681036122ba5790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156122ba570180359067ffffffffffffffff82116122ba576020019181360383136122ba57565b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1823603018112156122ba57016020813591019167ffffffffffffffff82116122ba5781360383136122ba57565b8035916001600160a01b03831683036122ba576001600160a01b036125e99316815260208201356020820152612cab612c9f612c66612c4b612c386040870187612ba3565b61012060408801526101208701916129dc565b612c586060870187612ba3565b9086830360608801526129dc565b6080850135608085015260a085013560a085015260c085013560c0850152612c9160e0860186612ba3565b9085830360e08701526129dc565b92610100810190612ba3565b916101008185039101526129dc565b3d6108008111612cde575b604051906020818301016040528082525f602083013e90565b50610800612cc5565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480612dda575b15612d42577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152612dd460c082612465565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614612d19565b909392938483116122ba5784116122ba578101920390565b612e286040820182612b52565b9091612e348284614123565b15612f1457612e45612e4a91612b3e565b614178565b9160148211612e935750506040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000602082019260601b16825260148152612dd4603482612465565b816014116122ba576020612dd4916040519384917fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008484019760601b16875260147fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec83019101603484013781015f838201520301601f198101835282612465565b5050505f90565b92919092835f5b818110612f2f5750505050565b612f3981856129a9565b51612f4582848661293c565b5f915a8151926001600160a01b03612f5c82612b3e565b168452602081013560208501526080810135936fffffffffffffffffffffffffffffffff8560801c951694604082019060608301968752815260c0820160a0840135815260c0840135906fffffffffffffffffffffffffffffffff8260801c92169161012085019061010086019384528152612fdb60e0870187612b52565b90816138aa575b5050604051612ff087612747565b9960208a019a8b528160405285519586855117825117926effffffffffffffffffffffffffffff60808a01948551179560a08b019687511789511790511711613861575051905101905101905101905101905102956040860191878352896001600160a01b0360e089516130788b848351169561307060408d018d612b52565b9290916147c5565b015116985f99801561383a575b8951604081015190516001600160a01b031680916040519d8e808d8b519360208301947f19822f7c00000000000000000000000000000000000000000000000000000000865260248401926130d993614bd2565b03601f19810182526130eb9082612465565b51905f6020948194f15f519c3d602003613832575b604052156137605750156136ff575b50506001600160a01b038451166020850151905f52600160205260405f2077ffffffffffffffffffffffffffffffffffffffffffffffff8260401c165f5260205267ffffffffffffffff60405f209182549261316a846126b0565b905516036136b3575a860311613667576001600160a01b0360e06060940151166133e0575b50506001600160a01b03949260a0859360809360606131b99801520135905a90030191015261453e565b92909116613394576132fa57506131d76001600160a01b039161453e565b929091166132ae576131ec5750600101612f22565b6132625760a49060405190631101335b60e11b8252600482015260406024820152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f7420647560648201527f65000000000000000000000000000000000000000000000000000000000000006084820152fd5b60849060405190631101335b60e11b8252600482015260406024820152602060448201527f41413337207061796d617374657220696e76616c20626c6f636b2072616e67656064820152fd5b60848360405190631101335b60e11b8252600482015260406024820152601460448201527f41413334207369676e6174757265206572726f720000000000000000000000006064820152fd5b8260849161334b5760405190631101335b60e11b8252600482015260406024820152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152fd5b60405190631101335b60e11b8252600482015260406024820152601e60448201527f41413237206f7574736964652076616c696420626c6f636b2072616e676500006064820152fd5b60848460405190631101335b60e11b8252600482015260406024820152601460448201527f41413234207369676e6174757265206572726f720000000000000000000000006064820152fd5b909c9b9a99989796505a9085519d60e08f01516001600160a01b0316815161340791614bf4565b1561361b5761345a7f52b7512c00000000000000000000000000000000000000000000000000000000999a9b9c9d9e9f608001519261084360405193849251905190602084019d8e528960248501614bd2565b5f8088518b8260806001600160a01b0360e08501511693015192865193f1983d90815f843e519482519a604084019b8c51911561359d5760401490811591613589575b5061350c5750601f601f199101160191826040525a9003116134c35750948260a061318f565b8088631101335b60e11b60849352600482015260406024820152602060448201527f41413336206f76657220706d566572696669636174696f6e4761734c696d69746064820152fd5b8b610993613518612cba565b6040519384937f65c8fd4d00000000000000000000000000000000000000000000000000000000855260048501526024840152601d60648401527f41413335206d616c666f726d6564207061796d61737465722064617461000000608484015260a0604484015260a48301906125ad565b601f199150601f011681018214155f61349d565b828e6109936135aa612cba565b6040519384937f65c8fd4d00000000000000000000000000000000000000000000000000000000855260048501526024840152600d60648401527f4141333320726576657274656400000000000000000000000000000000000000608484015260a0604484015260a48301906125ad565b60848960405190631101335b60e11b8252600482015260406024820152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152fd5b60848960405190631101335b60e11b8252600482015260406024820152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152fd5b60848a60405190631101335b60e11b8252600482015260406024820152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152fd5b61370891614bf4565b15613714575f8061310f565b60848a60405190631101335b60e11b8252600482015260406024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152fd5b8d903b6137b35760849060405190631101335b60e11b8252600482015260406024820152601960448201527f41413230206163636f756e74206e6f74206465706c6f796564000000000000006064820152fd5b6137bb612cba565b906109936040519283927f65c8fd4d000000000000000000000000000000000000000000000000000000008452600484015260606024840152600d60648401527f4141323320726576657274656400000000000000000000000000000000000000608484015260a0604484015260a48301906125ad565b5f9150613100565b9950815f525f60205260405f20548181115f1461385a57505f5b99613085565b8103613854565b808f631101335b60e11b60849352600482015260406024820152601860448201527f41413934206761732076616c756573206f766572666c6f7700000000000000006064820152fd5b6034821061393b57816014116122ba57803560601c91602481106122ba576014820135906034116122ba576fffffffffffffffffffffffffffffffff60248193013560801c1660a089015260801c16608087015280156139105760e08601525f80612fe2565b7fd8ccb292000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b507f120aaab5000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9092915a6020820180515f5d606083015190604051968761398b6060830183612b52565b5f60038211613f4b575b7fffffffff00000000000000000000000000000000000000000000000000000000167f8dd7712f0000000000000000000000000000000000000000000000000000000003613e15575050505f613a82613b5c613a2e613a4260209587516040519384927f8dd7712f000000000000000000000000000000000000000000000000000000008a850152604060248501526064840190612bf3565b90604483015203601f198101835282612465565b6108436040519384927e42dc53000000000000000000000000000000000000000000000000000000008885015261020060248501526102248401906125ad565b613b2b604484018c60806101a09161012081516001600160a01b038151168652602081015160208701526040810151604087015260608101516060870152838101518487015260a081015160a087015260c081015160c08701526001600160a01b0360e08201511660e087015261010081015161010087015201516101208501526020810151610140850152604081015161016085015260608101516101808501520151910152565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc83820301610204840152886125ad565b828151910182305af15f519760405215613b78575b5050505050565b909192939495505f3d602014613e08575b7fdeaddead000000000000000000000000000000000000000000000000000000008103613bfc5760848660405190631101335b60e11b8252600482015260406024820152600f60448201527f41413935206f7574206f662067617300000000000000000000000000000000006064820152fd5b7fdeadaa5100000000000000000000000000000000000000000000000000000000919293949550145f14613c64575050613c48613c3d613c58925a906126dd565b60808401519061262d565b6040830151836120e982956140e0565b905b5f80808080613b71565b91613cc8919260405190518551907ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f479260206001600160a01b03845116930151613cab612cba565b90613cbb604051928392836125d2565b0390a36040525a906126dd565b613cd8608084019182519061262d565b915f905a92855161010081015161012082015148018082105f14613e005750955b613d196001600160a01b0360e08401511693518203606084015190613ff3565b01925f9280613dd1575050516001600160a01b0316935b5a900301019283026040850151928184105f14613d9257505080613d6557509081613d5f92936120e9816140e0565b90613c5a565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526021600452fd5b613dba90828493979503906001600160a01b03165f525f60205260405f209081540180915590565b50613d65575090825f613dcc93614079565b613d5f565b95919051613de0575b50613d30565b93509050613df95a9360a05f955a900391015190613ff3565b905f613dda565b905095613cf9565b5060205f803e5f51613b89565b613f429350613f3491613e5a917e42dc5300000000000000000000000000000000000000000000000000000000602086015261020060248601526102248501916129dc565b613f03604484018960806101a09161012081516001600160a01b038151168652602081015160208701526040810151604087015260608101516060870152838101518487015260a081015160a087015260c081015160c08701526001600160a01b0360e08201511660e087015261010081015161010087015201516101208501526020810151610140850152604081015161016085015260608101516101808501520151910152565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdc83820301610204840152856125ad565b03601f198101895288612465565b60205f88613b5c565b508135613995565b6001600160a01b03168015613fc8575f805d5f80808085855af1613f756126ea565b9015613f8057505050565b610993906040519384937f40848e61000000000000000000000000000000000000000000000000000000008552600485015260248401526060604484015260648301906125ad565b7f1a3b45fd000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b90619c40820181111561400c57606491600a9103020490565b50505f90565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f608060208301519251946001600160a01b038651169460206001600160a01b0360e089015116970151916040519283525f602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f9160208401519351956001600160a01b038751169560206001600160a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e6020806001600160a01b03855116940151604051908152a3565b9060021161417357357fffffffffffffffffffffffffffffffffffffffff000000000000000000000000167f77020000000000000000000000000000000000000000000000000000000000001490565b505f90565b60175f80833c5f51907fef010000000000000000000000000000000000000000000000000000000000007fffffff00000000000000000000000000000000000000000000000000000000008316036141da575060481c6001600160a01b031690565b806001600160a01b03913b15614216577f9f4e4cc9000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b7fe5819b95000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b60ff81146142a15760ff811690601f82116142795760405191614266604084612465565b6020808452838101919036833783525290565b7fb3512b0c000000000000000000000000000000000000000000000000000000005f5260045ffd5b506040515f6002548060011c91600182169182156143ae575b60208410831461438157838552849290811561434457506001146142e5575b6125e992500382612465565b5060025f90815290917f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b8183106143285750509060206125e9928201016142d9565b6020919350806001915483858801015201910190918392614310565b602092506125e99491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b8201016142d9565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b92607f16926142ba565b60ff81146143dc5760ff811690601f82116142795760405191614266604084612465565b506040515f6003548060011c916001821691821561447e575b602084108314614381578385528492908115614344575060011461441f576125e992500382612465565b5060035f90815290917fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8183106144625750509060206125e9928201016142d9565b602091935080600191548385880101520191019091839261444a565b92607f16926143f5565b614492828261462d565b806144a35750816040519182372090565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe919203604051927ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff682019084377f22e325a2974396560000000000000000000000000000000000000000000000007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6828501015201902090565b8015614624575f6040805161455281612449565b82815282602082015201526001600160a01b0381169065ffffffffffff8160a01c16908115614616575b60409060d01c91815161458e81612449565b84815283602082015265ffffffffffff821692839101526580000000000083101580614606575b156145e957657fffffffffff91501643119081156145d6575b509060019092565b657fffffffffff9150164311155f6145ce565b5042119081156145fb575b50905f9092565b90504211155f6145f4565b50658000000000008210156145b5565b65ffffffffffff915061457c565b505f905f905f90565b603e821061400c577f22e325a2974396560000000000000000000000000000000000000000000000007fffffffffffffffff0000000000000000000000000000000000000000000000006146a5847ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff881018186612e03565b903582811691600881106147b0575b5050160361400c57816146eb91817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6810191612e03565b90357fffff0000000000000000000000000000000000000000000000000000000000008116916002811061477b575b505060f01c907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc28101821161474d575090565b7f07b9a191000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7fffff0000000000000000000000000000000000000000000000000000000000009250829060020360031b1b16165f8061471a565b839250829060080360031b1b16165f806146b4565b929091925f826147d6575050505050565b8351946001600160a01b03865116956147ef8583614123565b614a96575060148410614a4a5783601411614a4657803560601c93863b614a105761485b9160209160408851015190856040518096819582947f570e1a3600000000000000000000000000000000000000000000000000000000845288600485015260248401916129dc565b03926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690f1918215614a0457916149e5575b506001600160a01b038116801561499957850361494d573b15614901575060407fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d916001600160a01b0360e06020860151955101511682519182526020820152a35f80808080613b71565b60849060405190631101335b60e11b8252600482015260406024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152fd5b60848260405190631101335b60e11b8252600482015260406024820152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152fd5b60848360405190631101335b60e11b8252600482015260406024820152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152fd5b6149fe915060203d602011611414576114068183612465565b5f614896565b604051903d90823e3d90fd5b50505050906020807fa39bcda08ffd11bafb11c4f170ef24fc6dc1a9d1b0394d90dbd19e0b919050e992015192604051908152a3565b5080fd5b60848360405190631101335b60e11b8252600482015260406024820152601760448201527f4141393920696e6974436f646520746f6f20736d616c6c0000000000000000006064820152fd5b9195949390925060148111614aae575b505050505050565b60406001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016920151816014116122ba57823b156122ba57614b5c935f80946040518097819682957fc09ad0d90000000000000000000000000000000000000000000000000000000084528c60048501526040602485015260147fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec60448601930191016129dc565b0393f18015614bc757614bb2575b507f7c9f9ade6a03a0bba484e52df872467a270e798ffc1adab9dfaa8d0e627f05446001600160a01b036020614b9f85614178565b93015192169380a45f8080808080614aa6565b614bbf9193505f90612465565b5f915f614b6a565b6040513d5f823e3d90fd5b614bea60409295949395606083526060830190612bf3565b9460208201520152565b6001600160a01b03165f525f60205260405f20908154818110612f145703905560019056fea264697066735822122042a9122003ddaf427b826536bf23a9cc94c2e0ac6c100a4a9f9a9170c93357a564736f6c6343000821003360a08060405234602f57336080526104ba9081610034823960805181818160c30152818161023701526102cf0152f35b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c8063570e1a361461025b578063b0d691fe146101ed5763c09ad0d91461003a575f80fd5b346101e95760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101e95760043573ffffffffffffffffffffffffffffffffffffffff811681036101e95760243567ffffffffffffffff81116101e957366023820112156101e9575f916100bd8392369060248160040135910161038a565b906101027f0000000000000000000000000000000000000000000000000000000000000000303373ffffffffffffffffffffffffffffffffffffffff8316331461042c565b82602083519301915af11561011357005b3d61080081116101e0575b60c460405160208382010160405282815260208101925f843e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6040519485937f65c8fd4d0000000000000000000000000000000000000000000000000000000085525f6004860152606060248601528260648601527f4141313320454950373730322073656e64657220696e6974206661696c656400608486015260a060448601525180918160a48701528686015e5f85828601015201168101030190fd5b5061080061011e565b5f80fd5b346101e9575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101e957602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b346101e95760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101e95760043567ffffffffffffffff81116101e957366023820112156101e95780600401359067ffffffffffffffff82116101e95736602483830101116101e9575f9161030e7f0000000000000000000000000000000000000000000000000000000000000000303373ffffffffffffffffffffffffffffffffffffffff8316331461042c565b806014116101e95760209161034b5f927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec3691016038840161038a565b90826024858451940192013560601c5af1610382575b60209073ffffffffffffffffffffffffffffffffffffffff60405191168152f35b505f51610361565b92919267ffffffffffffffff82116103ff57604051917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f81601f8401160116830183811067ffffffffffffffff8211176103ff576040528294818452818301116101e9578281602093845f960137010152565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b1561043657505050565b73ffffffffffffffffffffffffffffffffffffffff92918380927ffe34a6d3000000000000000000000000000000000000000000000000000000005f5216600452166024521660445260645ffdfea2646970667358221220e9e7afecea4a69b36e49284a4d2974b57bbe45ab5f9443377e13e1304ec438ff64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/FAUCET_API_URL.md b/0.16.23/api/@aastar/core/variables/FAUCET_API_URL.md new file mode 100644 index 000000000..8af0616d6 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/FAUCET_API_URL.md @@ -0,0 +1,5 @@ +> `const` **FAUCET\_API\_URL**: `"https://faucet-aastar.vercel.app"` = `"https://faucet-aastar.vercel.app"` + +Defined in: [packages/core/src/constants.ts:79](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L79) + +Common Constants diff --git a/0.16.23/api/@aastar/core/variables/GTOKEN_ADDRESS.md b/0.16.23/api/@aastar/core/variables/GTOKEN_ADDRESS.md new file mode 100644 index 000000000..c7b2e0f05 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTOKEN_ADDRESS.md @@ -0,0 +1,3 @@ +> **GTOKEN\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L30) diff --git a/0.16.23/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md b/0.16.23/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md new file mode 100644 index 000000000..a923d35d0 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md @@ -0,0 +1,3 @@ +> **GTOKEN\_STAKING\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L31) diff --git a/0.16.23/api/@aastar/core/variables/GTokenABI.md b/0.16.23/api/@aastar/core/variables/GTokenABI.md new file mode 100644 index 000000000..fe061d3e3 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTokenABI.md @@ -0,0 +1,3 @@ +> `const` **GTokenABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L40) diff --git a/0.16.23/api/@aastar/core/variables/GTokenArtifact.md b/0.16.23/api/@aastar/core/variables/GTokenArtifact.md new file mode 100644 index 000000000..ee707b82c --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTokenArtifact.md @@ -0,0 +1,13 @@ +> `const` **GTokenArtifact**: `object` = `GTokenABIData` + +Defined in: [packages/core/src/abis/index.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L41) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a0604052346103c6576111426020813803918261001c816103ca565b9384928339810103126103c6575161003460406103ca565b90601082526f23b7bb32b93730b731b2902a37b5b2b760811b602083015261005c60406103ca565b600681526523aa37b5b2b760d11b602082015282519091906001600160401b0381116102cc57600354600181811c911680156103bc575b60208210146102ae57601f811161034e575b506020601f82116001146102eb57819293945f926102e0575b50508160011b915f199060031b1c1916176003555b81516001600160401b0381116102cc57600454600181811c911680156102c2575b60208210146102ae57601f8111610240575b50602092601f82116001146101df57928192935f926101d4575b50508160011b915f199060031b1c1916176004555b80156101c15760805233156101ae5760058054336001600160a01b03198216811790925560405191906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3610d5290816103f082396080518181816105fb015281816106c401526106f90152f35b631e4fbdf760e01b5f525f60045260245ffd5b63392e1e2760e01b5f525f60045260245ffd5b015190505f80610120565b601f1982169360045f52805f20915f5b8681106102285750836001959610610210575b505050811b01600455610135565b01515f1960f88460031b161c191690555f8080610202565b919260206001819286850151815501940192016101ef565b818111156101065760045f52601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b602084106102a6575b81601f9101920160051c03905f5b828110610299575050610106565b5f8282015560010161028b565b5f915061027d565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100f4565b634e487b7160e01b5f52604160045260245ffd5b015190505f806100be565b601f1982169060035f52805f20915f5b8181106103365750958360019596971061031e575b505050811b016003556100d3565b01515f1960f88460031b161c191690555f8080610310565b9192602060018192868b0151815501940192016102fb565b818111156100a55760035f52601f820160051c7fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b602084106103b4575b81601f9101920160051c03905f5b8281106103a75750506100a5565b5f82820155600101610399565b5f915061038b565b90607f1690610093565b5f80fd5b6040519190601f01601f191682016001600160401b038111838210176102cc5760405256fe6080806040526004361015610012575f80fd5b5f3560e01c90816306fdde031461088657508063095ea7b31461079f57806318160ddd1461078257806323b872dd1461074a578063313ce5671461072f578063349f0b90146106e7578063355274ea146106ad57806340c10f191461056957806342966c681461054c57806354fd4d50146104b757806370a0823114610473578063715018a6146103f557806379cc6790146103c35780638da5cb5b1461039057806395d89b4114610255578063a9059cbb14610224578063dd62ed3e146101b65763f2fde38b146100e2575f80fd5b346101b25760206003193601126101b25773ffffffffffffffffffffffffffffffffffffffff610110610986565b610118610c25565b1680156101865773ffffffffffffffffffffffffffffffffffffffff600554827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600555167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b7f1e4fbdf7000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b5f80fd5b346101b25760406003193601126101b2576101cf610986565b73ffffffffffffffffffffffffffffffffffffffff6101ec6109a9565b91165f52600160205273ffffffffffffffffffffffffffffffffffffffff60405f2091165f52602052602060405f2054604051908152f35b346101b25760406003193601126101b25761024a610240610986565b6024359033610b2f565b602060405160018152f35b346101b2575f6003193601126101b2576040515f6004548060011c90600181168015610386575b6020831081146103595782855290811561031757506001146102b9575b6102b5836102a9818503826109cc565b6040519182918261093e565b0390f35b91905060045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b915f905b8082106102fd575090915081016020016102a9610299565b9192600181602092548385880101520191019092916102e5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208086019190915291151560051b840190910191506102a99050610299565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f169161027c565b346101b2575f6003193601126101b257602073ffffffffffffffffffffffffffffffffffffffff60055416604051908152f35b346101b25760406003193601126101b2576103f36103df610986565b602435906103ee823383610a0d565b610c72565b005b346101b2575f6003193601126101b25761040d610c25565b5f73ffffffffffffffffffffffffffffffffffffffff6005547fffffffffffffffffffffffff00000000000000000000000000000000000000008116600555167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101b25760206003193601126101b25773ffffffffffffffffffffffffffffffffffffffff6104a1610986565b165f525f602052602060405f2054604051908152f35b346101b2575f6003193601126101b257604051604081019080821067ffffffffffffffff83111761051f576102b591604052600c81527f47546f6b656e2d322e312e32000000000000000000000000000000000000000060208201526040519182918261093e565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b346101b25760206003193601126101b2576103f360043533610c72565b346101b25760406003193601126101b257610582610986565b73ffffffffffffffffffffffffffffffffffffffff602435916105a3610c25565b1690811561068157600254908082018092116106545760207fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef915f9360025584845283825260408420818154019055604051908152a37f000000000000000000000000000000000000000000000000000000000000000060025481811161062657005b7f9e79f854000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101b2575f6003193601126101b25760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b346101b2575f6003193601126101b2577f0000000000000000000000000000000000000000000000000000000000000000600254810390811161065457602090604051908152f35b346101b2575f6003193601126101b257602060405160128152f35b346101b25760606003193601126101b25761024a610766610986565b61076e6109a9565b6044359161077d833383610a0d565b610b2f565b346101b2575f6003193601126101b2576020600254604051908152f35b346101b25760406003193601126101b2576107b8610986565b60243590331561085a5773ffffffffffffffffffffffffffffffffffffffff1690811561082e57335f52600160205260405f20825f526020528060405f20556040519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3602060405160018152f35b7f94280d62000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7fe602df05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346101b2575f6003193601126101b2575f6003548060011c90600181168015610934575b6020831081146103595782855290811561031757506001146108d6576102b5836102a9818503826109cc565b91905060035f527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b915f905b80821061091a575090915081016020016102a9610299565b919260018160209254838588010152019101909291610902565b91607f16916108aa565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602060409481855280519182918282880152018686015e5f8582860101520116010190565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036101b257565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036101b257565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761051f57604052565b73ffffffffffffffffffffffffffffffffffffffff909291921691825f52600160205260405f2073ffffffffffffffffffffffffffffffffffffffff82165f5260205260405f2054927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8403610a84575b50505050565b828410610ae557801561085a5773ffffffffffffffffffffffffffffffffffffffff82161561082e575f52600160205273ffffffffffffffffffffffffffffffffffffffff60405f2091165f5260205260405f20910390555f808080610a7e565b5073ffffffffffffffffffffffffffffffffffffffff83917ffb8f41b2000000000000000000000000000000000000000000000000000000005f521660045260245260445260645ffd5b73ffffffffffffffffffffffffffffffffffffffff16908115610bf95773ffffffffffffffffffffffffffffffffffffffff1691821561068157815f525f60205260405f2054818110610bc757817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92602092855f525f84520360405f2055845f525f825260405f20818154019055604051908152a3565b827fe450d38c000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffd5b7f96c6fd1e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b73ffffffffffffffffffffffffffffffffffffffff600554163303610c4657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b90919073ffffffffffffffffffffffffffffffffffffffff168015610bf957805f525f60205260405f2054838110610ce9576020845f94957fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef938587528684520360408620558060025403600255604051908152a3565b91507fe450d38c000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffdfea26469706673582212200de962b538a5ce14e10fc74e638266bdab2cdff1fc7cfe5d19e0948d33e714a264736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/GTokenStakingABI.md b/0.16.23/api/@aastar/core/variables/GTokenStakingABI.md new file mode 100644 index 000000000..9b0f1aae7 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTokenStakingABI.md @@ -0,0 +1,3 @@ +> `const` **GTokenStakingABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L43) diff --git a/0.16.23/api/@aastar/core/variables/GTokenStakingArtifact.md b/0.16.23/api/@aastar/core/variables/GTokenStakingArtifact.md new file mode 100644 index 000000000..0c281ea98 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/GTokenStakingArtifact.md @@ -0,0 +1,13 @@ +> `const` **GTokenStakingArtifact**: `object` = `GTokenStakingABIData` + +Defined in: [packages/core/src/abis/index.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L44) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a03461019c57601f6128f638819003918201601f19168301916001600160401b038311848410176101a057808492604094855283398101031261019c57610052602061004b836101b4565b92016101b4565b60015f5533156101895760018054336001600160a01b0319821681179092556040519391906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a36001600160a01b031691821561015657506001600160a01b031690811561011e57608052600380546001600160a01b03191691909117905560405161272d90816101c982396080518181816105ec0152818161118d0152818161129e015281816116280152818161193b01528181611d360152611d800152f35b60405162461bcd60e51b815260206004820152601060248201526f496e76616c696420547265617375727960801b6044820152606490fd5b62461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21023aa37b5b2b760911b6044820152606490fd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361019c5756fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816306433b1b1461205f5750806316934fc414611ff657806330b039ee14611f4d57806336cb2b8214611ecc578063374e4d7314611ad45780634bcb80a21461188257806354fd4d501461181f57806361d027b3146117ec578063678b3ee2146114af5780636d265c111461144a5780636da12d0c146113e857806370a08231146113a3578063715018a6146113255780637c50309f146112c25780637f6b337b14611272578063817b1cd2146112555780638da5cb5b146112225780638f7648481461102d57806391b65cd614610dc157806394e2b21e14610d8e578063a0821be314610d6a578063a91ee0dc14610ca2578063aed2d90814610c58578063b4d81fb314610b8e578063befa570e1461052b578063d64c66aa14610455578063f0f442601461038d578063f2fde38b146102bb5763f50102c01461015d575f80fd5b346102b85760406003193601126102b85760809073ffffffffffffffffffffffffffffffffffffffff61018e61208f565b82606060405161019d81612168565b8281528260208201528260408201520152169081815260056020526040812060243582526020526040812091604051906101d68261214c565b83546fffffffffffffffffffffffffffffffff81168352851c602083015261021e600365ffffffffffff600187015416956040850196875260028101546060860152016121a7565b858301528252600460205265ffffffffffff6fffffffffffffffffffffffffffffffff604084209260405161025281612168565b8454815260606003600187015496876020850152600281015460408501520154910152511693511690606060405161028981612168565b858152602081019283526040810193845201928352604051938452516020840152516040830152516060820152f35b80fd5b50346102b85760206003193601126102b85773ffffffffffffffffffffffffffffffffffffffff6102ea61208f565b6102f2612439565b1680156103615773ffffffffffffffffffffffffffffffffffffffff600154827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b50346102b85760206003193601126102b85773ffffffffffffffffffffffffffffffffffffffff6103bc61208f565b6103c4612439565b1680156103f7577fffffffffffffffffffffffff0000000000000000000000000000000000000000600354161760035580f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964205472656173757279000000000000000000000000000000006044820152fd5b50346102b85760606003193601126102b85773ffffffffffffffffffffffffffffffffffffffff6002541633141580610509575b6104ab5760043581526007602052604081206024358155600160443591015580f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152fd5b5073ffffffffffffffffffffffffffffffffffffffff60015416331415610489565b5034610acd5760a0600319360112610acd5761054561208f565b6064359160243591608435906044359073ffffffffffffffffffffffffffffffffffffffff83168303610acd5761057a612486565b73ffffffffffffffffffffffffffffffffffffffff600254163303610b2f5773ffffffffffffffffffffffffffffffffffffffff1691825f52600560205260405f20855f526020526fffffffffffffffffffffffffffffffff60405f205416610ad1576106146105ea8784612335565b7f00000000000000000000000000000000000000000000000000000000000000009230908461251f565b856109e7575b50818352600460205260408320610632828254612335565b905581835260046020526002604084200154156109d1575b6fffffffffffffffffffffffffffffffff8111610972576fffffffffffffffffffffffffffffffff851161097257604051946106858661214c565b6fffffffffffffffffffffffffffffffff82168652602086016fffffffffffffffffffffffffffffffff821681526003604088019765ffffffffffff4216895260608101888152602099604051946106dd8c87612184565b8986526080848101968752898b5260058d526040808c208d8d528e528b2094519151901b7fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff91909116178355516001830180547fffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000001665ffffffffffff9290921691909117905551600282015591518051919092019167ffffffffffffffff821161094557819061079f84546120b2565b601f8111610905575b508990601f83116001146108a557889261089a575b50505f198260011b9260031b1c19161790555b82845260068652604084208054906801000000000000000082101561086d57869360019695938561084261082c866060968c7fe4c76dcad70ec0bf6b921afbe6bb7b4950aedf705245ec68942ea9ecf00f8a0c990181556122b8565b81939154905f199060031b92831b921b19161790565b905561085082600854612335565b60085560405191825289820152426040820152a355604051908152f35b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b015190505f806107bd565b8489528a892092601f1916895b8c8282106108ef5750509084600195949392106108d7575b505050811b0190556107d0565b01515f1960f88460031b161c191690555f80806108ca565b60018596829396860151815501950193016108b2565b828111156107a8578489528a892061093791601f850160051c908d861061093d575b601f82910160051c0391016122fa565b5f6107a8565b8b9150610927565b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f416d6f756e7420657863656564732075696e74313238000000000000000000006044820152606490fd5b818352600460205242600260408520015561064a565b73ffffffffffffffffffffffffffffffffffffffff16803b15610acd575f80916024604051809481937f42966c680000000000000000000000000000000000000000000000000000000083528b60048401525af18015610ac257610aad575b5083827fbbd5bd0123b04ed83c5d79cf2f6fca38e7b242f17f09d9eea712fb1cbe2fb861608060405189815260406020820152600a60408201527f456e747279204275726e000000000000000000000000000000000000000000006060820152a35f61061a565b610aba9193505f90612184565b5f915f610a46565b6040513d5f823e3d90fd5b5f80fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f526f6c6520616c7265616479206c6f636b6564000000000000000000000000006044820152fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4f6e6c79205265676973747279000000000000000000000000000000000000006044820152606490fd5b34610acd576040600319360112610acd576040610ba961208f565b73ffffffffffffffffffffffffffffffffffffffff60243591165f526005602052815f20815f526020526fffffffffffffffffffffffffffffffff825f205416905f526007602052815f2090612710610c1e845193610c0785612103565b602060018254928388520154950194855283612315565b049151808310610c50575b50808211610c48575b81610c3c91612328565b82519182526020820152f35b905080610c32565b915083610c29565b34610acd576020600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff610c8661208f565b165f526009602052602060ff60405f2054166040519015158152f35b34610acd576020600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff610cd061208f565b610cd8612439565b168015610d0c577fffffffffffffffffffffffff000000000000000000000000000000000000000060025416176002555f80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f496e76616c6964205265676973747279000000000000000000000000000000006044820152fd5b34610acd576020600319360112610acd57610d8361208f565b5060206040515f8152f35b34610acd576020600319360112610acd576004355f5260076020526040805f206001815491015482519182526020820152f35b34610acd576020600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff610def61208f565b16805f52600660205260405f2090604051808360208295549384815201905f5260205f20925f5b818110611014575050610e2b92500383612184565b815191601f19610e53610e3d8561240d565b94610e4b6040519687612184565b80865261240d565b015f5b818110610fde5750505f5b8151811015610f0057600190835f52600560205260405f20610e838285612425565b515f5260205260405f20610edf600360405192610e9f8461214c565b80546fffffffffffffffffffffffffffffffff8116855260801c602085015265ffffffffffff8682015416604085015260028101546060850152016121a7565b6080820152610eee8287612425565b52610ef98186612425565b5001610e61565b836040518091602082016020835281518091526040830190602060408260051b8601019301915f905b828210610f3857505050500390f35b91936020610fce827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0600195979984950301865260a060808a516fffffffffffffffffffffffffffffffff81511684526fffffffffffffffffffffffffffffffff86820151168685015265ffffffffffff6040820151166040850152606081015160608501520151918160808201520190612265565b9601920192018594939192610f29565b602090604051610fed8161214c565b5f81525f838201525f60408201525f60608201526060608082015282828801015201610e56565b8454835260019485019487945060209093019201610e16565b34610acd576080600319360112610acd5761104661208f565b6044359060643567ffffffffffffffff8111610acd5761106a90369060040161228a565b90335f52600960205260ff60405f205416156111c4576111bf73ffffffffffffffffffffffffffffffffffffffff7f6951689eba99e77d7e3b622f276c0ad8e36126c3c510f181b86d05d685eaa074941694855f52600560205260405f206024355f5260205260405f206fffffffffffffffffffffffffffffffff611101818354166110f8858210156123a8565b82851690612342565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055855f52600460205260405f2061115d828254611147828210156123a8565b60018401611156838254612335565b9055612328565b905561116b81600854612328565b6008556111b18173ffffffffffffffffffffffffffffffffffffffff600354167f00000000000000000000000000000000000000000000000000000000000000006124bd565b604051938493429285612374565b0390a2005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4e6f7420617574686f72697a656420736c6173686572000000000000000000006044820152fd5b34610acd575f600319360112610acd57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b34610acd575f600319360112610acd576020600854604051908152f35b34610acd575f600319360112610acd57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610acd576040600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff6112f061208f565b165f52600560205260405f206024355f5260205260206fffffffffffffffffffffffffffffffff60405f205416604051908152f35b34610acd575f600319360112610acd5761133d612439565b5f73ffffffffffffffffffffffffffffffffffffffff6001547fffffffffffffffffffffffff00000000000000000000000000000000000000008116600155167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610acd576020600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff6113d161208f565b165f526004602052602060405f2054604051908152f35b34610acd576040600319360112610acd5761140161208f565b73ffffffffffffffffffffffffffffffffffffffff60243591165f52600660205260405f208054821015610acd5760209161143b916122b8565b90549060031b1c604051908152f35b34610acd576040600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff61147861208f565b165f52600560205260405f206024355f5260205260206fffffffffffffffffffffffffffffffff60405f2054161515604051908152f35b34610acd576060600319360112610acd576114c861208f565b60243560443567ffffffffffffffff8111610acd576114eb90369060040161228a565b90926114f5612486565b73ffffffffffffffffffffffffffffffffffffffff60025416331415806117d5575b6117775773ffffffffffffffffffffffffffffffffffffffff1690815f52600460205260405f208054938481115f146117715750835b8461159b575b50506020937f6951689eba99e77d7e3b622f276c0ad8e36126c3c510f181b86d05d685eaa0749161158c60405192839242918885612374565b0390a260015f55604051908152f35b846115af9160018401611156838254612335565b81556115bd84600854612328565b600855825f5260066020526115d78460405f209254612335565b8015918215611655575b5050506020937f6951689eba99e77d7e3b622f276c0ad8e36126c3c510f181b86d05d685eaa0749161164c8573ffffffffffffffffffffffffffffffffffffffff600354167f00000000000000000000000000000000000000000000000000000000000000006124bd565b91819550611553565b9193909294955f5b835481101561173e57825f52600560205260405f2061167c82866122b8565b90549060031b1c5f5260205260405f20906fffffffffffffffffffffffffffffffff825416916116ac8a84612315565b9288611711576116dc6fffffffffffffffffffffffffffffffff91896001960481811161170a575b831690612342565b167fffffffffffffffffffffffffffffffff000000000000000000000000000000008254161790550161165d565b50806116d4565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b50959490935091508490507f6951689eba99e77d7e3b622f276c0ad8e36126c3c510f181b86d05d685eaa07460206115e1565b9361154d565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4f6e6c79205265676973747279206f7220617574686f72697a656400000000006044820152fd5b50335f52600960205260ff60405f20541615611517565b34610acd575f600319360112610acd57602073ffffffffffffffffffffffffffffffffffffffff60035416604051908152f35b34610acd575f600319360112610acd5761187e604051611840604082612184565b600d81527f5374616b696e672d332e312e32000000000000000000000000000000000000006020820152604051918291602083526020830190612265565b0390f35b34610acd576080600319360112610acd5761189b61208f565b60243590604435906064359073ffffffffffffffffffffffffffffffffffffffff82168203610acd576118cc612486565b73ffffffffffffffffffffffffffffffffffffffff600254163303610b2f5773ffffffffffffffffffffffffffffffffffffffff1691825f52600560205260405f20845f5260205260405f20916fffffffffffffffffffffffffffffffff83541615611a76578161195f9130907f000000000000000000000000000000000000000000000000000000000000000061251f565b6fffffffffffffffffffffffffffffffff81166fffffffffffffffffffffffffffffffff83541601906fffffffffffffffffffffffffffffffff8211611a495765ffffffffffff60017fe4c76dcad70ec0bf6b921afbe6bb7b4950aedf705245ec68942ea9ecf00f8a0c946fffffffffffffffffffffffffffffffff606095167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416178155865f52600460205260405f20611a1d858254612335565b9055611a2b84600854612335565b6008550154166040519182525f60208301526040820152a360015f55005b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f526f6c65206e6f74206c6f636b656400000000000000000000000000000000006044820152fd5b34610acd576040600319360112610acd57611aed61208f565b60243590611af9612486565b73ffffffffffffffffffffffffffffffffffffffff600254163303610b2f5773ffffffffffffffffffffffffffffffffffffffff811691825f52600560205260405f20815f5260205260405f2065ffffffffffff60018201541615611e6e576fffffffffffffffffffffffffffffffff90541690835f52600560205260405f20815f52602052600360405f205f81555f60018201555f600282015501611b9f81546120b2565b9081611e2a575b5050835f52600660205260405f20935f5b855480821015611dfa5783611bcc83896122b8565b90549060031b1c14611be15750600101611bb7565b5f1981969394959601908111611a495761082c611c01611c0f92896122b8565b90549060031b1c92886122b8565b90558454908115611dcd576020955f197f9cadbc33680e22a2f04ed8eb0d7cc7f218ee9231b3473ed05904c7ec5e2d483d930190611c4d82826122b8565b5f1982549160031b1b19169055555b825f526004865260405f20611c72868254612328565b9055825f526004865260405f205415611db8575b611c9285600854612328565b600855835f526007865260405f20612710611cc960405192611cb384612103565b8960018254928387520154940193845288612315565b049051808210611db0575b50858111611da9575b611d21611cea8288612328565b96879383611d61575b8480611d30575b50506040519384934292859094939260609260808301968352602083015260408201520152565b0390a360015f55604051908152f35b611d5a917f00000000000000000000000000000000000000000000000000000000000000006124bd565b8984611cfa565b611da48473ffffffffffffffffffffffffffffffffffffffff600354167f00000000000000000000000000000000000000000000000000000000000000006124bd565b611cf3565b5084611cdd565b905087611cd4565b825f52600486525f6001604082200155611c86565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd5b5050909192602094507f9cadbc33680e22a2f04ed8eb0d7cc7f218ee9231b3473ed05904c7ec5e2d483d90611c5c565b81601f5f9311600114611e415750555b8480611ba6565b81835260208320611e5e91601f0160051c5f1901906001016122fa565b8082528160208120915555611e3a565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e6f206c6f636b20666f756e64000000000000000000000000000000000000006044820152fd5b34610acd576040600319360112610acd57611ee561208f565b60243590811515809203610acd5773ffffffffffffffffffffffffffffffffffffffff90611f11612439565b165f52600960205260405f209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083541691161790555f80f35b34610acd576040600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff611f7b61208f565b165f52600560205260405f206024355f5260205260405f20805461187e65ffffffffffff60018401541692611fb76003600283015492016121a7565b9060405194846fffffffffffffffffffffffffffffffff879616865260801c60208601526040850152606084015260a0608084015260a0830190612265565b34610acd576020600319360112610acd5773ffffffffffffffffffffffffffffffffffffffff61202461208f565b165f90815260046020908152604091829020805460018201546002830154600390930154855192835293820152928301526060820152608090f35b34610acd575f600319360112610acd5760209073ffffffffffffffffffffffffffffffffffffffff600254168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610acd57565b90600182811c921680156120f9575b60208310146120cc57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f16916120c1565b6040810190811067ffffffffffffffff82111761211f57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b60a0810190811067ffffffffffffffff82111761211f57604052565b6080810190811067ffffffffffffffff82111761211f57604052565b90601f601f19910116810190811067ffffffffffffffff82111761211f57604052565b9060405191825f8254926121ba846120b2565b808452936001811690811561222557506001146121e1575b506121df92500383612184565b565b90505f9291925260205f20905f915b8183106122095750509060206121df928201015f6121d2565b60209193508060019154838589010152019101909184926121f0565b602093506121df9592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201015f6121d2565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b9181601f84011215610acd5782359167ffffffffffffffff8311610acd5760208381860195010111610acd57565b80548210156122cd575f5260205f2001905f90565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f5b82811061230857505050565b5f828201556001016122fc565b81810292918115918404141715611a4957565b91908203918211611a4957565b91908201809211611a4957565b906fffffffffffffffffffffffffffffffff809116911603906fffffffffffffffffffffffffffffffff8211611a4957565b949392601f81601f19926040956080958a52606060208b01528160608b0152858a01375f84828a0101520116850101930152565b156123af57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e73756666696369656e74207374616b6500000000000000000000000000006044820152fd5b67ffffffffffffffff811161211f5760051b60200190565b80518210156122cd5760209160051b010190565b73ffffffffffffffffffffffffffffffffffffffff60015416330361245a57565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b60025f54146124955760025f55565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b6121df9273ffffffffffffffffffffffffffffffffffffffff604051937fa9059cbb00000000000000000000000000000000000000000000000000000000602086015216602484015260448301526044825261251a606483612184565b612586565b90919273ffffffffffffffffffffffffffffffffffffffff6121df9481604051957f23b872dd00000000000000000000000000000000000000000000000000000000602088015216602486015216604484015260648301526064825261251a608483612184565b5f73ffffffffffffffffffffffffffffffffffffffff8192169260208151910182855af13d15612652573d67ffffffffffffffff811161211f576125ed916020601f19601f84011601916125dd6040519384612184565b82523d5f602084013e5b8361265e565b805190811515918261262e575b50506126035750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b8192509060209181010312610acd5760200151801590811503610acd575f806125fa565b6125ed906060906125e7565b9061269b575080511561267357805190602001fd5b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b815115806126ee575b6126ac575090565b73ffffffffffffffffffffffffffffffffffffffff907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b156126a456fea264697066735822122025cb3e229da914f7a0654b01bf22e64244a8848c0e3c57f8cabdee7f26162afa64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md b/0.16.23/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md new file mode 100644 index 000000000..816466169 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md @@ -0,0 +1,13 @@ +> `const` **INITIAL\_ROLE\_STAKES**: `object` + +Defined in: [packages/core/src/roles.ts:172](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L172) + +Exact stake requirements from Registry.sol constructor (lines 92-100) + +## Index Signature + +\[`key`: `string`\]: \{ `additionalRequirement?`: `undefined`; `entryBurn`: `"3 GT"`; `exitFeePercent`: `"10%"`; `line`: `92`; `lockDuration`: `"30 days"`; `minExitFee`: `"1 GT"`; `minStake`: `"30 GT"`; \} \| \{ `additionalRequirement`: `"aPNTs collateral in SuperPaymaster"`; `entryBurn`: `"5 GT"`; `exitFeePercent`: `"10%"`; `line`: `93`; `lockDuration`: `"30 days"`; `minExitFee`: `"2 GT"`; `minStake`: `"50 GT"`; \} \| \{ `additionalRequirement?`: `undefined`; `entryBurn`: `"3 GT"`; `exitFeePercent`: `"10%"`; `line`: `94`; `lockDuration`: `"30 days"`; `minExitFee`: `"1 GT"`; `minStake`: `"30 GT"`; \} \| \{ `additionalRequirement?`: `undefined`; `entryBurn`: `"2 GT"`; `exitFeePercent`: `"10%"`; `line`: `95`; `lockDuration`: `"30 days"`; `minExitFee`: `"1 GT"`; `minStake`: `"20 GT"`; \} \| \{ `additionalRequirement?`: `undefined`; `entryBurn`: `"10 GT"`; `exitFeePercent`: `"10%"`; `line`: `98`; `lockDuration`: `"30 days"`; `minExitFee`: `"5 GT"`; `minStake`: `"100 GT"`; \} \| \{ `additionalRequirement?`: `undefined`; `entryBurn`: `"3 GT"`; `exitFeePercent`: `"5%"`; `line`: `99`; `lockDuration`: `"30 days"`; `minExitFee`: `"1 GT"`; `minStake`: `"30 GT"`; \} \| \{ `additionalRequirement`: `"Must hold MySBT from community"`; `entryBurn`: `"0.05 GT"`; `exitFeePercent`: `"10%"`; `line`: `100`; `lockDuration`: `"7 days"`; `minExitFee`: `"0.05 GT"`; `minStake`: `"0.3 GT"`; \} + +## Warning + +These are initial values, always query contract for current configuration diff --git a/0.16.23/api/@aastar/core/variables/LINKS.md b/0.16.23/api/@aastar/core/variables/LINKS.md new file mode 100644 index 000000000..eddd8448a --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/LINKS.md @@ -0,0 +1,33 @@ +> `const` **LINKS**: `object` + +Defined in: [packages/core/src/branding.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/branding.ts#L24) + +## Type Declaration + +### airAccount + +> `readonly` **airAccount**: `"https://airAccount.aastar.io"` = `"https://airAccount.aastar.io"` + +### demo + +> `readonly` **demo**: `"https://aastar.io/demo"` = `"https://aastar.io/demo"` + +### discord + +> `readonly` **discord**: `"https://discord.gg/aastar"` = `"https://discord.gg/aastar"` + +### github + +> `readonly` **github**: `"https://github.com/AAStarCommunity"` = `"https://github.com/AAStarCommunity"` + +### main + +> `readonly` **main**: `"https://aastar.io"` = `"https://aastar.io"` + +### superPaymaster + +> `readonly` **superPaymaster**: `"https://superpaymaster.aastar.io"` = `"https://superpaymaster.aastar.io"` + +### twitter + +> `readonly` **twitter**: `"https://twitter.com/AAStarCommunity"` = `"https://twitter.com/AAStarCommunity"` diff --git a/0.16.23/api/@aastar/core/variables/MAX_SERVICE_FEE.md b/0.16.23/api/@aastar/core/variables/MAX_SERVICE_FEE.md new file mode 100644 index 000000000..cf52b282b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/MAX_SERVICE_FEE.md @@ -0,0 +1,3 @@ +> `const` **MAX\_SERVICE\_FEE**: `1000` = `1000` + +Defined in: [packages/core/src/constants.ts:81](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L81) diff --git a/0.16.23/api/@aastar/core/variables/MONITORING_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/MONITORING_ADDRESSES.md new file mode 100644 index 000000000..b736b7c1c --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/MONITORING_ADDRESSES.md @@ -0,0 +1,15 @@ +> `const` **MONITORING\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L78) + +Monitoring System Addresses + +## Type Declaration + +### blsAggregator + +> `readonly` **blsAggregator**: `` `0x${string}` `` = `BLS_AGGREGATOR_ADDRESS` + +### dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/MySBTABI.md b/0.16.23/api/@aastar/core/variables/MySBTABI.md new file mode 100644 index 000000000..a7967445e --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/MySBTABI.md @@ -0,0 +1,3 @@ +> `const` **MySBTABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L73) diff --git a/0.16.23/api/@aastar/core/variables/MySBTArtifact.md b/0.16.23/api/@aastar/core/variables/MySBTArtifact.md new file mode 100644 index 000000000..214b650d9 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/MySBTArtifact.md @@ -0,0 +1,13 @@ +> `const` **MySBTArtifact**: `object` = `MySBTABIData` + +Defined in: [packages/core/src/abis/index.ts:74](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L74) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60c06040523461020a576138666080813803918261001c81610438565b93849283398101031261020a576100328161045d565b9061003f6020820161045d565b61005760606100506040850161045d565b930161045d565b926100626040610438565b601981527f4d7963656c69756d20536f756c20426f756e6420546f6b656e0000000000000060208201526100966040610438565b6005815264135e54d09560da1b6020820152815190916001600160401b038211610337575f5490600182811c9216801561042e575b60208310146103195781601f8493116103b9575b50602090601f8311600114610356575f9261034b575b50508160011b915f199060031b1c1916175f555b8051906001600160401b0382116103375760015490600182811c9216801561032d575b60208310146103195781601f8493116102a3575b50602090601f831160011461023d575f92610232575b50508160011b915f199060031b1c1916176001555b600160068190556007805460ff19169055601255670429d069189e000060135567016345785d8a00006014556001600160a01b038116151580610220575b8061020e575b1561020a5760805260a052600e80546001600160a01b039283166001600160a01b031991821617909155600f80549390921692169190911790556040516133f49081610472823960805181610e00015260a05181610d850152f35b5f80fd5b506001600160a01b03841615156101af565b506001600160a01b03821615156101a9565b015190505f80610156565b60015f9081528281209350601f198516905b81811061028b5750908460019594939210610273575b505050811b0160015561016b565b01515f1960f88460031b161c191690555f8080610265565b9293602060018192878601518155019501930161024f565b828111156101405760015f52909150601f830160051c7fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf660208510610311575b849392601f0160051c82900391015f5b828110610301575050610140565b5f818301558594506001016102f3565b5f91506102e3565b634e487b7160e01b5f52602260045260245ffd5b91607f169161012c565b634e487b7160e01b5f52604160045260245ffd5b015190505f806100f5565b5f8080528281209350601f198516905b8181106103a15750908460019594939210610389575b505050811b015f55610109565b01515f1960f88460031b161c191690555f808061037c565b92936020600181928786015181550195019301610366565b828111156100df575f8052909150601f830160051c7f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56360208510610426575b849392601f0160051c82900391015f5b8281106104165750506100df565b5f81830155859450600101610408565b5f91506103f8565b91607f16916100cb565b6040519190601f01601f191682016001600160401b0381118382101761033757604052565b51906001600160a01b038216820361020a5756fe6080806040526004361015610012575f80fd5b5f3560e01c90816301ffc9a714611c875750806306433b1b14611c6157806306fdde0314611bbf578063081812fc14611b825780630880427514611b65578063095ea7b314611a485780630f68ae40146119cc57806313966db5146119af57806323b872dd146119985780632d5a7f4f14610da95780632f7c88f514611819578063374e7fa31461159c5780633e3e68421461155c5780633f4ba83a146114a357806342842e0e1461147a5780634f8cc065146113ea57806354fd4d501461138b578063556697da1461129957806355f804b3146110df5780635afc4b5c146110a85780635bb5bf0c146110725780635c975abb146110505780636352211e1461102157806370a0823114610fb757806371eb90a114610ef557806375794a3c14610ed8578063776fafac14610e7a5780637e21579114610e245780637f6b337b14610de157806380f4b8c814610da9578063826600ce14610d665780638456cb5914610cd35780638ceebd8f14610b4d578063908c101814610b0857806395d89b4114610a3e578063a1141b07146109f9578063a22cb4651461093b578063a61096501461089f578063a91ee0dc14610806578063b88d4fde146107a6578063bead05131461076d578063bf1fb0f2146106c8578063c0d0aa69146106a2578063c580163e1461064b578063c87b56dd14610376578063ccbc10d014610350578063d977b66b1461030e578063e985e9c5146102b55763eddd0d9c14610237575f80fd5b346102b15760206003193601126102b1577fd3950a5507479ea19c5c7766f5191546ace60f0a00dc360d52ce083b58f223316004356102826001600160a01b03600f54163314611fb1565b60145490806014556102ac6040519283924291846040919493926060820195825260208201520152565b0390a1005b5f80fd5b346102b15760406003193601126102b1576102ce611d7b565b6001600160a01b036102de611d91565b91165f5260056020526001600160a01b0360405f2091165f52602052602060ff60405f2054166040519015158152f35b346102b15760406003193601126102b15761034e61032a611d7b565b610332611d91565b906103496001600160a01b03600e541633146122bc565b6132eb565b005b346102b1575f6003193601126102b15760206001600160a01b0360105416604051908152f35b346102b15760206003193601126102b15760043561039381612faa565b5060405160115490915f836103a784611f60565b9182825260208201946001811690815f1461062f57506001146105d0575b6103d192500384611eeb565b8251156105b4578092815f927a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000811015610589575b50806d04ee2d6d415b85acef8100000000600a92101561056e575b662386f26fc1000081101561055a575b6305f5e100811015610549575b61271081101561053a575b606481101561052c575b1015610522575b6001820193600a5f19602161048261046c89611f0e565b9861047a6040519a8b611eeb565b808a52611f0e565b95601f1960208a0197013688378801015b01917f30313233343536373839616263646566000000000000000000000000000000008282061a8353049081156104cf57600a905f1990610493565b5050602061050a9261051e956040519586945180918587015e840190838201905f8252519283915e01015f815203601f198101835282611eeb565b604051918291602083526020830190611d56565b0390f35b9060010190610455565b60646002910493019261044e565b61271060049104930192610444565b6305f5e10060089104930192610439565b662386f26fc100006010910493019261042c565b6d04ee2d6d415b85acef81000000006020910493019261041c565b604093507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000090049050600a610401565b50505061051e6040516105c8602082611eeb565b5f815261050a565b5060115f90815290917f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c685b8183106106135750509060206103d1928201016103c5565b6020919350806001915483858a010152019101909185926105fb565b60ff19168652506103d192151560051b820160200190506103c5565b346102b15761068b61065c36611e23565b92909150610668612ff6565b610670613169565b6106866001600160a01b03600e541633146122bc565b612df1565b600160065560408051928352901515602083015290f35b346102b1575f6003193601126102b15760206001600160a01b03600f5416604051908152f35b346102b15760206003193601126102b1575f60606040516106e881611ecf565b82815282602082015282604082015201526004355f526009602052608060405f2060405161071581611ecf565b6001600160a01b03825416918282526001600160a01b03806001830154166020840190815260606003600285015494604087019586520154940193845260405194855251166020840152516040830152516060820152f35b346102b15760206003193601126102b15761079f610789611d7b565b610791612ff6565b610799613169565b336132eb565b6001600655005b346102b15760806003193601126102b1576107bf611d7b565b6107c7611d91565b6064359167ffffffffffffffff83116102b157366023840112156102b1576107fc61034e933690602481600401359101611f2a565b9160443591612c22565b346102b15760206003193601126102b1576001600160a01b03610827611d7b565b61083682600f54163314611fb1565b1680156102b157600e54817fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600e557f724c89272c35417e239c6cd89ada342e0717632938f38b47eaacecacf291ace260206001600160a01b03604051934285521692a3005b346102b15760206003193601126102b1576108b8611d7b565b6108ce6001600160a01b03600f54163314611fb1565b6001600160a01b03601054911690817fffffffffffffffffffffffff00000000000000000000000000000000000000008216176010557fb71a92720c720f655d24a8ebbeeb4c9875d85189ca58d32cb0e6997aa5e6c29160206001600160a01b03604051934285521692a3005b346102b15760406003193601126102b157610954611d7b565b60243590811515908183036102b1576001600160a01b03169182156109cd5761099f90335f52600560205260405f20845f5260205260405f209060ff60ff1983541691151516179055565b6040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b827f5b08ba18000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b346102b15760406003193601126102b157610a12611d91565b6004355f52600b6020526001600160a01b0360405f2091165f52602052602060405f2054604051908152f35b346102b1575f6003193601126102b1576040515f600154610a5e81611f60565b8084529060018116908115610ae45750600114610a86575b61051e8361050a81850382611eeb565b60015f9081527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6939250905b808210610aca5750909150810160200161050a610a76565b919260018160209254838588010152019101909291610ab2565b60ff191660208086019190915291151560051b8401909101915061050a9050610a76565b346102b15760406003193601126102b157610b21611d91565b6004355f52600d6020526001600160a01b0360405f2091165f52602052602060405f2054604051908152f35b346102b15760206003193601126102b1576004355f52600a60205260405f208054610b77816129ba565b91610b856040519384611eeb565b81835260208301905f5260205f205f915b838310610cb5575f85815b8151811015610bda576060610bb68284612c0e565b510151610bc6575b600101610ba1565b91610bd26001916125a5565b929050610bbe565b50610bfd610be7836129ba565b92610bf56040519485611eeb565b8084526129ba565b90601f196020840192013683375f5f5b8251811015610c66576060610c228285612c0e565b510151610c32575b600101610c0d565b90610c5e6001916001600160a01b03610c4b8587612c0e565b515116610c588289612c0e565b526125a5565b919050610c2a565b50505090604051918291602083019060208452518091526040830191905f5b818110610c93575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610c85565b60056020600192610cc5856129d2565b815201920192019190610b96565b346102b1575f6003193601126102b157610cf96001600160a01b03600f54163314611fb1565b610d01612ff6565b600160ff1960075416176007557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b346102b1575f6003193601126102b15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346102b15760206003193601126102b1576001600160a01b03610dca611d7b565b165f526008602052602060405f2054604051908152f35b346102b1575f6003193601126102b15760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b346102b15760606003193601126102b157610e3d611d91565b6004355f52600c6020526001600160a01b0360405f2091165f5260205260405f206044355f52602052602060ff60405f2054166040519015158152f35b346102b15760206003193601126102b1576004355f526009602052608060405f206001600160a01b03815416906001600160a01b03600182015416906003600282015491015491604051938452602084015260408301526060820152f35b346102b1575f6003193601126102b1576020601254604051908152f35b346102b15760406003193601126102b157600435610f11611d91565b9060606080604051610f2281611eb3565b5f81525f60208201525f60408201525f838201520152805f52600b60205260405f206001600160a01b0383165f5260205260405f205490805f52600a60205260405f20548210156102b157610f8b91610f85915f52600a60205260405f20612276565b506129d2565b906001600160a01b03808351169116036102b15761051e90604051918291602083526020830190611e6a565b346102b15760206003193601126102b1576001600160a01b03610fd8611d7b565b168015610ff5575f526003602052602060405f2054604051908152f35b7f89c62b64000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b346102b15760206003193601126102b157602061103f600435612faa565b6001600160a01b0360405191168152f35b346102b1575f6003193601126102b157602060ff600754166040519015158152f35b346102b15760406003193601126102b157602061109e611090611d7b565b611098611d91565b90612b74565b6040519015158152f35b346102b15760206003193601126102b15761034e6110c4611d7b565b6110da6001600160a01b03600e541633146122bc565b612abb565b346102b15760206003193601126102b15760043567ffffffffffffffff81116102b157611110903690600401611df5565b6111266001600160a01b03600f54163314611fb1565b67ffffffffffffffff811161126c57611140601154611f60565b601f81116111fe575b505f601f8211600114611186578190611176935f9261117b575b50505f198260011b9260031b1c19161790565b601155005b013590508380611163565b601f198216927f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68915f5b8581106111e6575083600195106111cd575b505050811b01601155005b5f1960f88560031b161c199101351690558280806111c2565b909260206001819286860135815501940191016111b0565b818111156111495760115f52601f820160051c7f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c6860208410611264575b81601f9101920160051c03905f5b828110611257575050611149565b5f82820155600101611249565b5f915061123b565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b346102b15760206003193601126102b1576004355f52600a60205260405f208054906112c4826129ba565b916112d26040519384611eeb565b8083526020830180925f5260205f205f915b83831061136d57848660405191829160208301906020845251809152604083019060408160051b85010192915f905b82821061132257505050500390f35b9193602061135d827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc060019597998495030186528851611e6a565b9601920192018594939192611313565b6005602060019261137d856129d2565b8152019201920191906112e4565b346102b1575f6003193601126102b15761051e6040516113ac604082611eeb565b600b81527f4d795342542d332e312e320000000000000000000000000000000000000000006020820152604051918291602083526020830190611d56565b346102b15760206003193601126102b157611403611d7b565b600f54906001600160a01b038083169161141e833314611fb1565b169182156102b1577fffffffffffffffffffffffff000000000000000000000000000000000000000083911617600f557f90de8705b1aaf3966be0e8ec8acf9aed10a6d3d0d572ec8f96112409e2820c616020604051428152a3005b346102b15761034e61148b36611dbb565b906040519261149b602085611eeb565b5f8452612c22565b346102b1575f6003193601126102b1576114c96001600160a01b03600f54163314611fb1565b60075460ff8116156115345760ff19166007557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b7f8dfc202b000000000000000000000000000000000000000000000000000000005f5260045ffd5b346102b15761068b61156d36611e23565b92909150611579612ff6565b611581613169565b6115976001600160a01b03600e541633146122bc565b6125cf565b346102b15760206003193601126102b1576001600160a01b036115bd611d7b565b6115c5612ff6565b6115cd613169565b6115dc82600e541633146122bc565b16805f52600860205260405f205490811515806117ff575b156102b157815f52600a60205260405f205f5b815481101561168b578060ff600361162160019486612276565b50015416611630575b01611607565b600361163c8285612276565b500160ff1981541690556001600160a01b036116588285612276565b505416857fee0396c067d25a2fde86b8e1c13e3995b0940b5f98651052d79fada14ea7dba56020604051428152a361162a565b5050805f5260086020525f6040812055815f5260026020526001600160a01b0360405f2054161580156117f7575b156102b157815f5260026020526001600160a01b0360405f20541680159081156117a8575b835f52600260205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055835f827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a45061177c577f108d98610c6944880c68d31a01ab6252b635e7c7a9728687f31e68a76538c86560606013546040519081525f6020820152426040820152a36001600655005b507f7e273289000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6117df845f52600460205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b805f52600360205260405f205f1981540190556116de565b5060016116b9565b50806001600160a01b0361181284612faa565b16146115f4565b346102b15760206003193601126102b157611832611d7b565b61183a612ff6565b61184333613042565b156102b1576001600160a01b03165f52600860205260405f205480156102b157805f52600b60205260405f206001600160a01b0333165f5260205260405f2054815f52600a60205260405f20548110908161196f575b50156102b157805f52600d60205260405f206001600160a01b0333165f5260205260405f2054801590811561192b575b50156102b157805f52600d60205260405f206001600160a01b0333165f5260205260405f204290556040519062093a80420482524260208301527f0bd2c5444bc0126737809a3970e1c3bc8cf29e5efb7d5448cbaa6a9c1af8120760403393a3005b905061012c810180911161194257421015826118c9565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6119859150825f52600a60205260405f20612276565b50546001600160a01b0316331482611899565b346102b15761034e6119a936611dbb565b91612016565b346102b1575f6003193601126102b1576020601454604051908152f35b346102b15760206003193601126102b1576004356119f66001600160a01b03600f54163314611fb1565b80156102b1577f5d1f56e31e5dc1f29354822b887b1463ececf7edfad7c39216980b7dfd7ea97d9060135490806013556102ac6040519283924291846040919493926060820195825260208201520152565b346102b15760406003193601126102b157611a61611d7b565b602435611a6d81612faa565b33151580611b52575b80611b1f575b611af35781906001600160a01b0380851691167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9255f80a45f5260046020526001600160a01b0360405f2091167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790555f80f35b7fa9fbf51f000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b506001600160a01b0381165f52600560205260405f206001600160a01b0333165f5260205260ff60405f20541615611a7c565b50336001600160a01b0382161415611a76565b346102b1575f6003193601126102b1576020601354604051908152f35b346102b15760206003193601126102b157600435611b9f81612faa565b505f52600460205260206001600160a01b0360405f205416604051908152f35b346102b1575f6003193601126102b1576040515f5f54611bde81611f60565b8084529060018116908115610ae45750600114611c055761051e8361050a81850382611eeb565b5f8080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563939250905b808210611c475750909150810160200161050a610a76565b919260018160209254838588010152019101909291611c2f565b346102b1575f6003193601126102b15760206001600160a01b03600e5416604051908152f35b346102b15760206003193601126102b157600435907fffffffff0000000000000000000000000000000000000000000000000000000082168092036102b157817f80ac58cd0000000000000000000000000000000000000000000000000000000060209314908115611d2c575b8115611d02575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483611cfb565b7f5b5e139f0000000000000000000000000000000000000000000000000000000081149150611cf4565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b600435906001600160a01b03821682036102b157565b602435906001600160a01b03821682036102b157565b35906001600160a01b03821682036102b157565b60031960609101126102b1576004356001600160a01b03811681036102b157906024356001600160a01b03811681036102b1579060443590565b9181601f840112156102b15782359167ffffffffffffffff83116102b157602083818601950101116102b157565b60606003198201126102b1576004356001600160a01b03811681036102b15791602435916044359067ffffffffffffffff82116102b157611e6691600401611df5565b9091565b9060a06080611eb0936001600160a01b03815116845260208101516020850152604081015160408501526060810151151560608501520151918160808201520190611d56565b90565b60a0810190811067ffffffffffffffff82111761126c57604052565b6080810190811067ffffffffffffffff82111761126c57604052565b90601f601f19910116810190811067ffffffffffffffff82111761126c57604052565b67ffffffffffffffff811161126c57601f01601f191660200190565b929192611f3682611f0e565b91611f446040519384611eeb565b8294818452818301116102b1578281602093845f960137010152565b90600182811c92168015611fa7575b6020831014611f7a57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691611f6f565b15611fb857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4f6e6c792044414f0000000000000000000000000000000000000000000000006044820152fd5b91906001600160a01b0316801561224a57815f5260026020526001600160a01b0360405f205416158015612243575b156102b157815f5260026020526001600160a01b0360405f20541692823315159283612175575b6001600160a01b03935085612126575b805f52600360205260405f2060018154019055815f52600260205260405f20817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055857fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4168083036120f557505050565b7f64283d7b000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffd5b61215d825f52600460205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b855f52600360205260405f205f19815401905561207c565b91929050806121ec575b1561218c5782829161206c565b82846121bd577f7e273289000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f177e802f000000000000000000000000000000000000000000000000000000005f523360045260245260445ffd5b50338414801561221a575b8061217f5750825f526004602052336001600160a01b0360405f2054161461217f565b50835f52600560205260405f206001600160a01b0333165f5260205260ff60405f2054166121f7565b505f612045565b7f64a0ae92000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b805482101561228f575f52600560205f20910201905f90565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b156122c357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4f6e6c79205265676973747279000000000000000000000000000000000000006044820152fd5b1561232857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f496e76616c6964207573657200000000000000000000000000000000000000006044820152fd5b91906040838203126102b15761239b83611da7565b9260208101359067ffffffffffffffff82116102b157019080601f830112156102b157816020611eb093359101611f2a565b91909180546801000000000000000081101561126c576123f291600182018155612276565b6125795760046080916001600160a01b0380865116167fffffffffffffffffffffffff0000000000000000000000000000000000000000825416178155602085015160018201556040850151600282015561246360608601511515600383019060ff60ff1983541691151516179055565b0192015191825167ffffffffffffffff811161126c576124838254611f60565b601f8111612528575b506020601f82116001146124ca5781906124bb9394955f926124bf5750505f198260011b9260031b1c19161790565b9055565b015190505f80611163565b601f19821690835f52805f20915f5b818110612510575095836001959697106124f8575b505050811b019055565b01515f1960f88460031b161c191690555f80806124ee565b9192602060018192868b0151815501940192016124d9565b8181111561248c57825f5260205f20601f830160051c9060208410612571575b81601f9101920160051c03905f5b82811061256457505061248c565b5f82820155600101612556565b5f9150612548565b7f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b5f1981146119425760010190565b9291906125ca602091604086526040860190611d56565b930152565b929091926001600160a01b0381166125e8811515612321565b805f52600860205260405f205480155f146127a457506012549061260b826125a5565b6012558195600195818101946020828703126102b15784612788916127647ff5491bdb765a4be5a1bdc9bfd09cf61e1b89962ac33ed2e928f11a59a5e72331956001600160a01b0361265c87611da7565b16998c60038c6040519261266f84611ecf565b8c84526020840191825260408401904282526001600160a01b038060608701948386528c5f526009602052818060405f20995116167fffffffffffffffffffffffff0000000000000000000000000000000000000000895416178855511691860191167fffffffffffffffffffffffff000000000000000000000000000000000000000082541617905551600284015551910155885f5260086020528460405f2055602096876040516127228282611eeb565b5f81529311612791575b5050835f52600a865260405f206040519161274683611eb3565b8b835242888401524260408401528d606084015260808301526123cd565b815f52600b845260405f206001600160a01b0389165f5284525f60408120556131a2565b604051428152a4565b61279b9250612386565b90505f8061272c565b94939150505f92808201916020818403126102b1576001600160a01b036127ca82611da7565b1692865f52600b60205260405f206001600160a01b0385165f5260205260405f2054875f52600a60205260405f2054811080612992575b6128fd5750602091826040516128178282611eeb565b5f815294116128e8575b5050855f52600a815261285e60405f206040519061283e82611eb3565b8582524284830152426040830152600160608301528460808301526123cd565b855f52600a815260405f2054905f19820191821161194257869260096128e3927fdce074e613075d639af3f726477d52ac48d3fbdb03f4aa8a9b1e6cede312db1094865f52600b825260405f206001600160a01b0389165f52825260405f2055855f5252600360405f20016128d381546125a5565b90556040519182914290836125b3565b0390a3565b6128f3929350612386565b9050905f80612821565b9394969550505050825f52600a60205260ff600361291e8360405f20612276565b500154161561292f575b5050905f90565b612946600391845f52600a60205260405f20612276565b5001600160ff19825416179055817fdce074e613075d639af3f726477d52ac48d3fbdb03f4aa8a9b1e6cede312db106060604051604081525f6040820152426020820152a35f80612928565b50875f52600a602052846001600160a01b036129b18360405f20612276565b50541614612801565b67ffffffffffffffff811161126c5760051b60200190565b906040516129df81611eb3565b600481936001600160a01b038154168352600181015460208401526002810154604084015260ff60038201541615156060840152019060405180925f90805490612a2882611f60565b8085529160018116908115612a945750600114612a55575b505060809291612a51910384611eeb565b0152565b5f908152602081209092505b818310612a78575050810160200181612a51612a40565b6020919350806001915483858901015201910190918492612a61565b60ff191660208681019190915292151560051b85019092019250839150612a519050612a40565b6001600160a01b03165f52600860205260405f2054908115612b7057815f52600a60205260405f20915f5b8354811015612b6a578060ff6003612b0060019488612276565b50015416612b0f575b01612ae6565b6003612b1b8287612276565b500160ff1981541690556001600160a01b03612b378287612276565b505416837fee0396c067d25a2fde86b8e1c13e3995b0940b5f98651052d79fada14ea7dba56020604051428152a3612b09565b50509050565b9050565b6001600160a01b03165f52600860205260405f20548015612c0857805f52600b60205260405f206001600160a01b0383165f5260205260405f205490805f52600a60205260405f2054821015612c0157612bdc91610f85915f52600a60205260405f20612276565b906001600160a01b03808351169116149081612bf6575090565b606091500151151590565b5050505f90565b50505f90565b805182101561228f5760209160051b010190565b90612c2e838284612016565b803b612c3b575b50505050565b602091612c9a6001600160a01b038093169560405195869485947f150b7a020000000000000000000000000000000000000000000000000000000086523360048701521660248501526044840152608060648401526084830190611d56565b03815f865af15f9181612d94575b50612d1657503d15612d0f573d612cbe81611f0e565b90612ccc6040519283611eeb565b81523d5f602083013e5b80519081612d0a57827f64a0ae92000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b602001fd5b6060612cd6565b7fffffffff000000000000000000000000000000000000000000000000000000007f150b7a0200000000000000000000000000000000000000000000000000000000911603612d6957505f808080612c35565b7f64a0ae92000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b9091506020813d602011612de9575b81612db060209383611eeb565b810103126102b157517fffffffff00000000000000000000000000000000000000000000000000000000811681036102b157905f612ca8565b3d9150612da3565b929091926001600160a01b038116612e0a811515612321565b805f52600860205260405f205480155f14612e2d57506012549061260b826125a5565b94939150505f92808201916020818403126102b1576001600160a01b03612e5382611da7565b169260209182604051612e668282611eeb565b5f81529411612f95575b5050855f52600b815260405f206001600160a01b0384165f52815260405f2054865f52600a825260405f2054811080612f6e575b612ec45750855f52600a815261285e60405f206040519061283e82611eb3565b9091868096505f9794959752600a835260ff6003612ee58460405f20612276565b50015416612f6457612f47612f5c92600a7fdce074e613075d639af3f726477d52ac48d3fbdb03f4aa8a9b1e6cede312db1095875f528181526003612f2d8460405f20612276565b5001600160ff19825416179055875f525260405f20612276565b506001429101556040519182914290836125b3565b0390a3905f90565b5050505050905f90565b50865f52600a8252836001600160a01b03612f8c8360405f20612276565b50541614612ea4565b612fa0929350612386565b9050905f80612e70565b805f5260026020526001600160a01b0360405f205416908115612fcb575090565b7f7e273289000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b60ff6007541661300257565b7fd93c0665000000000000000000000000000000000000000000000000000000005f5260045ffd5b908160209103126102b1575180151581036102b15790565b6001600160a01b03600e5416908115612c08576001600160a01b03604051917f91d148540000000000000000000000000000000000000000000000000000000083527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07460048401521690816024820152602081604481865afa5f9181613148575b5061314257506020906024604051809481937f6b10437f00000000000000000000000000000000000000000000000000000000835260048301525afa5f9181613111575b50611eb057505f90565b61313491925060203d60201161313b575b61312c8183611eeb565b81019061302a565b905f613107565b503d613122565b91505090565b61316291925060203d60201161313b5761312c8183611eeb565b905f6130c3565b60026006541461317a576002600655565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b6001600160a01b031690811561224a57805f5260026020526001600160a01b0360405f2054161580156132e4575b156102b157805f5260026020526001600160a01b0360405f205416908115159283613295575b805f52600360205260405f2060018154019055815f52600260205260405f20817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a45061326957565b7f73c6ac6e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b6132cc825f52600460205260405f207fffffffffffffffffffffffff00000000000000000000000000000000000000008154169055565b825f52600360205260405f205f1981540190556131f6565b505f6131d0565b6001600160a01b03165f52600860205260405f205480156133ba57805f52600b60205260405f206001600160a01b0383165f5260205260405f2054815f52600a60205260405f20548110156133b55761334f90825f52600a60205260405f20612276565b506001600160a01b03808254169316809314806133a7575b61337057505050565b60030160ff1981541690557fee0396c067d25a2fde86b8e1c13e3995b0940b5f98651052d79fada14ea7dba56020604051428152a3565b5060ff600382015416613367565b505050565b505056fea264697066735822122095c9b3591a32bc3207c17be68c9388a63758cdb83cfe60d91a3ed00981ae04ce64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/NETWORKS.md b/0.16.23/api/@aastar/core/variables/NETWORKS.md new file mode 100644 index 000000000..de616e411 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/NETWORKS.md @@ -0,0 +1,151 @@ +> `const` **NETWORKS**: `object` + +Defined in: [packages/core/src/networks.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/networks.ts#L5) + +Blockchain Network Configuration + +## Type Declaration + +### anvil + +> `readonly` **anvil**: `object` + +#### anvil.blockExplorer + +> `readonly` **blockExplorer**: `""` = `''` + +#### anvil.chainId + +> `readonly` **chainId**: `31337` = `31337` + +#### anvil.name + +> `readonly` **name**: `"Anvil"` = `'Anvil'` + +#### anvil.nativeCurrency + +> `readonly` **nativeCurrency**: `object` + +#### anvil.nativeCurrency.decimals + +> `readonly` **decimals**: `18` = `18` + +#### anvil.nativeCurrency.name + +> `readonly` **name**: `"ETH"` = `'ETH'` + +#### anvil.nativeCurrency.symbol + +> `readonly` **symbol**: `"ETH"` = `'ETH'` + +#### anvil.rpcUrl + +> `readonly` **rpcUrl**: `"http://127.0.0.1:8545"` = `'http://127.0.0.1:8545'` + +### op-sepolia + +> `readonly` **op-sepolia**: `object` + +#### op-sepolia.blockExplorer + +> `readonly` **blockExplorer**: `"https://optimism-sepolia.blockscout.com"` = `'https://optimism-sepolia.blockscout.com'` + +#### op-sepolia.chainId + +> `readonly` **chainId**: `11155420` = `11155420` + +#### op-sepolia.name + +> `readonly` **name**: `"Optimism Sepolia"` = `'Optimism Sepolia'` + +#### op-sepolia.nativeCurrency + +> `readonly` **nativeCurrency**: `object` + +#### op-sepolia.nativeCurrency.decimals + +> `readonly` **decimals**: `18` = `18` + +#### op-sepolia.nativeCurrency.name + +> `readonly` **name**: `"Sepolia Ether"` = `'Sepolia Ether'` + +#### op-sepolia.nativeCurrency.symbol + +> `readonly` **symbol**: `"ETH"` = `'ETH'` + +#### op-sepolia.rpcUrl + +> `readonly` **rpcUrl**: `"https://sepolia.optimism.io"` = `'https://sepolia.optimism.io'` + +### optimism + +> `readonly` **optimism**: `object` + +#### optimism.blockExplorer + +> `readonly` **blockExplorer**: `"https://optimistic.etherscan.io"` = `'https://optimistic.etherscan.io'` + +#### optimism.chainId + +> `readonly` **chainId**: `10` = `10` + +#### optimism.name + +> `readonly` **name**: `"Optimism"` = `'Optimism'` + +#### optimism.nativeCurrency + +> `readonly` **nativeCurrency**: `object` + +#### optimism.nativeCurrency.decimals + +> `readonly` **decimals**: `18` = `18` + +#### optimism.nativeCurrency.name + +> `readonly` **name**: `"Ether"` = `'Ether'` + +#### optimism.nativeCurrency.symbol + +> `readonly` **symbol**: `"ETH"` = `'ETH'` + +#### optimism.rpcUrl + +> `readonly` **rpcUrl**: `"https://mainnet.optimism.io"` = `'https://mainnet.optimism.io'` + +### sepolia + +> `readonly` **sepolia**: `object` + +#### sepolia.blockExplorer + +> `readonly` **blockExplorer**: `"https://sepolia.etherscan.io"` = `'https://sepolia.etherscan.io'` + +#### sepolia.chainId + +> `readonly` **chainId**: `11155111` = `11155111` + +#### sepolia.name + +> `readonly` **name**: `"Sepolia"` = `'Sepolia'` + +#### sepolia.nativeCurrency + +> `readonly` **nativeCurrency**: `object` + +#### sepolia.nativeCurrency.decimals + +> `readonly` **decimals**: `18` = `18` + +#### sepolia.nativeCurrency.name + +> `readonly` **name**: `"Sepolia ETH"` = `'Sepolia ETH'` + +#### sepolia.nativeCurrency.symbol + +> `readonly` **symbol**: `"ETH"` = `'ETH'` + +#### sepolia.rpcUrl + +> `readonly` **rpcUrl**: `"https://rpc.sepolia.org"` = `'https://rpc.sepolia.org'` diff --git a/0.16.23/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md b/0.16.23/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md new file mode 100644 index 000000000..7fb40ecd3 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md @@ -0,0 +1,21 @@ +> `const` **NODE\_STAKE\_AMOUNTS**: `object` + +Defined in: [packages/core/src/constants.ts:87](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L87) + +## Type Declaration + +### ENTERPRISE + +> `readonly` **ENTERPRISE**: `1000` = `1000` + +### LITE + +> `readonly` **LITE**: `30` = `30` + +### STANDARD + +> `readonly` **STANDARD**: `100` = `100` + +### SUPER + +> `readonly` **SUPER**: `300` = `300` diff --git a/0.16.23/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md new file mode 100644 index 000000000..27db59ae2 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md @@ -0,0 +1,11 @@ +> `const` **OFFICIAL\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:86](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L86) + +Official Contract Addresses + +## Type Declaration + +### entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md new file mode 100644 index 000000000..aa5e4e98f --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md @@ -0,0 +1,15 @@ +> `const` **PAYMASTER\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L70) + +Paymaster Addresses + +## Type Declaration + +### paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `` `0x${string}` `` + +### paymasterV4\_1iImplementation + +> `readonly` **paymasterV4\_1iImplementation**: `` `0x${string}` `` = `PAYMASTER_V4_IMPL_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md b/0.16.23/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md new file mode 100644 index 000000000..8632110bb --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md @@ -0,0 +1,3 @@ +> **PAYMASTER\_FACTORY\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L35) diff --git a/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_ADDRESS.md b/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_ADDRESS.md new file mode 100644 index 000000000..50d6955f4 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_ADDRESS.md @@ -0,0 +1,3 @@ +> **PAYMASTER\_V4\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L36) diff --git a/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md b/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md new file mode 100644 index 000000000..a927c1f85 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md @@ -0,0 +1,3 @@ +> **PAYMASTER\_V4\_IMPL\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L37) diff --git a/0.16.23/api/@aastar/core/variables/PaymasterABI.md b/0.16.23/api/@aastar/core/variables/PaymasterABI.md new file mode 100644 index 000000000..7a2bcec49 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PaymasterABI.md @@ -0,0 +1,3 @@ +> `const` **PaymasterABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L53) diff --git a/0.16.23/api/@aastar/core/variables/PaymasterArtifact.md b/0.16.23/api/@aastar/core/variables/PaymasterArtifact.md new file mode 100644 index 000000000..4241e6e75 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PaymasterArtifact.md @@ -0,0 +1,13 @@ +> `const` **PaymasterArtifact**: `object` = `PaymasterABIData` + +Defined in: [packages/core/src/abis/index.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L54) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs?`: `undefined`; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: (\{ `components`: `object`[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a03461019057601f612a9b38819003918201601f19168301916001600160401b038311848410176101945780849260209460405283398101031261019057516001600160a01b0381169081900361019057331561017d575f8054336001600160a01b0319821681178355604051939290916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055801561016e576080525f516020612a7b5f395f51905f525460ff8160401c1661015f576002600160401b03196001600160401b0382160161010c575b6040516128d290816101a98239608051818181610fe0015281816111c801528181611cd001526122670152f35b6001600160401b0319166001600160401b039081175f516020612a7b5f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f806100df565b63f92ee8a960e01b5f5260045ffd5b632462edf160e01b5f5260045ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe6080604052600436101561001a575b3615610018575f80fd5b005b5f5f3560e01c80630396cb6014611fa1578063083e91c414611edc5780630879c41214611ebe57806314d90e1b14611ea1578063204120bc14611e69578063205c287814611ddd5780633272668414611dbd5780633400ba5214611da157806336f897e714611cad57806339788cd914611c8c57806342f6fb2914611c65578063431f63c914611b5f5780634915a85814611b3c5780634a58db1914611acf57806352b7512c1461169757806354fd4d50146116325780635c975abb1461160f5780635dbfc94d146113e857806361d027b3146113c157806361d1bc94146113a3578063673a7e28146112825780636f374b0f1461125d578063715018a6146111ec5780637b103999146111a85780637c627b21146110ec5780638da5cb5b146110c65780638ee573ac1461108b5780639b1d309114611006578063a032f4b814610fc0578063aa51e01514610fa4578063b0d691fe14610f7d578063b1f145c514610ca0578063b3db428b14610b45578063bb9fe6bf14610ad7578063bd11187014610ab9578063c23a5cea14610a15578063c23f001f146109c7578063c9929dad14610972578063e68b52e71461094e578063e77fc7a41461048e578063f0f44260146103da578063f2fde38b14610371578063f3fef3a31461024d5763f60fdcb314610209575061000e565b3461024a578060031936011261024a57604060055481519079ffffffffffffffffffffffffffffffffffffffffffffffffffff8116825260d01c6020820152f35b80fd5b503461024a57604060031936011261024a5761026761203b565b60243590610273612582565b338352600a602052604083206001600160a01b0382165f526020528160405f205410610349576001600160a01b0390338452600a602052604084208282165f5260205260405f206102c58482546121ec565b905516906103166040517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015233602482015282604482015260448152610310606482612107565b83612730565b6040519081527fa92ff919b850e4909ab2261d907ef955f11bc1716733a6cbece38d163a69af8a60203392a36001805580f35b6004837fa18ee550000000000000000000000000000000000000000000000000000000008152fd5b503461024a57602060031936011261024a5761038b61203b565b610393612543565b6001600160a01b038116156103ae576103ab906125df565b80f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b503461024a57602060031936011261024a576001600160a01b036103fc61203b565b610404612543565b168015610466577fffffffffffffffffffffffff0000000000000000000000000000000000000000600654826001600160a01b0382167f4ab5be82436d353e61ca18726e984e561f5c1cc7c6d38b29d2553c790434705a8680a3161760065580f35b6004827f2462edf1000000000000000000000000000000000000000000000000000000008152fd5b503461024a5760e060031936011261024a576104a861203b565b6104b0612051565b6044356001600160a01b03811680910361094a57606435906001600160a01b0382168092036109465760843560c435917ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549560ff8760401c16159667ffffffffffffffff81168015908161093e575b6001149081610934575b15908161092b575b506109035790818860017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000006001600160a01b039516177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00556108ae575b5016938415610886576001600160a01b03861694851561085e57821561085e57811561085e576103e88411610836577fffffffffffffffffffffffff0000000000000000000000000000000000000000600254161760025560035490807fffffffffffffffffffffffff00000000000000000000000000000000000000008316176003556040517f313ce567000000000000000000000000000000000000000000000000000000008152602081600481855afa8a9181610805575b506107bd57505050740800000000000000000000000000000000000000007fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff60035416176003555b7fffffffffffffffffffffffff0000000000000000000000000000000000000000600654161760065560075560a4356008558015155f146107b4575b6004557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0060095416600955610702826125df565b33036107a5575b506107115780f35b7fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a180f35b6107ae906125df565b5f610709565b50610e106106ce565b74ff00000000000000000000000000000000000000007fffffffffffffffffffffff0000000000000000000000000000000000000000009160a01b1692161717600355610692565b61082891925060203d60201161082f575b6108208183612107565b810190612148565b905f61064a565b503d610816565b6004897f2cbc9627000000000000000000000000000000000000000000000000000000008152fd5b6004897f2462edf1000000000000000000000000000000000000000000000000000000008152fd5b6004887f2462edf1000000000000000000000000000000000000000000000000000000008152fd5b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555f61058f565b6004897ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b9050155f610532565b303b15915061052a565b899150610520565b8480fd5b8380fd5b503461024a578060031936011261024a57602060ff60035460a01c16604051908152f35b503461024a57602060031936011261024a5760043561098f612543565b7f49081791577ea5202d6975e5d6ad3a55a49709b1adf70fbd4fbf4b3ffda6e03160406008548151908152836020820152a160085580f35b503461024a57604060031936011261024a576001600160a01b0360406109eb61203b565b92826109f5612051565b94168152600a6020522091165f52602052602060405f2054604051908152f35b503461024a57602060031936011261024a5780610a3061203b565b610a38612543565b6001600160a01b036002541690813b15610ab5576001600160a01b03602484928360405195869485937fc23a5cea0000000000000000000000000000000000000000000000000000000085521660048401525af18015610aaa57610a995750f35b81610aa391612107565b61024a5780f35b6040513d84823e3d90fd5b5050fd5b503461024a578060031936011261024a576020600454604051908152f35b503461024a578060031936011261024a57610af0612543565b806001600160a01b0360025416803b15610b42578180916004604051809481937fbb9fe6bf0000000000000000000000000000000000000000000000000000000083525af18015610aaa57610a995750f35b50fd5b503461024a57606060031936011261024a57610b5f61203b565b610b67612051565b6001600160a01b0360443591610b7b612582565b1691828452600b602052604084205415610c785760206001600160a01b037ff0d0e99cae184d0187b093b48894117462462379674a6e11d89c3fbb618e96b092610c476040517f23b872dd0000000000000000000000000000000000000000000000000000000085820152610c4181610c15893033602485016001600160a01b036040929594938160608401971683521660208201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282612107565b87612730565b1692838652600a825260408620855f52825260405f20610c688282546121b2565b9055604051908152a36001805580f35b6004847f5f77d0bd000000000000000000000000000000000000000000000000000000008152fd5b503461024a57604060031936011261024a57610cba612051565b303303610f55576001600160a01b031690818152600b60205260408120548015610f2d57600460a06001600160a01b0360035416604051928380927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa908115610f22578391610eef575b5082811315610eb8576402540be40081128015610ee0575b610eb85760ff60035460a01c16936007548061271001908161271011610e8b57908592918193610e43575b5050610d99610da59392610d9f928752600c602052610d9460ff604089205416946004356125bb565b6125bb565b916125ce565b906125bb565b92600a0160ff8111610e1657610dba906125ce565b91612710820291820461271003610de9576020610de185610ddb86866125bb565b9061263b565b604051908152f35b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b612af89192935001809111610e5e5790610d99610d9f610d6b565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6004837f89c61c06000000000000000000000000000000000000000000000000000000008152fd5b506509184e72a0008113610d40565b610f11915060a03d60a011610f1b575b610f098183612107565b810190612210565b5092505090610d28565b503d610eff565b6040513d85823e3d90fd5b6004827f5f77d0bd000000000000000000000000000000000000000000000000000000008152fd5b6004827f4fd3f395000000000000000000000000000000000000000000000000000000008152fd5b503461024a578060031936011261024a5760206001600160a01b0360025416604051908152f35b503461024a578060031936011261024a57602060405160058152f35b503461024a578060031936011261024a5760206040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001615158152f35b503461024a57602060031936011261024a57600435611023612543565b6103e88111611063577e3b413cf14a67407425bd0b5c065b2de08876554d8489ad7dd4aa95604d280c60406007548151908152836020820152a160075580f35b6004827f2cbc9627000000000000000000000000000000000000000000000000000000008152fd5b503461024a57602060031936011261024a5760ff60406020926001600160a01b036110b461203b565b168152600c8452205416604051908152f35b503461024a578060031936011261024a576001600160a01b036020915416604051908152f35b503461024a57608060031936011261024a576003600435101561024a5760243567ffffffffffffffff81116111a457366023820112156111a457806004013567ffffffffffffffff81116111a05736602482840101116111a0576001600160a01b03600254163303611178579061117191611165612582565b6024604435920161230c565b6001805580f35b6004837f7f3c57b5000000000000000000000000000000000000000000000000000000008152fd5b8280fd5b5080fd5b503461024a578060031936011261024a5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b503461024a578060031936011261024a57611205612543565b806001600160a01b0381547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461024a578060031936011261024a57602061127861225d565b6040519015158152f35b503461024a578060031936011261024a57600460a06001600160a01b0360035416604051928380927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa8015610aaa578291839161137d575b5082821315610eb8578160409179ffffffffffffffffffffffffffffffffffffffffffffffffffff7f945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd69683894168351611334816120be565b818152602065ffffffffffff84169101527fffffffffffff00000000000000000000000000000000000000000000000000008260d01b161760055582519182526020820152a180f35b9050611398915060a03d60a011610f1b57610f098183612107565b50925050905f6112de565b503461024a578060031936011261024a576020600754604051908152f35b503461024a578060031936011261024a5760206001600160a01b0360065416604051908152f35b503461024a57606060031936011261024a57611402612051565b906044359182151583036111a457303303610f55576001600160a01b031691828252600b60205260408220549081156115e75782901561158157600460a06001600160a01b0360035416604051928380927ffeaf968c0000000000000000000000000000000000000000000000000000000082525afa908115611576578491611553575b50905b8382131561151c576402540be40082128015611544575b61151c5760ff60035460a01c169460075480612710019081612710116114ef578193610e43575050610d99610da59392610d9f928752600c602052610d9460ff604089205416946004356125bb565b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6004847f89c61c06000000000000000000000000000000000000000000000000000000008152fd5b506509184e72a00082136114a0565b61156c915060a03d60a011610f1b57610f098183612107565b5092505090611486565b6040513d86823e3d90fd5b5060405161158e816120be565b6005549079ffffffffffffffffffffffffffffffffffffffffffffffffffff8216808252602082019260d01c83521561151c575179ffffffffffffffffffffffffffffffffffffffffffffffffffff1690506001611489565b6004837f5f77d0bd000000000000000000000000000000000000000000000000000000008152fd5b503461024a578060031936011261024a57602060ff600954166040519015158152f35b503461024a578060031936011261024a5750611693604051611655604082612107565b601281527f504d56342d4465706f7369742d342e332e300000000000000000000000000000602082015260405191829160208352602083019061207b565b0390f35b503461024a57606060031936011261024a5760043567ffffffffffffffff81116111a457806004019061012060031982360301126111a057604435906001600160a01b03600254163303611aa75760ff60095416611a7f5760e4906116fa612582565b019260346117088585612161565b905010611a57578235936001600160a01b038516928386036111a0576008549081811115611a4f5750935b604861173f8383612161565b905010155f14611a27579061175391612161565b6048116111a4576034013560601c808252600b6020526040822054909384918015610c785760405191611785836120be565b6005549279ffffffffffffffffffffffffffffffffffffffffffffffffffff8416808252602082019460d01c8552156119ff575179ffffffffffffffffffffffffffffffffffffffffffffffffffff169250848313156119c8576402540be400831280156119f0575b6119c85760ff60035460a01c169260075490816127100191826127101161199b57612af8018092116114ef57610d9982610d94610d9f93611841969550898b52600c60205260ff60408c205416956125bb565b91600a0160ff8111610e5e57611856906125ce565b90612710810290810461271003610e5e576118759291610ddb916125bb565b92808352600a60205260408320825f526020528360405f205410610349578252600a60205260408220905f5260205260405f206118b38382546121ec565b905560055460d01c9081156119735750611965936119066118da61193293600454906121b2565b93604051958693602085016001600160a01b036040929594938160608401971683521660208201520152565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283612107565b6001805579ffffffffffff000000000000000000000000000000000000000060405193849360408552604085019061207b565b9160a01b1660208301520390f35b807f7d1bece70000000000000000000000000000000000000000000000000000000060049252fd5b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6004857f89c61c06000000000000000000000000000000000000000000000000000000008152fd5b506509184e72a00083136117ee565b6004867f89c61c06000000000000000000000000000000000000000000000000000000008152fd5b6004837f4fd3f395000000000000000000000000000000000000000000000000000000008152fd5b905093611733565b807f4fd3f3950000000000000000000000000000000000000000000000000000000060049252fd5b6004847f4ddcc820000000000000000000000000000000000000000000000000000000008152fd5b6004847f7f3c57b5000000000000000000000000000000000000000000000000000000008152fd5b508060031936011261024a57611ae3612543565b806001600160a01b0360025416803b15610b425781602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610aaa57610a995750f35b503461024a57602060031936011261024a57611b56612543565b60043560045580f35b503461024a57604060031936011261024a57611b7961203b565b7fceb40be0a58aa33916c199e469842b614ef313295573c15d82f85cc9d1a89d326020602435611ba7612543565b6001600160a01b0360129416936040517f313ce5670000000000000000000000000000000000000000000000000000000081528381600481895afa879181611c46575b50611c3e575b50848652600c835260ff6040872091167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055838552600b8252806040862055604051908152a280f35b90505f611bf0565b611c5e919250853d871161082f576108208183612107565b905f611bea565b503461024a578060031936011261024a5760206001600160a01b0360035416604051908152f35b503461024a578060031936011261024a5760206040516509184e72a0008152f35b503461024a578060031936011261024a57611cc6612543565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168015611d79578082913b15610b42578180916004604051809481937f51b42b000000000000000000000000000000000000000000000000000000000083525af18015610aaa57611d64575b50307fca323d32ea3ada728fbc5a470183af7d4cc49a426cb2bdf68847d6e298576f208280a280f35b81611d6e91612107565b61024a57805f611d3b565b6004827f192dbd6a000000000000000000000000000000000000000000000000000000008152fd5b503461024a578060031936011261024a576020604051600a8152f35b503461024a578060031936011261024a5760206040516402540be4008152f35b503461024a57604060031936011261024a5780611df861203b565b611e00612543565b6001600160a01b036002541690813b15610ab5576001600160a01b03604484928360405195869485937f205c287800000000000000000000000000000000000000000000000000000000855216600484015260243560248401525af18015610aaa57610a995750f35b503461024a57602060031936011261024a5760406020916001600160a01b03611e9061203b565b168152600b83522054604051908152f35b503461024a578060031936011261024a5760206040516103e88152f35b503461024a578060031936011261024a576020600854604051908152f35b503461024a57604060031936011261024a5760043560243565ffffffffffff81169081810361094a57611f0d612543565b821561151c57916040917f945c1c4e99aa89f648fbfe3df471b916f719e16d960fcec0737d4d56bd696838937fffffffffffff000000000000000000000000000000000000000000000000000079ffffffffffffffffffffffffffffffffffffffffffffffffffff8416918360208751611f86816120be565b858152015260d01b161760055582519182526020820152a180f35b5060206003193601126120375760043563ffffffff811680910361203757611fc7612543565b6001600160a01b036002541690813b15612037575f906024604051809481937f0396cb60000000000000000000000000000000000000000000000000000000008352600483015234905af1801561202c57612020575080f35b61001891505f90612107565b6040513d5f823e3d90fd5b5f80fd5b600435906001600160a01b038216820361203757565b602435906001600160a01b038216820361203757565b35906001600160a01b038216820361203757565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b6040810190811067ffffffffffffffff8211176120da57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176120da57604052565b90816020910312612037575160ff811681036120375790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215612037570180359067ffffffffffffffff82116120375760200191813603831361203757565b919082018092116121bf57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b919082039182116121bf57565b519069ffffffffffffffffffff8216820361203757565b908160a091031261203757612224816121f9565b916020820151916040810151916122426080606084015193016121f9565b90565b90816020910312612037575180151581036120375790565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168015612307576020602491604051928380927f928708220000000000000000000000000000000000000000000000000000000082523060048301525afa5f91816122d6575b5061224257505f90565b6122f991925060203d602011612300575b6122f18183612107565b810190612245565b905f6122cc565b503d6122e7565b505f90565b90915f92801561253d5782606091810103126120375761232b82612067565b6001600160a01b0380604061234260208701612067565b95013592169316935f61235a60055460d01c426121ec565b600454106124e6575b604051907f5dbfc94d00000000000000000000000000000000000000000000000000000000825284600483015286602483015215156044820152602081606481305afa829181612492575b5091606093917f62544d7f48b11c32334310ebd306b47224fca220163218d4a7264322c52ae0739593155f1461248c5750815b808311612484575b826123f3916121ec565b80612452575b5081612415575b506040519182528060208301526040820152a3565b6040906001600160a01b03600654168152600a602052206001600160a01b0387165f5260205260405f2061244a8282546121b2565b90555f612400565b868252600a602052604082206001600160a01b0389165f5260205261247c60405f209182546121b2565b90555f6123f9565b9150816123e9565b916123e1565b9091506020813d6020116124de575b816124ae60209383612107565b810103126111a05751907f62544d7f48b11c32334310ebd306b47224fca220163218d4a7264322c52ae0736123ae565b3d91506124a1565b50303b15612037576040517f673a7e280000000000000000000000000000000000000000000000000000000081525f8160048183305af161252a575b506001612363565b61253691505f90612107565b5f5f612522565b50505050565b6001600160a01b035f5416330361255657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b600260015414612593576002600155565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b818102929181159184041417156121bf57565b60ff16604d81116121bf57600a0a90565b6001600160a01b03805f54921691827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60018209918180841093039280840393146126f757828111156126cf578060018309815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b7f227bc153000000000000000000000000000000000000000000000000000000005f5260045ffd5b80925015612703570490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f6001600160a01b038192169260208151910182855af13d15612804573d67ffffffffffffffff81116120da576127a89160207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601916127986040519384612107565b82523d5f602084013e5b83612810565b80519081151591826127e9575b50506127be5750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6127fc9250602080918301019101612245565b155f806127b5565b6127a8906060906127a2565b9061284d575080511561282557805190602001fd5b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b81511580612893575b61285e575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561285656fea264697066735822122033eea345a3e8c9fd2c1e4c528b7266a932fd55ec00b72612ad92735dfbb778d664736f6c63430008210033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"` diff --git a/0.16.23/api/@aastar/core/variables/PaymasterFactoryABI.md b/0.16.23/api/@aastar/core/variables/PaymasterFactoryABI.md new file mode 100644 index 000000000..f3a41de5e --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PaymasterFactoryABI.md @@ -0,0 +1,3 @@ +> `const` **PaymasterFactoryABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L49) diff --git a/0.16.23/api/@aastar/core/variables/PaymasterFactoryArtifact.md b/0.16.23/api/@aastar/core/variables/PaymasterFactoryArtifact.md new file mode 100644 index 000000000..b97580981 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/PaymasterFactoryArtifact.md @@ -0,0 +1,13 @@ +> `const` **PaymasterFactoryArtifact**: `object` = `PaymasterFactoryABIData` + +Defined in: [packages/core/src/abis/index.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L50) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `never`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x6080806040523460755733156062575f8054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055611aae908161007a8239f35b631e4fbdf760e01b5f525f60045260245ffd5b5f80fdfe60806040526004361015610011575f80fd5b5f3560e01c80630618f104146113fb5780630cfb14b0146113de57806314b1c401146113c15780631798d4821461139257806341bbe5a8146110a257806354fd4d501461132f57806364feab64146111cc5780636a1894391461116f5780636b683896146110fd5780636c583e59146110a2578063715018a6146110265780637563750514610d6b5780637857bce914610c4e578063821ac3fb14610c0057806385365cbb1461099b5780638da5cb5b14610969578063a87d5a74146108da578063ad384a9b146104b6578063bde9cb2a14610396578063ce47d4671461033b578063d1255313146102c2578063dc2a147214610261578063f2fde38b146101935763f3bcebbd14610121575f80fd5b3461018f57602060031936011261018f5760043567ffffffffffffffff811161018f5773ffffffffffffffffffffffffffffffffffffffff60208061016b819436906004016114a6565b604051928184925191829101835e8101600281520301902054161515604051908152f35b5f80fd5b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff6101c1611635565b6101c9611a2c565b1680156102355773ffffffffffffffffffffffffffffffffffffffff5f54827fffffffffffffffffffffffff00000000000000000000000000000000000000008216175f55167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3005b7f1e4fbdf7000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff61028f611635565b165f526004602052604073ffffffffffffffffffffffffffffffffffffffff815f20541681519080825215156020820152f35b3461018f57604060031936011261018f576102e1602435600435611919565b6040518091602082016020835281518091526020604084019201905f5b81811061030c575050500390f35b825173ffffffffffffffffffffffffffffffffffffffff168452859450602093840193909201916001016102fe565b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff610369611635565b165f526004602052602073ffffffffffffffffffffffffffffffffffffffff60405f205416604051908152f35b3461018f57604060031936011261018f5760043567ffffffffffffffff811161018f576103c79036906004016114a6565b73ffffffffffffffffffffffffffffffffffffffff604051602081845180838701835e8101600281520301902054169081156104745760206055604384604051903060388301526f5af43d82803e903d91602b57fd5bf3ff60248301526014820152733d602d80600a3d3981f3363d3d373d3d3d363d73815260243560588201526037600c8201206078820152012073ffffffffffffffffffffffffffffffffffffffff60405191168152f35b6104b2906040519182917fed4fac37000000000000000000000000000000000000000000000000000000008352602060048401526024830190611610565b0390fd5b3461018f57606060031936011261018f5760043567ffffffffffffffff811161018f576104e79036906004016114a6565b60443567ffffffffffffffff811161018f576105079036906004016114a6565b906105106119f3565b335f52600360205273ffffffffffffffffffffffffffffffffffffffff60405f2054166108ae57604051602081835180838601835e810160028152030190205473ffffffffffffffffffffffffffffffffffffffff811615610873577fffffffffffffffffffffffffffffffffff00000000000000000000000000000081763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff6e5af43d82803e903d91602b57fd5bf39460881c16175f5260781b1617602052602435603760095ff573ffffffffffffffffffffffffffffffffffffffff811691821561084b578351156107c657610744839261066c60205f808983809b51910182875af1610667602d61061c6116ec565b6040519485917f496e6974206661696c65643a2000000000000000000000000000000000000000828401528051918291018484015e81015f838201520301601f198101845283611467565b61171b565b6106c35f80604051898101907f8da5cb5b000000000000000000000000000000000000000000000000000000008252600481526106aa602482611467565b5190855afa6106b76116ec565b81610793575b5061178d565b335f526003865260405f20847fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055835f526004865260405f2073ffffffffffffffffffffffffffffffffffffffff33167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790556117f2565b61074f600754611881565b6007557fa1ff1ed230517376e0a7481a00b4dfc8f2f2e212bccebd933d567bf5640494c06040518061078433944290836118bc565b0390a360018055604051908152f35b905073ffffffffffffffffffffffffffffffffffffffff6107be8251928a8033958301019101611761565b1614886106bd565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f696e69744461746120726571756972656420666f72207365637572652064657060448201527f6c6f796d656e74000000000000000000000000000000000000000000000000006064820152608490fd5b7fc2f868f4000000000000000000000000000000000000000000000000000000005f5260045ffd5b6040517fed4fac3700000000000000000000000000000000000000000000000000000000815260206004820152806104b26024820185611610565b7f69e496ad000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff610908611635565b16805f52600460205273ffffffffffffffffffffffffffffffffffffffff60405f205416801561093d57602090604051908152f35b507f51b795b8000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b3461018f575f60031936011261018f57602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b3461018f57602060031936011261018f5760043567ffffffffffffffff811161018f576109cc9036906004016114a6565b6109d4611a2c565b73ffffffffffffffffffffffffffffffffffffffff604051602081845180838701835e8101600281520301902054161561047457610a1061153b565b81519167ffffffffffffffff8311610bd357610a2d6006546114ea565b601f8111610b65575b50602092601f8111600114610abd57610a9f929181610aad927ff2d0bf91625d9d6f0875b7d42914fd44597c078083d98cb3619c009136be9f6a965f91610ab2575b505f198260011b9260031b1c1916176006555b604051938493604085526040850190611610565b908382036020850152611610565b0390a1005b905082015187610a78565b601f19811660065f527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f905f5b818110610b4d575082610a9f9594927ff2d0bf91625d9d6f0875b7d42914fd44597c078083d98cb3619c009136be9f6a97610aad9560019410610b35575b5050811b01600655610a8b565b8401515f1960f88460031b161c191690558780610b28565b84870151835560209687019660019093019201610aea565b83811115610a365760065f52601f840160051c9060208510610bcb575b601f82910160051c03905f5b828110610b9c575050610a36565b5f8282017ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0155600101610b8e565b5f9150610b82565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b3461018f57602060031936011261018f5760043560055481101561018f5773ffffffffffffffffffffffffffffffffffffffff610c3e6020926116a7565b90549060031b1c16604051908152f35b3461018f57610c5c36611658565b90610c65611a2c565b73ffffffffffffffffffffffffffffffffffffffff8216918215908115610d61575b50610d35576040519073ffffffffffffffffffffffffffffffffffffffff815192602081818501958087835e8101600281520301902054169182156108735790610d0f916020604051809284518091835e81016002815203019020847fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790556118d8565b7f2255c4b39068cc7208e9c29b0fc9a3d106b3a41ada38999656d54aa44a6dc9e85f80a4005b507f0c760937000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b90503b1583610c87565b3461018f57610d7936611658565b610d81611a2c565b73ffffffffffffffffffffffffffffffffffffffff811690811590811561101c575b50610ff15760405173ffffffffffffffffffffffffffffffffffffffff835191602081818701948086835e810160028152030190205416610fb6576020604051809285518091835e81016002815203019020817fffffffffffffffffffffffff000000000000000000000000000000000000000082541617905560065491610e2a836114ea565b15610e5f575b610e39906118d8565b7f9aa81ca4174435962ad1571b0a59c4440cf6de4a12ba4ed96d6fdf5d346742785f80a3005b80519267ffffffffffffffff8411610bd357610e7a906114ea565b601f8111610f48575b50602092601f8111600114610ec55780610e3993945f91610eba575b505f198260011b9260031b1c1916176006555b829150610e30565b905082015185610e9f565b601f19811660065f527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f905f5b818110610f30575090610e399495836001949310610f18575b5050811b01600655610eb2565b8401515f1960f88460031b161c191690558580610f0b565b84870151835560209687019660019093019201610ef2565b83811115610e835760065f52601f840160051c9060208510610fae575b601f82910160051c03905f5b828110610f7f575050610e83565b5f8282017ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0155600101610f71565b5f9150610f65565b6040517fb94f32dd00000000000000000000000000000000000000000000000000000000815260206004820152806104b26024820186611610565b7f0c760937000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b90503b1583610da3565b3461018f575f60031936011261018f5761103e611a2c565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff6110d0611635565b165f526003602052602073ffffffffffffffffffffffffffffffffffffffff60405f205416604051908152f35b3461018f57602060031936011261018f5760043567ffffffffffffffff811161018f5761112e9036906004016114a6565b73ffffffffffffffffffffffffffffffffffffffff604051602081845180838701835e81016002815203019020541690811561047457602082604051908152f35b3461018f57602060031936011261018f5773ffffffffffffffffffffffffffffffffffffffff61119d611635565b165f526003602052602073ffffffffffffffffffffffffffffffffffffffff60405f2054161515604051908152f35b3461018f57604060031936011261018f5760043567ffffffffffffffff811161018f576111fd9036906004016114a6565b60243567ffffffffffffffff811161018f5761121d9036906004016114a6565b906112266119f3565b335f52600360205273ffffffffffffffffffffffffffffffffffffffff60405f2054166108ae57604051602081835180838601835e810160028152030190205473ffffffffffffffffffffffffffffffffffffffff811615610873577fffffffffffffffffffffffffffffffffff00000000000000000000000000000081763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff6e5af43d82803e903d91602b57fd5bf39460881c16175f5260781b1617602052603760095ff073ffffffffffffffffffffffffffffffffffffffff811691821561084b578351156107c657610744839261066c60205f808983809b51910182875af1610667602d61061c6116ec565b3461018f575f60031936011261018f5761138e604051611350604082611467565b601681527f5061796d6173746572466163746f72792d312e302e32000000000000000000006020820152604051918291602083526020830190611610565b0390f35b3461018f575f60031936011261018f5761138e6113ad61153b565b604051918291602083526020830190611610565b3461018f575f60031936011261018f576020600554604051908152f35b3461018f575f60031936011261018f576020600754604051908152f35b3461018f57602060031936011261018f5760043567ffffffffffffffff811161018f5773ffffffffffffffffffffffffffffffffffffffff602080611445819436906004016114a6565b604051928184925191829101835e810160028152030190205416604051908152f35b90601f601f19910116810190811067ffffffffffffffff821117610bd357604052565b67ffffffffffffffff8111610bd357601f01601f191660200190565b81601f8201121561018f576020813591016114c08261148a565b926114ce6040519485611467565b8284528282011161018f57815f92602092838601378301015290565b90600182811c92168015611531575b602083101461150457565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f16916114f9565b604051905f826006549161154e836114ea565b80835292600181169081156115d35750600114611574575b61157292500383611467565b565b5060065f90815290917ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b8183106115b757505090602061157292820101611566565b602091935080600191548385890101520191019091849261159f565b602092506115729491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b820101611566565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361018f57565b604060031982011261018f576004359067ffffffffffffffff821161018f57611683916004016114a6565b9060243573ffffffffffffffffffffffffffffffffffffffff8116810361018f5790565b6005548110156116bf5760055f5260205f2001905f90565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b3d15611716573d906116fd8261148a565b9161170b6040519384611467565b82523d5f602084013e565b606090565b156117235750565b6104b2906040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352602060048401526024830190611610565b9081602091031261018f575173ffffffffffffffffffffffffffffffffffffffff8116810361018f5790565b1561179457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4f776e6572206e6f742073657420636f72726563746c790000000000000000006044820152fd5b60055468010000000000000000811015610bd357600181016005556005548110156116bf5760055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b5f19811461188f5760010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b9291906118d3602091604086526040860190611610565b930152565b602090604051918183925191829101835e81015f815203902090565b67ffffffffffffffff8111610bd35760051b60200190565b9190820180921161188f57565b919060055490818410156119d757611931908461190c565b908082116119cf575b5082810390811161188f5761194e816118f4565b9061195c6040519283611467565b808252601f1961196b826118f4565b0136602084013781935f5b8281106119835750505050565b73ffffffffffffffffffffffffffffffffffffffff6119aa6119a5838561190c565b6116a7565b90549060031b1c169084518110156116bf5760019160208260051b8701015201611976565b90505f61193a565b505090506040516119e9602082611467565b5f81525f36813790565b600260015414611a04576002600155565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b73ffffffffffffffffffffffffffffffffffffffff5f54163303611a4c57565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffdfea26469706673582212201a2b719ecc574d1143d904cc827eb01a03cfbd975ea97193417e671b07a281db64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/REGISTRY_ADDRESS.md b/0.16.23/api/@aastar/core/variables/REGISTRY_ADDRESS.md new file mode 100644 index 000000000..e95aa88c5 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/REGISTRY_ADDRESS.md @@ -0,0 +1,3 @@ +> **REGISTRY\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L29) diff --git a/0.16.23/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md b/0.16.23/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md new file mode 100644 index 000000000..906c2021b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md @@ -0,0 +1,3 @@ +> **REPUTATION\_SYSTEM\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L33) diff --git a/0.16.23/api/@aastar/core/variables/ROLE_ANODE.md b/0.16.23/api/@aastar/core/variables/ROLE_ANODE.md new file mode 100644 index 000000000..a15dd40eb --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_ANODE.md @@ -0,0 +1,29 @@ +> `const` **ROLE\_ANODE**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L84) + +ANODE Role (Anonymous Node) + +## Description + +Anonymous infrastructure node operator + +## Permission + +Infrastructure operator + +## Requirement + +minStake: 20 GT, entryBurn: 2 GT (line 95) + +## Exit Fee + +10% (1000 basis points), min 1 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 37: ROLE_ANODE = keccak256("ANODE") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_COMMUNITY.md b/0.16.23/api/@aastar/core/variables/ROLE_COMMUNITY.md new file mode 100644 index 000000000..506d353c4 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_COMMUNITY.md @@ -0,0 +1,29 @@ +> `const` **ROLE\_COMMUNITY**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L27) + +Community Role + +## Description + +Community administrator, can issue xPNTs, configure SBT rules + +## Permission + +Community-level governance + +## Requirement + +minStake: 30 GT, entryBurn: 3 GT (line 99) + +## Exit Fee + +5% (500 basis points), min 1 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 32: ROLE_COMMUNITY = keccak256("COMMUNITY") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_DVT.md b/0.16.23/api/@aastar/core/variables/ROLE_DVT.md new file mode 100644 index 000000000..e824eb059 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_DVT.md @@ -0,0 +1,29 @@ +> `const` **ROLE\_DVT**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:73](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L73) + +DVT Role (Distributed Validator Technology) + +## Description + +DVT node operator for consensus validation + +## Permission + +Infrastructure operator + +## Requirement + +minStake: 30 GT, entryBurn: 3 GT (line 94) + +## Exit Fee + +10% (1000 basis points), min 1 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 36: ROLE_DVT = keccak256("DVT") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_ENDUSER.md b/0.16.23/api/@aastar/core/variables/ROLE_ENDUSER.md new file mode 100644 index 000000000..efb84d41b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_ENDUSER.md @@ -0,0 +1,33 @@ +> `const` **ROLE\_ENDUSER**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:39](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L39) + +End User Role + +## Description + +Community member, can participate and use gasless transactions + +## Permission + +Basic user level + +## Requirement + +minStake: 0.3 GT, entryBurn: 0.05 GT (line 100) + +## Additional Requirement + +Must hold MySBT from community + +## Exit Fee + +10% (1000 basis points), min 0.05 GT + +## Lock Duration + +7 days + +## Source + +Registry.sol line 33: ROLE_ENDUSER = keccak256("ENDUSER") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_KMS.md b/0.16.23/api/@aastar/core/variables/ROLE_KMS.md new file mode 100644 index 000000000..1754d298f --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_KMS.md @@ -0,0 +1,29 @@ +> `const` **ROLE\_KMS**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:95](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L95) + +KMS Role (Key Management Service) + +## Description + +KMS operator for secure key storage and management + +## Permission + +Infrastructure operator (highest stake) + +## Requirement + +minStake: 100 GT, entryBurn: 10 GT (line 98) + +## Exit Fee + +10% (1000 basis points), min 5 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 38: ROLE_KMS = keccak256("KMS") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_NAMES.md b/0.16.23/api/@aastar/core/variables/ROLE_NAMES.md new file mode 100644 index 000000000..fc450ca03 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_NAMES.md @@ -0,0 +1,3 @@ +> `const` **ROLE\_NAMES**: `Record`\<`string`, `string`\> + +Defined in: [packages/core/src/roles.ts:128](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L128) diff --git a/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md b/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md new file mode 100644 index 000000000..96f543c64 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md @@ -0,0 +1,29 @@ +> `const` **ROLE\_PAYMASTER\_AOA**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L50) + +Paymaster AOA Role (Account Ownership Authentication) + +## Description + +Basic Paymaster node operator with account-based auth + +## Permission + +Infrastructure operator + +## Requirement + +minStake: 30 GT, entryBurn: 3 GT (line 92) + +## Exit Fee + +10% (1000 basis points), min 1 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 34: ROLE_PAYMASTER_AOA = keccak256("PAYMASTER_AOA") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md b/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md new file mode 100644 index 000000000..d6c9545cc --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md @@ -0,0 +1,33 @@ +> `const` **ROLE\_PAYMASTER\_SUPER**: [`Hash`](https://viem.sh/docs/index.html) + +Defined in: [packages/core/src/roles.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L62) + +Paymaster Super Role + +## Description + +Advanced Paymaster operator, can use SuperPaymaster with aPNTs collateral + +## Permission + +Infrastructure operator (higher tier) + +## Requirement + +minStake: 50 GT, entryBurn: 5 GT (line 93) + +## Additional Requirement + +aPNTs collateral in SuperPaymaster contract + +## Exit Fee + +10% (1000 basis points), min 2 GT + +## Lock Duration + +30 days + +## Source + +Registry.sol line 35: ROLE_PAYMASTER_SUPER = keccak256("PAYMASTER_SUPER") diff --git a/0.16.23/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md b/0.16.23/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md new file mode 100644 index 000000000..f6f13bad8 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md @@ -0,0 +1,3 @@ +> `const` **ROLE\_PERMISSION\_LEVELS**: `Record`\<`string`, [`RolePermissionLevel`](../enumerations/RolePermissionLevel.md)\> + +Defined in: [packages/core/src/roles.ts:157](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/roles.ts#L157) diff --git a/0.16.23/api/@aastar/core/variables/RegistryABI.md b/0.16.23/api/@aastar/core/variables/RegistryABI.md new file mode 100644 index 000000000..4d551ebcb --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/RegistryABI.md @@ -0,0 +1,3 @@ +> `const` **RegistryABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:37](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L37) diff --git a/0.16.23/api/@aastar/core/variables/RegistryArtifact.md b/0.16.23/api/@aastar/core/variables/RegistryArtifact.md new file mode 100644 index 000000000..e82fc81f2 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/RegistryArtifact.md @@ -0,0 +1,13 @@ +> `const` **RegistryArtifact**: `object` = `RegistryABIData` + +Defined in: [packages/core/src/abis/index.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L38) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: (\{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components`: `object`[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs`: `never`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: (\{ `components?`: `undefined`; `indexed`: `boolean`; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components`: `object`[]; `indexed`: `boolean`; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60808060405234611917575f9060608161799480380380916100218285611a48565b8339810103126119175761003481611a6b565b5061004d604061004660208401611a6b565b9201611a6b565b903315611a19575f8054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360018055600280546001600160a01b039283166001600160a01b031991821617909155600380549390921692169190911790556040805191906100db9083611a48565b600d82526c20a7a0902830bcb6b0b9ba32b960991b602083015260405161010181611a2c565b6801a055690d9db800008152602081016729a2241af62c0000815260408201600a8152606083016002815260808401916001835260a0850192600a845260c086016103e8815260e087019060018252610100880194670de0b6b3a7640000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206179345f395f51905f525f52600760205260405f209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b038111611a05578154600181811c911680156119fb575b60208210146119e757601f8111611996575b506020601f821160011461193057819060069697985f92611925575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b0392831617905590519190920155600254168015158061191b575b6118b7575b50604051906102f0604083611a48565b600e82526d29bab832b92830bcb6b0b9ba32b960911b602083015260405161031781611a2c565b6802b5e3af16b1880000815260208101674563918244f40000815260408201600a8152606083016002815260808401916001835260a0850192600a845260c086016103e8815260e087019060018252610100880194671bc16d674ec80000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206179145f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c911680156118ad575b602082101461126d57601f811161185b575b506020601f82116001146117f6578190879860069798926117eb575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b0392831617905590519190920155600254829116801515806117e1575b61177f575b505060405190610509604083611a48565b600b82526a11d95b995c9a58c811159560aa1b602083015260405161052d81611a2c565b6801a055690d9db800008152602081016729a2241af62c0000815260408201600a8152606083016002815260808401916001835260a0850192600a845260c086016103e8815260e087019060018252610100880194670de0b6b3a7640000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206179545f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c91168015611775575b602082101461126d57601f8111611723575b506020601f82116001146116be578190879860069798926116b3575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b0392831617905590519190920155600254829116801515806116a9575b611647575b50506040519061071f604083611a48565b6005825264414e4f444560d81b602083015260405161073d81611a2c565b6801158e460913d00000815260208101671bc16d674ec80000815260408201600f8152606083016001815260808401916001835260a08501926005845260c086016103e8815260e087019060018252610100880194670de0b6b3a7640000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206179745f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c9116801561163d575b602082101461126d57601f81116115eb575b506020601f82116001146115865781908798600697989261157b575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b039283161790559051919092015560025482911680151580611571575b61150f575b50506040519061092f604083611a48565b60038252624b4d5360e81b602083015260405161094b81611a2c565b68056bc75e2d63100000815260208101678ac7230489e8000081526040820160058152606083016005815260808401916002835260a08501926014845260c086016103e8815260e087019060018252610100880194674563918244f40000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206178b45f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c91168015611505575b602082101461126d57601f81116114b3575b506020601f821160011461144e57819087986006979892611443575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b039283161790559051919092015560025482911680151580611439575b6113d7575b505060405190610b3d604083611a48565b6009825268436f6d6d756e69747960b81b6020830152604051610b5f81611a2c565b6801a055690d9db800008152602081016729a2241af62c0000815260408201600a8152606083016002815260808401916001835260a0850192600a845260c086016101f4815260e087019060018252610100880194670de0b6b3a7640000865261012089019a8b526101408901963388526101608a019862278d008a525f5160206178f45f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c911680156113cd575b602082101461126d57601f811161137b575b506020601f82116001146113165781908798600697989261130b575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b039283161790559051919092015560025482911680151580611301575b61129f575b505060405190610d51604083611a48565b600782526622b7322ab9b2b960c91b6020830152604051610d7181611a2c565b670429d069189e000081526020810166b1a2bc2ec5000081526040820183815260608301848152608084019185835260a085019286845260c086016103e8815260e08701906001825261010088019466b1a2bc2ec50000865261012089019a8b526101408901963388526101608a019862093a808a525f5160206178d45f395f51905f528c52600760205260408c209a518b555160018b015563ffffffff60028b019651166fffffffff0000000000000000000000006bffffffff000000000000000067ffffffff000000008954955160201b16975160401b16925160601b169361ffff60801b905160801b169460ff60901b9051151560901b169560ff60901b199361ffff60801b19926fffffffff000000000000000000000000199160018060601b031916171617161716171717905551600384015560048301945194855160018060401b03811161128b578154600181811c91168015611281575b602082101461126d57601f811161121b575b506020601f82116001146111b6578190879860069798926111ab575b50508160011b915f199060031b1c19161790555b516005840180546001600160a01b0319166001600160a01b0392831617905590519190920155600254829116801515806111a1575b61113a575b5060019052601660205280604081205560028152601660205268056bc75e2d631000006040822055600381526016602052681043561a88293000006040822055600481526016602052682086ac3510526000006040822055600581526016602052683635c9adc5dea000006040822055600681526016602052686c6b935b8bbd40000060408220556018546801000000000000000081101561112657600181018060185581101561111257600d9060188352602083200155601854680100000000000000008110156111265760018101806018558110156111125760229060188352602083200155601854680100000000000000008110156111265760018101806018558110156111125760599060188352602083200155601854680100000000000000008110156111265760018101806018558110156111125760e9906018835260208320015560185490680100000000000000008210156110fe5760018201806018558210156110ea5761026260409260188352602083200155338152601760205220600160ff19825416179055604051615e349081611a808239f35b634e487b7160e01b81526032600452602490fd5b634e487b7160e01b81526041600452602490fd5b634e487b7160e01b82526032600452602482fd5b634e487b7160e01b82526041600452602482fd5b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206178d45f395f51905f5260048401526103e8602484015266b1a2bc2ec5000060448401525af115610f4b578161119091611a48565b61119b57805f610f4b565b80fd5b50fd5b50803b1515610f46565b015190505f80610efd565b82875280872097601f198316885b8181106112035750916006979899918460019594106111eb575b505050811b019055610f11565b01515f1960f88460031b161c191690555f80806111de565b838301518b556001909a0199602093840193016111c4565b81811115610ee15782875260208720601f830160051c9060208410611265575b81601f9101920160051c0390875b828110611257575050610ee1565b808960019284015501611249565b88915061123b565b634e487b7160e01b87526022600452602487fd5b90607f1690610ecf565b634e487b7160e01b86526041600452602486fd5b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206178f45f395f51905f5260048401526101f46024840152670de0b6b3a764000060448401525af115610d4057816112f691611a48565b61119b57805f610d40565b50803b1515610d3b565b015190505f80610cf2565b82875280872097601f198316885b81811061136357509160069798999184600195941061134b575b505050811b019055610d06565b01515f1960f88460031b161c191690555f808061133e565b838301518b556001909a019960209384019301611324565b81811115610cd65782875260208720601f830160051c90602084106113c5575b81601f9101920160051c0390875b8281106113b7575050610cd6565b8089600192840155016113a9565b88915061139b565b90607f1690610cc4565b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206178b45f395f51905f5260048401526103e86024840152674563918244f4000060448401525af115610b2c578161142e91611a48565b61119b57805f610b2c565b50803b1515610b27565b015190505f80610ade565b82875280872097601f198316885b81811061149b575091600697989991846001959410611483575b505050811b019055610af2565b01515f1960f88460031b161c191690555f8080611476565b838301518b556001909a01996020938401930161145c565b81811115610ac25782875260208720601f830160051c90602084106114fd575b81601f9101920160051c0390875b8281106114ef575050610ac2565b8089600192840155016114e1565b8891506114d3565b90607f1690610ab0565b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206179745f395f51905f5260048401526103e86024840152670de0b6b3a764000060448401525af11561091e578161156691611a48565b61119b57805f61091e565b50803b1515610919565b015190505f806108d0565b82875280872097601f198316885b8181106115d35750916006979899918460019594106115bb575b505050811b0190556108e4565b01515f1960f88460031b161c191690555f80806115ae565b838301518b556001909a019960209384019301611594565b818111156108b45782875260208720601f830160051c9060208410611635575b81601f9101920160051c0390875b8281106116275750506108b4565b808960019284015501611619565b88915061160b565b90607f16906108a2565b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206179545f395f51905f5260048401526103e86024840152670de0b6b3a764000060448401525af11561070e578161169e91611a48565b61119b57805f61070e565b50803b1515610709565b015190505f806106c0565b82875280872097601f198316885b81811061170b5750916006979899918460019594106116f3575b505050811b0190556106d4565b01515f1960f88460031b161c191690555f80806116e6565b838301518b556001909a0199602093840193016116cc565b818111156106a45782875260208720601f830160051c906020841061176d575b81601f9101920160051c0390875b82811061175f5750506106a4565b808960019284015501611751565b889150611743565b90607f1690610692565b803b1561119e57818091606460405180948193636b26335560e11b83525f5160206179145f395f51905f5260048401526103e86024840152671bc16d674ec8000060448401525af1156104f857816117d691611a48565b61119b57805f6104f8565b50803b15156104f3565b015190505f806104aa565b82875280872097601f198316885b81811061184357509160069798999184600195941061182b575b505050811b0190556104be565b01515f1960f88460031b161c191690555f808061181e565b838301518b556001909a019960209384019301611804565b8181111561048e5782875260208720601f830160051c90602084106118a5575b81601f9101920160051c0390875b82811061189757505061048e565b808960019284015501611889565b88915061187b565b90607f169061047c565b803b15611917575f8091606460405180948193636b26335560e11b83525f5160206179345f395f51905f5260048401526103e86024840152670de0b6b3a764000060448401525af1156102e05761191091505f90611a48565b5f5f6102e0565b5f80fd5b50803b15156102db565b015190505f80610294565b601f19821697835f52815f20985f5b81811061197e575091600697989991846001959410611966575b505050811b0190556102a8565b01515f1960f88460031b161c191690555f8080611959565b838301518b556001909a01996020938401930161193f565b8181111561027857825f5260205f20601f830160051c90602084106119df575b81601f9101920160051c03905f5b8281106119d2575050610278565b5f828201556001016119c4565b5f91506119b6565b634e487b7160e01b5f52602260045260245ffd5b90607f1690610266565b634e487b7160e01b5f52604160045260245ffd5b631e4fbdf760e01b5f525f60045260245ffd5b61018081019081106001600160401b03821117611a0557604052565b601f909101601f19168101906001600160401b03821190821017611a0557604052565b51906001600160a01b03821682036119175756fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816306a36aee146149bd5750806307cf0ee9146149045780630ab0c75e146141a05780630dbb49291461415857806310fdfea71461411d57806311c85b0b146140e557806315de32ca1461409057806317e1c595146139bc57806319c46e81146139955780631a08a8191461395a5780631b02e44f146133015780631c5bf6bb146132185780631cae0412146131c85780632822ffce146131905780632c333e25146130e257806336db9caf1461309c5780633b60288a1461306d578063410087ad1461300d57806343e6a16014612fd25780634b8b8a6e14612fa857806354fd4d5014612f4757806359dc912614612efa5780635c44541214612ec05780635ee05b1714612b875780636229738c14612b07578063669d77621461230a578063682bb1c9146120cf578063715018a614612069578063727b52a5146117a457806377c0d7e71461175e5780637f52815514611714578063826600ce146116ed57806385513971146116245780638da5cb5b146115fe5780638ff3909914611588578063919d1e2c1461156157806391d1485414611516578063920983fb146114dc578063995d74ef146114665780639b1465a31461142b578063a2d0020e146113f0578063a3246ad314611337578063a3b2298814610e87578063a9d5652314610e1a578063aa9e8cf714610de7578063af5eda0214610dbd578063b5e936ab14610bd9578063bc95910114610b63578063be30742f14610b3c578063bf0cb04214610b01578063bf28c98a14610ac4578063c8ee23ef14610a7e578063cb31e2f114610952578063cd5d1e74146108dc578063ce830e7b1461060a578063d12b93ff146105e3578063e350d77b146105b9578063e74c7bd714610581578063e79e97391461050b578063e7b89138146104ab578063e9ebf83114610470578063f2fde38b146103c55763f538e1dc146102d3575f80fd5b346103c25760206003193601126103c2576040906004358152600760205220805460018201549160028101546103b16003830154604051906103238261031c8160048901614be3565b0383614cce565b60ff60066001600160a01b03600588015416960154946040519889988952602089015263ffffffff8116604089015263ffffffff8160201c16606089015263ffffffff8160401c16608089015263ffffffff8160601c1660a089015261ffff8160801c1660c089015260901c16151560e0870152610100860152610180610120860152610180850190614cf1565b916101408401526101608301520390f35b80fd5b50346103c25760206003193601126103c2576001600160a01b036103e7614a6e565b6103ef615371565b168015610444576001600160a01b0382548273ffffffffffffffffffffffffffffffffffffffff198216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b50346103c257806003193601126103c25760206040517f3b5016dc6721b132ddcb7027030b137a739df81e419695dae0899a866c1c514d8152f35b50346103c25760206003193601126103c2576004359067ffffffffffffffff82116103c25760206001600160a01b0381806104e93660048801614d32565b604051928184925191829101835e8101600f8152030190205416604051908152f35b50346103c25760206003193601126103c257610525614a6e565b61052d615371565b6001600160a01b03806004549216918273ffffffffffffffffffffffffffffffffffffffff19821617600455167f1f7cd67c986d0cce4aa6f69075b5278a05438ef2a5d1abf6eeded51ba81232458380a380f35b50346103c25760206003193601126103c25760406020916001600160a01b036105a8614a6e565b168152601583522054604051908152f35b50346103c25760206003193601126103c25760406020916004358152601b83522054604051908152f35b50346103c257806003193601126103c25760206001600160a01b0360065416604051908152f35b50346103c25760806003193601126103c257610624614a6e565b60243567ffffffffffffffff81116108d857610644903690600401614b7a565b9160443567ffffffffffffffff81116108d457610665903690600401614b7a565b93909260643567ffffffffffffffff811161076c57610688903690600401614ac4565b9190956106936153b0565b338852601760205260ff6040892054161561088f576106b3818514614ec9565b6001600160a01b036004541692831561084b5781838a9987936001600160a01b0360065416918b8b84151580610842575b610770575b5050505050505050823b1561076c5786946107358692604051988997889687957f5f4cd4fe0000000000000000000000000000000000000000000000000000000087526004870161530c565b03925af180156107615761074c575b506001805580f35b8161075691614cce565b6103c257805f610744565b6040513d84823e3d90fd5b8680fd5b61078c60209761079a936107d09a604051998a958c870161530c565b03601f198101865285614cce565b604051958694859384937fb8e72af600000000000000000000000000000000000000000000000000000000855260048501614f75565b03915afa80156108375788906107f8575b6107eb9150614f9b565b8381835f80808b8b6106e9565b506020813d60201161082f575b8161081260209383614cce565b8101031261082b576108266107eb91614e7a565b6107e1565b8780fd5b3d9150610805565b6040513d8a823e3d90fd5b508315156106e4565b606460405162461bcd60e51b815260206004820152601660248201527f53757065725061796d6173746572206e6f7420736574000000000000000000006044820152fd5b60405162461bcd60e51b815260206004820152601e60248201527f556e617574686f72697a65642052657075746174696f6e20536f7572636500006044820152606490fd5b8480fd5b8280fd5b50346103c25760206003193601126103c2576108f6614a6e565b6108fe615371565b6001600160a01b03806003549216918273ffffffffffffffffffffffffffffffffffffffff19821617600355167f171f7dbde35aed7cddf3ece2dad8f4eb62443a3d6bf8616586da6fd03c6b4ed98380a380f35b50346103c25761096136614aae565b9061096a615371565b60185480821015610a3a57816109fc575b5f1981019081116109e85781106109b4575b6109996109af91614af2565b81939154905f199060031b92831b921b19161790565b905580f35b600181018082116109e8576109af916109e06109d261099993614af2565b90549060031b1c85106152c1565b91505061098d565b602484634e487b7160e01b81526011600452fd5b5f198201828111610a2657610a13610a2191614af2565b90549060031b1c84116152c1565b61097b565b602485634e487b7160e01b81526011600452fd5b606460405162461bcd60e51b815260206004820152601360248201527f496e646578206f7574206f6620626f756e6473000000000000000000000000006044820152fd5b50346103c25760406003193601126103c2576001600160a01b036040610aa2614a84565b92600435815260096020522091165f52602052602060405f2054604051908152f35b50346103c25760206003193601126103c25760ff60406020926001600160a01b03610aed614a6e565b168152601784522054166040519015158152f35b50346103c257806003193601126103c25760206040517ff86d13979a91272f2c54c4147e588ecbeaad32dd1e0a5332a77356847049a70e8152f35b50346103c257806003193601126103c25760206001600160a01b0360055416604051908152f35b50346103c25760206003193601126103c257610b7d614a6e565b610b85615371565b6001600160a01b03806005549216918273ffffffffffffffffffffffffffffffffffffffff19821617600555167f019f532f6e08ee8944dc2e7ac40f3c97ad4a20618aee847ddf7c502821c7dad48380a380f35b50346103c25760206003193601126103c25780604051610bf881614c65565b8181528160208201528160408201528160608201528160808201528160a08201528160c08201528160e0820152816101008201526101208101606090528161014082015261016001526004358152600760205260409020604051610c5b81614c65565b81548152600182015491602082019283526002810154604083019063ffffffff8116825260608401908060201c63ffffffff16825260808501908060401c63ffffffff16825260a086018160601c63ffffffff16815260c08701908260801c61ffff16825260e088019260901c60ff1615158352600387015493610100890194855260405195868060048b0190610cf191614be3565b03610cfc9088614cce565b6101208a0196875260058901546001600160a01b0316986101408b01998a5260060154976101608b019889526040519b8c9b60208d525160208d01525160408c01525163ffffffff1660608b01525163ffffffff1660808a01525163ffffffff1660a08901525163ffffffff1660c08801525161ffff1660e08701525115156101008601525161012085015251610140840161018090526101a08401610da191614cf1565b91516001600160a01b0316610160840152516101808301520390f35b50346103c25760206003193601126103c25760406020916004358152601683522054604051908152f35b50346103c25760206003193601126103c2576001600160a01b0360406020926004358152601a8452205416604051908152f35b50346103c25760406003193601126103c257610e34614a84565b610e3c615371565b610e506001600160a01b0382161515615276565b6004358252601a6020526001600160a01b0360408320911673ffffffffffffffffffffffffffffffffffffffff1982541617905580f35b50346103c25760606003193601126103c2576024359060043567ffffffffffffffff831161133357826004018336039361018060031986011261125f57604435906001600160a01b0382168092036108d457610ee1615371565b838552601a6020526001600160a01b036040862054166112ef57610f06821515615276565b838552600760205260408520918335835560248201356001840155600283019263ffffffff610f37604485016150a3565b1684549067ffffffff00000000610f50606487016150a3565b60201b167fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff6bffffffff0000000000000000610f8e608489016150a3565b60401b16927fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006fffffffff000000000000000000000000610fd160a48b016150a3565b60601b1695161716171717845560c4830193611032610fef86615049565b82547fffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffff1660809190911b71ffff0000000000000000000000000000000016178255565b60e48401358015158091036112eb577fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff72ff00000000000000000000000000000000000083549260901b1691161790556101048301359283600383015560048201987fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd61012483013591018112156112eb5781019860048a013567ffffffffffffffff81116112e75780360360248c01136112e7576110fb816110f58454614bab565b84614deb565b89601f821160011461127157916111338260069593610164958e9f8f9d9e9f92611263575b50505f198260011b9260031b1c19161790565b90555b611143610144820161501c565b6001600160a01b0360058601911673ffffffffffffffffffffffffffffffffffffffff198254161790550135910155858452601a602052604084209073ffffffffffffffffffffffffffffffffffffffff198254161790556111b06001600160a01b036002541692615049565b90823b1561125f576040517fd64c66aa0000000000000000000000000000000000000000000000000000000081526004810187905261ffff92909216602483015260448201529082908290606490829084905af180156107615761124a575b50506112447f287e005099116032e1bba9482a5b0df09cc99f7e82a4482fa2810c52158d473d916040519182914290836150c5565b0390a280f35b8161125491614cce565b6108d857825f61120f565b8380fd5b016024013590505f80611120565b828b5260208b2090601f1983168c5b8181106112cc57509261016494928d9e6001939d9e9c9d8360069997106112af575b505050811b019055611136565b6024910101355f19600384901b60f8161c191690555f80806112a2565b60248f84010135845560019093019260209283019201611280565b8980fd5b8880fd5b606460405162461bcd60e51b815260206004820152601360248201527f526f6c6520616c726561647920657869737473000000000000000000000000006044820152fd5b5080fd5b50346103c25760206003193601126103c2576004358152600a60205260408120604051908160208254918281520190819285526020852090855b8181106113d15750505082611387910383614cce565b604051928392602084019060208552518091526040840192915b8181106113af575050500390f35b82516001600160a01b03168452859450602093840193909201916001016113a1565b82546001600160a01b0316845260209093019260019283019201611371565b50346103c257806003193601126103c25760206040517fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c0748152f35b50346103c257806003193601126103c25760206040517f6fb2b25080d21c908f32ff8ff99eb1d552c210854f7de48a40406764c09c68f88152f35b50346103c25760206003193601126103c257611480614a6e565b611488615371565b6001600160a01b03806006549216918273ffffffffffffffffffffffffffffffffffffffff19821617600655167f9e5ee21152afb219d78a3588775fe954c5094514af1627c6d4b203175091d3048380a380f35b50346103c25760206003193601126103c2576001600160a01b03604060209282611504614a6e565b16815260108452205416604051908152f35b50346103c25760406003193601126103c2576001600160a01b03604061153a614a84565b92600435815260086020522091165f52602052602060ff60405f2054166040519015158152f35b50346103c257806003193601126103c25760206001600160a01b0360045416604051908152f35b50346103c25760206003193601126103c2576115a2614a6e565b6115aa615371565b6001600160a01b03806002549216918273ffffffffffffffffffffffffffffffffffffffff19821617600255167f7042586b23181180eb30b4798702d7a0233b7fc2551e89806770e8e5d9392e6a8380a380f35b50346103c257806003193601126103c2576001600160a01b036020915416604051908152f35b50346103c25761163336614aae565b818352601a6020526001600160a01b03604084205416331415806116d9575b6116945760207f13fa7976d19366a82359594f556abe5fe2d49e404db9fc466282cdb6471c629a9183855260078252806006604087200155604051908152a280f35b60405162461bcd60e51b815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152606490fd5b506001600160a01b03835416331415611652565b50346103c257806003193601126103c25760206001600160a01b0360025416604051908152f35b50346103c25761172336614aae565b91908152600a602052604081209081548310156103c25760206001600160a01b0361174e8585614b1e565b90549060031b1c16604051908152f35b50346103c25760406003193601126103c2576001600160a01b036040611782614a84565b926004358152600b6020522091165f52602052602060405f2054604051908152f35b50346103c25760206003193601126103c2576004356117c16153b0565b8082526008602052604082206001600160a01b0333165f5260205260ff60405f2054161561203a578082526007602052600660408320015480611ee3575b508082526009602052604082206001600160a01b0333165f5260205260405f2054907f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a81145f14611c1d57826001600160a01b0360035416803b15611333578180916024604051809481937f5afc4b5c0000000000000000000000000000000000000000000000000000000083523360048401525af1801561076157611c08575b50505b8060405183815260406020820152600460408201527f457869740000000000000000000000000000000000000000000000000000000060608201527fe80f99d9789e367c229c526d3d3f84d44d3daf77ea65f7bbe8510f176ac45a2360803392a38083526008602052604083206001600160a01b0333165f5260205260405f2060ff198154169055611935338261593e565b33835260136020526040832054611beb575b33835260126020526040832091825492845b848110611b48575b50509091503383526013602052604083205415611a5f575b6002546040517f374e4d730000000000000000000000000000000000000000000000000000000081523360048201526024810184905291906020908390604490829088906001600160a01b03165af1908115611a54578491611a1a575b6119e09250615030565b906040519182524260208301527f0d9361411a652b66cd4aed24a96d36c0b048899896c927d879a9d3ba2790d9c660403393a36001805580f35b90506020823d602011611a4c575b81611a3560209383614cce565b81010312611a48576119e09151906119d6565b5f80fd5b3d9150611a28565b6040513d86823e3d90fd5b826001600160a01b036004541680611ae4575b506001600160a01b0360035416803b15611333578180916024604051809481937f374e7fa30000000000000000000000000000000000000000000000000000000083523360048401525af1801561076157611acf575b5050611979565b81611ad991614cce565b6108d857825f611ac8565b803b15611333578180916044604051809481937fa3970ae60000000000000000000000000000000000000000000000000000000083523360048401528160248401525af180156107615715611a725781611b3d91614cce565b6108d857825f611a72565b83611b538284614b1e565b90549060031b1c14611b6757600101611959565b909192935f198101908111611bd757610999611b86611b949285614b1e565b90549060031b1c9284614b1e565b905580548015611bc3575f190190611bac8282614b1e565b5f1982549160031b1b191690555581905f80611961565b602485634e487b7160e01b81526031600452fd5b602486634e487b7160e01b81526011600452fd5b338352601360205260408320611c01815461503d565b9055611947565b81611c1291614cce565b6108d857825f6118a0565b7fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07481036118a357808352600d602052604083206001600160a01b0333165f52602052611c75611c7c60405f2060405192838092614be3565b0382614cce565b805180611cfe575b5050826001600160a01b0360035416803b15611333578180916044604051809481937fd977b66b0000000000000000000000000000000000000000000000000000000083523360048401523360248401525af1801561076157611ce9575b50506118a3565b81611cf391614cce565b6108d857825f611ce2565b8101906020820190602081840312611edf57602081015167ffffffffffffffff811161076c57019160c090839003126108d45760405190611d3e82614c96565b602083015167ffffffffffffffff811161076c57816020611d619286010161525c565b8252604083015167ffffffffffffffff811161076c57816020611d869286010161525c565b9260208301938452606081015167ffffffffffffffff811161082b57826020611db19284010161525c565b6040840152608081015167ffffffffffffffff811161082b57826020611dd99284010161525c565b606084015260a081015167ffffffffffffffff811161082b5760c0926020611e039284010161525c565b6080840152015160a0820152336001600160a01b03611e228351614d76565b541614611eb4575b5080518051908115159182611e85575b5050611e47575b80611c84565b6020809151604051928184925191829101835e8101600f81520301902073ffffffffffffffffffffffffffffffffffffffff1981541690555f611e41565b6001600160a01b039192508060206040519401845e820191600f83526020813394030190205416145f80611e3a565b611ebe9051614d76565b73ffffffffffffffffffffffffffffffffffffffff1981541690555f611e2a565b8580fd5b6002546040517f30b039ee00000000000000000000000000000000000000000000000000000000815233600482015260248101849052908490829060449082906001600160a01b03165afa8015611a54578490611fb3575b65ffffffffffff915016908101809111611f9f574210611f5b575f6117ff565b606460405162461bcd60e51b815260206004820152601560248201527f4c6f636b206475726174696f6e206e6f74206d657400000000000000000000006044820152fd5b602483634e487b7160e01b81526011600452fd5b503d8085833e611fc38183614cce565b81019060a0818303126108d457611fd981615209565b50611fe660208201615209565b5060408101519065ffffffffffff82168203611edf5760808101519067ffffffffffffffff821161076c570182601f82011215611edf5765ffffffffffff9281602061203493519101615226565b50611f3b565b7fe9007bcc00000000000000000000000000000000000000000000000000000000825260045233602452604490fd5b50346103c257806003193601126103c257612082615371565b806001600160a01b03815473ffffffffffffffffffffffffffffffffffffffff1981168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346103c25760a06003193601126103c2576004356064356084356120f2615371565b6121006107d0831115615058565b82845260076020526040842060243581556001810190604435825561ffff84116122c6576002810180547fffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffff16608086901b71ffff000000000000000000000000000000001617815592869060038301958187556001600160a01b036002541690813b1561125f5760648985809460405196879586947fd64c66aa0000000000000000000000000000000000000000000000000000000086526004860152602485015260448401525af18015610761576122b1575b50507f287e005099116032e1bba9482a5b0df09cc99f7e82a4482fa2810c52158d473d9360ff60405194859460408652845460408701525460608601525463ffffffff8116608086015263ffffffff8160201c1660a086015263ffffffff8160401c1660c086015263ffffffff8160601c1660e086015261ffff8160801c1661010086015260901c1615156101208401525461014083015261018061016083015260066122886101c0840160048401614be3565b916001600160a01b0360058201541661018085015201546101a08301524260208301520390a280f35b816122bb91614cce565b611edf57855f6121d4565b606460405162461bcd60e51b815260206004820152601460248201527f56616c756520657863656564732075696e7431360000000000000000000000006044820152fd5b50346103c25761231936614b33565b61232694939192946153b0565b6001600160a01b038516928315612aa9576108008211612a4b57828552600760205260408520916040519161235a83614c65565b8354835260018401549360208401948552600660028201549163ffffffff8316604087015263ffffffff8360201c16606087015263ffffffff8360401c16608087015263ffffffff8360601c1660a087015261ffff8360801c1660c087015260ff60e087019360901c161515835260038101546101008701526040516123e781611c758160048601614be3565b6101208701526001600160a01b036005820154166101408701520154610160850152511580612a1a5750848752600860205260408720865f5260205260ff60405f205416928380946129f0575b6129c0577f2024516755f401845808190bb830b0e4523d0df0845503cab52130a794699a0f86148015612997575b612909575b6124728383886153e9565b90518082106128d957508361281d57858852600860205260408820875f5260205260405f20600160ff19825416179055858852600960205260408820875f526020528060405f2055858852600a6020526124cf8960408a20614da2565b858852600a6020526040882054868952600b60205260408920885f5260205260405f20558688526013602052604088206125098154614e58565b905586885260126020526040882080549068010000000000000000821015612809579187612543610999848e966001602097018155614b1e565b905560025487516040517fbefa570e0000000000000000000000000000000000000000000000000000000081526001600160a01b0395861660048201819052602482018c90526044820194909452606481019190915260848101929092529092839160a49183918d91165af18015610837576127da575b505b848752600d60205260408720865f5260205260405f209767ffffffffffffffff83116127c6576125f6836125f08b54614bab565b8b614deb565b8798601f841160011461275f5761262a84808b9c61267e98999a9b9c91612754575b505f198260011b9260031b1c19161790565b90555b604061263b8484848b6156e5565b6001600160a01b0360035416898c84518099819582947f3e3e68420000000000000000000000000000000000000000000000000000000084528960048501614ea4565b03925af18015612749576126b1948a91612719575b50878a52600c60205260408a20895f5260205260405f20558661578e565b156126ef57507f2c48d754bbf59f20e71c13710fac35aa1ea020da58dcbb366de0ef7f75c9377d6040845b8151908152426020820152a36001805580f35b60407f2c48d754bbf59f20e71c13710fac35aa1ea020da58dcbb366de0ef7f75c9377d91516126dc565b61273b915060403d604011612742575b6127338183614cce565b810190614e87565b505f612693565b503d612729565b6040513d8b823e3d90fd5b90508501355f612618565b80895260208920601f1985169a8a5b8c81106127ae57508561267e9798999a9b9c10612795575b5050600184811b01905561262d565b5f1960f88760031b161c19908501351690555f80612786565b9091602060018192858901358155019301910161276e565b602488634e487b7160e01b81526041600452fd5b6127fb9060203d602011612802575b6127f38183614cce565b810190614e49565b505f6125ba565b503d6127e9565b60248a634e487b7160e01b81526041600452fd5b6001600160a01b0360025416868952600960205260408920885f5260205261284960405f205483615030565b813b156112e757899060848a8360405195869485937f4bcb80a200000000000000000000000000000000000000000000000000000000855260048501528d602485015260448401528d60648401525af18015612749579089916128c4575b50869052600960205260408820875f5260205260405f20556125bc565b816128ce91614cce565b61082b57875f6128a7565b88906044927f45be0a26000000000000000000000000000000000000000000000000000000008352600452602452fd5b7fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c0748852600860205260408820875f5260205260ff60405f20541661246757604488887fe9007bcc0000000000000000000000000000000000000000000000000000000082527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c074600452602452fd5b507ff86d13979a91272f2c54c4147e588ecbeaad32dd1e0a5332a77356847049a70e8614612462565b60448888887f6dd4f06c000000000000000000000000000000000000000000000000000000008352600452602452fd5b507f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a861415612434565b87604491877f2b30318e00000000000000000000000000000000000000000000000000000000835260045215602452fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4461746120746f6f206c617267650000000000000000000000000000000000006044820152fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f55736572207265717569726564000000000000000000000000000000000000006044820152fd5b50346103c25760406003193601126103c257612b21614a6e565b602435908115158092036108d85760206001600160a01b037f6be30291a8f228c9342613e5e66df1a1b85aa570ac1bca9219f3ac7b7f73bbf392612b63615371565b1692838552601782526040852060ff1981541660ff8316179055604051908152a280f35b50346103c25760406003193601126103c2576024359060043567ffffffffffffffff831161133357826004018336039361018060031986011261125f57828452601a6020526001600160a01b0360408520541633141580612eac575b6116945760c4810190612c066107d061ffff612bfe85615049565b161115615058565b83855260076020526040852083358155602482013560018201556002810163ffffffff612c35604485016150a3565b1681549067ffffffff00000000612c4e606487016150a3565b60201b167fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff6bffffffff0000000000000000612c8c608489016150a3565b60401b16927fffffffffffffffffffffffffffffffffffffffff0000000000000000000000006fffffffff000000000000000000000000612ccf60a48b016150a3565b60601b16951617161717178155612ce8610fef85615049565b60e483013580151580910361082b577fffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff72ff00000000000000000000000000000000000083549260901b1691161790556101048201359182600383015560048201977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdd610124830135910181121561082b57810197600489013567ffffffffffffffff81116112eb5780360360248b01136112eb57612dab816110f58454614bab565b88601f8211600114612e365791612de28260069593610164958d9e8e9c9d9e926112635750505f198260011b9260031b1c19161790565b90555b612df2610144820161501c565b6001600160a01b0360058601911673ffffffffffffffffffffffffffffffffffffffff1982541617905501359101556111b06001600160a01b036002541692615049565b828a5260208a2090601f1983168b5b818110612e9157509261016494928c9d600193839d9e9c9d6006999710612e74575b505050811b019055612de5565b6024910101355f19600384901b60f8161c191690555f8080612e67565b60248e84010135845560019093019260209283019201612e45565b506001600160a01b03845416331415612be3565b50346103c25760206003193601126103c257600435906018548210156103c2576020612eeb83614af2565b90549060031b1c604051908152f35b50346103c25760206003193601126103c257611c75612f2f6040612f4393600435815260196020522060405192838092614be3565b604051918291602083526020830190614cf1565b0390f35b50346103c257806003193601126103c25750612f43604051612f6a604082614cce565b600e81527f52656769737472792d332e302e320000000000000000000000000000000000006020820152604051918291602083526020830190614cf1565b50346103c25760206003193601126103c25760406020916004358152600a83522054604051908152f35b50346103c257806003193601126103c25760206040517f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a8152f35b50346103c25760206003193601126103c2576004359067ffffffffffffffff82116103c25760206001600160a01b03818061304b3660048801614d32565b604051928184925191829101835e8101600e8152030190205416604051908152f35b50346103c25760206003193601126103c25760ff60406020926004358152601184522054166040519015158152f35b50346103c25760406003193601126103c2576001600160a01b0360406130c0614a84565b926004358152600c6020522091165f52602052602060405f2054604051908152f35b50346103c25760206003193601126103c2576001600160a01b03613104614a6e565b16815260146020526040812054600190601854805b613134575b6020604085858152601683522054604051908152f35b5f198101818111610a265761314890614af2565b90549060031b1c8210156131655761315f9061503d565b80613119565b809250600191500180911161317c5781604061311e565b602482634e487b7160e01b81526011600452fd5b50346103c25760206003193601126103c25760406020916001600160a01b036131b7614a6e565b168152601383522054604051908152f35b50346103c25760406003193601126103c2576001600160a01b0360406131ec614a84565b926004358152600d6020522091165f52602052612f43611c75612f2f60405f2060405192838092614be3565b50346103c25760206003193601126103c257600435613235615371565b60185480613276575b68010000000000000000811015613262576109998160016109af9301601855614af2565b602483634e487b7160e01b81526041600452fd5b5f1981018181116109e85761328a90614af2565b90549060031b1c821161323e57608460405162461bcd60e51b815260206004820152602260248201527f5468726573686f6c64206d75737420626520686967686572207468616e206c6160448201527f73740000000000000000000000000000000000000000000000000000000000006064820152fd5b50346103c25760a06003193601126103c25760043560243567ffffffffffffffff81116108d857613336903690600401614b7a565b9160443567ffffffffffffffff81116108d457613357903690600401614b7a565b9190936064359160843567ffffffffffffffff811161082b5761337e903690600401614ac4565b6133899291926153b0565b338952601760205260ff60408a2054161561088f576133a9868514614ec9565b8015613916578083016080848203126112e757833567ffffffffffffffff811161376857816133d9918601614d32565b50602084013567ffffffffffffffff811161376857816133fa918601614d32565b5060408401359067ffffffffffffffff82116137685761341b918501614d32565b50886060840135805b6138e357506003906001600160a01b036005541680613868575b5010613824576006546001600160a01b0316156137e0578161376c575b604051926020840192835289604085015289606085015260e060808501526134886101008501868a614f14565b92601f198585030160a08601528784527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff881161376857846134f2602061354f978d82988d60051b8092858301378c60c08401524660e0840152010301601f198101835282614cce565b51902091604051928484015283835261350c604084614cce565b6001600160a01b036006541691604051958694859384937fb8e72af600000000000000000000000000000000000000000000000000000000855260048501614f75565b03915afa801561375d578790613722575b61356a9150614f9b565b855b81811061357b57866001805580f35b6001600160a01b0361359661359183858961500c565b61501c565b168088526015602052604088205484111561371857808852601460205260408820546135c383878a61500c565b35908082111561367f5760646135d98284615030565b11613638575b50907fbb42fde0252fd03324102c3666f457311508c4dd05f96e66e0fd26f0c28e85426040600194935b838c52601460205280828d2055838c52601560205287828d20558151908152876020820152a201935b9361356c565b90506064810180911161366b577fbb42fde0252fd03324102c3666f457311508c4dd05f96e66e0fd26f0c28e85426135df565b602489634e487b7160e01b81526011600452fd5b8181116136b5575b50907fbb42fde0252fd03324102c3666f457311508c4dd05f96e66e0fd26f0c28e8542604060019493613609565b60646136c18383615030565b1115613687577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9c81019150811161366b577fbb42fde0252fd03324102c3666f457311508c4dd05f96e66e0fd26f0c28e8542613687565b5060010193613632565b506020813d602011613755575b8161373c60209383614cce565b8101031261076c5761375061356a91614e7a565b613560565b3d915061372f565b6040513d89823e3d90fd5b8a80fd5b818952601160205260ff60408a20541661379c57818952601160205260408920600160ff1982541617905561345b565b606460405162461bcd60e51b815260206004820152601960248201527f50726f706f73616c20616c7265616479206578656375746564000000000000006044820152fd5b606460405162461bcd60e51b815260206004820152601c60248201527f424c532056616c696461746f72206e6f7420636f6e66696775726564000000006044820152fd5b606460405162461bcd60e51b815260206004820152602060248201527f496e73756666696369656e7420636f6e73656e737573207468726573686f6c646044820152fd5b6020600491604051928380927f42cde4e80000000000000000000000000000000000000000000000000000000082525afa8c91816138af575b501561343e5791505f61343e565b9091506020813d6020116138db575b816138cb60209383614cce565b81010312611a485751905f6138a1565b3d91506138be565b5f1981019080821161390257169081906138fc90614e58565b91613424565b60248c634e487b7160e01b81526011600452fd5b606460405162461bcd60e51b815260206004820152601260248201527f424c532050726f6f6620726571756972656400000000000000000000000000006044820152fd5b50346103c257806003193601126103c25760206040517f3aa2e9509f29532b71f822e18bcde843a8070a508d564188ec8a6adf59eff28a8152f35b50346103c257806003193601126103c25760206001600160a01b0360035416604051908152f35b50346103c2576139cb36614b33565b6139d7949391946153b0565b81845260076020526040842090604051956139f187614c65565b8254875260018301549260208801938452600660028201549163ffffffff831660408b015263ffffffff8360201c1660608b015263ffffffff8360401c1660808b015263ffffffff8360601c1660a08b015261ffff8360801c1660c08b015260ff60e08b019360901c161515835260038101546101008b0152604051613a7e81611c758160048601614be3565b6101208b01526001600160a01b036005820154166101408b0152015461016089015251158061405f57508386526008602052604086206001600160a01b0386165f5260205260ff60405f205416614026577fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07486526008602052604086206001600160a01b0333165f5260205260ff60405f20541615613fe2577f2024516755f401845808190bb830b0e4523d0df0845503cab52130a794699a0f84148015613fb9575b613f19575b613b518282866153e9565b9651808810613ee957508386526008602052604086206001600160a01b0386165f5260205260405f20600160ff198254161790558386526009602052604086206001600160a01b0386165f526020528660405f2055838652600a602052613bbb8560408820614da2565b838652600a6020526040862054848752600b602052604087206001600160a01b0387165f5260205260405f2055838652600d602052604086206001600160a01b0386165f5260205260405f2067ffffffffffffffff8311613ed557613c2a83613c248354614bab565b83614deb565b86601f8411600114613e6e5787988792613c5a86806020958d91613e6357505f198260011b9260031b1c19161790565b90555b60025486516040517fbefa570e0000000000000000000000000000000000000000000000000000000081526001600160a01b039586166004820152602481018a9052604481019390935260648301523360848301529092839160a49183918c91165af1801561375d57613e30575b506001600160a01b03851694858752601360205260408720613ced8154614e58565b90553386867f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8a80a46040613d6a613d278585858a6156e5565b6001600160a01b03600354169083519a8b809481937fc580163e0000000000000000000000000000000000000000000000000000000083528c8960048501614ea4565b03925af196871561083757976020988198613ddd575b50927f2c48d754bbf59f20e71c13710fac35aa1ea020da58dcbb366de0ef7f75c9377d9492613dc59260408689829852600c8d5220895f528b5289865f20558761578e565b5181519081524287820152a360018055604051908152f35b60409491985092613dc59285613e217f2c48d754bbf59f20e71c13710fac35aa1ea020da58dcbb366de0ef7f75c9377d9896823d8411612742576127338183614cce565b509a9396505092509294613d80565b95506020863d602011613e5b575b81613e4b60209383614cce565b81010312611a4857869551613ccb565b3d9150613e3e565b90508701355f612618565b8188526020882090601f198516895b818110613ebd5750926020928a9b92878b9610613ea4575b5050600186811b019055613c5d565b5f1960f88960031b161c19908701351690555f80613e95565b91926020600181928689013581550194019201613e7d565b602487634e487b7160e01b81526041600452fd5b86604491897f45be0a26000000000000000000000000000000000000000000000000000000008352600452602452fd5b7fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07486526008602052604086206001600160a01b0386165f5260205260ff60405f205416613b46576044866001600160a01b03877fe9007bcc0000000000000000000000000000000000000000000000000000000083527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07460045216602452fd5b507ff86d13979a91272f2c54c4147e588ecbeaad32dd1e0a5332a77356847049a70e8414613b41565b606460405162461bcd60e51b815260206004820152601860248201527f43616c6c6572206d75737420626520436f6d6d756e69747900000000000000006044820152fd5b6044866001600160a01b0387877f6dd4f06c00000000000000000000000000000000000000000000000000000000845260045216602452fd5b86604491867f2b30318e00000000000000000000000000000000000000000000000000000000835260045215602452fd5b50346103c2577f7e684e0b76ed13bc9cf7e4fbac7d11873036be9c9a83f9958382721eeda4601060406140c236614aae565b6140ca615371565b8185526016602052808386205582519182526020820152a180f35b50346103c25760206003193601126103c25760406020916001600160a01b0361410c614a6e565b168152601483522054604051908152f35b50346103c257806003193601126103c25760206040517f2024516755f401845808190bb830b0e4523d0df0845503cab52130a794699a0f8152f35b50346103c25760406003193601126103c257614172614a6e565b6001600160a01b03168152601260205260408120805460243592908310156103c2576020612eeb8484614b1e565b5034611a48576040600319360112611a48576004359060243567ffffffffffffffff8111611a48576141d6903690600401614ac4565b92906141e06153b0565b3315612aa9576108008411612a4b57815f52600760205260405f20906040519061420982614c65565b8254825260018301549260208301938452600660028201549163ffffffff8316604086015263ffffffff8360201c16606086015263ffffffff8360401c16608086015263ffffffff8360601c1660a086015261ffff8360801c1660c086015260ff60e086019360901c1615158352600381015461010086015260405161429681611c758160048601614be3565b6101208601526001600160a01b0360058201541661014086015201546101608401525115806148d45750835f52600860205260405f206001600160a01b0333165f5260205260ff60405f205416918280936148aa575b61487a577f2024516755f401845808190bb830b0e4523d0df0845503cab52130a794699a0f85148015614851575b6147cc575b61432a8783876153e9565b905180821061479d5750826146c6578486526008602052604086206001600160a01b0333165f5260205260405f20600160ff198254161790558486526009602052604086206001600160a01b0333165f526020528060405f2055848652600a6020526143993360408820614da2565b848652600a6020526040862054858752600b602052604087206001600160a01b0333165f5260205260405f20553386526013602052604086206143dc8154614e58565b9055338652601260205260408620805490680100000000000000008210156127c65761448592876144196109998583956001602098018155614b1e565b905560025487516040517fbefa570e000000000000000000000000000000000000000000000000000000008152336004820181905260248201959095526044810193909352606483015260848201929092529283916001600160a01b03169082908a90829060a4820190565b03925af1801561461c576146a7575b505b838552600d602052604085206001600160a01b0333165f5260205260405f2067ffffffffffffffff8711614693576144d287613c248354614bab565b8587601f811160011461463257806144fc92899161462757505f198260011b9260031b1c19161790565b90555b8460406145546145118985338a6156e5565b6001600160a01b03600354169083519485809481937f3e3e68420000000000000000000000000000000000000000000000000000000083528c3360048501614ea4565b03925af190811561461c5791604097916145959388916145fe575b50868852600c6020528888206001600160a01b0333165f52602052885f2055338661578e565b156145f85750815b8351908152426020820152817f2c48d754bbf59f20e71c13710fac35aa1ea020da58dcbb366de0ef7f75c9377d853393a3600180558152600c602052206001600160a01b0333165f52602052602060405f2054604051908152f35b5161459d565b6146159150893d8b11612742576127338183614cce565b505f61456f565b6040513d88823e3d90fd5b90508401355f612618565b601f191690828852886020892092895b81811061467857501061465f575b5050600187811b0190556144ff565b5f1960f88a60031b161c19908401351690555f80614650565b8684013585556001909401936020938401938c935001614642565b602486634e487b7160e01b81526041600452fd5b6146bf9060203d602011612802576127f38183614cce565b505f614494565b6001600160a01b0360025416855f52600960205260405f206001600160a01b0333165f526020526146fb60405f205483615030565b813b15611a48575f916084839260405194859384927f4bcb80a20000000000000000000000000000000000000000000000000000000084523360048501528c602485015260448401523360648401525af180156147925761477d575b508486526009602052604086206001600160a01b0333165f5260205260405f2055614496565b61478a9196505f90614cce565b5f945f614757565b6040513d5f823e3d90fd5b907f45be0a26000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b335f9081527f2e2141118778e59f80a0cf148a1d7116c470229e7ee2d444743e9072b52a0c8d602052604090205460ff1661431f577fe9007bcc000000000000000000000000000000000000000000000000000000005f527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c0746004523360245260445ffd5b507ff86d13979a91272f2c54c4147e588ecbeaad32dd1e0a5332a77356847049a70e851461431a565b847f6dd4f06c000000000000000000000000000000000000000000000000000000005f526004523360245260445ffd5b507f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a8514156142ec565b847f2b30318e000000000000000000000000000000000000000000000000000000005f526004521560245260445ffd5b34611a485761496e604061491736614aae565b506001600160a01b0360025416825180809581947fb4d81fb30000000000000000000000000000000000000000000000000000000083523360048401602090939291936001600160a01b0360408201951681520152565b03915afa8015614792575f9061498a575b602090604051908152f35b506040813d6040116149b5575b816149a460409383614cce565b81010312611a48576020905161497f565b3d9150614997565b34611a48576020600319360112611a48576001600160a01b036149de614a6e565b165f52601260205260405f20908154808252602082019081935f5260205f20905f5b818110614a585750505081614a16910382614cce565b604051918291602083019060208452518091526040830191905f5b818110614a3f575050500390f35b8251845285945060209384019390920191600101614a31565b8254845260209093019260019283019201614a00565b600435906001600160a01b0382168203611a4857565b602435906001600160a01b0382168203611a4857565b35906001600160a01b0382168203611a4857565b6003196040910112611a48576004359060243590565b9181601f84011215611a485782359167ffffffffffffffff8311611a485760208381860195010111611a4857565b601854811015614b0a5760185f5260205f2001905f90565b634e487b7160e01b5f52603260045260245ffd5b8054821015614b0a575f5260205f2001905f90565b6060600319820112611a4857600435916024356001600160a01b0381168103611a4857916044359067ffffffffffffffff8211611a4857614b7691600401614ac4565b9091565b9181601f84011215611a485782359167ffffffffffffffff8311611a48576020808501948460051b010111611a4857565b90600182811c92168015614bd9575b6020831014614bc557565b634e487b7160e01b5f52602260045260245ffd5b91607f1691614bba565b5f9291815491614bf283614bab565b8083529260018116908115614c475750600114614c0e57505050565b5f9081526020812093945091925b838310614c2d575060209250010190565b600181602092949394548385870101520191019190614c1c565b9050602094955060ff1991509291921683830152151560051b010190565b610180810190811067ffffffffffffffff821117614c8257604052565b634e487b7160e01b5f52604160045260245ffd5b60c0810190811067ffffffffffffffff821117614c8257604052565b60a0810190811067ffffffffffffffff821117614c8257604052565b90601f601f19910116810190811067ffffffffffffffff821117614c8257604052565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b67ffffffffffffffff8111614c8257601f01601f191660200190565b81601f82011215611a4857602081359101614d4c82614d16565b92614d5a6040519485614cce565b82845282820111611a4857815f92602092838601378301015290565b60208091604051928184925191829101835e8101600e81520301902090565b35908115158203611a4857565b9081549168010000000000000000831015614c825782614dca916001614de995018155614b1e565b9091906001600160a01b038084549260031b9316831b921b1916179055565b565b919091601f8311614dfc575b505050565b818311614e0857505050565b5f5260205f206020601f830160051c9210614e41575b81601f9101920160051c03905f5b82811015614df7575f82820155600101614e2c565b5f9150614e1e565b90816020910312611a48575190565b5f198114614e665760010190565b634e487b7160e01b5f52601160045260245ffd5b51908115158203611a4857565b9190826040910312611a4857614ea1602083519301614e7a565b90565b614ea193926001600160a01b0360609316825260208201528160408201520190614cf1565b15614ed057565b606460405162461bcd60e51b815260206004820152600f60248201527f4c656e677468206d69736d6174636800000000000000000000000000000000006044820152fd5b916020908281520191905f5b818110614f2d5750505090565b9091926020806001926001600160a01b03614f4788614a9a565b168152019401929101614f20565b601f8260209493601f1993818652868601375f8582860101520116010190565b91614ea19391614f8d91604085526040850191614f55565b916020818403910152614cf1565b15614fa257565b608460405162461bcd60e51b815260206004820152602160248201527f52656769737472793a20424c5320566572696669636174696f6e204661696c6560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152fd5b9190811015614b0a5760051b0190565b356001600160a01b0381168103611a485790565b91908203918211614e6657565b8015614e66575f190190565b3561ffff81168103611a485790565b1561505f57565b606460405162461bcd60e51b815260206004820152600c60248201527f46656520746f6f206869676800000000000000000000000000000000000000006044820152fd5b3563ffffffff81168103611a485790565b359063ffffffff82168203611a4857565b92919060408452803560408501526020810135606085015263ffffffff6150ee604083016150b4565b16608085015263ffffffff615105606083016150b4565b1660a085015263ffffffff61511c608083016150b4565b1660c085015263ffffffff61513360a083016150b4565b1660e085015260c081013561ffff8116809103611a485761010085015261515c60e08201614d95565b15156101208501526101008101356101408501526101208101357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe182360301811215611a485781019060208235920167ffffffffffffffff8311611a48578236038113611a48576151df61016091602094610180848a01526101c0890191614f55565b916001600160a01b036151f56101408301614a9a565b1661018088015201356101a0860152930152565b51906fffffffffffffffffffffffffffffffff82168203611a4857565b92919261523282614d16565b916152406040519384614cce565b829481845281830111611a48578281602093845f96015e010152565b9080601f83011215611a48578151614ea192602001615226565b1561527d57565b606460405162461bcd60e51b815260206004820152600d60248201527f496e76616c6964206f776e6572000000000000000000000000000000000000006044820152fd5b156152c857565b606460405162461bcd60e51b815260206004820152601c60248201527f5468726573686f6c6473206d75737420626520617363656e64696e67000000006044820152fd5b916020936001600160a01b03615332939796971684526060858501526060840191614f14565b9060408183039101528281520191905f5b8181106153505750505090565b90919260208060019261536287614d95565b15158152019401929101615343565b6001600160a01b035f5416330361538457565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b6002600154146153c1576002600155565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b9291905f845f52600760205260405f209460066040519661540988614c65565b805488526001810154602089015260ff600282015463ffffffff811660408b015263ffffffff8160201c1660608b015263ffffffff8160401c1660808b015263ffffffff8160601c1660a08b015261ffff8160801c1660c08b015260901c16151560e0890152600381015461010089015260405161548e81611c758160048601614be3565b61012089015260058101546001600160a01b031661014089015201546101608701527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c07481036155d3575050906154e391615bd6565b80515115615575576001600160a01b036154fd8251614d76565b54166155175760a00151915b82156155125750565b519150565b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f4e616d652074616b656e000000000000000000000000000000000000000000006044820152fd5b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4e616d65207265717569726564000000000000000000000000000000000000006044820152fd5b7f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a036156ba57509061560491615a46565b7fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c0745f52600860205260405f206001600160a01b0380602084015116165f5260205260ff60405f2054161561565c576080015191615509565b60646040517faa33ade000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c696420636f6d6d756e6974790000000000000000000000000000006044820152fd5b9391602081146156cc575b5050615509565b819294509060209181010312611a485735915f806156c5565b909291907f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a14615746575050604080516001600160a01b039092166020830152818101525f6060820152614ea181608081015b03601f198101835282614cce565b61573892506020615762614ea1936001600160a01b0393615a46565b015116604051928391602083016001600160a01b03606092168152604060208201525f60408201520190565b92919092600454906001600160a01b035f9216806158d0575b507fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c074810361585d5750506020916157dd91615bd6565b6157e78151614d76565b6001600160a01b03841673ffffffffffffffffffffffffffffffffffffffff1982541617905501518051908161581c57505050565b60208091836001600160a01b039460405194859301835e8101600f815203019020911673ffffffffffffffffffffffffffffffffffffffff19825416179055565b7f0c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3a1461588a575b50505050565b6001600160a01b0361589f8194604094615a46565b51168152601060205220911673ffffffffffffffffffffffffffffffffffffffff198254161790555f808080615884565b803b15611a48575f80916044604051809481937fa3970ae60000000000000000000000000000000000000000000000000000000083526001600160a01b038c166004840152600160248401525af1801561479257156157a7576159369192505f90614cce565b5f905f6157a7565b805f52600b60205260405f206001600160a01b0383165f5260205260405f20548015614df757815f52600a60205260405f20905f198101818111614e665782545f198101908111614e66578082036159f4575b505050805480156159e0575f1901906159aa8282614b1e565b6001600160a01b0382549160031b1b19169055555f52600b6020526001600160a01b0360405f2091165f526020525f6040812055565b634e487b7160e01b5f52603160045260245ffd5b614dca916001600160a01b03615a0d615a1e9387614b1e565b90549060031b1c1692839186614b1e565b835f52600b6020526001600160a01b0360405f2091165f5260205260405f20555f8080615991565b90604051615a5381614cb2565b5f81525f6020820152606060408201526060808201525f608082015250602081101580615bc3575b15615b2a57810190602081830312611a485780359067ffffffffffffffff8211611a4857019060a082820312611a485760405191615ab883614cb2565b615ac181614a9a565b8352615acf60208201614a9a565b6020840152604081013567ffffffffffffffff8111611a485782615af4918301614d32565b6040840152606081013567ffffffffffffffff8111611a4857608092615b1b918301614d32565b60608401520135608082015290565b810160a082820312611a4857615b3f82614a9a565b91615b4c60208201614a9a565b604082013567ffffffffffffffff8111611a485783615b6c918401614d32565b60608301359367ffffffffffffffff8511611a4857615b976001600160a01b03916080968601614d32565b928160405197615ba689614cb2565b168752166020860152604085015260608401520135608082015290565b5080602011611a48576020823514615a7b565b90604051615be381614c96565b606081526060602082015260606040820152606080820152606060808201525f60a082015250602081101580615deb575b15615d1057810190602081830312611a485780359067ffffffffffffffff8211611a4857019060c082820312611a485760405191615c5183614c96565b803567ffffffffffffffff8111611a485782615c6e918301614d32565b8352602081013567ffffffffffffffff8111611a485782615c90918301614d32565b6020840152604081013567ffffffffffffffff8111611a485782615cb5918301614d32565b6040840152606081013567ffffffffffffffff8111611a485782615cda918301614d32565b6060840152608081013567ffffffffffffffff8111611a485760a092615d01918301614d32565b6080840152013560a082015290565b810160c082820312611a4857813567ffffffffffffffff8111611a485781615d39918401614d32565b91602081013567ffffffffffffffff8111611a485782615d5a918301614d32565b604082013567ffffffffffffffff8111611a485783615d7a918401614d32565b606083013567ffffffffffffffff8111611a485784615d9a918501614d32565b90608084013567ffffffffffffffff8111611a485760a095615dbd918601614d32565b9260405196615dcb88614c96565b87526020870152604086015260608501526080840152013560a082015290565b5080602011611a48576020823514615c1456fea2646970667358221220aa7c50a4e413d71090e385f57c6de204047c119177a72ea04406924345c412eb64736f6c634300082100336fb2b25080d21c908f32ff8ff99eb1d552c210854f7de48a40406764c09c68f80c34ecc75d3bf122e0609d2576e167f53fb42429262ce8c9b33cab91ff670e3ae94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c0742024516755f401845808190bb830b0e4523d0df0845503cab52130a794699a0ff86d13979a91272f2c54c4147e588ecbeaad32dd1e0a5332a77356847049a70e3b5016dc6721b132ddcb7027030b137a739df81e419695dae0899a866c1c514d3aa2e9509f29532b71f822e18bcde843a8070a508d564188ec8a6adf59eff28a"` diff --git a/0.16.23/api/@aastar/core/variables/ReputationSystemABI.md b/0.16.23/api/@aastar/core/variables/ReputationSystemABI.md new file mode 100644 index 000000000..f70d56f68 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ReputationSystemABI.md @@ -0,0 +1,3 @@ +> `const` **ReputationSystemABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L77) diff --git a/0.16.23/api/@aastar/core/variables/ReputationSystemArtifact.md b/0.16.23/api/@aastar/core/variables/ReputationSystemArtifact.md new file mode 100644 index 000000000..d272a5859 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/ReputationSystemArtifact.md @@ -0,0 +1,13 @@ +> `const` **ReputationSystemArtifact**: `object` = `ReputationSystemABIData` + +Defined in: [packages/core/src/abis/index.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L78) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60a0604052346102c557604051601f61231c38819003918201601f19168301916001600160401b0383118484101761029e578084926020946040528339810103126102c557516001600160a01b038116908190036102c55733156102b2575f8054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a360809081526040519081016001600160401b0381118282101761029e57604052600a81526020810160018152604082019060648252604051926040840184811060018060401b0382111761029e576040526007845266111959985d5b1d60ca1b60208501526060810184905251600355516004555160055580516001600160401b03811161029e57600654600181811c91168015610294575b602082101461028057601f8111610212575b50602091601f82116001146101b2579181925f926101a7575b50508160011b915f199060031b1c1916176006555b60405161205290816102ca8239608051818181610a1d01528181610d920152818161175201526117d10152f35b015190505f80610165565b601f1982169260065f52805f20915f5b8581106101fa575083600195106101e2575b505050811b0160065561017a565b01515f1960f88460031b161c191690555f80806101d4565b919260206001819286850151815501940192016101c2565b8181111561014c5760065f52601f820160051c7ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f60208410610278575b81601f9101920160051c03905f5b82811061026b57505061014c565b5f8282015560010161025d565b5f915061024f565b634e487b7160e01b5f52602260045260245ffd5b90607f169061013a565b634e487b7160e01b5f52604160045260245ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fdfe6080806040526004361015610012575f80fd5b5f905f3560e01c90816306433b1b146117a757508063097f6b7c146116165780632f4468811461144957806330cd71a81461134a5780633425bfae146112dc5780634a2357b91461126757806354fd4d50146112085780636df80b4e14610d40578063715018a614610cc457806374f9924414610c345780638da5cb5b14610c025780638dbda2eb14610bbd5780639172ff45146108f45780639c4b3436146107a6578063a00e8f8114610737578063a981c9f5146106d3578063bcd3697c146105c5578063ce26b0e014610503578063cf1c5456146104be578063f2fde38b146103ee578063fb42a9bf14610393578063fc193b49146103435763ff61c64e1461011b575f80fd5b34610340576101293661183b565b50909173ffffffffffffffffffffffffffffffffffffffff8192168082526002602052604082206040518082602082945493848152019086526020862092865b81811061032757505061017e925003826118fe565b80511561031957818352600160205261019a6040842091611c2e565b5183526020526101ac60408320611c4f565b9260208451940151915b835260076020526040832054928315610309575b948573ffffffffffffffffffffffffffffffffffffffff600b549216965b82811061020d5750505060809450604051938452602084015260408301526060820152f35b6024602073ffffffffffffffffffffffffffffffffffffffff61022f84611bbc565b90549060031b1c16604051928380927f70a082310000000000000000000000000000000000000000000000000000000082528d60048301525afa8391816102d2575b50610280575b506001016101e8565b61028b575b5f610277565b926102ca60019173ffffffffffffffffffffffffffffffffffffffff6102b087611bbc565b90549060031b1c1684526009602052604084205490611cc8565b939050610285565b9091506020813d8211610301575b816102ed602093836118fe565b810103126102fd5751905f610271565b5f80fd5b3d91506102e0565b670de0b6b3a764000093506101ca565b5060035492600454916101b6565b8454835260019485019486945060209093019201610169565b80fd5b50346103405760206003193601126103405760043590600b5482101561034057602073ffffffffffffffffffffffffffffffffffffffff61038384611bbc565b90549060031b1c16604051908152f35b50346103405760406003193601126103405773ffffffffffffffffffffffffffffffffffffffff60406103c46117f5565b92826103ce611818565b9416815260086020522091165f52602052602060405f2054604051908152f35b50346103405760206003193601126103405773ffffffffffffffffffffffffffffffffffffffff61041d6117f5565b610425611fd0565b1680156104925773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b503461034057602060031936011261034057604060209173ffffffffffffffffffffffffffffffffffffffff6104f26117f5565b168152600983522054604051908152f35b50346103405760206003193601126103405773ffffffffffffffffffffffffffffffffffffffff6105326117f5565b168152600260205260408120604051908160208254918281520190819285526020852090855b8181106105af575050508261056e9103836118fe565b604051928392602084019060208552518091526040840192915b818110610596575050500390f35b8251845285945060209384019390920191600101610588565b8254845260209093019260019283019201610558565b5034610340578060031936011261034057600354600454916005546040519180600654906105f282611a87565b808652916001811690811561068e575060011461062d575b50509061061d83610629949303836118fe565b60405194859485611b96565b0390f35b600681527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f94939250905b808210610672575091925090820160200161061d8361060a565b9192936001816020925483858901015201910190939291610658565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208088019190915292151560051b8601909201925061061d915084905061060a565b5034610340576040600319360112610340576106ed6117f5565b73ffffffffffffffffffffffffffffffffffffffff168152600260205260408120805460243592908310156103405760206107288484611c01565b90549060031b1c604051908152f35b50346103405760406003193601126103405760409073ffffffffffffffffffffffffffffffffffffffff6107696117f5565b16815260016020528181206024358252602052208054610629600183015492610799600360028301549201611ad8565b9060405194859485611b96565b50346103405773ffffffffffffffffffffffffffffffffffffffff6107ca3661183b565b5091909116918281526002602052604081209260405191826020865491828152019582526020822090825b8181106108de5750505061080f836108d1959603846118fe565b60409485519261081f87856118fe565b60018452601f198701926108368460208701611fb4565b8561084086611c2e565b5261084a85611c2e565b5087519561085889886118fe565b600187526108698560208901611fb4565b519050601f1961089061087b83611921565b926108888b5194856118fe565b808452611921565b013660208301376108a086611c2e565b526108aa85611c2e565b508651926108b888856118fe565b600184523660208501376108cb83611c2e565b52611cd5565b8151908082526020820152f35b82548852602090970196600192830192016107f5565b50346102fd5760c06003193601126102fd5761090e6117f5565b60243567ffffffffffffffff81116102fd5761092e903690600401611939565b60443567ffffffffffffffff81116102fd5761094e9036906004016119b4565b60643567ffffffffffffffff81116102fd5761096e9036906004016119b4565b60a4359067ffffffffffffffff82116102fd5761099261099b9236906004016118b4565b93909486611cd5565b916040918251916109ac84846118fe565b600183526020830191601f198501918236853773ffffffffffffffffffffffffffffffffffffffff6109dd86611c2e565b98168098528551936109ef87866118fe565b60018552602085019336853787610a0586611c2e565b5273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001694853b156102fd57959392919087519687957f1b02e44f00000000000000000000000000000000000000000000000000000000875260a48701905f600489015260a060248901525180915260c4870192905f5b818110610b8e5750505060209060031987840301604488015251918281520193905f5b818110610b75575050506020845f9694601f19601f8684978b97608435606488015260031987870301608488015281865287860137868682860101520116010301925af18015610b6b57610b30575b507fdb8ed69eccdb6ff5105e3934ba9b515bb1b9d366e3a0c25a5f852ee20b6783e29160209151908152a280f35b602091945091610b615f7fdb8ed69eccdb6ff5105e3934ba9b515bb1b9d366e3a0c25a5f852ee20b6783e2946118fe565b5f94915091610b02565b82513d5f823e3d90fd5b8251865288965060209586019590920191600101610ab3565b825173ffffffffffffffffffffffffffffffffffffffff1685528a985060209485019490920191600101610a90565b346102fd5760206003193601126102fd5773ffffffffffffffffffffffffffffffffffffffff610beb6117f5565b165f526007602052602060405f2054604051908152f35b346102fd575f6003193601126102fd57602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b346102fd5760806003193601126102fd57610c4d6117f5565b60243567ffffffffffffffff81116102fd57610c6d903690600401611939565b9060443567ffffffffffffffff81116102fd57610c8e9036906004016119b4565b906064359167ffffffffffffffff83116102fd57602093610cb6610cbc9436906004016119b4565b92611cd5565b604051908152f35b346102fd575f6003193601126102fd57610cdc611fd0565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346102fd5760a06003193601126102fd5760043560243560443560843567ffffffffffffffff81116102fd57610d7a9036906004016118b4565b9073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166040517fa2d0020e000000000000000000000000000000000000000000000000000000008152602081600481855afa80156111ca575f906111d5575b602091506044604051809481937f91d1485400000000000000000000000000000000000000000000000000000000835260048301523360248301525afa9081156111ca575f9161119b575b50801561117b575b1561111d57335f52600160205260405f20855f5260205260405f20541580611114575b6110af575b604051610e75816118e2565b848152602081018481526040820190606435825267ffffffffffffffff85116110825760405194610eb0601f8201601f1916602001876118fe565b80865236818601116102fd576020815f92600397838a01378701015260608301948552335f52600160205260405f20885f5260205260405f209251835551600183015551600282015501905180519067ffffffffffffffff8211611082578190610f1a8454611a87565b601f8111611029575b50602090601f8311600114610fa9575f92610f9e575b50507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8260011b9260031b1c19161790555b60405191825260208201527f868a11f79934bfa7243fd979d39bf00f37050e24b3ffc20a11f12a8b7e48d99560403392a3005b015190508680610f39565b5f85815282812093601f1916905b8181106110115750908460019594939210610fda575b505050811b019055610f6b565b01517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88460031b161c19169055868080610fcd565b92936020600181928786015181550195019301610fb7565b82811115610f2357909150835f5260205f20601f840160051c906020851061107a575b849392601f0160051c82900391015f5b82811061106a575050610f23565b5f8183015585945060010161105c565b5f915061104c565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b335f52600260205260405f20805468010000000000000000811015611082576110dd91600182018155611c01565b81549060031b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff88831b921b1916179055610e69565b50831515610e64565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f4e6f7420417574686f72697a65640000000000000000000000000000000000006044820152fd5b503373ffffffffffffffffffffffffffffffffffffffff5f541614610e41565b6111bd915060203d6020116111c3575b6111b581836118fe565b810190611c16565b86610e39565b503d6111ab565b6040513d5f823e3d90fd5b506020813d602011611200575b816111ef602093836118fe565b810103126102fd5760209051610dee565b3d91506111e2565b346102fd575f6003193601126102fd576106296040516112296040826118fe565b601081527f52657075746174696f6e2d302e332e3200000000000000000000000000000000602082015260405191829160208352602083019061188f565b346102fd5760406003193601126102fd576112806117f5565b7f21281390931aaf470d02c340b1ca10fabd02c8d7cdd1efcdbb3dc3fe5a0d0749602073ffffffffffffffffffffffffffffffffffffffff602435936112c4611fd0565b1692835f52600782528060405f2055604051908152a2005b346102fd5760406003193601126102fd576112f56117f5565b73ffffffffffffffffffffffffffffffffffffffff611312611818565b91165f52600a60205273ffffffffffffffffffffffffffffffffffffffff60405f2091165f52602052602060405f2054604051908152f35b346102fd5760406003193601126102fd576113636117f5565b73ffffffffffffffffffffffffffffffffffffffff60243591611384611fd0565b1690815f52600960205260405f2054156113d3575b60207fcde4878b12c6b6c93c3eb3433ffbfdb24eb29698d8ac6ac98caf5db49d82345791835f52600982528060405f2055604051908152a2005b600b5468010000000000000000811015611082577fcde4878b12c6b6c93c3eb3433ffbfdb24eb29698d8ac6ac98caf5db49d8234579161141b82600160209401600b55611bbc565b81549060031b9073ffffffffffffffffffffffffffffffffffffffff87831b921b1916179055915050611399565b346102fd5760206003193601126102fd576114626117f5565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff86165afa5f91816115e2575b506115185760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420636f6c6c656374696f6e00000000000000000000000000006044820152fd5b1561158457335f52600a60205260405f2073ffffffffffffffffffffffffffffffffffffffff82165f5260205260405f20541561155157005b335f52600a60205273ffffffffffffffffffffffffffffffffffffffff60405f2091165f5260205260405f204290555f80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f446f6573206e6f7420686f6c64204e46540000000000000000000000000000006044820152fd5b9091506020813d60201161160e575b816115fe602093836118fe565b810103126102fd575190836114b5565b3d91506115f1565b346102fd576116243661183b565b9173ffffffffffffffffffffffffffffffffffffffff5f541633148015611708575b156116aa57602073ffffffffffffffffffffffffffffffffffffffff807f6c1649831c4a2bebf79dfe8a2623ce1f5c65c9ab62903600dc011ee60a11c408931693845f526008835260405f208282165f5283528560405f20556040519586521693a3005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f556e617574686f72697a656400000000000000000000000000000000000000006044820152fd5b506040517fbf28c98a00000000000000000000000000000000000000000000000000000000815233600482015260208160248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9081156111ca575f91611788575b50611646565b6117a1915060203d6020116111c3576111b581836118fe565b84611782565b346102fd575f6003193601126102fd5760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036102fd57565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036102fd57565b60031960609101126102fd5760043573ffffffffffffffffffffffffffffffffffffffff811681036102fd579060243573ffffffffffffffffffffffffffffffffffffffff811681036102fd579060443590565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b9181601f840112156102fd5782359167ffffffffffffffff83116102fd57602083818601950101116102fd57565b6080810190811067ffffffffffffffff82111761108257604052565b90601f601f19910116810190811067ffffffffffffffff82111761108257604052565b67ffffffffffffffff81116110825760051b60200190565b9080601f830112156102fd5781359061195182611921565b9261195f60405194856118fe565b82845260208085019360051b8201019182116102fd57602001915b8183106119875750505090565b823573ffffffffffffffffffffffffffffffffffffffff811681036102fd5781526020928301920161197a565b9080601f830112156102fd578135906119cc82611921565b926119da60405194856118fe565b82845260208085019360051b820101908282116102fd5760208101935b828510611a0657505050505090565b843567ffffffffffffffff81116102fd57820184603f820112156102fd57602081013590611a3382611921565b91611a4160405193846118fe565b8083526020808085019260051b84010101918783116102fd57604001905b828210611a77575050508152602094850194016119f7565b8135815260209182019101611a5f565b90600182811c92168015611ace575b6020831014611aa157565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691611a96565b9060405191825f825492611aeb84611a87565b8084529360018116908115611b565750600114611b12575b50611b10925003836118fe565b565b90505f9291925260205f20905f915b818310611b3a575050906020611b10928201015f611b03565b6020919350806001915483858901015201910190918492611b21565b60209350611b109592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201015f611b03565b9092608092611bb99594835260208301526040820152816060820152019061188f565b90565b600b54811015611bd457600b5f5260205f2001905f90565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8054821015611bd4575f5260205f2001905f90565b908160209103126102fd575180151581036102fd5790565b805115611bd45760200190565b8051821015611bd45760209160051b010190565b90604051611c5c816118e2565b6060611c836003839580548552600181015460208601526002810154604086015201611ad8565b910152565b81810292918115918404141715611c9b57565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b91908201809211611c9b57565b93919290935f935f915b8651831015611e5c5773ffffffffffffffffffffffffffffffffffffffff611d078489611c3b565b5116965f91825b611d188686611c3b565b5151841015611e0d57611da5600191611d3b86611d358a8a611c3b565b51611c3b565b518c5f528360205260405f20905f5260205285611d5a60405f20611c4f565b8a8a82511580611e05575b611db5575b611d9f93611d35611d7e92611d8a94611c3b565b51602083015190611c88565b906040810151808311611dad575b5051611cc8565b90611cc8565b930192611d0e565b91505f611d98565b50505050611d9f89611d8a611d7e89611d358d604051611dd4816118e2565b600354815260045460208201526005546040820152611df36006611ad8565b60608201529594509250509350611d6a565b508315611d65565b60019350611e42670de0b6b3a764000091611e49949b9a93979a9996995f52600760205260405f2054908115611e5457611c88565b0490611cc8565b950191939093611cdf565b839150611c88565b939495505050505f90600b54915b828110611e7657505050565b73ffffffffffffffffffffffffffffffffffffffff611e9482611bbc565b90549060031b1c1673ffffffffffffffffffffffffffffffffffffffff8316805f52600a60205260405f2073ffffffffffffffffffffffffffffffffffffffff83165f5260205260405f20548015159081611f9c575b50611efa575b5050600101611e6a565b604051907f70a082310000000000000000000000000000000000000000000000000000000082526004820152602081602481855afa5f9181611f69575b5015611ef057611f48575b80611ef0565b60019195611f62915f52600960205260405f205490611cc8565b9490611f42565b9091506020813d8211611f94575b81611f84602093836118fe565b810103126102fd5751905f611f37565b3d9150611f77565b905062093a808101809111611c9b574210155f611eea565b5f5b828110611fc257505050565b606082820152602001611fb6565b73ffffffffffffffffffffffffffffffffffffffff5f54163303611ff057565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffdfea26469706673582212209605ab785653a377b6015b8a9a078efeafd842fddf812cf127c38edf06a3712d64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/SBT_ADDRESS.md b/0.16.23/api/@aastar/core/variables/SBT_ADDRESS.md new file mode 100644 index 000000000..6ba788333 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SBT_ADDRESS.md @@ -0,0 +1,3 @@ +> **SBT\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L32) diff --git a/0.16.23/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md b/0.16.23/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md new file mode 100644 index 000000000..09ccf8b41 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md @@ -0,0 +1,175 @@ +> `const` **SEPOLIA\_CONTRACTS**: `object` + +Defined in: [packages/core/src/contracts.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contracts.ts#L38) + +Sepolia Testnet Contracts + +## Type Declaration + +### communities + +> `readonly` **communities**: `object` + +#### communities.aastar + +> `readonly` **aastar**: `object` + +AAStar Community - Test community for development (registered: 2025-11-01) + +#### communities.aastar.ensName + +> `readonly` **ensName**: `"aastar.eth"` = `'aastar.eth'` + +#### communities.aastar.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.aPNTs` + +#### communities.aastar.name + +> `readonly` **name**: `"AAStar"` = `'AAStar'` + +#### communities.aastar.owner + +> `readonly` **owner**: `"0x411BD567E46C0781248dbB6a9211891C032885e5"` = `COMMUNITY_OWNERS.aastarOwner` + +#### communities.aastar.stake + +> `readonly` **stake**: `"50"` = `'50'` + +#### communities.breadCommunity + +> `readonly` **breadCommunity**: `object` + +BreadCommunity - Test community for development (registered: 2025-11-03) + +#### communities.breadCommunity.ensName + +> `readonly` **ensName**: `"bread.eth"` = `'bread.eth'` + +#### communities.breadCommunity.gasToken + +> `readonly` **gasToken**: `` `0x${string}` `` = `TEST_TOKEN_ADDRESSES.bPNTs` + +#### communities.breadCommunity.name + +> `readonly` **name**: `"BreadCommunity"` = `'BreadCommunity'` + +#### communities.breadCommunity.owner + +> `readonly` **owner**: `"0xe24b6f321B0140716a2b671ed0D983bb64E7DaFA"` = `COMMUNITY_OWNERS.breadCommunityOwner` + +#### communities.breadCommunity.stake + +> `readonly` **stake**: `"50"` = `'50'` + +### core + +> `readonly` **core**: `object` = `CORE_ADDRESSES` + +#### core.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` = `APNTS_ADDRESS` + +#### core.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +#### core.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` = `ENTRY_POINT_ADDRESS` + +#### core.gToken + +> `readonly` **gToken**: `` `0x${string}` `` = `GTOKEN_ADDRESS` + +#### core.gTokenStaking + +> `readonly` **gTokenStaking**: `` `0x${string}` `` = `GTOKEN_STAKING_ADDRESS` + +#### core.mySBT + +> `readonly` **mySBT**: `` `0x${string}` `` = `SBT_ADDRESS` + +#### core.paymasterFactory + +> `readonly` **paymasterFactory**: `` `0x${string}` `` = `PAYMASTER_FACTORY_ADDRESS` + +#### core.paymasterV4 + +> `readonly` **paymasterV4**: `` `0x${string}` `` + +#### core.registry + +> `readonly` **registry**: `` `0x${string}` `` = `REGISTRY_ADDRESS` + +#### core.superPaymaster + +> `readonly` **superPaymaster**: `` `0x${string}` `` = `SUPER_PAYMASTER_ADDRESS` + +#### core.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` + +### monitoring + +> `readonly` **monitoring**: `object` = `MONITORING_ADDRESSES` + +#### monitoring.blsAggregator + +> `readonly` **blsAggregator**: `` `0x${string}` `` = `BLS_AGGREGATOR_ADDRESS` + +#### monitoring.dvtValidator + +> `readonly` **dvtValidator**: `` `0x${string}` `` = `DVT_VALIDATOR_ADDRESS` + +### official + +> `readonly` **official**: `object` = `OFFICIAL_ADDRESSES` + +#### official.entryPoint + +> `readonly` **entryPoint**: `` `0x${string}` `` + +### paymaster + +> `readonly` **paymaster**: `object` = `PAYMASTER_ADDRESSES` + +#### paymaster.paymasterV4\_1 + +> `readonly` **paymasterV4\_1**: `` `0x${string}` `` + +#### paymaster.paymasterV4\_1iImplementation + +> `readonly` **paymasterV4\_1iImplementation**: `` `0x${string}` `` = `PAYMASTER_V4_IMPL_ADDRESS` + +### testAccounts + +> `readonly` **testAccounts**: `object` = `TEST_ACCOUNT_ADDRESSES` + +#### testAccounts.simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` + +### testTokens + +> `readonly` **testTokens**: `object` = `TEST_TOKEN_ADDRESSES` + +#### testTokens.aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +#### testTokens.bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +#### testTokens.mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` + +### tokens + +> `readonly` **tokens**: `object` = `TOKEN_ADDRESSES` + +#### tokens.xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md b/0.16.23/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md new file mode 100644 index 000000000..f24d2a60a --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md @@ -0,0 +1,67 @@ +> `const` **SEPOLIA\_V2\_VERSIONS**: `object` + +Defined in: [packages/core/src/contract-versions.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L42) + +V2 Contract Versions on Sepolia + +## Type Declaration + +### core + +> `readonly` **core**: `object` + +#### core.gToken + +> `readonly` **gToken**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### core.gTokenStaking + +> `readonly` **gTokenStaking**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### core.paymasterFactory + +> `readonly` **paymasterFactory**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### core.registry + +> `readonly` **registry**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### core.superPaymaster + +> `readonly` **superPaymaster**: [`ContractVersion`](../interfaces/ContractVersion.md) + +### monitoring + +> `readonly` **monitoring**: `object` + +#### monitoring.blsAggregator + +> `readonly` **blsAggregator**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### monitoring.dvtValidator + +> `readonly` **dvtValidator**: [`ContractVersion`](../interfaces/ContractVersion.md) + +### testTokens + +> `readonly` **testTokens**: `object` + +#### testTokens.aPNTs + +> `readonly` **aPNTs**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### testTokens.bPNTs + +> `readonly` **bPNTs**: [`ContractVersion`](../interfaces/ContractVersion.md) + +### tokens + +> `readonly` **tokens**: `object` + +#### tokens.mySBT + +> `readonly` **mySBT**: [`ContractVersion`](../interfaces/ContractVersion.md) + +#### tokens.xPNTsFactory + +> `readonly` **xPNTsFactory**: [`ContractVersion`](../interfaces/ContractVersion.md) diff --git a/0.16.23/api/@aastar/core/variables/SERVICE_FEE_RATE.md b/0.16.23/api/@aastar/core/variables/SERVICE_FEE_RATE.md new file mode 100644 index 000000000..6b395b152 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SERVICE_FEE_RATE.md @@ -0,0 +1,3 @@ +> `const` **SERVICE\_FEE\_RATE**: `200` = `200` + +Defined in: [packages/core/src/constants.ts:80](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L80) diff --git a/0.16.23/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md b/0.16.23/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md new file mode 100644 index 000000000..39345b639 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md @@ -0,0 +1,3 @@ +> **SUPER\_PAYMASTER\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:34](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L34) diff --git a/0.16.23/api/@aastar/core/variables/SimpleAccountABI.md b/0.16.23/api/@aastar/core/variables/SimpleAccountABI.md new file mode 100644 index 000000000..2b7ccf148 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SimpleAccountABI.md @@ -0,0 +1,3 @@ +> `const` **SimpleAccountABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L60) diff --git a/0.16.23/api/@aastar/core/variables/SimpleAccountArtifact.md b/0.16.23/api/@aastar/core/variables/SimpleAccountArtifact.md new file mode 100644 index 000000000..fca95892c --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SimpleAccountArtifact.md @@ -0,0 +1,13 @@ +> `const` **SimpleAccountArtifact**: `object` = `SimpleAccountABIData` + +Defined in: [packages/core/src/abis/index.ts:61](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L61) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs?`: `undefined`; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: (\{ `components`: `object`[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60c03461014757601f61183e38819003918201601f19168301916001600160401b0383118484101761014b5780849260209460405283398101031261014757516001600160a01b0381168103610147573060805260a0525f51602061181e5f395f51905f525460ff8160401c16610138576002600160401b03196001600160401b038216016100e2575b6040516116be90816101608239608051818181610798015261086e015260a0518181816101b40152818161034d0152818161051e015281816106b401528181610b8d01528181610c4401528181610e4601526112f70152f35b6001600160401b0319166001600160401b039081175f51602061181e5f395f51905f52556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f610089565b63f92ee8a960e01b5f5260045ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f905f3560e01c90816301ffc9a714610f7357508063150b7a0214610f0457806319822f7c14610dfa57806334fcd5be14610cc85780634a58db1914610c215780634d44560d14610b3a5780634f1ef2861461081057806352d1902d146107705780638da5cb5b1461073d578063ad3cb1cc146106d8578063b0d691fe14610687578063b61d27f61461060b578063bc197c8114610557578063c399ec88146104c3578063c4d66de814610231578063d087d288146101535763f23a6e610361000f57346101505760a0600319360112610150576100f8611042565b50610101611065565b5060843567ffffffffffffffff811161014e57610122903690600401611088565b505060206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b505b80fd5b5034610150578060031936011261015057604051907f35567e1a00000000000000000000000000000000000000000000000000000000825230600483015280602483015260208260448173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa90811561022557906101ee575b602090604051908152f35b506020813d60201161021d575b81610208602093836110e7565b8101031261021957602090516101e3565b5f80fd5b3d91506101fb565b604051903d90823e3d90fd5b50346101505760206003193601126101505761024b611042565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549060ff8260401c16159167ffffffffffffffff8116801590816104bb575b60011490816104b1575b1590816104a8575b506104805790818360017fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000073ffffffffffffffffffffffffffffffffffffffff9516177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005561042b575b501690817fffffffffffffffffffffffff00000000000000000000000000000000000000008454161783556040519173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167f47e55c76e7a6f1fd8996a1da8008c1ea29699cca35e7bcd057f2dec313b6e5de8580a3610399575080f35b60207fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2917fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005560018152a180f35b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555f610307565b6004847ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b9050155f61029d565b303b159150610295565b84915061028b565b5034610150578060031936011261015057604051907f70a0823100000000000000000000000000000000000000000000000000000000825230600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa90811561022557906101ee57602090604051908152f35b50346101505760a060031936011261015057610571611042565b5061057a611065565b5060443567ffffffffffffffff811161014e5761059b9036906004016110b6565b505060643567ffffffffffffffff811161014e576105bd9036906004016110b6565b505060843567ffffffffffffffff811161014e576105df903690600401611088565b505060206040517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b50346101505760606003193601126101505780610626611042565b60443567ffffffffffffffff811161068357829161064b61065e923690600401611088565b92906106556112e0565b5a93369161118f565b916020835193019160243591f1156106735780f35b61067b6113a5565b602081519101fd5b5050fd5b5034610150578060031936011261015057602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5034610150578060031936011261015057506107396040516106fb6040826110e7565b600581527f352e302e3000000000000000000000000000000000000000000000000000000060208201526040519182916020835260208301906111c5565b0390f35b503461015057806003193601126101505773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461015057806003193601126101505773ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001630036107e85760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b807fe07c8dba0000000000000000000000000000000000000000000000000000000060049252fd5b50604060031936011261015057610825611042565b9060243567ffffffffffffffff811161014e573660238201121561014e5761085790369060248160040135910161118f565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803014908115610af8575b50610ad0576108a66113bf565b73ffffffffffffffffffffffffffffffffffffffff831690604051937f52d1902d000000000000000000000000000000000000000000000000000000008552602085600481865afa80958596610a98575b5061092857602484847f4c9c8ce3000000000000000000000000000000000000000000000000000000008252600452fd5b9091847f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8103610a6d5750813b15610a4257807fffffffffffffffffffffffff00000000000000000000000000000000000000007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416177f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8480a28151839015610a0f5780836020610a0b95519101845af4610a056112b1565b916115ef565b5080f35b50505034610a1a5780f35b807fb398979f0000000000000000000000000000000000000000000000000000000060049252fd5b7f4c9c8ce3000000000000000000000000000000000000000000000000000000008452600452602483fd5b7faa1d49a4000000000000000000000000000000000000000000000000000000008552600452602484fd5b9095506020813d602011610ac8575b81610ab4602093836110e7565b81010312610ac45751945f6108f7565b8480fd5b3d9150610aa7565b6004827fe07c8dba000000000000000000000000000000000000000000000000000000008152fd5b905073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541614155f610899565b5034610150576040600319360112610150578060043573ffffffffffffffffffffffffffffffffffffffff8116809103610c1e57610b766113bf565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690813b156106835782916044839260405194859384927f205c2878000000000000000000000000000000000000000000000000000000008452600484015260243560248401525af18015610c1357610c025750f35b81610c0c916110e7565b6101505780f35b6040513d84823e3d90fd5b50fd5b505f6003193601126102195773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803b15610219575f602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610cbd57610cb1575080f35b61001a91505f906110e7565b6040513d5f823e3d90fd5b346102195760206003193601126102195760043567ffffffffffffffff811161021957610cf99036906004016110b6565b610d016112e0565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301905b8281101561001a578060051b8401358281121561021957840180359073ffffffffffffffffffffffffffffffffffffffff82168203610219575f9181610d81610d76604086950183611208565b91905a92369161118f565b926020808551950193013591f115610d9b57600101610d29565b60018303610dab5761067b6113a5565b610db36113a5565b90610df66040519283927f5a15467500000000000000000000000000000000000000000000000000000000845260048401526040602484015260448301906111c5565b0390fd5b346102195760606003193601126102195760043567ffffffffffffffff81116102195761012060031982360301126102195760443573ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163303610ea657610e7e60209260243590600401611259565b9080610e8e575b50604051908152f35b5f80808093335af150610e9f6112b1565b5082610e85565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e74000000006044820152fd5b3461021957608060031936011261021957610f1d611042565b50610f26611065565b5060643567ffffffffffffffff811161021957610f47903690600401611088565b505060206040517f150b7a02000000000000000000000000000000000000000000000000000000008152f35b3461021957602060031936011261021957600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361021957817f150b7a020000000000000000000000000000000000000000000000000000000060209314908115611018575b8115610fee575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483610fe7565b7f4e2312e00000000000000000000000000000000000000000000000000000000081149150610fe0565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361021957565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361021957565b9181601f840112156102195782359167ffffffffffffffff8311610219576020838186019501011161021957565b9181601f840112156102195782359167ffffffffffffffff8311610219576020808501948460051b01011161021957565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761112857604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b67ffffffffffffffff811161112857601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b92919261119b82611155565b916111a960405193846110e7565b829481845281830111610219578281602093845f960137010152565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610219570180359067ffffffffffffffff82116102195760200191813603831361021957565b906112a261129973ffffffffffffffffffffffffffffffffffffffff9261129361128c855f541696610100810190611208565b369161118f565b9061144e565b90929192611488565b16036112ac575f90565b600190565b3d156112db573d906112c282611155565b916112d060405193846110e7565b82523d5f602084013e565b606090565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001633148015611385575b1561132757565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e746044820152fd5b5073ffffffffffffffffffffffffffffffffffffffff5f54163314611320565b3d604051906020818301016040528082525f602083013e90565b73ffffffffffffffffffffffffffffffffffffffff5f541633148015611445575b156113e757565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e6572000000000000000000000000000000000000000000006044820152fd5b503033146113e0565b815191906041830361147e576114779250602082015190606060408401519301515f1a90611560565b9192909190565b50505f9160029190565b6004811015611533578061149a575050565b600181036114ca577ff645eedf000000000000000000000000000000000000000000000000000000005f5260045ffd5b600281036114fe57507ffce698f7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6003146115085750565b7fd78bce0c000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116115e4579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610cbd575f5173ffffffffffffffffffffffffffffffffffffffff8116156115da57905f905f90565b505f906001905f90565b5050505f9160039190565b9061162c575080511561160457602081519101fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b8151158061167f575b61163d575090565b73ffffffffffffffffffffffffffffffffffffffff907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b1561163556fea2646970667358221220b89f331a6d28607c751a074e9d4b888a9c4df5a4e278f75c243676b2102c680264736f6c63430008210033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"` diff --git a/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryABI.md b/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryABI.md new file mode 100644 index 000000000..8a3131ffc --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryABI.md @@ -0,0 +1,3 @@ +> `const` **SimpleAccountFactoryABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:63](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L63) diff --git a/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md b/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md new file mode 100644 index 000000000..8e7448b12 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md @@ -0,0 +1,13 @@ +> `const` **SimpleAccountFactoryArtifact**: `object` = `SimpleAccountFactoryABIData` + +Defined in: [packages/core/src/abis/index.ts:64](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L64) + +## Type Declaration + +### abi + +> **abi**: (\{ `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60c0806040523461010d5760208161219d803803809161001f8285610138565b83398101031261010d57516001600160a01b0381169081900361010d576040516117ed808201906001600160401b038211838310176101245760209183916109b083398481520301905ff08015610119576080526040516213997160e71b815290602090829060049082905afa908115610119575f916100d3575b5060a052604051610854908161015c823960805181818160e60152818161037f01526104b6015260a05181818161015201526102b20152f35b90506020813d602011610111575b816100ee60209383610138565b8101031261010d57516001600160a01b038116810361010d575f61009a565b5f80fd5b3d91506100e1565b6040513d5f823e3d90fd5b634e487b7160e01b5f52604160045260245ffd5b601f909101601f19168101906001600160401b038211908210176101245760405256fe6080806040526004361015610012575f80fd5b5f3560e01c90816309ccb8801461010a5750806311464fbe1461009c5780635fbfb9cf1461008357638cb84e1814610048575f80fd5b3461007f57602061006161005b36610176565b90610422565b73ffffffffffffffffffffffffffffffffffffffff60405191168152f35b5f80fd5b3461007f57602061006161009636610176565b9061029b565b3461007f575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261007f57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b3461007f575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261007f5760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc604091011261007f5760043573ffffffffffffffffffffffffffffffffffffffff8116810361007f579060243590565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761020857604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f602060609473ffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0941685526040828601528051918291826040880152018686015e5f8582860101520116010190565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168033036103ef57506102e48282610422565b803b6103d3575073ffffffffffffffffffffffffffffffffffffffff604051917fc4d66de80000000000000000000000000000000000000000000000000000000060208401521660248201526024815261033f6044826101c7565b604051906102a88083019183831067ffffffffffffffff8411176102085783926103a592610577853973ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690610235565b03905ff580156103c85773ffffffffffffffffffffffffffffffffffffffff1690565b6040513d5f823e3d90fd5b73ffffffffffffffffffffffffffffffffffffffff1692915050565b7f389b01ec000000000000000000000000000000000000000000000000000000005f52336004523060245260445260645ffd5b600b73ffffffffffffffffffffffffffffffffffffffff926055926102a8906105576040519261045560208201856101c7565b8084526020840190610577823987604051937fc4d66de8000000000000000000000000000000000000000000000000000000006020860152166024840152602483526104a26044846101c7565b602060405193610508856104dc848201938d7f00000000000000000000000000000000000000000000000000000000000000001685610235565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018752866101c7565b60405194859383850197518091895e840190838201905f8252519283915e01015f8152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826101c7565b5190209060405191604083015260208201523081520160ff815320169056fe60806040526102a88038038061001481610168565b92833981016040828203126101645781516001600160a01b03811692909190838303610164576020810151906001600160401b03821161016457019281601f8501121561016457835161006e610069826101a1565b610168565b9481865260208601936020838301011161016457815f926020809301865e86010152823b15610152577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a282511561013a575f8091610122945190845af43d15610132573d91610113610069846101a1565b9283523d5f602085013e6101bc565b505b604051608d908161021b8239f35b6060916101bc565b50505034156101245763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b6040519190601f01601f191682016001600160401b0381118382101761018d57604052565b634e487b7160e01b5f52604160045260245ffd5b6001600160401b03811161018d57601f01601f191660200190565b906101e057508051156101d157602081519101fd5b63d6bda27560e01b5f5260045ffd5b81511580610211575b6101f1575090565b639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b50803b156101e956fe60806040525f8073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416368280378136915af43d5f803e156053573d5ff35b3d5ffdfea26469706673582212200c98db95f0b67d7beb06faffee42bf478c4cecdac4fc0a07c523783606f410c964736f6c63430008210033a2646970667358221220272909d6b84306f6c9962a98e74da35b4af10b0c4638c973a922a677e8d5d4ab64736f6c6343000821003360c03461014757601f6117ed38819003918201601f19168301916001600160401b0383118484101761014b5780849260209460405283398101031261014757516001600160a01b0381168103610147573060805260a0525f5160206117cd5f395f51905f525460ff8160401c16610138576002600160401b03196001600160401b038216016100e2575b60405161166d90816101608239608051818181610798015261086e015260a0518181816101b40152818161034d0152818161051e015281816106b401528181610b8d01528181610c4401528181610e4601526112ce0152f35b6001600160401b0319166001600160401b039081175f5160206117cd5f395f51905f52556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f610089565b63f92ee8a960e01b5f5260045ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe608080604052600436101561001c575b50361561001a575f80fd5b005b5f905f3560e01c90816301ffc9a714610f4a57508063150b7a0214610edb57806319822f7c14610dfa57806334fcd5be14610cc85780634a58db1914610c215780634d44560d14610b3a5780634f1ef2861461081057806352d1902d146107705780638da5cb5b1461073d578063ad3cb1cc146106d8578063b0d691fe14610687578063b61d27f61461060b578063bc197c8114610557578063c399ec88146104c3578063c4d66de814610231578063d087d288146101535763f23a6e610361000f57346101505760a0600319360112610150576100f8611019565b5061010161103c565b5060843567ffffffffffffffff811161014e5761012290369060040161105f565b505060206040517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b505b80fd5b5034610150578060031936011261015057604051907f35567e1a00000000000000000000000000000000000000000000000000000000825230600483015280602483015260208260448173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa90811561022557906101ee575b602090604051908152f35b506020813d60201161021d575b81610208602093836110be565b8101031261021957602090516101e3565b5f80fd5b3d91506101fb565b604051903d90823e3d90fd5b50346101505760206003193601126101505761024b611019565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549060ff8260401c16159167ffffffffffffffff8116801590816104bb575b60011490816104b1575b1590816104a8575b506104805790818360017fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000073ffffffffffffffffffffffffffffffffffffffff9516177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005561042b575b501690817fffffffffffffffffffffffff00000000000000000000000000000000000000008454161783556040519173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167f47e55c76e7a6f1fd8996a1da8008c1ea29699cca35e7bcd057f2dec313b6e5de8580a3610399575080f35b60207fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2917fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005560018152a180f35b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00555f610307565b6004847ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b9050155f61029d565b303b159150610295565b84915061028b565b5034610150578060031936011261015057604051907f70a0823100000000000000000000000000000000000000000000000000000000825230600483015260208260248173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa90811561022557906101ee57602090604051908152f35b50346101505760a060031936011261015057610571611019565b5061057a61103c565b5060443567ffffffffffffffff811161014e5761059b90369060040161108d565b505060643567ffffffffffffffff811161014e576105bd90369060040161108d565b505060843567ffffffffffffffff811161014e576105df90369060040161105f565b505060206040517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b50346101505760606003193601126101505780610626611019565b60443567ffffffffffffffff811161068357829161064b61065e92369060040161105f565b92906106556112b7565b5a933691611166565b916020835193019160243591f1156106735780f35b61067b61137d565b602081519101fd5b5050fd5b5034610150578060031936011261015057602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5034610150578060031936011261015057506107396040516106fb6040826110be565b600581527f352e302e30000000000000000000000000000000000000000000000000000000602082015260405191829160208352602083019061119c565b0390f35b503461015057806003193601126101505773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461015057806003193601126101505773ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001630036107e85760206040517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b807fe07c8dba0000000000000000000000000000000000000000000000000000000060049252fd5b50604060031936011261015057610825611019565b9060243567ffffffffffffffff811161014e573660238201121561014e57610857903690602481600401359101611166565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803014908115610af8575b50610ad0576108a6611397565b73ffffffffffffffffffffffffffffffffffffffff831690604051937f52d1902d000000000000000000000000000000000000000000000000000000008552602085600481865afa80958596610a98575b5061092857602484847f4c9c8ce3000000000000000000000000000000000000000000000000000000008252600452fd5b9091847f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8103610a6d5750813b15610a4257807fffffffffffffffffffffffff00000000000000000000000000000000000000007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5416177f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8480a28151839015610a0f5780836020610a0b95519101845af4610a05611288565b9161159e565b5080f35b50505034610a1a5780f35b807fb398979f0000000000000000000000000000000000000000000000000000000060049252fd5b7f4c9c8ce3000000000000000000000000000000000000000000000000000000008452600452602483fd5b7faa1d49a4000000000000000000000000000000000000000000000000000000008552600452602484fd5b9095506020813d602011610ac8575b81610ab4602093836110be565b81010312610ac45751945f6108f7565b8480fd5b3d9150610aa7565b6004827fe07c8dba000000000000000000000000000000000000000000000000000000008152fd5b905073ffffffffffffffffffffffffffffffffffffffff7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541614155f610899565b5034610150576040600319360112610150578060043573ffffffffffffffffffffffffffffffffffffffff8116809103610c1e57610b76611397565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690813b156106835782916044839260405194859384927f205c2878000000000000000000000000000000000000000000000000000000008452600484015260243560248401525af18015610c1357610c025750f35b81610c0c916110be565b6101505780f35b6040513d84823e3d90fd5b50fd5b505f6003193601126102195773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803b15610219575f602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610cbd57610cb1575080f35b61001a91505f906110be565b6040513d5f823e3d90fd5b346102195760206003193601126102195760043567ffffffffffffffff811161021957610cf990369060040161108d565b610d016112b7565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa183360301905b8281101561001a578060051b8401358281121561021957840180359073ffffffffffffffffffffffffffffffffffffffff82168203610219575f9181610d81610d766040869501836111df565b91905a923691611166565b926020808551950193013591f115610d9b57600101610d29565b60018303610dab5761067b61137d565b610db361137d565b90610df66040519283927f5a154675000000000000000000000000000000000000000000000000000000008452600484015260406024840152604483019061119c565b0390fd5b346102195760606003193601126102195760043567ffffffffffffffff81116102195761012060031982360301126102195760443573ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803303610ea85750610e8060209260243590600401611230565b9080610e90575b50604051908152f35b5f80808093335af150610ea1611288565b5082610e87565b7ffe34a6d3000000000000000000000000000000000000000000000000000000005f52336004523060245260445260645ffd5b3461021957608060031936011261021957610ef4611019565b50610efd61103c565b5060643567ffffffffffffffff811161021957610f1e90369060040161105f565b505060206040517f150b7a02000000000000000000000000000000000000000000000000000000008152f35b3461021957602060031936011261021957600435907fffffffff00000000000000000000000000000000000000000000000000000000821680920361021957817f150b7a020000000000000000000000000000000000000000000000000000000060209314908115610fef575b8115610fc5575b5015158152f35b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483610fbe565b7f4e2312e00000000000000000000000000000000000000000000000000000000081149150610fb7565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361021957565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361021957565b9181601f840112156102195782359167ffffffffffffffff8311610219576020838186019501011161021957565b9181601f840112156102195782359167ffffffffffffffff8311610219576020808501948460051b01011161021957565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176110ff57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b67ffffffffffffffff81116110ff57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9291926111728261112c565b9161118060405193846110be565b829481845281830111610219578281602093845f960137010152565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610219570180359067ffffffffffffffff82116102195760200191813603831361021957565b9061127961127073ffffffffffffffffffffffffffffffffffffffff9261126a611263855f5416966101008101906111df565b3691611166565b906113fd565b90929192611437565b1603611283575f90565b600190565b3d156112b2573d906112998261112c565b916112a760405193846110be565b82523d5f602084013e565b606090565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016803314801561135d575b73ffffffffffffffffffffffffffffffffffffffff5f5416901561131a575050565b60849250604051917f62018a3100000000000000000000000000000000000000000000000000000000835233600484015230602484015260448301526064820152fd5b5073ffffffffffffffffffffffffffffffffffffffff5f541633146112f8565b3d604051906020818301016040528082525f602083013e90565b73ffffffffffffffffffffffffffffffffffffffff5f541680331480156113f4575b156113c15750565b7fcbce04d8000000000000000000000000000000000000000000000000000000005f52336004523060245260445260645ffd5b503033146113b9565b815191906041830361142d576114269250602082015190606060408401519301515f1a9061150f565b9192909190565b50505f9160029190565b60048110156114e25780611449575050565b60018103611479577ff645eedf000000000000000000000000000000000000000000000000000000005f5260045ffd5b600281036114ad57507ffce698f7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b6003146114b75750565b7fd78bce0c000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611593579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15610cbd575f5173ffffffffffffffffffffffffffffffffffffffff81161561158957905f905f90565b505f906001905f90565b5050505f9160039190565b906115db57508051156115b357602081519101fd5b7fd6bda275000000000000000000000000000000000000000000000000000000005f5260045ffd5b8151158061162e575b6115ec575090565b73ffffffffffffffffffffffffffffffffffffffff907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b156115e456fea2646970667358221220ae8b4013efb78cdce9563e5b116833be5bfaac44e3d166825f6faaf42e24670864736f6c63430008210033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"` diff --git a/0.16.23/api/@aastar/core/variables/SuperPaymasterABI.md b/0.16.23/api/@aastar/core/variables/SuperPaymasterABI.md new file mode 100644 index 000000000..655b2b558 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SuperPaymasterABI.md @@ -0,0 +1,3 @@ +> `const` **SuperPaymasterABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L46) diff --git a/0.16.23/api/@aastar/core/variables/SuperPaymasterArtifact.md b/0.16.23/api/@aastar/core/variables/SuperPaymasterArtifact.md new file mode 100644 index 000000000..20d6c50e4 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/SuperPaymasterArtifact.md @@ -0,0 +1,13 @@ +> `const` **SuperPaymasterArtifact**: `object` = `SuperPaymasterABIData` + +Defined in: [packages/core/src/abis/index.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L47) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: (\{ `components`: `object`[]; `internalType`: `string`; `name`: `string`; `type`: `string`; \} \| \{ `components?`: `undefined`; `internalType`: `string`; `name`: `string`; `type`: `string`; \})[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60e03461027357601f614fc838819003918201601f19168301916001600160401b038311848410176102775780849260e0946040528339810103126102735780516001600160a01b03811691908281036102735761005f6020830161028b565b60408301519091906001600160a01b0381168103610273576100836060850161028b565b906100906080860161028b565b9260c061009f60a0880161028b565b960151966001600160a01b038616908115610260575f80546001600160a01b031981168417825560405193916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a31561022957506080526001805566470de4df8200006009556103e8600d5560a052600280546001600160a01b0319166001600160a01b0392831617905590811660c05282161561022257505b600480546001600160a01b0319166001600160a01b03929092169190911790558015610219575b601155604051614d2890816102a08239608051818181610c4f01528181610d2801528181610dce01528181611376015281816116da0152818161231401528181612af601528181612f13015261384f015260a0518181816102f3015281816108c80152818161141f0152818161181401528181611b0f01528181611d150152818161284d01528181612be60152613576015260c051818181611696015281816124af01526136770152f35b50610e1061016e565b9050610147565b62461bcd60e51b8152602060048201526012602482015271125b9d985b1a5908115b9d1c9e541bda5b9d60721b6044820152606490fd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b03821682036102735756fe60806040526004361015610011575f80fd5b5f5f3560e01c80630396cb601461381f578063058ae10f1461359a57806306433b1b14613556578063079d2d421461306e57806313e7c9d814612f90578063205c287814612ee65780632e1a7d4d14612dab5780632f4f21e214612b985780633272668414612b7857806339788cd914612b5757806352b7512c14612aae578063539f51db14612a9157806354fd4d5014612a3057806358a2570a146129d9578063594a6f23146129bb5780635f4cd4fe146127e657806360f28de6146127ca57806361ad446e146127ac57806361d027b3146127855780636640431f1461272357806366c36875146126eb578063673a7e28146124945780636d8a4aff1461246d578063715018a6146123fc57806374f053c4146123d5578063787dce3d146123755780637af3816c146123575780637c627b21146122c4578063847807f214611ce657806388a7ca5c14611a845780638da5cb5b14611a5e5780638e580213146119bc57806396daa3221461199e578063a134d63a1461187f578063a3970ae6146117fa578063a4b5328f146116fe578063b0d691fe146116ba578063b0f0abe914611676578063b6b55f25146113f8578063b8ca3b83146113db578063bb9fe6bf14611352578063bc959101146112d1578063bd111870146112b3578063bfa5a1eb14610f58578063c06f58e814610f31578063c1d9cb0814610e47578063c23a5cea14610da1578063c399ec8814610cda578063d0e30db014610c30578063d20727d714610ba4578063ddc380d814610b87578063e1a4521814610b6a578063e8ade1a914610a99578063eafe74b51461085d578063ec2123f1146107d8578063ede31502146107bc578063f0f4426014610737578063f2fde38b14610681578063f5c91a0814610563578063f60fdcb31461051c578063f7e8cb0d146104df5763fc347007146102c4575f80fd5b346104dc5760206003193601126104dc5760043565ffffffffffff8116908181036104da576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166040517f10fdfea7000000000000000000000000000000000000000000000000000000008152602081600481855afa9081156104cf578591610497575b506040517f91d1485400000000000000000000000000000000000000000000000000000000815260048101919091523360248201529060209082908180604481015b03915afa90811561048c57849161045d575b501561043557338352600560205260016040842001907fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff7dffffffffffff00000000000000000000000000000000000000000000000083549260c01b1691161790556040519081527f4419a541734858dec04cd4ea31aff7b399a0b82dc61f30cc777c1907dc8102ed60203392a280f35b6004837f82b42900000000000000000000000000000000000000000000000000000000008152fd5b61047f915060203d602011610485575b6104778183613a68565b810190613d82565b5f6103a4565b503d61046d565b6040513d86823e3d90fd5b90506020813d6020116104c7575b816104b260209383613a68565b810103126104c35751610392610350565b5f80fd5b3d91506104a5565b6040513d87823e3d90fd5b825b80fd5b50346104dc5760206003193601126104dc5760ff60406020926001600160a01b03610508613903565b168152600784522054166040519015158152f35b50346104dc57806003193601126104dc576080600a5460ff600b54600c5490604051938452602084015269ffffffffffffffffffff8116604084015260501c166060820152f35b50346104dc5760406003193601126104dc5761057d613903565b60243590610589614813565b63ffffffff8211610623576001600160a01b0316808352600560209081526040842060010180547fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff1660a085901b77ffffffff00000000000000000000000000000000000000001617905590917ffc577563f1b9a0461e24abef1e1fcc0d33d3d881f20b5df6dda59de4aae2c8219190604051908152a280f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f53636f726520657863656564732075696e7433320000000000000000000000006044820152fd5b50346104dc5760206003193601126104dc576001600160a01b036106a3613903565b6106ab614813565b16801561070b576001600160a01b038254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b50346104dc5760206003193601126104dc576001600160a01b03610759613903565b610761614813565b168015610794577fffffffffffffffffffffffff0000000000000000000000000000000000000000600454161760045580f35b6004827fe6c4247b000000000000000000000000000000000000000000000000000000008152fd5b50346104dc57806003193601126104dc57602060405160348152f35b50346104dc5760206003193601126104dc576004356107f5614813565b80156108355760407ffcc60d1b1dedb59d33b8eef97db5a70c8f8f8523c70d6a027dbf676f1290f8d291600954908060095582519182526020820152a180f35b6004827fc52a9bd3000000000000000000000000000000000000000000000000000000008152fd5b50346104dc5760406003193601126104dc57610877613903565b90610880613919565b916001600160a01b03604051917f2c333e2500000000000000000000000000000000000000000000000000000000835216928360048301526020826024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa918215610a1e578392610a5e575b506001600160a01b0316604051937f9a78e72e0000000000000000000000000000000000000000000000000000000085526004850152602084602481845afa938415610a1e578394610a29575b50926020600494604051958680927f3ba0b9a90000000000000000000000000000000000000000000000000000000082525afa938415610a1e5783946109ea575b50670de0b6b3a7640000810290808204670de0b6b3a764000014901517156109d6576020936109b491613edc565b90818111156109cf576109c79250613bfb565b604051908152f35b50506109c7565b602483634e487b7160e01b81526011600452fd5b9093506020813d602011610a16575b81610a0660209383613a68565b810103126104c35751925f610986565b3d91506109f9565b6040513d85823e3d90fd5b93506020843d602011610a56575b81610a4460209383613a68565b810103126104c3579251926020610945565b3d9150610a37565b9091506020813d602011610a91575b81610a7a60209383613a68565b810103126104c35751906001600160a01b036108f8565b3d9150610a6d565b50346104dc576001600160a01b03610ab036613bcc565b9190610aba614813565b169081835260056020526040832080547fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7dff000000000000000000000000000000000000000000000000000000000084151560e81b1691161790555f14610b43577fc5437eb8dd091f69800961953f2bb0bc16ae1ff2d3e52caa96796db65f8271da8280a280f35b7fae02c1bd695006b6d891af37fdeefea45a10ebcc17071e3471787db4f17728858280a280f35b50346104dc57806003193601126104dc5760206040516127108152f35b50346104dc57806003193601126104dc5760206040516103e88152f35b50346104dc5760206003193601126104dc576001600160a01b03610bc6613903565b610bce614813565b168015610794576001600160a01b03600254827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600255167f75f4cc3f3f70100dc11e396f47f8af2dec5cf7ec94e06062222be779cf2f3dec8380a380f35b50806003193601126104dc57610c44614813565b806001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610cd75781602491604051928380927fb760faf900000000000000000000000000000000000000000000000000000000825230600483015234905af18015610ccc57610cbb5750f35b81610cc591613a68565b6104dc5780f35b6040513d84823e3d90fd5b50fd5b50346104dc57806003193601126104dc57604051907f70a082310000000000000000000000000000000000000000000000000000000082523060048301526020826024816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa908115610d955790610d62575b602090604051908152f35b506020813d602011610d8d575b81610d7c60209383613a68565b810103126104c35760209051610d57565b3d9150610d6f565b604051903d90823e3d90fd5b50346104dc5760206003193601126104dc5780610dbc613903565b610dc4614813565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b15610e43576001600160a01b03602484928360405195869485937fc23a5cea0000000000000000000000000000000000000000000000000000000085521660048401525af18015610ccc57610cbb5750f35b5050fd5b50346104dc5760206003193601126104dc576001600160a01b03610e69613903565b826080604051610e7881613a4c565b8281528260208201528260408201526060808201520152168082526008602052604082205415610f095780825260086020526040822090825260086020526040822054915f198301928311610ef557610ef1610edd610ed785856139b7565b506145d2565b604051918291602083526020830190613b85565b0390f35b80634e487b7160e01b602492526011600452fd5b6004827fe0a1dc31000000000000000000000000000000000000000000000000000000008152fd5b50346104dc57806003193601126104dc5760206001600160a01b03600e5416604051908152f35b50346104dc5760806003193601126104dc5780610f73613903565b6024356003811015610e4357604435916064359067ffffffffffffffff82116112af576001600160a01b037fa7503227727e36abb7f0ecf24f626347ccc20233c48c554d49d7d2077a1a304060407ffc577563f1b9a0461e24abef1e1fcc0d33d3d881f20b5df6dda59de4aae2c821966020966110f0610ffc63ffffffff9836906004016138d5565b969097611007614813565b169a8b9687825260058b52858220988261102086613b67565b856111f157506110d79087600a945b60018d019c8d8f8890825460a01c16115f146111c6578f906110606110a8928a1663ffffffff835460a01c16614621565b7fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff77ffffffff000000000000000000000000000000000000000083549260a01b169116179055565b89611112575b508b815260088f5220928851946110c486613a4c565b428652888f870152898601523691613d1a565b60608301526110e584613b67565b83608083015261463b565b82519182526110fe81613b67565b87820152a25460a01c16604051908152a280f35b80546fffffffffffffffffffffffffffffffff168a811061118c57506fffffffffffffffffffffffffffffffff61114e818c1682845416613d50565b167fffffffffffffffffffffffffffffffff0000000000000000000000000000000082541617905561118289601054613dcc565b6010555b5f6110ae565b817fffffffffffffffffffffffffffffffff000000000000000000000000000000006111be9354169055601054613dcc565b601055611186565b7fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff81541690556110a8565b6111fa86613b67565b6001860361121057506110d7908760149461102f565b9261121a86613b67565b8a60028714611230575b5090876110d79261102f565b935090876110d7927d0100000000000000000000000000000000000000000000000000000000007fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6032975416178d558b7fc5437eb8dd091f69800961953f2bb0bc16ae1ff2d3e52caa96796db65f8271da8280a2919250508a611224565b8480fd5b50346104dc57806003193601126104dc576020601154604051908152f35b50346104dc5760206003193601126104dc576112eb613903565b6112f3614813565b6001600160a01b0380600e54921691827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600e55167f019f532f6e08ee8944dc2e7ac40f3c97ad4a20618aee847ddf7c502821c7dad48380a380f35b50346104dc57806003193601126104dc5761136b614813565b806001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016803b15610cd7578180916004604051809481937fbb9fe6bf0000000000000000000000000000000000000000000000000000000083525af18015610ccc57610cbb5750f35b50346104dc57806003193601126104dc5760206040516107d08152f35b50346104dc5760206003193601126104dc57600435611415614852565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166040517f10fdfea7000000000000000000000000000000000000000000000000000000008152602081600481855afa90811561048c578491611642575b506040517f91d1485400000000000000000000000000000000000000000000000000000000815260048101919091523360248201529060209082908180604481015b03915afa908115610a1e578391611623575b50156115fb576114ef816001600160a01b03600254163090339061490a565b6fffffffffffffffffffffffffffffffff811161159c573382526005602052604082206fffffffffffffffffffffffffffffffff61153281841682845416613d9a565b167fffffffffffffffffffffffffffffffff0000000000000000000000000000000082541617905561156681600f54613dcc565b600f556040519081527f06653c045d0a3144153a51ac6909baae43b8d5b67184cb74e988b72858727fe460203392a26001805580f35b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f416d6f756e7420657863656564732075696e74313238000000000000000000006044820152606490fd5b6004827f82b42900000000000000000000000000000000000000000000000000000000008152fd5b61163c915060203d602011610485576104778183613a68565b5f6114d0565b90506020813d60201161166e575b8161165d60209383613a68565b810103126104c357516114be61147c565b3d9150611650565b50346104dc57806003193601126104dc5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104dc57806003193601126104dc5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104dc5760406003193601126104dc57611718613903565b602435611723614813565b61172b614852565b6001600160a01b0382169182156117d2576010548083116117aa579161179c81602093611779827ff7595c4fd7fa675e456dd9520ac8266c06d237d52900fc573bccc85b7c177c9e97613bfb565b60105561178882600f54613bfb565b600f556001600160a01b036002541661488b565b604051908152a26001805580f35b6004857fb4aa8063000000000000000000000000000000000000000000000000000000008152fd5b6004847fe6c4247b000000000000000000000000000000000000000000000000000000008152fd5b50346104dc5761180936613bcc565b906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163303610435576001600160a01b031682526007602052604082209060ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169115151617905580f35b50346104dc5760206003193601126104dc576001600160a01b036118a1613903565b168152600860205260408120805467ffffffffffffffff811161198a57604051906118d260208260051b0183613a68565b80825260208201809385526020852085915b83831061196c57868587604051928392602084019060208552518091526040840160408260051b8601019392905b82821061192157505050500390f35b9193602061195c827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc060019597998495030186528851613b85565b9601920192018594939192611912565b6005602060019261197c856145d2565b8152019201920191906118e4565b602483634e487b7160e01b81526041600452fd5b50346104dc57806003193601126104dc576020600d54604051908152f35b50346104dc5760406003193601126104dc576119d6613903565b6001600160a01b036024359116825260086020526040822080548210156104da57611a0192506139b7565b508054600182015491611a4b60028201549160ff6004611a2360038401613aa9565b920154169260405195869586526020860152604085015260a0606085015260a0840190613943565b90611a5581613b67565b60808301520390f35b50346104dc57806003193601126104dc576001600160a01b036020915416604051908152f35b50346104dc5760806003193601126104dc57611a9e613903565b50611aa7613919565b6044359060643567ffffffffffffffff8111611ce257611acb9036906004016138d5565b5050611ad5614852565b6001600160a01b03600254163303610435576040517f10fdfea70000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602082600481845afa80156104cf5783928691611caa575b506040517f91d1485400000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b03929092166024830152602090829060449082905afa90811561048c578491611c8b575b5015610435576fffffffffffffffffffffffffffffffff821161159c577f06653c045d0a3144153a51ac6909baae43b8d5b67184cb74e988b72858727fe49160406001600160a01b03602093169485815260058452206fffffffffffffffffffffffffffffffff611c1f81841682845416613d9a565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055611c5381600f54613dcc565b600f55604051908152a26001805560206040517f88a7ca5c000000000000000000000000000000000000000000000000000000008152f35b611ca4915060203d602011610485576104778183613a68565b5f611ba9565b9250506020823d602011611cda575b81611cc660209383613a68565b810103126104c35790518291906020611b4f565b3d9150611cb9565b8380fd5b50346104dc5760606003193601126104dc57611d00613903565b611d08613919565b6044356001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166040517f10fdfea7000000000000000000000000000000000000000000000000000000008152602081600481855afa90811561223f578691612291575b506040517f91d148540000000000000000000000000000000000000000000000000000000081526004810191909152336024820152602081604481855afa90811561223f578691612272575b501561224a576040517fa2d0020e000000000000000000000000000000000000000000000000000000008152602081600481855afa90811561223f57869161220b575b506040517f91d1485400000000000000000000000000000000000000000000000000000000815260048101919091523360248201529060209082908180604481015b03915afa9081156104cf5785916121ec575b50156121c4576001600160a01b03831691821580156121b3575b80156121ab575b612183576001600160a01b036003541680611fb9575b507fff8a1775e676e9fe3cc41088a092f762a9c36c13098d2a9c6a02d1814e0ecbd7923386526005602052604086209060018201907fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055600281016001600160a01b0383167fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790557c010000000000000000000000000000000000000000000000000000000081547fffffff00000000000000000000000000ffffffffffffffffffffffffffffffff7bffffffffffffffffffffffff000000000000000000000000000000008660801b16911617179055611fb36040519283923396846001600160a01b036040929594938160608401971683521660208201520152565b0390a280f35b6020602491604051928380927fb8d7b6690000000000000000000000000000000000000000000000000000000082523360048301525afa86918161213b575b506120815760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f53656375726974793a20466163746f727920766572696669636174696f6e206660448201527f61696c65640000000000000000000000000000000000000000000000000000006064820152fd5b6001600160a01b03849116036120b7577fff8a1775e676e9fe3cc41088a092f762a9c36c13098d2a9c6a02d1814e0ecbd7611e8c565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f53656375726974793a20496e76616c69642078504e5473546f6b656e20666f7260448201527f207468697320436f6d6d756e69747900000000000000000000000000000000006064820152fd5b9091506020813d60201161217b575b8161215760209383613a68565b8101031261217757516001600160a01b038116810361217757905f611ff8565b8680fd5b3d915061214a565b6004857fc52a9bd3000000000000000000000000000000000000000000000000000000008152fd5b508115611e76565b506001600160a01b03811615611e6f565b6004847f82b42900000000000000000000000000000000000000000000000000000000008152fd5b612205915060203d602011610485576104778183613a68565b5f611e55565b90506020813d602011612237575b8161222660209383613a68565b810103126104c35751611e43611e01565b3d9150612219565b6040513d88823e3d90fd5b6004857f82b42900000000000000000000000000000000000000000000000000000000008152fd5b61228b915060203d602011610485576104778183613a68565b5f611dbe565b90506020813d6020116122bc575b816122ac60209383613a68565b810103126104c357516020611d72565b3d915061229f565b50346104dc5760806003193601126104dc576004356003811015612353576024359067ffffffffffffffff82116104da5761230661234c9236906004016138d5565b9061233b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314613dd9565b612343614852565b60443592614299565b6001805580f35b5080fd5b50346104dc57806003193601126104dc576020601054604051908152f35b50346104dc5760206003193601126104dc57600435612392614813565b6107d081116108355760407fb404cac19fb1cbeff98d325795b08886e3cd8fe8cb1a2f193aac66f13fb239c391600d549080600d5582519182526020820152a180f35b50346104dc57806003193601126104dc5760206001600160a01b0360025416604051908152f35b50346104dc57806003193601126104dc57612415614813565b806001600160a01b0381547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346104dc57806003193601126104dc5760206001600160a01b0360035416604051908152f35b50346104dc57806003193601126104dc576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166040517ffeaf968c00000000000000000000000000000000000000000000000000000000815260a081600481855afa91839083859386956126b0575b50612538576004857fb41b6cb1000000000000000000000000000000000000000000000000000000008152fd5b6402540be400831280156126a1575b6126795761255760115442613bfb565b841061267957906020600492604051938480927f313ce5670000000000000000000000000000000000000000000000000000000082525afa9182156104cf57859261263b575b5069ffffffffffffffffffff604051916125b683613a1c565b8483528560208401521690816040820152606060ff841691015282600a5583600b557fffffffffffffffffffffffffffffffffffffffffff00000000000000000000006aff00000000000000000000600c549360501b1692161717600c557fdb6fb3cf4cc5fb760bcd63b958a53b2396776dff32c063188e864296541e76bd8380a380f35b9091506020813d602011612671575b8161265760209383613a68565b810103126112af575160ff811681036112af57905f61259d565b3d915061264a565b6004857fb41b6cb1000000000000000000000000000000000000000000000000000000008152fd5b506509184e72a0008313612547565b91935093506126d7915060a03d60a0116126e4575b6126cf8183613a68565b810190613c33565b509491939190505f61250b565b503d6126c5565b50346104dc5760206003193601126104dc5760406020916001600160a01b03612712613903565b168152600883522054604051908152f35b50346104dc5760406003193601126104dc576001600160a01b036040612747613903565b9282612751613919565b9416815260066020522091165f526020526040805f205460ff82519165ffffffffffff8116835260301c1615156020820152f35b50346104dc57806003193601126104dc5760206001600160a01b0360045416604051908152f35b50346104dc57806003193601126104dc576020600f54604051908152f35b50346104dc57806003193601126104dc57602060405160488152f35b50346104dc5760606003193601126104dc57612800613903565b60243567ffffffffffffffff81116104da57612820903690600401613986565b9060443567ffffffffffffffff81116112af57612841903690600401613986565b90926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036129935781810361296b5791936001600160a01b03169185805b828110612894575080f35b85857f272958aacfbf07577da4ede62cc7d612dfb0881c6489c961988ef59378d7709f60206001600160a01b036129576128ea878b8f612906838e6129519360019f60408f918f926128ea878b6128ef9361427c565b61428c565b92815260068e52208b61290b61290687878761427c565b613e64565b165f528c5260405f20907fffffffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffff66ff000000000000835492151560301b16911617905561427c565b9861427c565b9460405195151586521693a3018690612889565b6004867fc52a9bd3000000000000000000000000000000000000000000000000000000008152fd5b6004867f82b42900000000000000000000000000000000000000000000000000000000008152fd5b50346104dc57806003193601126104dc576020600954604051908152f35b50346104dc5760206003193601126104dc576001600160a01b036129fb613903565b612a03614813565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600354161760035580f35b50346104dc57806003193601126104dc5750610ef1604051612a53604082613a68565b601481527f53757065725061796d61737465722d332e322e320000000000000000000000006020820152604051918291602083526020830190613943565b50346104dc57806003193601126104dc57602060405161012c8152f35b50346104dc5760606003193601126104dc576004359067ffffffffffffffff82116104dc5761012060031983360301126104dc57612b4d612b3583612b1d6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163314613dd9565b612b25614852565b6044359060243590600401613ee6565b60018055604051928392604084526040840190613943565b9060208301520390f35b50346104dc57806003193601126104dc5760206040516509184e72a0008152f35b50346104dc57806003193601126104dc5760206040516402540be4008152f35b50346104dc5760406003193601126104dc57612bb2613903565b60243590612bbe614852565b6040517f10fdfea70000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316602082600481845afa80156104cf5783928691612d73575b506040517f91d1485400000000000000000000000000000000000000000000000000000000815260048101919091526001600160a01b03929092166024830152602090829060449082905afa90811561048c578491612d54575b501561043557612c9f826001600160a01b03600254163090339061490a565b6fffffffffffffffffffffffffffffffff821161159c5760206001600160a01b037f06653c045d0a3144153a51ac6909baae43b8d5b67184cb74e988b72858727fe492169283855260058252604085206fffffffffffffffffffffffffffffffff612d0f81841682845416613d9a565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055612d4381600f54613dcc565b600f55604051908152a26001805580f35b612d6d915060203d602011610485576104778183613a68565b5f612c80565b9250506020823d602011612da3575b81612d8f60209383613a68565b810103126104c35790518291906020612c26565b3d9150612d82565b50346104dc5760206003193601126104dc57600435612dc8614852565b3382526005602052806fffffffffffffffffffffffffffffffff60408420541610612e99573382526005602052604082206fffffffffffffffffffffffffffffffff612e1981841682845416613d50565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055612e4d81600f54613bfb565b600f55612e6681336001600160a01b036002541661488b565b6040519081527f4eea589c35918e3c4d8e0371a062a1d544e41d78fb522381678923b9cd6e6dfa60203392a26001805580f35b338252600560205260408220547fcf4791810000000000000000000000000000000000000000000000000000000083526fffffffffffffffffffffffffffffffff16600452602452604490fd5b50346104dc5760406003193601126104dc5780612f01613903565b612f09614813565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b15610e43576001600160a01b03604484928360405195869485937f205c287800000000000000000000000000000000000000000000000000000000855216600484015260243560248401525af18015610ccc57610cbb5750f35b50346104dc5760206003193601126104dc576040610140916001600160a01b03612fb8613903565b1681526005602052208054906001810154906001600160a01b0360028201541665ffffffffffff600460038401549301549360ff604051966fffffffffffffffffffffffffffffffff811688526bffffffffffffffffffffffff8160801c166020890152818160e01c161515604089015260e81c16151560608701526001600160a01b038116608087015263ffffffff8160a01c1660a087015260c01c1660c085015260e0840152610100830152610120820152f35b50346104dc5760606003193601126104dc57613088613903565b60243560038110156104da5760443567ffffffffffffffff8111611ce2576130b49036906004016138d5565b92906001600160a01b03600e5416330361224a57846130d284613b67565b6001841490811561351557506001600160a01b038316865260056020526fffffffffffffffffffffffffffffffff600a816040892054160416905b613118368785613d1a565b60208151910120936040936131668551916131338784613a68565b600d835260208301997f44565420424c5320536c617368000000000000000000000000000000000000008b523691613d1a565b5080896001600160a01b03869416998a9586835260056020528883209061318c8c613b67565b8b6134f5575060ff600a5b16946131a28c613b67565b60028c146134aa575b60ff825460e81c16613480575b600182018663ffffffff825460a01c16115f1461345557806110608863ffffffff6131e7945460a01c16614621565b886132b2575b50505095608097959361327d86947fa7503227727e36abb7f0ecf24f626347ccc20233c48c554d49d7d2077a1a304094848b819a7fa49f25e6b37dc7492af788d36761dc1b25f8fb6dcc448fb5637dc828725f0d889f9d526008602052209085519261325884613a4c565b4284528560208501528684015260608301526132738b613b67565b8a8c83015261463b565b815190815261328b88613b67565b876020820152a281519361329e81613b67565b84526020840152820152426060820152a280f35b91965091506fffffffffffffffffffffffffffffffff82541695610bb88702878104610bb8148815171561344157947fa7503227727e36abb7f0ecf24f626347ccc20233c48c554d49d7d2077a1a3040948a8f8f98967fa49f25e6b37dc7492af788d36761dc1b25f8fb6dcc448fb5637dc828725f0d889f9d9b9660809f9d9b968c612710869b048091116133b1575b5050506fffffffffffffffffffffffffffffffff61336787988261327d991690613d50565b167fffffffffffffffffffffffffffffffff0000000000000000000000000000000082541617905561339b86601054613dcc565b60105595505094509496989a8296989a506131ed565b61327d98506fffffffffffffffffffffffffffffffff929996509061343960106020613367949c89519485915180918484015e81017f20284361707065642061742033302529000000000000000000000000000000008382015203017ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0810184520182613a68565b959897613342565b60248e634e487b7160e01b81526011600452fd5b7fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff81541690556131e7565b877fc5437eb8dd091f69800961953f2bb0bc16ae1ff2d3e52caa96796db65f8271da8580a26131b8565b7d0100000000000000000000000000000000000000000000000000000000007fffff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8354161782556131ab565b6134fe8c613b67565b1561350c5760ff6014613197565b60ff6032613197565b9061351f85613b67565b6002850361310d576001600160a01b0384168752600560205260408720546fffffffffffffffffffffffffffffffff16915061310d565b50346104dc57806003193601126104dc5760206040516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104dc5760606003193601126104dc5760243560043560443567ffffffffffffffff8111611ce2576135d29036906004016138d5565b600e546001600160a01b03169150338214158061380b575b61224a57600b54841115612679577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe3e042014281116137f7578410612679576137f0575b506402540be400811280156137e1575b61377a576040517ffeaf968c00000000000000000000000000000000000000000000000000000000815260a0816004816001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000165afa80859286926137b8575b50613730575b5050600860606040516136bb81613a1c565b838152846020820152856040820152015280600a5581600b556a08000000000000000000007fffffffffffffffffffffffffffffffffffffffffff0000000000000000000000600c541617600c557fdb6fb3cf4cc5fb760bcd63b958a53b2396776dff32c063188e864296541e76bd8380a380f35b61373d611c209142613bfb565b10613749575b806136a9565b601490808313156137a2578061376a61376561376f9386613c68565b613c80565b613c96565b1361377a575f613743565b6004837fb41b6cb1000000000000000000000000000000000000000000000000000000008152fd5b8061376a613765856137b394613c68565b61376f565b9092506137d4915060a03d60a0116126e4576126cf8183613a68565b509392505091905f6136a3565b506509184e72a000811361363d565b151561362d565b602486634e487b7160e01b81526011600452fd5b506001600160a01b038554163314156135ea565b5060206003193601126104c35760043563ffffffff81168091036104c357613845614813565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690813b156104c3575f906024604051809481937f0396cb60000000000000000000000000000000000000000000000000000000008352600483015234905af180156138ca576138bc575080f35b6138c891505f90613a68565b005b6040513d5f823e3d90fd5b9181601f840112156104c35782359167ffffffffffffffff83116104c357602083818601950101116104c357565b600435906001600160a01b03821682036104c357565b602435906001600160a01b03821682036104c357565b35906001600160a01b03821682036104c357565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b9181601f840112156104c35782359167ffffffffffffffff83116104c3576020808501948460051b0101116104c357565b80548210156139d0575f52600560205f20910201905f90565b634e487b7160e01b5f52603260045260245ffd5b90600182811c92168015613a12575b60208310146139fe57565b634e487b7160e01b5f52602260045260245ffd5b91607f16916139f3565b6080810190811067ffffffffffffffff821117613a3857604052565b634e487b7160e01b5f52604160045260245ffd5b60a0810190811067ffffffffffffffff821117613a3857604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117613a3857604052565b9060405191825f825492613abc846139e4565b8084529360018116908115613b275750600114613ae3575b50613ae192500383613a68565b565b90505f9291925260205f20905f915b818310613b0b575050906020613ae1928201015f613ad4565b6020919350806001915483858901015201910190918492613af2565b60209350613ae19592507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201015f613ad4565b60031115613b7157565b634e487b7160e01b5f52602160045260245ffd5b90815181526020820151602082015260408201516040820152608080613bba606085015160a0606086015260a0850190613943565b93015191613bc783613b67565b015290565b60031960409101126104c3576004356001600160a01b03811681036104c3579060243580151581036104c35790565b91908203918211613c0857565b634e487b7160e01b5f52601160045260245ffd5b519069ffffffffffffffffffff821682036104c357565b908160a09103126104c357613c4781613c1c565b91602082015191604081015191613c65608060608401519301613c1c565b90565b81810392915f138015828513169184121617613c0857565b90606482029180830560641490151715613c0857565b8115613ccc575f1982147f8000000000000000000000000000000000000000000000000000000000000000821416613c08570590565b634e487b7160e01b5f52601260045260245ffd5b67ffffffffffffffff8111613a3857601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b929192613d2682613ce0565b91613d346040519384613a68565b8294818452818301116104c3578281602093845f960137010152565b906fffffffffffffffffffffffffffffffff809116911603906fffffffffffffffffffffffffffffffff8211613c0857565b908160209103126104c3575180151581036104c35790565b906fffffffffffffffffffffffffffffffff809116911601906fffffffffffffffffffffffffffffffff8211613c0857565b91908201809211613c0857565b15613de057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f426173655061796d61737465723a2063616c6c6572206973206e6f7420456e7460448201527f7279506f696e74000000000000000000000000000000000000000000000000006064820152fd5b356001600160a01b03811681036104c35790565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1813603018212156104c3570180359067ffffffffffffffff82116104c3576020019181360383136104c357565b81810292918115918404141715613c0857565b8115613ccc570490565b929190613ef284614965565b6001600160a01b035f9116805f52600560205260405f2092835460ff8160e01c161561426657613f27600b5460115490613dcc565b955f9560ff8360e81c1661424e576001600160a01b03613f468b613e64565b165f52600760205260ff60405f2054161561424e57845f52600660205260405f206001600160a01b03613f788c613e64565b165f5260205260405f209160405192604084019084821067ffffffffffffffff831117613a385760ff916040525465ffffffffffff8116855260301c16151580602085015261422c57600182019265ffffffffffff845460c01c169081614204575b50505f198b6068613fef60e083018093613e78565b905010156141e0575b506bffffffffffffffffffffffff8560801c16116141aa576140199061499c565b600d549081612710019182612710116141cc57612af801809211614196576fffffffffffffffffffffffffffffffff9161405291614a5c565b93168381106141aa576140796fffffffffffffffffffffffffffffffff9182861690613d50565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416178155600381016140b0848254613dcc565b90556140be83601054613dcc565b6010556004810180545f198114614196577fffffffffffff000000000000000000000000000000000000000000000000000096936141546001600160a01b03670de0b6b3a764000061414a6bffffffffffffffffffffffff79ffffffffffff00000000000000000000000000000000000000009e9b988f9e9b98600186990190555460801c1687613ec9565b049254169d613e64565b90604080519e8f90602082015201521660608c015260808b015260a08a015260c089015260c0885261418760e089613a68565b5060d01b169260a01b16161790565b602488634e487b7160e01b81526011600452fd5b5050505050509293505050604051906141c4602083613a68565b815290600190565b602489634e487b7160e01b81526011600452fd5b90506141ee9197508b613e78565b6068979197116104c35760485f9701355f613ff8565b5165ffffffffffff168015613fda579198500165ffffffffffff8111613c0857965f80613fda565b5050505050505050509050604051614245602082613a68565b5f815290600190565b50505050505050509050604051614245602082613a68565b5050505050509050604051614245602082613a68565b91908110156139d05760051b0190565b3580151581036104c35790565b91925f9380156145cb578260c091810103126104c3576142b88261392f565b936142c56040840161392f565b9160026001600160a01b0380806142e360a060608a0135990161392f565b99169516971695865f52600560205265ffffffffffff600160405f20015460c01c16614577575b61431381613b67565b1461456f576143219061499c565b600d5461271001908161271011613c08576127109161433f91613ec9565b0492808410156144d0578361435391613bfb565b6fffffffffffffffffffffffffffffffff81116144b9575b6143d7906010548082116144b1575b508583526005602052604083206fffffffffffffffffffffffffffffffff6143a781841682845416613d9a565b167fffffffffffffffffffffffffffffffff00000000000000000000000000000000825416179055601054613bfb565b6010558381526005602052670de0b6b3a764000061440a6bffffffffffffffffffffffff604084205460801c1685613ec9565b0491803b15612353576040517ffa74542d0000000000000000000000000000000000000000000000000000000081526001600160a01b0387166004820152602481018490529082908290604490829084905af18015610ccc5761449c575b50507fcde7e91a718e2439d8ff2a679ad52713e82a37b72622fb530c8c41039fdd5bf09160409182519182526020820152a3565b6144a7828092613a68565b6104dc5780614468565b90505f61437a565b506fffffffffffffffffffffffffffffffff61436b565b9050670de0b6b3a764000092506145069194935f5260056020526bffffffffffffffffffffffff60405f205460801c1690613ec9565b04823b156104c3576040517ffa74542d0000000000000000000000000000000000000000000000000000000081526001600160a01b039290921660048301526024820152905f908290604490829084905af180156138ca576145655750565b5f613ae191613a68565b505050505050565b865f52600660205260405f206001600160a01b0389165f5260205260405f2065ffffffffffff42167fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000082541617905561430a565b5050505050565b906040516145df81613a4c565b608060ff6004839580548552600181015460208601526002810154604086015261460b60038201613aa9565b60608601520154169161461d83613b67565b0152565b9063ffffffff8091169116039063ffffffff8211613c0857565b805468010000000000000000811015613a385761465d916001820181556139b7565b6148005781518155602082015160018201556040820151600282015560038101606083015180519067ffffffffffffffff8211613a385761469e83546139e4565b601f81116147af575b50602090601f831160011461472857918060049492608096945f9261471d575b50505f198260011b9260031b1c19161790555b019101516146e781613b67565b6146f081613b67565b60ff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008354169116179055565b015190505f806146c7565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831691845f52815f20925f5b818110614797575092600192859260809896600498961061477f575b505050811b0190556146da565b01515f1960f88460031b161c191690555f8080614772565b92936020600181928786015181550195019301614756565b828111156146a757835f5260205f20601f840160051c90602085106147f8575b81601f9101920160051c03905f5b8281106147eb5750506146a7565b5f828201556001016147dd565b5f91506147cf565b634e487b7160e01b5f525f60045260245ffd5b6001600160a01b035f5416330361482657565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b600260015414614863576002600155565b7f3ee5aeb5000000000000000000000000000000000000000000000000000000005f5260045ffd5b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000060208201526001600160a01b0390921660248301526044820192909252613ae19161490582606481015b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101845283613a68565b614bb9565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000060208201526001600160a01b0392831660248201529290911660448301526064820192909252613ae19161490582608481016148d9565b60e0810160486149758284613e78565b9050106149965761498591613e78565b6048116104c3576034013560601c90565b50505f90565b6060906040516149ab81613a1c565b600a5490818152600b54602082015260ff600c5469ffffffffffffffffffff8116604084015260501c1693849101525f811315614a34576149eb91613ec9565b90604d8111613c0857600954614a0391600a0a613ec9565b614a0d8183614af5565b918115613ccc57670de0b6b3a76400009009614a265790565b60018101809111613c085790565b7fb41b6cb1000000000000000000000000000000000000000000000000000000005f5260045ffd5b9190915f838202915f1985820991838084109303928084039314614ae857826127101115614ac057507fbc01a36e2eb1c432ca57a786c226809d495182a9930be0ded288ce703afb7e919394612710910990828211900360fc1b910360041c170290565b807f227bc1530000000000000000000000000000000000000000000000000000000060049252fd5b5050506127109192500490565b90670de0b6b3a76400008202905f19670de0b6b3a7640000840992828085109403938085039414614bad5783821115614b8557670de0b6b3a7640000829109815f0382168092046002816003021880820260020302808202600203028082026002030280820260020302808202600203028091026002030293600183805f03040190848311900302920304170290565b7f227bc153000000000000000000000000000000000000000000000000000000005f5260045ffd5b5090613c659250613edc565b5f806001600160a01b03614c0293169360208151910182865af13d15614c5e573d90614be482613ce0565b91614bf26040519384613a68565b82523d5f602084013e5b83614c66565b8051908115159182614c43575b5050614c185750565b7f5274afe7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b614c569250602080918301019101613d82565b155f80614c0f565b606090614bfc565b90614ca35750805115614c7b57805190602001fd5b7f1425ea42000000000000000000000000000000000000000000000000000000005f5260045ffd5b81511580614ce9575b614cb4575090565b6001600160a01b03907f9996b315000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b50803b15614cac56fea26469706673582212202b12bbaa23feca0547c5cce1e5cc5115fd4c8041448fc95841853c1edc7212dd64736f6c63430008210033"` diff --git a/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md new file mode 100644 index 000000000..ffce2b3cf --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md @@ -0,0 +1,11 @@ +> `const` **TEST\_ACCOUNT\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L62) + +Test Account Addresses (For Development & Testing) + +## Type Declaration + +### simpleAccountFactory + +> `readonly` **simpleAccountFactory**: `` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md b/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md new file mode 100644 index 000000000..a72ab270d --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md @@ -0,0 +1,3 @@ +> `const` **TEST\_ACCOUNT\_POOL\_SIZE**: `20` = `20` + +Defined in: [packages/core/src/constants.ts:85](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L85) diff --git a/0.16.23/api/@aastar/core/variables/TEST_COMMUNITIES.md b/0.16.23/api/@aastar/core/variables/TEST_COMMUNITIES.md new file mode 100644 index 000000000..55e2abc80 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/TEST_COMMUNITIES.md @@ -0,0 +1,19 @@ +> `const` **TEST\_COMMUNITIES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L101) + +Test Community Addresses (Registered in Registry v2.2.0 on 2025-11-08) + +## Type Declaration + +### aastar + +> `readonly` **aastar**: `` `0x${string}` `` + +### bread + +> `readonly` **bread**: `` `0x${string}` `` + +### mycelium + +> `readonly` **mycelium**: `` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md new file mode 100644 index 000000000..c54392341 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md @@ -0,0 +1,19 @@ +> `const` **TEST\_TOKEN\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:53](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L53) + +Test Token Addresses (For Development & Testing) + +## Type Declaration + +### aPNTs + +> `readonly` **aPNTs**: `` `0x${string}` `` + +### bPNTs + +> `readonly` **bPNTs**: `` `0x${string}` `` + +### mockUSDT + +> `readonly` **mockUSDT**: `` `0x${string}` `` diff --git a/0.16.23/api/@aastar/core/variables/TOKEN_ADDRESSES.md b/0.16.23/api/@aastar/core/variables/TOKEN_ADDRESSES.md new file mode 100644 index 000000000..32e117d01 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/TOKEN_ADDRESSES.md @@ -0,0 +1,11 @@ +> `const` **TOKEN\_ADDRESSES**: `object` + +Defined in: [packages/core/src/contract-addresses.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-addresses.ts#L46) + +Token System Addresses + +## Type Declaration + +### xPNTsFactory + +> `readonly` **xPNTsFactory**: `` `0x${string}` `` = `XPNTS_FACTORY_ADDRESS` diff --git a/0.16.23/api/@aastar/core/variables/V2_SUMMARY.md b/0.16.23/api/@aastar/core/variables/V2_SUMMARY.md new file mode 100644 index 000000000..0953b3e43 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/V2_SUMMARY.md @@ -0,0 +1,39 @@ +> `const` **V2\_SUMMARY**: `object` + +Defined in: [packages/core/src/contract-versions.ts:364](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/contract-versions.ts#L364) + +V2 Contract Summary + +## Type Declaration + +### allContractsHaveVersion + +> `readonly` **allContractsHaveVersion**: `true` = `true` + +### categories + +> `readonly` **categories**: `object` + +#### categories.core + +> `readonly` **core**: `5` = `5` + +#### categories.monitoring + +> `readonly` **monitoring**: `2` = `2` + +#### categories.testTokens + +> `readonly` **testTokens**: `2` = `2` + +#### categories.tokens + +> `readonly` **tokens**: `2` = `2` + +### latestDeployment + +> `readonly` **latestDeployment**: `"2025-11-09"` = `'2025-11-09'` + +### totalContracts + +> `readonly` **totalContracts**: `11` = `11` diff --git a/0.16.23/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md b/0.16.23/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md new file mode 100644 index 000000000..84d1a84b2 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md @@ -0,0 +1,3 @@ +> **XPNTS\_FACTORY\_ADDRESS**: `` `0x${string}` `` + +Defined in: [packages/core/src/constants.ts:38](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/constants.ts#L38) diff --git a/0.16.23/api/@aastar/core/variables/xPNTsFactoryABI.md b/0.16.23/api/@aastar/core/variables/xPNTsFactoryABI.md new file mode 100644 index 000000000..6049fe69b --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/xPNTsFactoryABI.md @@ -0,0 +1,3 @@ +> `const` **xPNTsFactoryABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:70](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L70) diff --git a/0.16.23/api/@aastar/core/variables/xPNTsFactoryArtifact.md b/0.16.23/api/@aastar/core/variables/xPNTsFactoryArtifact.md new file mode 100644 index 000000000..f332d07f4 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/xPNTsFactoryArtifact.md @@ -0,0 +1,13 @@ +> `const` **xPNTsFactoryArtifact**: `object` = `xPNTsFactoryABIData` + +Defined in: [packages/core/src/abis/index.ts:71](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L71) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x60c03461022457601f614e0f38819003918201601f19168301916001600160401b038311848410176101ea57808492604094855283398101031261022457610052602061004b83610228565b9201610228565b903315610211575f8054336001600160a01b03198216811783556040519290916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36001600160a01b038316156101fe576135298181016001600160401b038111838210176101ea5782916118e6833903905ff080156101df5760018060a01b031660a05260018060a01b031660018060a01b0319600154161760015560805266470de4df820000600655671bc16d674ec800006024604051634465466960e01b81526005600482015220556714d1120d7b16000060266040516547616d696e6760d01b8152600560068201522055670de0b6b3a764000060266040516514dbd8da585b60d21b81526005600682015220556710a741a46278000060236040516244414f60e81b815260056003820152205567120a871cc002000060236040516213919560ea1b81526005600382015220556040516116a9908161023d823960805181818161078e0152611348015260a0518181816107fd0152610e740152f35b6040513d5f823e3d90fd5b634e487b7160e01b5f52604160045260245ffd5b634726455360e11b5f525f60045260245ffd5b631e4fbdf760e01b5f525f60045260245ffd5b5f80fd5b51906001600160a01b03821682036102245756fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816306433b1b1461131e5750806308c2ddcd146112c35780630ff65414146112a65780632598c32a146111ed5780632a5c792a1461110b578063358064a81461109e57806335fa61fa14611037578063382c803614610f7157806354fd4d5014610ee8578063594a6f2314610ecb57806359734e1a14610ecb5780635ae48ba414610e985780635c60da1b14610e48578063715018a614610dcc5780637ade132c14610d045780638da5cb5b14610cd25780638dbb03b114610caf578063954ebd3b146106685780639bb0f5991461061f578063a137891e146105fc578063a5509758146104dd578063ab7984491461027f578063ae9a6d6f14610432578063b2bcfd3414610406578063b8d7b669146103bf578063be382cdb146102d6578063df9a70ea1461027f578063ec81aadb1461022f5763f2fde38b1461015d575f80fd5b3461022c57602060031936011261022c5773ffffffffffffffffffffffffffffffffffffffff61018b61136c565b610193611627565b1680156102005773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b6024827f1e4fbdf700000000000000000000000000000000000000000000000000000000815280600452fd5b80fd5b503461022c57602060031936011261022c576004359060045482101561022c57602073ffffffffffffffffffffffffffffffffffffffff61026f846114d0565b90549060031b1c16604051908152f35b503461022c57602060031936011261022c576004359067ffffffffffffffff821161022c57602080806102b53660048701611419565b604051928184925191829101835e8101600581520301902054604051908152f35b503461022c57602060031936011261022c576102f061136c565b9073ffffffffffffffffffffffffffffffffffffffff82168152600360205260408120906040516103208161138f565b6103518354808352600185015490816020850152606060036002880154976040870198895201549401938452611515565b92601e840292848404601e1485151715610392575061037160a095611555565b90519151926040519485526020850152604084015260608301526080820152f35b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526011600452fd5b503461022c57602060031936011261022c5773ffffffffffffffffffffffffffffffffffffffff6040602092826103f461136c565b16815260028452205416604051908152f35b503461022c57602060031936011261022c57602061042a61042561136c565b611555565b604051908152f35b503461022c57602060031936011261022c57604060809173ffffffffffffffffffffffffffffffffffffffff61046661136c565b82606085516104748161138f565b828152826020820152828782015201521681526003602052206040516104998161138f565b815491828252600181015460208301908152606060036002840154936040860194855201549301928352604051938452516020840152516040830152516060820152f35b503461022c57604060031936011261022c5760043567ffffffffffffffff81116105f85761050f903690600401611419565b6024359061051b611627565b811515806105e6575b156105885760207f4bea76f3309d60543efdcea3904bba05cd2c7a2e58668e7de988d525fd6a3f969160405190848151928481818501958087835e8101600581520301902055604051918291518091835e810186815203902092604051908152a280f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c6964206d756c7469706c69657200000000000000000000000000006044820152fd5b50678ac7230489e80000821115610524565b5080fd5b503461022c578060031936011261022c5760206040516714d1120d7b1600008152f35b503461022c57602060031936011261022c5773ffffffffffffffffffffffffffffffffffffffff60406020928261065461136c565b168152600284522054161515604051908152f35b5034610bbe5760c0600319360112610bbe5760043567ffffffffffffffff8111610bbe5761069a903690600401611419565b9060243567ffffffffffffffff8111610bbe576106bb903690600401611419565b9160443567ffffffffffffffff8111610bbe576106dc903690600401611419565b9160643567ffffffffffffffff8111610bbe576106fd903690600401611419565b60a4359073ffffffffffffffffffffffffffffffffffffffff8216809203610bbe576040517f91d148540000000000000000000000000000000000000000000000000000000081527fe94d78b6d8fb99b2c21131eb4552924a60f564d8515a3cc90ef300fc9735c074600482015233602482015260208160448173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa908115610bb3575f91610c74575b5015610c1657335f52600260205273ffffffffffffffffffffffffffffffffffffffff60405f205416610bea576e5af43d82803e903d91602b57fd5bf37f0000000000000000000000000000000000000000000000000000000000000000763d602d80600a3d3981f3363d3d373d3d3d363d7300000062ffffff8260881c16175f5260781b1760205273ffffffffffffffffffffffffffffffffffffffff603760095ff016948515610bc257853b15610bbe576108e75f916108f960405194859384937ff0ce3dd200000000000000000000000000000000000000000000000000000000855260c060048601526108cf8d6108bd8d60c489019061148d565b9060031988830301602489015261148d565b9033604487015260031986830301606487015261148d565b9060031984830301608485015261148d565b60843560a4830152038183895af18015610bb357610b9e575b5073ffffffffffffffffffffffffffffffffffffffff6001541680610ab0575b5080610a40575b50338152600260205260408120837fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790556004549068010000000000000000821015610a135750927fabfc2cb9c596be68324e2badae1694b9003727b1c82695e6c2cfa7ad8a5875926109fa84936109bd876001602099016004556114d0565b81549060031b9073ffffffffffffffffffffffffffffffffffffffff88831b921b1916179055610a0860405192839260408452604084019061148d565b82810389840152339561148d565b0390a3604051908152f35b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b833b156105f857604051907faae64da20000000000000000000000000000000000000000000000000000000082526004820152818160248183885af18015610aa557908291610a90575b50610939565b81610a9a916113d8565b61022c57805f610a8a565b6040513d84823e3d90fd5b843b15610b8557604051907f7ade132c0000000000000000000000000000000000000000000000000000000082526004820152828160248183895af18015610b7a57908391610b89575b505073ffffffffffffffffffffffffffffffffffffffff60015416843b15610b8557604051907faae64da20000000000000000000000000000000000000000000000000000000082526004820152828160248183895af18015610b7a57908391610b65575b50610932565b81610b6f916113d8565b6105f857815f610b5f565b6040513d85823e3d90fd5b8280fd5b81610b93916113d8565b6105f857815f610afa565b610bab9192505f906113d8565b5f905f610912565b6040513d5f823e3d90fd5b5f80fd5b7fc2f868f4000000000000000000000000000000000000000000000000000000005f5260045ffd5b7f29ab51bf000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616c6c6572206d75737420626520436f6d6d756e69747900000000000000006044820152fd5b90506020813d602011610ca7575b81610c8f602093836113d8565b81010312610bbe57518015158103610bbe575f6107be565b3d9150610c82565b34610bbe575f600319360112610bbe57602060405168056bc75e2d631000008152f35b34610bbe575f600319360112610bbe57602073ffffffffffffffffffffffffffffffffffffffff5f5416604051908152f35b34610bbe576020600319360112610bbe5773ffffffffffffffffffffffffffffffffffffffff610d3261136c565b610d3a611627565b168015610d6e577fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001555f80f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c6964206164647265737300000000000000000000000000000000006044820152fd5b34610bbe575f600319360112610bbe57610de4611627565b5f73ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b34610bbe575f600319360112610bbe57602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b34610bbe575f600319360112610bbe57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b34610bbe575f600319360112610bbe576020600654604051908152f35b34610bbe575f600319360112610bbe57610f6d604051610f096060826113d8565b602281527f78504e5473466163746f72792d322e312e302d636c6f6e652d6f7074696d697a60208201527f6564000000000000000000000000000000000000000000000000000000000000604082015260405191829160208352602083019061148d565b0390f35b34610bbe576080600319360112610bbe576044356064358115611027575b8015611018575b60039060405192610fa68461138f565b60043584526020840160243581526040850191825260608501928352335f528360205260405f209451855551600185015551600284015551910155610fea33611555565b6040519081527f2b4eaa806f1ef4367c0f395b151c87df87dcd9a99bdfa956df2e02a9a24d805e60203392a2005b506714d1120d7b160000610f96565b670de0b6b3a76400009150610f8f565b34610bbe576020600319360112610bbe5773ffffffffffffffffffffffffffffffffffffffff61106561136c565b165f526003602052608060405f208054906001810154906003600282015491015491604051938452602084015260408301526060820152f35b34610bbe576080600319360112610bbe5760443567ffffffffffffffff8111610bbe576110cf903690600401611419565b604051815160643592602091839181908401835e81016005815203019020549081156110275780156110185760039060405192610fa68461138f565b34610bbe575f600319360112610bbe576040518060206004549283815201809260045f527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b905f5b8181106111c157505050816111699103826113d8565b604051918291602083019060208452518091526040830191905f5b818110611192575050500390f35b825173ffffffffffffffffffffffffffffffffffffffff16845285945060209384019390920191600101611184565b825473ffffffffffffffffffffffffffffffffffffffff16845260209093019260019283019201611153565b34610bbe576020600319360112610bbe57600435611209611627565b80156112485760407ffcc60d1b1dedb59d33b8eef97db5a70c8f8f8523c70d6a027dbf676f1290f8d291600654908060065582519182526020820152a1005b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f5072696365206d75737420626520706f736974697665000000000000000000006044820152fd5b34610bbe575f600319360112610bbe576020600454604051908152f35b34610bbe576020600319360112610bbe5773ffffffffffffffffffffffffffffffffffffffff6112f161136c565b165f526002602052602073ffffffffffffffffffffffffffffffffffffffff60405f205416604051908152f35b34610bbe575f600319360112610bbe5760209073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610bbe57565b6080810190811067ffffffffffffffff8211176113ab57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176113ab57604052565b81601f82011215610bbe5780359067ffffffffffffffff82116113ab576040519261146c601f84017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016602001856113d8565b82845260208383010111610bbe57815f926020809301838601378301015290565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b6004548110156114e85760045f5260205f2001905f90565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b8181029291811591840414171561152857565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b73ffffffffffffffffffffffffffffffffffffffff165f52600360205260405f206040516115828161138f565b815480825260018301548060208401526060600360028601549560408601968752015493019283528115611616576115b991611515565b90601e820291808304601e1490151715611528576115ec6115f4926ec097ce7bc90715b34b9f1000000000945190611515565b905190611515565b049068056bc75e2d63100000821061160857565b68056bc75e2d631000009150565b5050505068056bc75e2d6310000090565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361164757565b7f118cdaa7000000000000000000000000000000000000000000000000000000005f523360045260245ffdfea2646970667358221220027d66aad81966788341afb47a3a012a4b2c221a99ecd296ecfa76720337cd5a64736f6c634300082100336101606040523461049a5760405161001860208261049e565b5f81526040519061002a60208361049e565b5f82526040519161003c60208461049e565b5f83526040519161004e60408461049e565b60018352603160f81b60208401908152825190926001600160401b0382116103955760035490600182811c92168015610490575b60208310146103775781601f84931161041a575b50602090601f83116001146103b4575f926103a9575b50508160011b915f199060031b1c1916176003555b83516001600160401b03811161039557600454600181811c9116801561038b575b602082101461037757601f8111610309575b50602094601f82116001146102a6579481929394955f9261029b575b50508160011b915f199060031b1c1916176004555b61012e816104c1565b6101205261013b83610654565b6101405260208151910120918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526101a860c08261049e565b5190206080523060c0525f5160206135095f395f51905f525460ff8160401c1661028c576002600160401b03196001600160401b03821601610236575b604051612d7090816107998239608051816123cd015260a0518161248a015260c0518161239e015260e0518161241c0152610100518161244201526101205181611385015261014051816113ae0152f35b6001600160401b0319166001600160401b039081175f5160206135095f395f51905f52556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f6101e5565b63f92ee8a960e01b5f5260045ffd5b015190505f80610110565b601f1982169560045f52805f20915f5b8881106102f1575083600195969798106102d9575b505050811b01600455610125565b01515f1960f88460031b161c191690555f80806102cb565b919260206001819286850151815501940192016102b6565b818111156100f45760045f52601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b6020841061036f575b81601f9101920160051c03905f5b8281106103625750506100f4565b5f82820155600101610354565b5f9150610346565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100e2565b634e487b7160e01b5f52604160045260245ffd5b015190505f806100ac565b60035f9081528281209350601f198516905b81811061040257509084600195949392106103ea575b505050811b016003556100c1565b01515f1960f88460031b161c191690555f80806103dc565b929360206001819287860151815501950193016103c6565b828111156100965760035f52909150601f830160051c7fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60208510610488575b849392601f0160051c82900391015f5b828110610478575050610096565b5f8183015585945060010161046a565b5f915061045a565b91607f1691610082565b5f80fd5b601f909101601f19168101906001600160401b0382119082101761039557604052565b908151602081105f1461053b575090601f8151116104fb5760208151910151602082106104ec571790565b5f198260200360031b1b161790565b604460209160405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b6001600160401b03811161039557600554600181811c9116801561064a575b602082101461037757601f811161060b575b50602092601f82116001146105aa57928192935f9261059f575b50508160011b915f199060031b1c19161760055560ff90565b015190505f80610586565b601f1982169360055f52805f20915f5b8681106105f357508360019596106105db575b505050811b0160055560ff90565b01515f1960f88460031b161c191690555f80806105cd565b919260206001819286850151815501940192016105ba565b8181111561056c5760055f5260205f20601f80840160051c809201920160051c03905f5b82811061063d57505061056c565b5f8282015560010161062f565b90607f169061055a565b908151602081105f1461067f575090601f8151116104fb5760208151910151602082106104ec571790565b6001600160401b03811161039557600654600181811c9116801561078e575b602082101461037757601f811161074f575b50602092601f82116001146106ee57928192935f926106e3575b50508160011b915f199060031b1c19161760065560ff90565b015190505f806106ca565b601f1982169360065f52805f20915f5b868110610737575083600195961061071f575b505050811b0160065560ff90565b01515f1960f88460031b161c191690555f8080610711565b919260206001819286850151815501940192016106fe565b818111156106b05760065f5260205f20601f80840160051c809201920160051c03905f5b8281106107815750506106b0565b5f82820155600101610773565b90607f169061069e56fe60806040526004361015610011575f80fd5b5f3560e01c806306fdde0314611c8e578063095ea7b314611c685780631296ee6214611c3057806318160ddd14611c1357806323b872dd14611ac457806325073b3a14611a375780632dd3100014611a115780632ecd4e7d146112f7578063313ce567146119f65780633644e515146119dc57806338518bfe146119b65780633ba0b9a9146119995780634000aea01461193557806340c10f191461189c57806342966c681461187f5780635054dbd01461185957806354fd4d50146117fa578063623330ae1461174257806366b48f91146117275780636b09de451461170b57806370a08231146116d45780637a5b4f59146116425780637ade132c146114e85780637ecebe00146114b05780637fd6327a1461148157806384b0196e1461136d5780638d0745471461134a57806395d89b411461132f5780639a78e72e146112f75780639dc29fac14611198578063a9059cbb14611167578063aae64da2146110d4578063b83aa2de14610fff578063b9e205ae14610f3c578063c504e20914610ece578063c6d572ae14610e9b578063d49bdad014610e4f578063d505accf14610cc9578063dd62ed3e14610c95578063f0ce3dd2146103ed578063f1d85d55146103b0578063f9ec7f241461038c5763fa74542d146101f2575f80fd5b346103885760406003193601126103885761020b611cce565b602435906001600160a01b03600a5416801561031e5733036102f25769010f0cf064dd5920000082116102875760206001600160a01b037f99cf5cc1e3146bd15204f8eae4fe16c690d6123fbdac32515502fe688b86b8f5921692835f526012825260405f2061027c828254612387565b9055604051908152a2005b60405162461bcd60e51b815260206004820152602160248201527f53696e676c65207472616e73616374696f6e206c696d6974206578636565646560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b7f8e4a23d6000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b608460405162461bcd60e51b815260206004820152602560248201527f53797374656d3a2053757065725061796d6173746572206e6f7420636f6e666960448201527f67757265640000000000000000000000000000000000000000000000000000006064820152fd5b5f80fd5b34610388575f60031936011261038857602060405169010f0cf064dd592000008152f35b34610388576020600319360112610388576001600160a01b036103d1611cce565b165f52600b602052602060ff60405f2054166040519015158152f35b346103885760c06003193601126103885760043567ffffffffffffffff81116103885761041e903690600401612064565b60243567ffffffffffffffff81116103885761043e903690600401612064565b6044356001600160a01b0381168091036103885760643567ffffffffffffffff811161038857610472903690600401612064565b60843567ffffffffffffffff811161038857610492903690600401612064565b60a435917ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549360ff8560401c16159467ffffffffffffffff811680159081610c8d575b6001149081610c83575b159081610c7a575b50610c52578560017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008316177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055610bfd575b508015610bd257337fffffffffffffffffffffffff000000000000000000000000000000000000000060085416176008557fffffffffffffffffffffffff0000000000000000000000000000000000000000600954161760095580519067ffffffffffffffff82116108a35781906105b4600d54611d9d565b601f8111610b5b575b50602090601f8311600114610ad9575f92610ace575b50505f198260011b9260031b1c191617600d555b80519067ffffffffffffffff82116108a3578190610606600e54611d9d565b601f8111610a57575b50602090601f83116001146109d5575f926109ca575b50505f198260011b9260031b1c191617600e555b835167ffffffffffffffff81116108a357610655601054611d9d565b601f811161095c575b50602094601f82116001146108db579481929394955f926108d0575b50505f198260011b9260031b1c1916176010555b825167ffffffffffffffff81116108a3576106aa601154611d9d565b601f8111610835575b506020601f82116001146107b457819293945f926107a9575b50505f198260011b9260031b1c1916176011555b801561079a575b600f55335f52600b60205260405f20600160ff1982541617905561070757005b7fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b50670de0b6b3a76400006106e7565b0151905084806106cc565b601f1982169060115f527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68915f5b81811061081d57509583600195969710610805575b505050811b016011556106e0565b01515f1960f88460031b161c191690558480806107f7565b9192602060018192868b0151815501940192016107e2565b818111156106b35760115f52601f820160051c906020831061089b575b601f82910160051c03905f5b82811061086c5750506106b3565b5f8282017f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68015560010161085e565b5f9150610852565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b01519050858061067a565b601f1982169560105f527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672915f5b8881106109445750836001959697981061092c575b505050811b0160105561068e565b01515f1960f88460031b161c1916905585808061091e565b91926020600181928685015181550194019201610909565b8181111561065e5760105f52601f820160051c90602083106109c2575b601f82910160051c03905f5b82811061099357505061065e565b5f8282017f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6720155600101610985565b5f9150610979565b015190508680610625565b91601f191691600e5f527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd925f5b818110610a3f5750908460019594939210610a27575b505050811b01600e55610639565b01515f1960f88460031b161c19169055868080610a19565b92936020600181928786015181550195019301610a03565b8281111561060f57909150600e5f52601f830160051c9060208410610ac6575b9080601f8594930160051c03905f5b828110610a9457505061060f565b5f8183017fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0155859450600101610a86565b5f9150610a77565b0151905087806105d3565b91601f191691600d5f527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5925f5b818110610b435750908460019594939210610b2b575b505050811b01600d556105e7565b01515f1960f88460031b161c19169055878080610b1d565b92936020600181928786015181550195019301610b07565b828111156105bd57909150600d5f52601f830160051c9060208410610bca575b9080601f8594930160051c03905f5b828110610b985750506105bd565b5f8183017fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155859450600101610b8a565b5f9150610b7b565b7f8e4c8aa6000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00558761053b565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b905015896104e8565b303b1591506104e0565b8791506104d6565b34610388576040600319360112610388576020610cc1610cb3611cce565b610cbb611ce4565b90612338565b604051908152f35b346103885760e060031936011261038857610ce2611cce565b610cea611ce4565b604435906064359260843560ff8116810361038857844211610e2357610dde610dd56001600160a01b039283851697885f52600760205260405f20908154916001830190556040519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c984528b6040840152878a1660608401528a608084015260a083015260c082015260c08152610d8860e082611d34565b519020610d93612394565b90604051917f190100000000000000000000000000000000000000000000000000000000000083526002830152602282015260c43591604260a4359220612ad6565b90929192612b63565b16848103610df35750610df19350612677565b005b84907f4b800e46000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b847f62791302000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b34610388575f600319360112610388576001600160a01b036009541633036102f257600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055005b34610388575f60031936011261038857610eca610eb6611fcf565b604051918291602083526020830190611ca9565b0390f35b3461038857602060031936011261038857610ee7611cce565b6001600160a01b036009541633036102f2576001600160a01b0316805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a2005b34610388576020600319360112610388576004356001600160a01b036008541633141580610fea575b6102f2578015610fa6577fc8d1043f24843c0a1c9251fdc30017d84e87498fbcf232af9f86816b5e182bde6040600f548151908152836020820152a1600f55005b606460405162461bcd60e51b815260206004820152601c60248201527f45786368616e676520726174652063616e6e6f74206265207a65726f000000006044820152fd5b506001600160a01b0360095416331415610f65565b3461038857606060031936011261038857611018611cce565b6024356044356001600160a01b03600a5416330361109f57805f52600c60205260ff60405f205416611074575f52600c60205260405f20600160ff1982541617905569010f0cf064dd59200000811161028757610df1916125dc565b7fe18b4060000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f8e4a23d6000000000000000000000000000000000000000000000000000000005f526001600160a01b03331660045260245ffd5b34610388576020600319360112610388576110ed611cce565b6001600160a01b036009541633141580611152575b6102f2576001600160a01b03168015610bd257805f52600b60205260405f20600160ff198254161790557fcd244ccee31904b178ff7bfc95631cea7812a955f9a330ac216c0c8c9dbfaf205f80a2005b506001600160a01b0360085416331415611102565b346103885760406003193601126103885761118d611183611cce565b6024359033612622565b602060405160018152f35b34610388576040600319360112610388576111b1611cce565b6024356001600160a01b03600a5416331461128d576001600160a01b03821633036111e0575b610df1916125dc565b6111ea3383612338565b918183106112245781835f19610df19503611209575b505091506111d7565b61121d9161121691612165565b3383612677565b8184611200565b608460405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152fd5b608460405162461bcd60e51b815260206004820152602c60248201527f53757065725061796d6173746572206d75737420757365206275726e46726f6d60448201527f576974684f7048617368282900000000000000000000000000000000000000006064820152fd5b34610388576020600319360112610388576001600160a01b03611318611cce565b165f526012602052602060405f2054604051908152f35b34610388575f60031936011261038857610eca610eb6611f3a565b3461038857602061136461135d36611cfa565b9291612338565b10604051908152f35b34610388575f600319360112610388576114256113a97f000000000000000000000000000000000000000000000000000000000000000061290b565b6113d27f0000000000000000000000000000000000000000000000000000000000000000612a1e565b6020611433604051926113e58385611d34565b5f84525f3681376040519586957f0f00000000000000000000000000000000000000000000000000000000000000875260e08588015260e0870190611ca9565b908582036040870152611ca9565b4660608501523060808501525f60a085015283810360c08501528180845192838152019301915f5b82811061146a57505050500390f35b83518552869550938101939281019260010161145b565b34610388576020600319360112610388576004355f52600c602052602060ff60405f2054166040519015158152f35b34610388576020600319360112610388576001600160a01b036114d1611cce565b165f526007602052602060405f2054604051908152f35b3461038857602060031936011261038857611501611cce565b6001600160a01b03600854163314158061162d575b6102f2576001600160a01b03168015610bd2576001600160a01b03600a541680151580611623575b6115d0575b50807fffffffffffffffffffffffff0000000000000000000000000000000000000000600a541617600a55805f52600b60205260405f20600160ff19825416179055807fcd244ccee31904b178ff7bfc95631cea7812a955f9a330ac216c0c8c9dbfaf205f80a27f3c84f1b682ac1493ee72abc0427a570b681583551f8fadd1b98ea9cce545ec6a5f80a2005b805f52600b60205260ff60405f2054161561154357805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a281611543565b508181141561153e565b506001600160a01b0360095416331415611516565b34610388575f600319360112610388576116a061165d611dee565b611665611f3a565b6116ca6001600160a01b0360095416916116bc611680611fcf565b6116ae61168b611ea5565b9360405198899860a08a5260a08a0190611ca9565b9088820360208a0152611ca9565b908682036040880152611ca9565b908482036060860152611ca9565b9060808301520390f35b34610388576020600319360112610388576001600160a01b036116f5611cce565b165f525f602052602060405f2054604051908152f35b3461038857602060031936011261038857610df160043561219f565b34610388575f60031936011261038857610eca610eb6611ea5565b346103885760206003193601126103885761175b611cce565b600954906001600160a01b038216908133036102f2576001600160a01b0316809281156117ce577fffffffffffffffffffffffff000000000000000000000000000000000000000016176009557f1191f7dd7e510e69e54c21c704f6f3c1179351c8a1a8d6a2a66d1e20aed6fd0f5f80a3005b507f8e4c8aa6000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b34610388575f60031936011261038857610eca60405161181b604082611d34565b601581527f58504e54732d332e302e302d756e6c696d6974656400000000000000000000006020820152604051918291602083526020830190611ca9565b34610388575f6003193601126103885760206001600160a01b03600a5416604051908152f35b3461038857602060031936011261038857610df1600435336125dc565b34610388576040600319360112610388576118b5611cce565b6001600160a01b036008541633141580611920575b61109f576001600160a01b038116156118eb57610df190602435905f6127df565b6001600160a01b03907f8e4c8aa6000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b506001600160a01b03600954163314156118ca565b346103885760606003193601126103885761194e611cce565b60443567ffffffffffffffff811161038857366023820112156103885760209161198561198f923690602481600401359101611d57565b9060243590612082565b6040519015158152f35b34610388575f600319360112610388576020600f54604051908152f35b34610388575f6003193601126103885760206001600160a01b0360095416604051908152f35b34610388575f600319360112610388576020610cc1612394565b34610388575f60031936011261038857602060405160128152f35b34610388575f6003193601126103885760206001600160a01b0360085416604051908152f35b34610388575f600319360112610388576001600160a01b036009541633036102f2576001600160a01b03600a541680151580611aae575b611a7457005b805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a2005b50805f52600b60205260ff60405f205416611a6e565b3461038857611ad236611cfa565b90335f52600b60205260ff60405f205416611afc575b61118d92611af7833383612732565b612622565b6001600160a01b038116338114159081611bfd575b50611b935769010f0cf064dd59200000821115611ae85760405162461bcd60e51b815260206004820152602160248201527f53696e676c65207472616e73616374696f6e206c696d6974206578636565646560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b608460405162461bcd60e51b815260206004820152603a60248201527f53656375726974793a20556e617574686f72697a656420726563697069656e7460448201527f20666f72206175746f2d617070726f766564207370656e6465720000000000006064820152fd5b90506001600160a01b03600a5416141584611b11565b34610388575f600319360112610388576020600254604051908152f35b3461038857604060031936011261038857602061198f611c4e611cce565b60405190611c5c8483611d34565b5f825260243590612082565b346103885760406003193601126103885761118d611c84611cce565b6024359033612677565b34610388575f60031936011261038857610eca610eb6611dee565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b600435906001600160a01b038216820361038857565b602435906001600160a01b038216820361038857565b6003196060910112610388576004356001600160a01b038116810361038857906024356001600160a01b0381168103610388579060443590565b90601f601f19910116810190811067ffffffffffffffff8211176108a357604052565b92919267ffffffffffffffff82116108a35760405191611d81601f8201601f191660200184611d34565b829481845281830111610388578281602093845f960137010152565b90600182811c92168015611de4575b6020831014611db757565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691611dac565b604051905f8260105491611e0183611d9d565b8083529260018116908115611e865750600114611e27575b611e2592500383611d34565b565b5060105f90815290917f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6725b818310611e6a575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611e52565b60209250611e2594915060ff191682840152151560051b820101611e19565b604051905f82600e5491611eb883611d9d565b8083529260018116908115611e865750600114611edb57611e2592500383611d34565b50600e5f90815290917fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b818310611f1e575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611f06565b604051905f8260115491611f4d83611d9d565b8083529260018116908115611e865750600114611f7057611e2592500383611d34565b5060115f90815290917f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c685b818310611fb3575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611f9b565b604051905f82600d5491611fe283611d9d565b8083529260018116908115611e86575060011461200557611e2592500383611d34565b50600d5f90815290917fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b818310612048575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492612030565b9080601f830112156103885781602061207f93359101611d57565b90565b9190600260135414612121576120a89260026013556120a18282612328565b50336124b0565b156120b7576001906001601355565b608460405162461bcd60e51b815260206004820152602160248201527f455243313336333a207472616e7366657220746f206e6f6e2d7265636569766560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b606460405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b9190820391821161217257565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b335f52601260205260405f205481156123245780156122e05780821161229c57335f525f6020528160405f20541061223257816121db91612165565b335f52601260205260405f20556121f281336125dc565b335f52601260205260405f205460405191825260208201527f798353030d4251a345706609acf9ea7527f2ace26f73150a098c0fae89e5886d60403392a2565b608460405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152fd5b606460405162461bcd60e51b815260206004820152601960248201527f526570617920616d6f756e7420657863656564732064656274000000000000006044820152fd5b606460405162461bcd60e51b815260206004820152601060248201527f4e6f206465627420746f207265706179000000000000000000000000000000006044820152fd5b5050565b906123339133612622565b600190565b6001600160a01b0382165f52600b60205260ff60405f205416612380576001600160a01b03165f5260016020526001600160a01b0360405f2091165f5260205260405f205490565b50505f1990565b9190820180921161217257565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480612487575b156123ef577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815261248160c082611d34565b51902090565b507f000000000000000000000000000000000000000000000000000000000000000046146123c6565b9190803b156125d3576001600160a01b035f81602095612518604051988997889687947f88a7ca5c0000000000000000000000000000000000000000000000000000000086523360048701521660248501526044840152608060648401526084830190611ca9565b0393165af15f9181612576575b5061252f57505f90565b7fffffffff00000000000000000000000000000000000000000000000000000000167f88a7ca5c000000000000000000000000000000000000000000000000000000001490565b9091506020813d6020116125cb575b8161259260209383611d34565b8101031261038857517fffffffff000000000000000000000000000000000000000000000000000000008116810361038857905f612525565b3d9150612585565b50505050600190565b906001600160a01b038216156125f6575f611e25926127df565b7f96c6fd1e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b91906001600160a01b038316156125f6576001600160a01b0381161561264b57611e25926127df565b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b6001600160a01b0316908115612706576001600160a01b03169182156126da5760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591835f526001825260405f20855f5282528060405f2055604051908152a3565b7f94280d62000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7fe602df05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b91906001600160a01b03811690815f52600b60205260ff60405f2054166127675761275d9084612338565b925f19840361276d575b50505050565b8284106127ab576001600160a01b031680156127065781156126da575f52600160205260405f20905f5260205260405f20910390555f808080612767565b5082907ffb8f41b2000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffd5b91906001600160a01b03831615806128f9575b806128f0575b612806575b611e2592612c3b565b612821816001600160a01b03165f52601260205260405f2090565b548061282d57506127fd565b918161286c92938083115f146128e857945b61285a826001600160a01b03165f52601260205260405f2090565b612865878254612165565b9055612c3b565b81612875575050565b61287f82826125dc565b6001600160a01b03816128e36128c77f798353030d4251a345706609acf9ea7527f2ace26f73150a098c0fae89e5886d946001600160a01b03165f52601260205260405f2090565b5460405193849316958360209093929193604081019481520152565b0390a2565b50819461283f565b508115156127f8565b506001600160a01b03811615156127f2565b60ff811461296a5760ff811690601f8211612942576040519161292f604084611d34565b6020808452838101919036833783525290565b7fb3512b0c000000000000000000000000000000000000000000000000000000005f5260045ffd5b50604051600554815f61297c83611d9d565b80835292600181169081156129ff57506001146129a0575b61207f92500382611d34565b5060055f90815290917f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b8183106129e357505090602061207f92820101612994565b60209193508060019154838588010152019101909183926129cb565b6020925061207f94915060ff191682840152151560051b820101612994565b60ff8114612a425760ff811690601f8211612942576040519161292f604084611d34565b50604051600654815f612a5483611d9d565b80835292600181169081156129ff5750600114612a775761207f92500382611d34565b5060065f90815290917ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b818310612aba57505090602061207f92820101612994565b6020919350806001915483858801015201910190918392612aa2565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411612b58579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15612b4d575f516001600160a01b03811615612b4357905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f9160039190565b6004811015612c0e5780612b75575050565b60018103612ba5577ff645eedf000000000000000000000000000000000000000000000000000000005f5260045ffd5b60028103612bd957507ffce698f7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b600314612be35750565b7fd78bce0c000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6001600160a01b03169081612cb45760206001600160a01b037fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92612c8286600254612387565b6002555b169384612c9f5780600254036002555b604051908152a3565b845f525f825260405f20818154019055612c96565b815f525f60205260405f2054838110612d06576001600160a01b037fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9285602093865f525f85520360405f2055612c86565b9190507fe450d38c000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffdfea2646970667358221220e5547380639544a70415454e7e6be2d7b81652dd79b625615c458a80c6c69c4464736f6c63430008210033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"` diff --git a/0.16.23/api/@aastar/core/variables/xPNTsTokenABI.md b/0.16.23/api/@aastar/core/variables/xPNTsTokenABI.md new file mode 100644 index 000000000..f1eafa7f6 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/xPNTsTokenABI.md @@ -0,0 +1,3 @@ +> `const` **xPNTsTokenABI**: `any` + +Defined in: [packages/core/src/abis/index.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L67) diff --git a/0.16.23/api/@aastar/core/variables/xPNTsTokenArtifact.md b/0.16.23/api/@aastar/core/variables/xPNTsTokenArtifact.md new file mode 100644 index 000000000..d200eae57 --- /dev/null +++ b/0.16.23/api/@aastar/core/variables/xPNTsTokenArtifact.md @@ -0,0 +1,13 @@ +> `const` **xPNTsTokenArtifact**: `object` = `xPNTsTokenABIData` + +Defined in: [packages/core/src/abis/index.ts:68](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/core/src/abis/index.ts#L68) + +## Type Declaration + +### abi + +> **abi**: (\{ `anonymous?`: `undefined`; `inputs`: `never`[]; `name?`: `undefined`; `outputs?`: `undefined`; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs`: `object`[]; `stateMutability`: `string`; `type`: `string`; \} \| \{ `anonymous`: `boolean`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \} \| \{ `anonymous?`: `undefined`; `inputs`: `object`[]; `name`: `string`; `outputs?`: `undefined`; `stateMutability?`: `undefined`; `type`: `string`; \})[] + +### bytecode + +> **bytecode**: `string` = `"0x6101606040523461049a5760405161001860208261049e565b5f81526040519061002a60208361049e565b5f82526040519161003c60208461049e565b5f83526040519161004e60408461049e565b60018352603160f81b60208401908152825190926001600160401b0382116103955760035490600182811c92168015610490575b60208310146103775781601f84931161041a575b50602090601f83116001146103b4575f926103a9575b50508160011b915f199060031b1c1916176003555b83516001600160401b03811161039557600454600181811c9116801561038b575b602082101461037757601f8111610309575b50602094601f82116001146102a6579481929394955f9261029b575b50508160011b915f199060031b1c1916176004555b61012e816104c1565b6101205261013b83610654565b6101405260208151910120918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526101a860c08261049e565b5190206080523060c0525f5160206135095f395f51905f525460ff8160401c1661028c576002600160401b03196001600160401b03821601610236575b604051612d7090816107998239608051816123cd015260a0518161248a015260c0518161239e015260e0518161241c0152610100518161244201526101205181611385015261014051816113ae0152f35b6001600160401b0319166001600160401b039081175f5160206135095f395f51905f52556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f6101e5565b63f92ee8a960e01b5f5260045ffd5b015190505f80610110565b601f1982169560045f52805f20915f5b8881106102f1575083600195969798106102d9575b505050811b01600455610125565b01515f1960f88460031b161c191690555f80806102cb565b919260206001819286850151815501940192016102b6565b818111156100f45760045f52601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b6020841061036f575b81601f9101920160051c03905f5b8281106103625750506100f4565b5f82820155600101610354565b5f9150610346565b634e487b7160e01b5f52602260045260245ffd5b90607f16906100e2565b634e487b7160e01b5f52604160045260245ffd5b015190505f806100ac565b60035f9081528281209350601f198516905b81811061040257509084600195949392106103ea575b505050811b016003556100c1565b01515f1960f88460031b161c191690555f80806103dc565b929360206001819287860151815501950193016103c6565b828111156100965760035f52909150601f830160051c7fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60208510610488575b849392601f0160051c82900391015f5b828110610478575050610096565b5f8183015585945060010161046a565b5f915061045a565b91607f1691610082565b5f80fd5b601f909101601f19168101906001600160401b0382119082101761039557604052565b908151602081105f1461053b575090601f8151116104fb5760208151910151602082106104ec571790565b5f198260200360031b1b161790565b604460209160405192839163305a27a960e01b83528160048401528051918291826024860152018484015e5f828201840152601f01601f19168101030190fd5b6001600160401b03811161039557600554600181811c9116801561064a575b602082101461037757601f811161060b575b50602092601f82116001146105aa57928192935f9261059f575b50508160011b915f199060031b1c19161760055560ff90565b015190505f80610586565b601f1982169360055f52805f20915f5b8681106105f357508360019596106105db575b505050811b0160055560ff90565b01515f1960f88460031b161c191690555f80806105cd565b919260206001819286850151815501940192016105ba565b8181111561056c5760055f5260205f20601f80840160051c809201920160051c03905f5b82811061063d57505061056c565b5f8282015560010161062f565b90607f169061055a565b908151602081105f1461067f575090601f8151116104fb5760208151910151602082106104ec571790565b6001600160401b03811161039557600654600181811c9116801561078e575b602082101461037757601f811161074f575b50602092601f82116001146106ee57928192935f926106e3575b50508160011b915f199060031b1c19161760065560ff90565b015190505f806106ca565b601f1982169360065f52805f20915f5b868110610737575083600195961061071f575b505050811b0160065560ff90565b01515f1960f88460031b161c191690555f8080610711565b919260206001819286850151815501940192016106fe565b818111156106b05760065f5260205f20601f80840160051c809201920160051c03905f5b8281106107815750506106b0565b5f82820155600101610773565b90607f169061069e56fe60806040526004361015610011575f80fd5b5f3560e01c806306fdde0314611c8e578063095ea7b314611c685780631296ee6214611c3057806318160ddd14611c1357806323b872dd14611ac457806325073b3a14611a375780632dd3100014611a115780632ecd4e7d146112f7578063313ce567146119f65780633644e515146119dc57806338518bfe146119b65780633ba0b9a9146119995780634000aea01461193557806340c10f191461189c57806342966c681461187f5780635054dbd01461185957806354fd4d50146117fa578063623330ae1461174257806366b48f91146117275780636b09de451461170b57806370a08231146116d45780637a5b4f59146116425780637ade132c146114e85780637ecebe00146114b05780637fd6327a1461148157806384b0196e1461136d5780638d0745471461134a57806395d89b411461132f5780639a78e72e146112f75780639dc29fac14611198578063a9059cbb14611167578063aae64da2146110d4578063b83aa2de14610fff578063b9e205ae14610f3c578063c504e20914610ece578063c6d572ae14610e9b578063d49bdad014610e4f578063d505accf14610cc9578063dd62ed3e14610c95578063f0ce3dd2146103ed578063f1d85d55146103b0578063f9ec7f241461038c5763fa74542d146101f2575f80fd5b346103885760406003193601126103885761020b611cce565b602435906001600160a01b03600a5416801561031e5733036102f25769010f0cf064dd5920000082116102875760206001600160a01b037f99cf5cc1e3146bd15204f8eae4fe16c690d6123fbdac32515502fe688b86b8f5921692835f526012825260405f2061027c828254612387565b9055604051908152a2005b60405162461bcd60e51b815260206004820152602160248201527f53696e676c65207472616e73616374696f6e206c696d6974206578636565646560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b7f8e4a23d6000000000000000000000000000000000000000000000000000000005f523360045260245ffd5b608460405162461bcd60e51b815260206004820152602560248201527f53797374656d3a2053757065725061796d6173746572206e6f7420636f6e666960448201527f67757265640000000000000000000000000000000000000000000000000000006064820152fd5b5f80fd5b34610388575f60031936011261038857602060405169010f0cf064dd592000008152f35b34610388576020600319360112610388576001600160a01b036103d1611cce565b165f52600b602052602060ff60405f2054166040519015158152f35b346103885760c06003193601126103885760043567ffffffffffffffff81116103885761041e903690600401612064565b60243567ffffffffffffffff81116103885761043e903690600401612064565b6044356001600160a01b0381168091036103885760643567ffffffffffffffff811161038857610472903690600401612064565b60843567ffffffffffffffff811161038857610492903690600401612064565b60a435917ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00549360ff8560401c16159467ffffffffffffffff811680159081610c8d575b6001149081610c83575b159081610c7a575b50610c52578560017fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008316177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0055610bfd575b508015610bd257337fffffffffffffffffffffffff000000000000000000000000000000000000000060085416176008557fffffffffffffffffffffffff0000000000000000000000000000000000000000600954161760095580519067ffffffffffffffff82116108a35781906105b4600d54611d9d565b601f8111610b5b575b50602090601f8311600114610ad9575f92610ace575b50505f198260011b9260031b1c191617600d555b80519067ffffffffffffffff82116108a3578190610606600e54611d9d565b601f8111610a57575b50602090601f83116001146109d5575f926109ca575b50505f198260011b9260031b1c191617600e555b835167ffffffffffffffff81116108a357610655601054611d9d565b601f811161095c575b50602094601f82116001146108db579481929394955f926108d0575b50505f198260011b9260031b1c1916176010555b825167ffffffffffffffff81116108a3576106aa601154611d9d565b601f8111610835575b506020601f82116001146107b457819293945f926107a9575b50505f198260011b9260031b1c1916176011555b801561079a575b600f55335f52600b60205260405f20600160ff1982541617905561070757005b7fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054167ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b50670de0b6b3a76400006106e7565b0151905084806106cc565b601f1982169060115f527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68915f5b81811061081d57509583600195969710610805575b505050811b016011556106e0565b01515f1960f88460031b161c191690558480806107f7565b9192602060018192868b0151815501940192016107e2565b818111156106b35760115f52601f820160051c906020831061089b575b601f82910160051c03905f5b82811061086c5750506106b3565b5f8282017f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68015560010161085e565b5f9150610852565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b01519050858061067a565b601f1982169560105f527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672915f5b8881106109445750836001959697981061092c575b505050811b0160105561068e565b01515f1960f88460031b161c1916905585808061091e565b91926020600181928685015181550194019201610909565b8181111561065e5760105f52601f820160051c90602083106109c2575b601f82910160051c03905f5b82811061099357505061065e565b5f8282017f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6720155600101610985565b5f9150610979565b015190508680610625565b91601f191691600e5f527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd925f5b818110610a3f5750908460019594939210610a27575b505050811b01600e55610639565b01515f1960f88460031b161c19169055868080610a19565b92936020600181928786015181550195019301610a03565b8281111561060f57909150600e5f52601f830160051c9060208410610ac6575b9080601f8594930160051c03905f5b828110610a9457505061060f565b5f8183017fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd0155859450600101610a86565b5f9150610a77565b0151905087806105d3565b91601f191691600d5f527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5925f5b818110610b435750908460019594939210610b2b575b505050811b01600d556105e7565b01515f1960f88460031b161c19169055878080610b1d565b92936020600181928786015181550195019301610b07565b828111156105bd57909150600d5f52601f830160051c9060208410610bca575b9080601f8594930160051c03905f5b828110610b985750506105bd565b5f8183017fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50155859450600101610b8a565b5f9150610b7b565b7f8e4c8aa6000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7fffffffffffffffffffffffffffffffffffffffffffffff0000000000000000001668010000000000000001177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00558761053b565b7ff92ee8a9000000000000000000000000000000000000000000000000000000005f5260045ffd5b905015896104e8565b303b1591506104e0565b8791506104d6565b34610388576040600319360112610388576020610cc1610cb3611cce565b610cbb611ce4565b90612338565b604051908152f35b346103885760e060031936011261038857610ce2611cce565b610cea611ce4565b604435906064359260843560ff8116810361038857844211610e2357610dde610dd56001600160a01b039283851697885f52600760205260405f20908154916001830190556040519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c984528b6040840152878a1660608401528a608084015260a083015260c082015260c08152610d8860e082611d34565b519020610d93612394565b90604051917f190100000000000000000000000000000000000000000000000000000000000083526002830152602282015260c43591604260a4359220612ad6565b90929192612b63565b16848103610df35750610df19350612677565b005b84907f4b800e46000000000000000000000000000000000000000000000000000000005f5260045260245260445ffd5b847f62791302000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b34610388575f600319360112610388576001600160a01b036009541633036102f257600880547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055005b34610388575f60031936011261038857610eca610eb6611fcf565b604051918291602083526020830190611ca9565b0390f35b3461038857602060031936011261038857610ee7611cce565b6001600160a01b036009541633036102f2576001600160a01b0316805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a2005b34610388576020600319360112610388576004356001600160a01b036008541633141580610fea575b6102f2578015610fa6577fc8d1043f24843c0a1c9251fdc30017d84e87498fbcf232af9f86816b5e182bde6040600f548151908152836020820152a1600f55005b606460405162461bcd60e51b815260206004820152601c60248201527f45786368616e676520726174652063616e6e6f74206265207a65726f000000006044820152fd5b506001600160a01b0360095416331415610f65565b3461038857606060031936011261038857611018611cce565b6024356044356001600160a01b03600a5416330361109f57805f52600c60205260ff60405f205416611074575f52600c60205260405f20600160ff1982541617905569010f0cf064dd59200000811161028757610df1916125dc565b7fe18b4060000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f8e4a23d6000000000000000000000000000000000000000000000000000000005f526001600160a01b03331660045260245ffd5b34610388576020600319360112610388576110ed611cce565b6001600160a01b036009541633141580611152575b6102f2576001600160a01b03168015610bd257805f52600b60205260405f20600160ff198254161790557fcd244ccee31904b178ff7bfc95631cea7812a955f9a330ac216c0c8c9dbfaf205f80a2005b506001600160a01b0360085416331415611102565b346103885760406003193601126103885761118d611183611cce565b6024359033612622565b602060405160018152f35b34610388576040600319360112610388576111b1611cce565b6024356001600160a01b03600a5416331461128d576001600160a01b03821633036111e0575b610df1916125dc565b6111ea3383612338565b918183106112245781835f19610df19503611209575b505091506111d7565b61121d9161121691612165565b3383612677565b8184611200565b608460405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760448201527f616e6365000000000000000000000000000000000000000000000000000000006064820152fd5b608460405162461bcd60e51b815260206004820152602c60248201527f53757065725061796d6173746572206d75737420757365206275726e46726f6d60448201527f576974684f7048617368282900000000000000000000000000000000000000006064820152fd5b34610388576020600319360112610388576001600160a01b03611318611cce565b165f526012602052602060405f2054604051908152f35b34610388575f60031936011261038857610eca610eb6611f3a565b3461038857602061136461135d36611cfa565b9291612338565b10604051908152f35b34610388575f600319360112610388576114256113a97f000000000000000000000000000000000000000000000000000000000000000061290b565b6113d27f0000000000000000000000000000000000000000000000000000000000000000612a1e565b6020611433604051926113e58385611d34565b5f84525f3681376040519586957f0f00000000000000000000000000000000000000000000000000000000000000875260e08588015260e0870190611ca9565b908582036040870152611ca9565b4660608501523060808501525f60a085015283810360c08501528180845192838152019301915f5b82811061146a57505050500390f35b83518552869550938101939281019260010161145b565b34610388576020600319360112610388576004355f52600c602052602060ff60405f2054166040519015158152f35b34610388576020600319360112610388576001600160a01b036114d1611cce565b165f526007602052602060405f2054604051908152f35b3461038857602060031936011261038857611501611cce565b6001600160a01b03600854163314158061162d575b6102f2576001600160a01b03168015610bd2576001600160a01b03600a541680151580611623575b6115d0575b50807fffffffffffffffffffffffff0000000000000000000000000000000000000000600a541617600a55805f52600b60205260405f20600160ff19825416179055807fcd244ccee31904b178ff7bfc95631cea7812a955f9a330ac216c0c8c9dbfaf205f80a27f3c84f1b682ac1493ee72abc0427a570b681583551f8fadd1b98ea9cce545ec6a5f80a2005b805f52600b60205260ff60405f2054161561154357805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a281611543565b508181141561153e565b506001600160a01b0360095416331415611516565b34610388575f600319360112610388576116a061165d611dee565b611665611f3a565b6116ca6001600160a01b0360095416916116bc611680611fcf565b6116ae61168b611ea5565b9360405198899860a08a5260a08a0190611ca9565b9088820360208a0152611ca9565b908682036040880152611ca9565b908482036060860152611ca9565b9060808301520390f35b34610388576020600319360112610388576001600160a01b036116f5611cce565b165f525f602052602060405f2054604051908152f35b3461038857602060031936011261038857610df160043561219f565b34610388575f60031936011261038857610eca610eb6611ea5565b346103885760206003193601126103885761175b611cce565b600954906001600160a01b038216908133036102f2576001600160a01b0316809281156117ce577fffffffffffffffffffffffff000000000000000000000000000000000000000016176009557f1191f7dd7e510e69e54c21c704f6f3c1179351c8a1a8d6a2a66d1e20aed6fd0f5f80a3005b507f8e4c8aa6000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b34610388575f60031936011261038857610eca60405161181b604082611d34565b601581527f58504e54732d332e302e302d756e6c696d6974656400000000000000000000006020820152604051918291602083526020830190611ca9565b34610388575f6003193601126103885760206001600160a01b03600a5416604051908152f35b3461038857602060031936011261038857610df1600435336125dc565b34610388576040600319360112610388576118b5611cce565b6001600160a01b036008541633141580611920575b61109f576001600160a01b038116156118eb57610df190602435905f6127df565b6001600160a01b03907f8e4c8aa6000000000000000000000000000000000000000000000000000000005f521660045260245ffd5b506001600160a01b03600954163314156118ca565b346103885760606003193601126103885761194e611cce565b60443567ffffffffffffffff811161038857366023820112156103885760209161198561198f923690602481600401359101611d57565b9060243590612082565b6040519015158152f35b34610388575f600319360112610388576020600f54604051908152f35b34610388575f6003193601126103885760206001600160a01b0360095416604051908152f35b34610388575f600319360112610388576020610cc1612394565b34610388575f60031936011261038857602060405160128152f35b34610388575f6003193601126103885760206001600160a01b0360085416604051908152f35b34610388575f600319360112610388576001600160a01b036009541633036102f2576001600160a01b03600a541680151580611aae575b611a7457005b805f52600b60205260405f2060ff1981541690557f49debedb360a6c155dc3046b522ec5e27906afea1be0015b4625302e9192e2d85f80a2005b50805f52600b60205260ff60405f205416611a6e565b3461038857611ad236611cfa565b90335f52600b60205260ff60405f205416611afc575b61118d92611af7833383612732565b612622565b6001600160a01b038116338114159081611bfd575b50611b935769010f0cf064dd59200000821115611ae85760405162461bcd60e51b815260206004820152602160248201527f53696e676c65207472616e73616374696f6e206c696d6974206578636565646560448201527f64000000000000000000000000000000000000000000000000000000000000006064820152608490fd5b608460405162461bcd60e51b815260206004820152603a60248201527f53656375726974793a20556e617574686f72697a656420726563697069656e7460448201527f20666f72206175746f2d617070726f766564207370656e6465720000000000006064820152fd5b90506001600160a01b03600a5416141584611b11565b34610388575f600319360112610388576020600254604051908152f35b3461038857604060031936011261038857602061198f611c4e611cce565b60405190611c5c8483611d34565b5f825260243590612082565b346103885760406003193601126103885761118d611c84611cce565b6024359033612677565b34610388575f60031936011261038857610eca610eb6611dee565b90601f19601f602080948051918291828752018686015e5f8582860101520116010190565b600435906001600160a01b038216820361038857565b602435906001600160a01b038216820361038857565b6003196060910112610388576004356001600160a01b038116810361038857906024356001600160a01b0381168103610388579060443590565b90601f601f19910116810190811067ffffffffffffffff8211176108a357604052565b92919267ffffffffffffffff82116108a35760405191611d81601f8201601f191660200184611d34565b829481845281830111610388578281602093845f960137010152565b90600182811c92168015611de4575b6020831014611db757565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b91607f1691611dac565b604051905f8260105491611e0183611d9d565b8083529260018116908115611e865750600114611e27575b611e2592500383611d34565b565b5060105f90815290917f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6725b818310611e6a575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611e52565b60209250611e2594915060ff191682840152151560051b820101611e19565b604051905f82600e5491611eb883611d9d565b8083529260018116908115611e865750600114611edb57611e2592500383611d34565b50600e5f90815290917fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b818310611f1e575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611f06565b604051905f8260115491611f4d83611d9d565b8083529260018116908115611e865750600114611f7057611e2592500383611d34565b5060115f90815290917f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c685b818310611fb3575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492611f9b565b604051905f82600d5491611fe283611d9d565b8083529260018116908115611e86575060011461200557611e2592500383611d34565b50600d5f90815290917fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b818310612048575050906020611e2592820101611e19565b6020919350806001915483858901015201910190918492612030565b9080601f830112156103885781602061207f93359101611d57565b90565b9190600260135414612121576120a89260026013556120a18282612328565b50336124b0565b156120b7576001906001601355565b608460405162461bcd60e51b815260206004820152602160248201527f455243313336333a207472616e7366657220746f206e6f6e2d7265636569766560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152fd5b606460405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b9190820391821161217257565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b335f52601260205260405f205481156123245780156122e05780821161229c57335f525f6020528160405f20541061223257816121db91612165565b335f52601260205260405f20556121f281336125dc565b335f52601260205260405f205460405191825260208201527f798353030d4251a345706609acf9ea7527f2ace26f73150a098c0fae89e5886d60403392a2565b608460405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152fd5b606460405162461bcd60e51b815260206004820152601960248201527f526570617920616d6f756e7420657863656564732064656274000000000000006044820152fd5b606460405162461bcd60e51b815260206004820152601060248201527f4e6f206465627420746f207265706179000000000000000000000000000000006044820152fd5b5050565b906123339133612622565b600190565b6001600160a01b0382165f52600b60205260ff60405f205416612380576001600160a01b03165f5260016020526001600160a01b0360405f2091165f5260205260405f205490565b50505f1990565b9190820180921161217257565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480612487575b156123ef577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815261248160c082611d34565b51902090565b507f000000000000000000000000000000000000000000000000000000000000000046146123c6565b9190803b156125d3576001600160a01b035f81602095612518604051988997889687947f88a7ca5c0000000000000000000000000000000000000000000000000000000086523360048701521660248501526044840152608060648401526084830190611ca9565b0393165af15f9181612576575b5061252f57505f90565b7fffffffff00000000000000000000000000000000000000000000000000000000167f88a7ca5c000000000000000000000000000000000000000000000000000000001490565b9091506020813d6020116125cb575b8161259260209383611d34565b8101031261038857517fffffffff000000000000000000000000000000000000000000000000000000008116810361038857905f612525565b3d9150612585565b50505050600190565b906001600160a01b038216156125f6575f611e25926127df565b7f96c6fd1e000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b91906001600160a01b038316156125f6576001600160a01b0381161561264b57611e25926127df565b7fec442f05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b6001600160a01b0316908115612706576001600160a01b03169182156126da5760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591835f526001825260405f20855f5282528060405f2055604051908152a3565b7f94280d62000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b7fe602df05000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b91906001600160a01b03811690815f52600b60205260ff60405f2054166127675761275d9084612338565b925f19840361276d575b50505050565b8284106127ab576001600160a01b031680156127065781156126da575f52600160205260405f20905f5260205260405f20910390555f808080612767565b5082907ffb8f41b2000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffd5b91906001600160a01b03831615806128f9575b806128f0575b612806575b611e2592612c3b565b612821816001600160a01b03165f52601260205260405f2090565b548061282d57506127fd565b918161286c92938083115f146128e857945b61285a826001600160a01b03165f52601260205260405f2090565b612865878254612165565b9055612c3b565b81612875575050565b61287f82826125dc565b6001600160a01b03816128e36128c77f798353030d4251a345706609acf9ea7527f2ace26f73150a098c0fae89e5886d946001600160a01b03165f52601260205260405f2090565b5460405193849316958360209093929193604081019481520152565b0390a2565b50819461283f565b508115156127f8565b506001600160a01b03811615156127f2565b60ff811461296a5760ff811690601f8211612942576040519161292f604084611d34565b6020808452838101919036833783525290565b7fb3512b0c000000000000000000000000000000000000000000000000000000005f5260045ffd5b50604051600554815f61297c83611d9d565b80835292600181169081156129ff57506001146129a0575b61207f92500382611d34565b5060055f90815290917f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b8183106129e357505090602061207f92820101612994565b60209193508060019154838588010152019101909183926129cb565b6020925061207f94915060ff191682840152151560051b820101612994565b60ff8114612a425760ff811690601f8211612942576040519161292f604084611d34565b50604051600654815f612a5483611d9d565b80835292600181169081156129ff5750600114612a775761207f92500382611d34565b5060065f90815290917ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b818310612aba57505090602061207f92820101612994565b6020919350806001915483858801015201910190918392612aa2565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411612b58579160209360809260ff5f9560405194855216868401526040830152606082015282805260015afa15612b4d575f516001600160a01b03811615612b4357905f905f90565b505f906001905f90565b6040513d5f823e3d90fd5b5050505f9160039190565b6004811015612c0e5780612b75575050565b60018103612ba5577ff645eedf000000000000000000000000000000000000000000000000000000005f5260045ffd5b60028103612bd957507ffce698f7000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b600314612be35750565b7fd78bce0c000000000000000000000000000000000000000000000000000000005f5260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6001600160a01b03169081612cb45760206001600160a01b037fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92612c8286600254612387565b6002555b169384612c9f5780600254036002555b604051908152a3565b845f525f825260405f20818154019055612c96565b815f525f60205260405f2054838110612d06576001600160a01b037fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9285602093865f525f85520360405f2055612c86565b9190507fe450d38c000000000000000000000000000000000000000000000000000000005f5260045260245260445260645ffdfea2646970667358221220e5547380639544a70415454e7e6be2d7b81652dd79b625615c458a80c6c69c4464736f6c63430008210033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"` diff --git a/0.16.23/api/@aastar/dapp/classes/DVTClient.md b/0.16.23/api/@aastar/dapp/classes/DVTClient.md new file mode 100644 index 000000000..622a8903b --- /dev/null +++ b/0.16.23/api/@aastar/dapp/classes/DVTClient.md @@ -0,0 +1,74 @@ +Defined in: [packages/dapp/src/ui/index.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/dapp/src/ui/index.ts#L10) + +## Constructors + +### Constructor + +> **new DVTClient**(): `DVTClient` + +#### Returns + +`DVTClient` + +## Methods + +### registerValidator() + +> `static` **registerValidator**(`wallet`, `dvtAddr`, `blsPublicKey`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [packages/dapp/src/ui/index.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/dapp/src/ui/index.ts#L11) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `wallet` | \{ `account`: [`Account`](https://viem.sh/docs/index.html) \| `undefined`; `addChain`: (`args`) => `Promise`\<`void`\>; `batch?`: \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \}; `cacheTime`: `number`; `ccipRead?`: `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \}; `chain`: [`Chain`](https://viem.sh/docs/index.html) \| `undefined`; `deployContract`: \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `experimental_blockTag?`: [`BlockTag`](https://viem.sh/docs/index.html); `extend`: \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\>; `fillTransaction`: \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\>; `getAddresses`: () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\>; `getCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `getCapabilities`: \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\>; `getChainId`: () => `Promise`\<`number`\>; `getPermissions`: () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `key`: `string`; `name`: `string`; `pollingInterval`: `number`; `prepareAuthorization`: (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `prepareTransactionRequest`: \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[K\] \}\>; `request`: [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\>; `requestAddresses`: () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\>; `requestPermissions`: (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\>; `sendCalls`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\>; `sendCallsSync`: \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `sendRawTransaction`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `sendRawTransactionSync`: (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `sendTransaction`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `sendTransactionSync`: \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; `showCallsStatus`: (`parameters`) => `Promise`\<`void`\>; `signAuthorization`: (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\>; `signMessage`: (`args`) => `Promise`\<`` `0x${string}` ``\>; `signTransaction`: \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\>; `signTypedData`: \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `switchChain`: (`args`) => `Promise`\<`void`\>; `transport`: [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\>; `type`: `string`; `uid`: `string`; `waitForCallsStatus`: (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\>; `watchAsset`: (`args`) => `Promise`\<`boolean`\>; `writeContract`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\>; `writeContractSync`: \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\>; \} | - | +| `wallet.account` | [`Account`](https://viem.sh/docs/index.html) \| `undefined` | The Account of the Client. | +| `wallet.addChain` | (`args`) => `Promise`\<`void`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/addChain - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085) **Example** `import { createWalletClient, custom } from 'viem' import { optimism } from 'viem/chains' const client = createWalletClient({ transport: custom(window.ethereum), }) await client.addChain({ chain: optimism })` | +| `wallet.batch?` | \{ `multicall?`: `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \}; \} | Flags for batch settings. | +| `wallet.batch.multicall?` | `boolean` \| \{ `batchSize?`: `number`; `deployless?`: `boolean`; `wait?`: `number`; \} | Toggle to enable `eth_call` multicall aggregation. | +| `wallet.cacheTime` | `number` | Time (in ms) that cached data will remain in memory. | +| `wallet.ccipRead?` | `false` \| \{ `request?`: (`parameters`) => `Promise`\<`` `0x${string}` ``\>; \} | [CCIP Read](https://eips.ethereum.org/EIPS/eip-3668) configuration. | +| `wallet.chain` | [`Chain`](https://viem.sh/docs/index.html) \| `undefined` | Chain for the client. | +| `wallet.deployContract` | \<`abi`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Deploys a contract to the network, given bytecode and constructor arguments. - Docs: https://viem.sh/docs/contract/deployContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_deploying-contracts **Example** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ account: privateKeyToAccount('0x…'), chain: mainnet, transport: http(), }) const hash = await client.deployContract({ abi: [], account: '0x…, bytecode: '0x608060405260405161083e38038061083e833981016040819052610...', })` | +| `wallet.experimental_blockTag?` | [`BlockTag`](https://viem.sh/docs/index.html) | Default block tag to use for RPC requests. | +| `wallet.extend` | \<`client`\>(`fn`) => [`Client`](https://viem.sh/docs/index.html)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`, [`WalletRpcSchema`](https://viem.sh/docs/index.html), \{ \[K in string \| number \| symbol\]: client\[K\] \} & [`WalletActions`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\>\> | - | +| `wallet.fillTransaction` | \<`chainOverride`, `accountOverride`\>(`args`) => `Promise`\<[`FillTransactionReturnType`](https://viem.sh/docs/index.html)\<[`Chain`](https://viem.sh/docs/index.html) \| `undefined`, `chainOverride`\>\> | Fills a transaction request with the necessary fields to be signed over. - Docs: https://viem.sh/docs/actions/public/fillTransaction **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const result = await client.fillTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: parseEther('1'), })` | +| `wallet.getAddresses` | () => `Promise`\<[`GetAddressesReturnType`](https://viem.sh/docs/index.html)\> | Returns a list of account addresses owned by the wallet or client. - Docs: https://viem.sh/docs/actions/wallet/getAddresses - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.getAddresses()` | +| `wallet.getCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Returns the status of a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/getCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await client.getCallsStatus({ id: '0xdeadbeef' })` | +| `wallet.getCapabilities` | \<`chainId`\>(`parameters?`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (chainId extends number ? \{ atomic?: \{ status: "supported" \| "ready" \| "unsupported" \}; paymasterService?: \{ supported: boolean \}; unstable\_addSubAccount?: \{ keyTypes: ((...) \| (...) \| (...) \| (...))\[\]; supported: boolean \}; \[key: string\]: any \} : ChainIdToCapabilities\, number\>)\[K\] \}\> | Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc). - Docs: https://viem.sh/docs/actions/wallet/getCapabilities - JSON-RPC Methods: [`wallet_getCapabilities`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const capabilities = await client.getCapabilities({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `wallet.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 { createWalletClient, http } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const chainId = await client.getChainId() // 1` | +| `wallet.getPermissions` | () => `Promise`\<[`GetPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Gets the wallets current permissions. - Docs: https://viem.sh/docs/actions/wallet/getPermissions - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.getPermissions()` | +| `wallet.key` | `string` | A key for the client. | +| `wallet.name` | `string` | A name for the client. | +| `wallet.pollingInterval` | `number` | Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. | +| `wallet.prepareAuthorization` | (`parameters`) => `Promise`\<[`PrepareAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Prepares an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object for signing. This Action will fill the required fields of the Authorization object if they are not provided (e.g. `nonce` and `chainId`). With the prepared Authorization object, you can use [`signAuthorization`](https://viem.sh/docs/eip7702/signAuthorization) to sign over the Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const authorization = await client.prepareAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const authorization = await client.prepareAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `wallet.prepareTransactionRequest` | \<`request`, `chainOverride`, `accountOverride`\>(`args`) => `Promise`\<\{ \[K in string \| number \| symbol\]: (UnionRequiredBy\ & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)\> extends true ? unknown : ExactPartial\<(...)\>\> & \{ chainId?: number \}, ParameterTypeToParameters\\> & (unknown extends request\["kzg"\] ? \{\} : Pick\))\[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, })` | +| `wallet.request` | [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\<[`WalletRpcSchema`](https://viem.sh/docs/index.html)\> | Request function wrapped with friendly error handling | +| `wallet.requestAddresses` | () => `Promise`\<[`RequestAddressesReturnType`](https://viem.sh/docs/index.html)\> | Requests a list of accounts managed by a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestAddresses - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102) Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses). This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts. **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const accounts = await client.requestAddresses()` | +| `wallet.requestPermissions` | (`args`) => `Promise`\<[`RequestPermissionsReturnType`](https://viem.sh/docs/index.html)\> | Requests permissions for a wallet. - Docs: https://viem.sh/docs/actions/wallet/requestPermissions - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const permissions = await client.requestPermissions({ eth_accounts: {} })` | +| `wallet.sendCalls` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `capabilities?`: \{\[`key`: `string`\]: `any`; \}; `id`: `string`; \}\> | Requests the connected wallet to send a batch of calls. - Docs: https://viem.sh/docs/actions/wallet/sendCalls - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const id = await client.sendCalls({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `wallet.sendCallsSync` | \<`calls`, `chainOverride`\>(`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block. - Docs: https://viem.sh/docs/actions/wallet/sendCallsSync - JSON-RPC Methods: [`wallet_sendCalls`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const status = await client.sendCallsSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', calls: [ { data: '0xdeadbeef', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', }, { to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 69420n, }, ], })` | +| `wallet.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' })` | +| `wallet.sendRawTransactionSync` | (`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Sends a **signed** transaction to the network synchronously, and waits for the transaction to be included in a block. - 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' })` | +| `wallet.sendTransaction` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Creates, signs, and sends a new transaction to the network. - Docs: https://viem.sh/docs/actions/wallet/sendTransaction - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.sendTransaction({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const hash = await client.sendTransaction({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `wallet.sendTransactionSync` | \<`request`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/actions/wallet/sendTransactionSync - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions_sending-transactions - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction) - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction) **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.sendTransactionSync({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` `// 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: http(), }) const receipt = await client.sendTransactionSync({ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n, })` | +| `wallet.showCallsStatus` | (`parameters`) => `Promise`\<`void`\> | Requests for the wallet to show information about a call batch that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/showCallsStatus - JSON-RPC Methods: [`wallet_showCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.showCallsStatus({ id: '0xdeadbeef' })` | +| `wallet.signAuthorization` | (`parameters`) => `Promise`\<[`SignAuthorizationReturnType`](https://viem.sh/docs/index.html)\> | Signs an [EIP-7702 Authorization](https://eips.ethereum.org/EIPS/eip-7702) object. With the calculated signature, you can: - use [`verifyAuthorization`](https://viem.sh/docs/eip7702/verifyAuthorization) to verify the signed Authorization object, - use [`recoverAuthorizationAddress`](https://viem.sh/docs/eip7702/recoverAuthorizationAddress) to recover the signing address from the signed Authorization object. **Examples** `import { createWalletClient, http } from 'viem' import { privateKeyToAccount } from 'viem/accounts' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: http(), }) const signature = await client.signAuthorization({ account: privateKeyToAccount('0x..'), contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` `// 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: http(), }) const signature = await client.signAuthorization({ contractAddress: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', })` | +| `wallet.signMessage` | (`args`) => `Promise`\<`` `0x${string}` ``\> | Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signMessage - JSON-RPC Methods: - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign) - Local Accounts: Signs locally. No JSON-RPC request. With the calculated signature, you can: - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature, - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signMessage({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', message: 'hello world', })` `// 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: http(), }) const signature = await client.signMessage({ message: 'hello world', })` | +| `wallet.signTransaction` | \<`chainOverride`, `request`\>(`args`) => `Promise`\<[`TransactionSerialized`](https://viem.sh/docs/index.html)\<[`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\>, [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip1559"` ? `` `0x02${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip2930"` ? `` `0x01${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip4844"` ? `` `0x03${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"eip7702"` ? `` `0x04${string}` `` : `never` \| [`GetTransactionType`](https://viem.sh/docs/index.html)\<`request`, `request` *extends* [`LegacyProperties`](https://viem.sh/docs/index.html) ? `"legacy"` : `never` \| `request` *extends* [`EIP1559Properties`](https://viem.sh/docs/index.html) ? `"eip1559"` : `never` \| `request` *extends* [`EIP2930Properties`](https://viem.sh/docs/index.html) ? `"eip2930"` : `never` \| `request` *extends* [`EIP4844Properties`](https://viem.sh/docs/index.html) ? `"eip4844"` : `never` \| `request` *extends* [`EIP7702Properties`](https://viem.sh/docs/index.html) ? `"eip7702"` : `never` \| `request`\[`"type"`\] *extends* `string` \| `undefined` ? `Extract`\<`any`\[`any`\], `string`\> : `never`\> *extends* `"legacy"` ? [`TransactionSerializedLegacy`](https://viem.sh/docs/index.html) : `never`\>\> | Signs a transaction. - Docs: https://viem.sh/docs/actions/wallet/signTransaction - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/) - Local Accounts: Signs locally. No JSON-RPC request. **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, }) const signature = await client.signTransaction(request)` `// 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, }) const signature = await client.signTransaction(request)` | +| `wallet.signTypedData` | \<`typedData`, `primaryType`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`. - Docs: https://viem.sh/docs/actions/wallet/signTypedData - JSON-RPC Methods: - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4) - Local Accounts: Signs locally. No JSON-RPC request. **Examples** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const signature = await client.signTypedData({ account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` `// 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: http(), }) const signature = await client.signTypedData({ domain: { name: 'Ether Mail', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, types: { Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'address' }, ], Mail: [ { name: 'from', type: 'Person' }, { name: 'to', type: 'Person' }, { name: 'contents', type: 'string' }, ], }, primaryType: 'Mail', message: { from: { name: 'Cow', wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826', }, to: { name: 'Bob', wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB', }, contents: 'Hello, Bob!', }, })` | +| `wallet.switchChain` | (`args`) => `Promise`\<`void`\> | Switch the target chain in a wallet. - Docs: https://viem.sh/docs/actions/wallet/switchChain - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet, optimism } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) await client.switchChain({ id: optimism.id })` | +| `wallet.transport` | [`TransportConfig`](https://viem.sh/docs/index.html)\<`string`, [`EIP1193RequestFn`](https://viem.sh/docs/index.html)\> & `Record`\<`string`, `any`\> | The RPC transport | +| `wallet.type` | `string` | The type of client. | +| `wallet.uid` | `string` | A unique ID for the client. | +| `wallet.waitForCallsStatus` | (`parameters`) => `Promise`\<\{ `atomic`: `boolean`; `capabilities?`: \{\[`key`: `string`\]: `any`; \} \| \{\[`key`: `string`\]: `any`; \}; `chainId`: `number`; `id`: `string`; `receipts?`: [`WalletCallReceipt`](https://viem.sh/docs/index.html)\<`bigint`, `"success"` \| `"reverted"`\>[]; `status`: `"success"` \| `"pending"` \| `"failure"` \| `undefined`; `statusCode`: `number`; `version`: `string`; \}\> | Waits for the status & receipts of a call bundle that was sent via `sendCalls`. - Docs: https://viem.sh/docs/actions/wallet/waitForCallsStatus - JSON-RPC Methods: [`wallet_getCallsStatus`](https://eips.ethereum.org/EIPS/eip-5792) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { receipts, status } = await waitForCallsStatus(client, { id: '0xdeadbeef' })` | +| `wallet.watchAsset` | (`args`) => `Promise`\<`boolean`\> | Adds an EVM chain to the wallet. - Docs: https://viem.sh/docs/actions/wallet/watchAsset - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747) **Example** `import { createWalletClient, custom } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const success = await client.watchAsset({ type: 'ERC20', options: { address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', decimals: 18, symbol: 'WETH', }, })` | +| `wallet.writeContract` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<`` `0x${string}` ``\> | Executes a write function on a contract. - Docs: https://viem.sh/docs/contract/writeContract - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts_writing-to-contracts A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Examples** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const hash = await client.writeContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` `// With Validation import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const { request } = await client.simulateContract({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], } const hash = await client.writeContract(request)` | +| `wallet.writeContractSync` | \<`abi`, `functionName`, `args`, `chainOverride`\>(`args`) => `Promise`\<[`TransactionReceipt`](https://viem.sh/docs/index.html)\> | Executes a write function on a contract synchronously. Returns the transaction receipt. - Docs: https://viem.sh/docs/contract/writeContract A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state. Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData). __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__ **Example** `import { createWalletClient, custom, parseAbi } from 'viem' import { mainnet } from 'viem/chains' const client = createWalletClient({ chain: mainnet, transport: custom(window.ethereum), }) const receipt = await client.writeContractSync({ address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2', abi: parseAbi(['function mint(uint32 tokenId) nonpayable']), functionName: 'mint', args: [69420], })` | +| `dvtAddr` | `` `0x${string}` `` | - | +| `blsPublicKey` | `` `0x${string}` `` | - | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/dapp/functions/useCreditScore.md b/0.16.23/api/@aastar/dapp/functions/useCreditScore.md new file mode 100644 index 000000000..944ee91e2 --- /dev/null +++ b/0.16.23/api/@aastar/dapp/functions/useCreditScore.md @@ -0,0 +1,21 @@ +> **useCreditScore**(`__namedParameters`): `object` + +Defined in: [packages/dapp/src/ui/hooks/useCreditScore.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/dapp/src/ui/hooks/useCreditScore.ts#L14) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `__namedParameters` | `UseCreditScoreConfig` | + +## Returns + +`object` + +### creditLimit + +> **creditLimit**: `bigint` \| `null` + +### loading + +> **loading**: `boolean` diff --git a/0.16.23/api/@aastar/dapp/functions/useSuperPaymaster.md b/0.16.23/api/@aastar/dapp/functions/useSuperPaymaster.md new file mode 100644 index 000000000..87669d8af --- /dev/null +++ b/0.16.23/api/@aastar/dapp/functions/useSuperPaymaster.md @@ -0,0 +1,13 @@ +> **useSuperPaymaster**(`config`): `UseSuperPaymasterResult` + +Defined in: [packages/dapp/src/ui/hooks/useSuperPaymaster.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/dapp/src/ui/hooks/useSuperPaymaster.ts#L11) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`PaymasterConfig`](../../paymaster/type-aliases/PaymasterConfig.md) | + +## Returns + +`UseSuperPaymasterResult` diff --git a/0.16.23/api/@aastar/dapp/index.md b/0.16.23/api/@aastar/dapp/index.md new file mode 100644 index 000000000..3dd423e73 --- /dev/null +++ b/0.16.23/api/@aastar/dapp/index.md @@ -0,0 +1,8 @@ +## Classes + +- [DVTClient](classes/DVTClient.md) + +## Functions + +- [useCreditScore](functions/useCreditScore.md) +- [useSuperPaymaster](functions/useSuperPaymaster.md) diff --git a/0.16.23/api/@aastar/enduser/classes/CommunityClient.md b/0.16.23/api/@aastar/enduser/classes/CommunityClient.md new file mode 100644 index 000000000..89e69197b --- /dev/null +++ b/0.16.23/api/@aastar/enduser/classes/CommunityClient.md @@ -0,0 +1,445 @@ +Defined in: [enduser/src/CommunityClient.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L27) + +Client for Community Managers (`ROLE_COMMUNITY`) + +## Extends + +- [`BaseClient`](../../core/classes/BaseClient.md) + +## Constructors + +### Constructor + +> **new CommunityClient**(`config`): `CommunityClient` + +Defined in: [enduser/src/CommunityClient.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L32) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`CommunityClientConfig`](../interfaces/CommunityClientConfig.md) | + +#### Returns + +`CommunityClient` + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`constructor`](../../core/classes/BaseClient.md#constructor) + +## Properties + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`client`](../../core/classes/BaseClient.md#client) + +*** + +### entryPointAddress? + +> `protected` `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:11 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`entryPointAddress`](../../core/classes/BaseClient.md#entrypointaddress) + +*** + +### factoryAddress? + +> `optional` **factoryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L29) + +*** + +### gTokenAddress? + +> `protected` `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:8 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenAddress`](../../core/classes/BaseClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `protected` `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:9 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenStakingAddress`](../../core/classes/BaseClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`paymasterFactoryAddress`](../../core/classes/BaseClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`publicClient`](../../core/classes/BaseClient.md#publicclient) + +*** + +### registryAddress? + +> `protected` `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:7 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`registryAddress`](../../core/classes/BaseClient.md#registryaddress) + +*** + +### reputationAddress? + +> `optional` **reputationAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L30) + +*** + +### sbtAddress? + +> `optional` **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L28) + +## Methods + +### airdropSBT() + +> **airdropSBT**(`users`, `roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:285](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L285) + +Airdrop SBTs to users to make them members + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `users` | `` `0x${string}` ``[] | +| `roleId` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### createCommunityToken() + +> **createCommunityToken**(`params`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L50) + +Create a new Community Token (xPNTs) and register it. +Note: In the current architecture, creating a community often involves: +1. Registering the ROLE_COMMUNITY on Registry (if not exists) -> usually manual or self-register +2. Deploying a Token (xPNTs) via Factory +3. Linking the Token to the Community in Registry + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | [`CreateCommunityParams`](../interfaces/CreateCommunityParams.md) | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getAddress`](../../core/classes/BaseClient.md#getaddress) + +*** + +### getCommunityInfo() + +> **getCommunityInfo**(`communityAddress?`): `Promise`\<\{ `description`: `string`; `ensName`: `string`; `logoURI`: `string`; `name`: `string`; `stakeAmount`: `bigint`; `website`: `string`; \}\> + +Defined in: [enduser/src/CommunityClient.ts:76](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L76) + +Get Community Details (Decodes Role Metadata) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `communityAddress?` | `` `0x${string}` `` | The address of the community manager (defaults to self) | + +#### Returns + +`Promise`\<\{ `description`: `string`; `ensName`: `string`; `logoURI`: `string`; `name`: `string`; `stakeAmount`: `bigint`; `website`: `string`; \}\> + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getStartPublicClient`](../../core/classes/BaseClient.md#getstartpublicclient) + +*** + +### registerAsCommunity() + +> **registerAsCommunity**(`params`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:142](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L142) + +Register self as a Community Manager. +This method handles all necessary steps: +1. Checks and approves GToken to GTokenStaking +2. Encodes CommunityRoleData with provided parameters +3. Calls registerRoleSelf on Registry + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params` | \{ `description?`: `string`; `ensName?`: `string`; `logoURI?`: `string`; `name`: `string`; `stakeAmount?`: `bigint`; `website?`: `string`; \} | Community registration parameters | +| `params.description?` | `string` | - | +| `params.ensName?` | `string` | - | +| `params.logoURI?` | `string` | - | +| `params.name?` | `string` | - | +| `params.stakeAmount?` | `bigint` | - | +| `params.website?` | `string` | - | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | Transaction options | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireEntryPoint`](../../core/classes/BaseClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGToken`](../../core/classes/BaseClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGTokenStaking`](../../core/classes/BaseClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requirePaymasterFactory`](../../core/classes/BaseClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireRegistry`](../../core/classes/BaseClient.md#requireregistry) + +*** + +### revokeMembership() + +> **revokeMembership**(`userAddr`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:336](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L336) + +Revoke membership (Burn SBT) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `userAddr` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### setReputationRule() + +> **setReputationRule**(`ruleId`, `ruleConfig`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:312](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L312) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `ruleId` | `bigint` | +| `ruleConfig` | `any` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### setupCommunity() + +> **setupCommunity**(`params`, `options?`): `Promise`\<\{ `hashes`: `` `0x${string}` ``[]; `tokenAddress`: `` `0x${string}` ``; \}\> + +Defined in: [enduser/src/CommunityClient.ts:210](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L210) + +One-click Setup: Register Community + Deploy Token +Orchestrates the complete community initialization flow. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `description?`: `string`; `logoURI?`: `string`; `name`: `string`; `stakeAmount?`: `bigint`; `tokenName`: `string`; `tokenSymbol`: `string`; `website?`: `string`; \} | +| `params.description?` | `string` | +| `params.logoURI?` | `string` | +| `params.name?` | `string` | +| `params.stakeAmount?` | `bigint` | +| `params.tokenName?` | `string` | +| `params.tokenSymbol?` | `string` | +| `params.website?` | `string` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<\{ `hashes`: `` `0x${string}` ``[]; `tokenAddress`: `` `0x${string}` ``; \}\> + +*** + +### transferCommunityTokenOwnership() + +> **transferCommunityTokenOwnership**(`tokenAddress`, `newOwner`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/CommunityClient.ts:353](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L353) + +Transfer ownership of the Community Token + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `tokenAddress` | `` `0x${string}` `` | +| `newOwner` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/enduser/classes/UserClient.md b/0.16.23/api/@aastar/enduser/classes/UserClient.md new file mode 100644 index 000000000..c186c6a75 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/classes/UserClient.md @@ -0,0 +1,583 @@ +Defined in: [enduser/src/UserClient.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L17) + +## Extends + +- [`BaseClient`](../../core/classes/BaseClient.md) + +## Constructors + +### Constructor + +> **new UserClient**(`config`): `UserClient` + +Defined in: [enduser/src/UserClient.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`UserClientConfig`](../interfaces/UserClientConfig.md) | + +#### Returns + +`UserClient` + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`constructor`](../../core/classes/BaseClient.md#constructor) + +## Properties + +### accountAddress + +> **accountAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L18) + +*** + +### bundlerClient? + +> `optional` **bundlerClient**: `any` + +Defined in: [enduser/src/UserClient.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L24) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`client`](../../core/classes/BaseClient.md#client) + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L20) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`entryPointAddress`](../../core/classes/BaseClient.md#entrypointaddress) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L23) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenAddress`](../../core/classes/BaseClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L21) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenStakingAddress`](../../core/classes/BaseClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`paymasterFactoryAddress`](../../core/classes/BaseClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`publicClient`](../../core/classes/BaseClient.md#publicclient) + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L22) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`registryAddress`](../../core/classes/BaseClient.md#registryaddress) + +*** + +### sbtAddress? + +> `optional` **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L19) + +## Methods + +### execute() + +> **execute**(`target`, `value`, `data`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:155](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L155) + +Execute a transaction from the AA account + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `target` | `` `0x${string}` `` | +| `value` | `bigint` | +| `data` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### executeBatch() + +> **executeBatch**(`targets`, `values`, `datas`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:174](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L174) + +Execute a batch of transactions + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `targets` | `` `0x${string}` ``[] | +| `values` | `bigint`[] | +| `datas` | `` `0x${string}` ``[] | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### executeGasless() + +> **executeGasless**(`params`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:441](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L441) + +Execute a transaction with Gasless Sponsorship + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `data`: `` `0x${string}` ``; `maxRate?`: `bigint`; `operator?`: `` `0x${string}` ``; `paymaster`: `` `0x${string}` ``; `paymasterType`: `"V4"` \| `"Super"`; `target`: `` `0x${string}` ``; `value`: `bigint`; \} | +| `params.data` | `` `0x${string}` `` | +| `params.maxRate?` | `bigint` | +| `params.operator?` | `` `0x${string}` `` | +| `params.paymaster?` | `` `0x${string}` `` | +| `params.paymasterType?` | `"V4"` \| `"Super"` | +| `params.target?` | `` `0x${string}` `` | +| `params.value?` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### exitRole() + +> **exitRole**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:320](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L320) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getAddress`](../../core/classes/BaseClient.md#getaddress) + +*** + +### getNonce() + +> **getNonce**(`key`): `Promise`\<`bigint`\> + +Defined in: [enduser/src/UserClient.ts:125](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L125) + +Get the nonce of the account from EntryPoint (more reliable for 4337) + +#### Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `key` | `bigint` | `0n` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getOwner() + +> **getOwner**(): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:143](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L143) + +Get the owner of the AA account + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getSBTBalance() + +> **getSBTBalance**(): `Promise`\<`bigint`\> + +Defined in: [enduser/src/UserClient.ts:196](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L196) + +Get user's SBT balance + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getStakedBalance() + +> **getStakedBalance**(`roleId`): `Promise`\<`bigint`\> + +Defined in: [enduser/src/UserClient.ts:302](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L302) + +Get staked balance for a specific role + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getStartPublicClient`](../../core/classes/BaseClient.md#getstartpublicclient) + +*** + +### getTokenBalance() + +> **getTokenBalance**(`token`): `Promise`\<`bigint`\> + +Defined in: [enduser/src/UserClient.ts:248](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L248) + +Get Token Balance + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### leaveCommunity() + +> **leaveCommunity**(`community`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:337](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L337) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `community` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### mintSBT() + +> **mintSBT**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:209](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L209) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### registerAsEndUser() + +> **registerAsEndUser**(`communityAddress`, `stakeAmount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:358](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L358) + +Register as EndUser (One-click: Approve + Register) +Handles GToken approval to Staking contract and Role registration. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `communityAddress` | `` `0x${string}` `` | +| `stakeAmount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireEntryPoint`](../../core/classes/BaseClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGToken`](../../core/classes/BaseClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGTokenStaking`](../../core/classes/BaseClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requirePaymasterFactory`](../../core/classes/BaseClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireRegistry`](../../core/classes/BaseClient.md#requireregistry) + +*** + +### stakeForRole() + +> **stakeForRole**(`roleId`, `amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:265](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L265) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### transferToken() + +> **transferToken**(`token`, `to`, `amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:230](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L230) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | +| `to` | `` `0x${string}` `` | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### unstakeFromRole() + +> **unstakeFromRole**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserClient.ts:282](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L282) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### deployAccount() + +> `static` **deployAccount**(`client`, `params`): `Promise`\<\{ `accountAddress`: `` `0x${string}` ``; `hash`: `` `0x${string}` ``; \}\> + +Defined in: [enduser/src/UserClient.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L45) + +Deploy a new Smart Account (Supports multiple factory types) +Static helper to facilitate onboarding before instantiating the UserClient. + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `client` | `any` | WalletClient to sign the deployment transaction | +| `params` | \{ `accountType?`: `string`; `customAbi?`: `any`; `factoryAddress?`: `` `0x${string}` ``; `owner`: `` `0x${string}` ``; `publicClient?`: `any`; `salt?`: `bigint`; \} | Deployment parameters | +| `params.accountType?` | `string` | - | +| `params.customAbi?` | `any` | - | +| `params.factoryAddress?` | `` `0x${string}` `` | - | +| `params.owner` | `` `0x${string}` `` | - | +| `params.publicClient?` | `any` | - | +| `params.salt?` | `bigint` | - | + +#### Returns + +`Promise`\<\{ `accountAddress`: `` `0x${string}` ``; `hash`: `` `0x${string}` ``; \}\> + +Object containing the deployed account address and transaction hash diff --git a/0.16.23/api/@aastar/enduser/classes/UserLifecycle.md b/0.16.23/api/@aastar/enduser/classes/UserLifecycle.md new file mode 100644 index 000000000..14b2b6223 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/classes/UserLifecycle.md @@ -0,0 +1,451 @@ +Defined in: [enduser/src/UserLifecycle.ts:40](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L40) + +UserLifecycle - L3 Pattern + +Responsibilities: +1. Managing the complete lifecycle of an End User (Onboard -> Operate -> Exit) +2. Providing a unified interface for Gasless operations +3. Abstracting underlying contract interactions via L2 Actions + +## Extends + +- [`BaseClient`](../../core/classes/BaseClient.md) + +## Constructors + +### Constructor + +> **new UserLifecycle**(`config`): `UserLifecycle` + +Defined in: [enduser/src/UserLifecycle.ts:51](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L51) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`UserLifecycleConfig`](../interfaces/UserLifecycleConfig.md) | + +#### Returns + +`UserLifecycle` + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`constructor`](../../core/classes/BaseClient.md#constructor) + +## Properties + +### accountAddress + +> **accountAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L41) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`client`](../../core/classes/BaseClient.md#client) + +*** + +### config + +> **config**: [`UserLifecycleConfig`](../interfaces/UserLifecycleConfig.md) + +Defined in: [enduser/src/UserLifecycle.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L49) + +*** + +### entryPointAddress + +> **entryPointAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:46](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L46) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`entryPointAddress`](../../core/classes/BaseClient.md#entrypointaddress) + +*** + +### gaslessConfig? + +> `optional` **gaslessConfig**: [`GaslessConfig`](../interfaces/GaslessConfig.md) + +Defined in: [enduser/src/UserLifecycle.ts:47](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L47) + +*** + +### gTokenAddress + +> **gTokenAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L44) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenAddress`](../../core/classes/BaseClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress + +> **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:45](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L45) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenStakingAddress`](../../core/classes/BaseClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`paymasterFactoryAddress`](../../core/classes/BaseClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`publicClient`](../../core/classes/BaseClient.md#publicclient) + +*** + +### registryAddress + +> **registryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L42) + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`registryAddress`](../../core/classes/BaseClient.md#registryaddress) + +*** + +### sbtAddress + +> **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:43](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L43) + +## Methods + +### checkEligibility() + +> **checkEligibility**(`community`): `Promise`\<`boolean`\> + +Defined in: [enduser/src/UserLifecycle.ts:71](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L71) + +Check if user is eligible to join a community + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `community` | `` `0x${string}` `` | Address of the community | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### claimSBT() + +> **claimSBT**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserLifecycle.ts:170](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L170) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### enableGasless() + +> **enableGasless**(`config`): `Promise`\<`void`\> + +Defined in: [enduser/src/UserLifecycle.ts:123](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L123) + +Enable or update Gasless configuration + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`GaslessConfig`](../interfaces/GaslessConfig.md) | + +#### Returns + +`Promise`\<`void`\> + +*** + +### executeGaslessTx() + +> **executeGaslessTx**(`params`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserLifecycle.ts:135](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L135) + +Execute a transaction effectively using Gasless configuration if available + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `data`: `` `0x${string}` ``; `operator?`: `` `0x${string}` ``; `target`: `` `0x${string}` ``; `value`: `bigint`; \} | +| `params.data` | `` `0x${string}` `` | +| `params.operator?` | `` `0x${string}` `` | +| `params.target` | `` `0x${string}` `` | +| `params.value` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### exitRole() + +> **exitRole**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserLifecycle.ts:217](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L217) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getAddress`](../../core/classes/BaseClient.md#getaddress) + +*** + +### getCreditLimit() + +> **getCreditLimit**(): `Promise`\<`bigint`\> + +Defined in: [enduser/src/UserLifecycle.ts:199](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L199) + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getMyReputation() + +> **getMyReputation**(): `Promise`\<[`ReputationData`](../interfaces/ReputationData.md)\> + +Defined in: [enduser/src/UserLifecycle.ts:183](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L183) + +#### Returns + +`Promise`\<[`ReputationData`](../interfaces/ReputationData.md)\> + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> \| [`PublicClient`](../../core/interfaces/PublicClient.md) + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getStartPublicClient`](../../core/classes/BaseClient.md#getstartpublicclient) + +*** + +### leaveCommunity() + +> **leaveCommunity**(`community`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserLifecycle.ts:208](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L208) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `community` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### onboard() + +> **onboard**(`community`, `stakeAmount`): `Promise`\<[`OnboardResult`](../interfaces/OnboardResult.md)\> + +Defined in: [enduser/src/UserLifecycle.ts:84](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L84) + +One-click Onboarding: Approve -> Stake -> Register -> Mint SBT + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `community` | `` `0x${string}` `` | Address of the community to join | +| `stakeAmount` | `bigint` | Amount of GToken to stake (default 0.4 GT) | + +#### Returns + +`Promise`\<[`OnboardResult`](../interfaces/OnboardResult.md)\> + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireEntryPoint`](../../core/classes/BaseClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGToken`](../../core/classes/BaseClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGTokenStaking`](../../core/classes/BaseClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requirePaymasterFactory`](../../core/classes/BaseClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireRegistry`](../../core/classes/BaseClient.md#requireregistry) + +*** + +### unstakeAll() + +> **unstakeAll**(`roleId`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [enduser/src/UserLifecycle.ts:226](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L226) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `roleId` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/enduser/index.md b/0.16.23/api/@aastar/enduser/index.md new file mode 100644 index 000000000..23187f0b3 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/index.md @@ -0,0 +1,16 @@ +## Classes + +- [CommunityClient](classes/CommunityClient.md) +- [UserClient](classes/UserClient.md) +- [UserLifecycle](classes/UserLifecycle.md) + +## Interfaces + +- [CommunityClientConfig](interfaces/CommunityClientConfig.md) +- [CommunityInfo](interfaces/CommunityInfo.md) +- [CreateCommunityParams](interfaces/CreateCommunityParams.md) +- [GaslessConfig](interfaces/GaslessConfig.md) +- [OnboardResult](interfaces/OnboardResult.md) +- [ReputationData](interfaces/ReputationData.md) +- [UserClientConfig](interfaces/UserClientConfig.md) +- [UserLifecycleConfig](interfaces/UserLifecycleConfig.md) diff --git a/0.16.23/api/@aastar/enduser/interfaces/CommunityClientConfig.md b/0.16.23/api/@aastar/enduser/interfaces/CommunityClientConfig.md new file mode 100644 index 000000000..8826abf4f --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/CommunityClientConfig.md @@ -0,0 +1,159 @@ +Defined in: [enduser/src/CommunityClient.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L5) + +Base configuration for all L2 Business Clients + +## Extends + +- [`ClientConfig`](../../core/interfaces/ClientConfig.md) + +## Properties + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/types.d.ts:11 + +Viem WalletClient for write operations. +Must have an account attached. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`client`](../../core/interfaces/ClientConfig.md#client) + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:41 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`entryPointAddress`](../../core/interfaces/ClientConfig.md#entrypointaddress) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:40 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`ethUsdPriceFeedAddress`](../../core/interfaces/ClientConfig.md#ethusdpricefeedaddress) + +*** + +### factoryAddress? + +> `optional` **factoryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L7) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:28 + +GToken contract address. +Required for operations involving token approvals and transfers. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenAddress`](../../core/interfaces/ClientConfig.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:33 + +GTokenStaking contract address. +Required for role registration that involves staking. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenStakingAddress`](../../core/interfaces/ClientConfig.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:38 + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`paymasterFactoryAddress`](../../core/interfaces/ClientConfig.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/types.d.ts:18 + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`publicClient`](../../core/interfaces/ClientConfig.md#publicclient) + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:23 + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`registryAddress`](../../core/interfaces/ClientConfig.md#registryaddress) + +*** + +### reputationAddress? + +> `optional` **reputationAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L8) + +*** + +### sbtAddress? + +> `optional` **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L6) + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:39 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`xpntsFactoryAddress`](../../core/interfaces/ClientConfig.md#xpntsfactoryaddress) diff --git a/0.16.23/api/@aastar/enduser/interfaces/CommunityInfo.md b/0.16.23/api/@aastar/enduser/interfaces/CommunityInfo.md new file mode 100644 index 000000000..137aa5ba3 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/CommunityInfo.md @@ -0,0 +1,9 @@ +Defined in: [enduser/src/CommunityClient.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L18) + +## Properties + +### address + +> **address**: `` `0x${string}` `` + +Defined in: [enduser/src/CommunityClient.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L19) diff --git a/0.16.23/api/@aastar/enduser/interfaces/CreateCommunityParams.md b/0.16.23/api/@aastar/enduser/interfaces/CreateCommunityParams.md new file mode 100644 index 000000000..a460156e3 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/CreateCommunityParams.md @@ -0,0 +1,33 @@ +Defined in: [enduser/src/CommunityClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L11) + +## Properties + +### description? + +> `optional` **description**: `string` + +Defined in: [enduser/src/CommunityClient.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L15) + +*** + +### ensName? + +> `optional` **ensName**: `string` + +Defined in: [enduser/src/CommunityClient.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L14) + +*** + +### name + +> **name**: `string` + +Defined in: [enduser/src/CommunityClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L12) + +*** + +### tokenSymbol + +> **tokenSymbol**: `string` + +Defined in: [enduser/src/CommunityClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/CommunityClient.ts#L13) diff --git a/0.16.23/api/@aastar/enduser/interfaces/GaslessConfig.md b/0.16.23/api/@aastar/enduser/interfaces/GaslessConfig.md new file mode 100644 index 000000000..727c46018 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/GaslessConfig.md @@ -0,0 +1,17 @@ +Defined in: [enduser/src/UserLifecycle.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L5) + +## Properties + +### paymasterUrl + +> **paymasterUrl**: `string` + +Defined in: [enduser/src/UserLifecycle.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L6) + +*** + +### policy? + +> `optional` **policy**: `"CREDIT"` \| `"TOKEN"` \| `"SPONSORED"` + +Defined in: [enduser/src/UserLifecycle.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L7) diff --git a/0.16.23/api/@aastar/enduser/interfaces/OnboardResult.md b/0.16.23/api/@aastar/enduser/interfaces/OnboardResult.md new file mode 100644 index 000000000..e651bc69f --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/OnboardResult.md @@ -0,0 +1,25 @@ +Defined in: [enduser/src/UserLifecycle.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L20) + +## Properties + +### sbtId? + +> `optional` **sbtId**: `bigint` + +Defined in: [enduser/src/UserLifecycle.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L22) + +*** + +### success + +> **success**: `boolean` + +Defined in: [enduser/src/UserLifecycle.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L21) + +*** + +### txHash? + +> `optional` **txHash**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L23) diff --git a/0.16.23/api/@aastar/enduser/interfaces/ReputationData.md b/0.16.23/api/@aastar/enduser/interfaces/ReputationData.md new file mode 100644 index 000000000..f31c524e4 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/ReputationData.md @@ -0,0 +1,25 @@ +Defined in: [enduser/src/UserLifecycle.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L26) + +## Properties + +### creditLimit + +> **creditLimit**: `bigint` + +Defined in: [enduser/src/UserLifecycle.ts:29](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L29) + +*** + +### level + +> **level**: `bigint` + +Defined in: [enduser/src/UserLifecycle.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L28) + +*** + +### score + +> **score**: `bigint` + +Defined in: [enduser/src/UserLifecycle.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L27) diff --git a/0.16.23/api/@aastar/enduser/interfaces/UserClientConfig.md b/0.16.23/api/@aastar/enduser/interfaces/UserClientConfig.md new file mode 100644 index 000000000..7668184b1 --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/UserClientConfig.md @@ -0,0 +1,167 @@ +Defined in: [enduser/src/UserClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L6) + +Base configuration for all L2 Business Clients + +## Extends + +- [`ClientConfig`](../../core/interfaces/ClientConfig.md) + +## Properties + +### accountAddress + +> **accountAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L7) + +*** + +### bundlerClient? + +> `optional` **bundlerClient**: `any` + +Defined in: [enduser/src/UserClient.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L14) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/types.d.ts:11 + +Viem WalletClient for write operations. +Must have an account attached. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`client`](../../core/interfaces/ClientConfig.md#client) + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L9) + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`entryPointAddress`](../../core/interfaces/ClientConfig.md#entrypointaddress) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:40 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`ethUsdPriceFeedAddress`](../../core/interfaces/ClientConfig.md#ethusdpricefeedaddress) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L13) + +GToken contract address. +Required for operations involving token approvals and transfers. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenAddress`](../../core/interfaces/ClientConfig.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L11) + +GTokenStaking contract address. +Required for role registration that involves staking. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenStakingAddress`](../../core/interfaces/ClientConfig.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:38 + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`paymasterFactoryAddress`](../../core/interfaces/ClientConfig.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/types.d.ts:18 + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`publicClient`](../../core/interfaces/ClientConfig.md#publicclient) + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L12) + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`registryAddress`](../../core/interfaces/ClientConfig.md#registryaddress) + +*** + +### sbtAddress? + +> `optional` **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L8) + +*** + +### superPaymasterAddress? + +> `optional` **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserClient.ts#L10) + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:39 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`xpntsFactoryAddress`](../../core/interfaces/ClientConfig.md#xpntsfactoryaddress) diff --git a/0.16.23/api/@aastar/enduser/interfaces/UserLifecycleConfig.md b/0.16.23/api/@aastar/enduser/interfaces/UserLifecycleConfig.md new file mode 100644 index 000000000..1bde7b19f --- /dev/null +++ b/0.16.23/api/@aastar/enduser/interfaces/UserLifecycleConfig.md @@ -0,0 +1,159 @@ +Defined in: [enduser/src/UserLifecycle.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L10) + +Base configuration for all L2 Business Clients + +## Extends + +- [`ClientConfig`](../../core/interfaces/ClientConfig.md) + +## Properties + +### accountAddress + +> **accountAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L11) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/types.d.ts:11 + +Viem WalletClient for write operations. +Must have an account attached. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`client`](../../core/interfaces/ClientConfig.md#client) + +*** + +### entryPointAddress + +> **entryPointAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L16) + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`entryPointAddress`](../../core/interfaces/ClientConfig.md#entrypointaddress) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:40 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`ethUsdPriceFeedAddress`](../../core/interfaces/ClientConfig.md#ethusdpricefeedaddress) + +*** + +### gasless? + +> `optional` **gasless**: [`GaslessConfig`](GaslessConfig.md) + +Defined in: [enduser/src/UserLifecycle.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L17) + +*** + +### gTokenAddress + +> **gTokenAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L14) + +GToken contract address. +Required for operations involving token approvals and transfers. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenAddress`](../../core/interfaces/ClientConfig.md#gtokenaddress) + +*** + +### gTokenStakingAddress + +> **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L15) + +GTokenStaking contract address. +Required for role registration that involves staking. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenStakingAddress`](../../core/interfaces/ClientConfig.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:38 + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`paymasterFactoryAddress`](../../core/interfaces/ClientConfig.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/types.d.ts:18 + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`publicClient`](../../core/interfaces/ClientConfig.md#publicclient) + +*** + +### registryAddress + +> **registryAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L12) + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +#### Overrides + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`registryAddress`](../../core/interfaces/ClientConfig.md#registryaddress) + +*** + +### sbtAddress + +> **sbtAddress**: `` `0x${string}` `` + +Defined in: [enduser/src/UserLifecycle.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/enduser/src/UserLifecycle.ts#L13) + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:39 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`xpntsFactoryAddress`](../../core/interfaces/ClientConfig.md#xpntsfactoryaddress) diff --git a/0.16.23/api/@aastar/identity/classes/ReputationClient.md b/0.16.23/api/@aastar/identity/classes/ReputationClient.md new file mode 100644 index 000000000..499f85904 --- /dev/null +++ b/0.16.23/api/@aastar/identity/classes/ReputationClient.md @@ -0,0 +1,137 @@ +Defined in: [index.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L7) + +## Constructors + +### Constructor + +> **new ReputationClient**(`client`, `reputationAddress`, `walletClient?`): `ReputationClient` + +Defined in: [index.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L17) + +Initialize ReputationClient + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `client` | [`PublicClient`](../../core/interfaces/PublicClient.md) | The public client for queries | +| `reputationAddress` | `` `0x${string}` `` | The address of the reputation system contract | +| `walletClient?` | [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> | Optional wallet client for write operations | + +#### Returns + +`ReputationClient` + +## Methods + +### computeScore() + +> **computeScore**(`user`, `communities`, `ruleIds`, `activities`): `Promise`\<`bigint`\> + +Defined in: [index.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L28) + +Compute reputation score for a user + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `user` | `` `0x${string}` `` | +| `communities` | `` `0x${string}` ``[] | +| `ruleIds` | `` `0x${string}` ``[][] | +| `activities` | `bigint`[][] | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getCreditLimit() + +> **getCreditLimit**(`user`): `Promise`\<`bigint`\> + +Defined in: [index.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L58) + +Get credit limit based on reputation + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `user` | `` `0x${string}` `` | User address | + +#### Returns + +`Promise`\<`bigint`\> + +Credit limit in wei (Mock logic closely tied to Reputation) + +*** + +### getGlobalReputation() + +> **getGlobalReputation**(`user`): `Promise`\<`number`\> + +Defined in: [index.ts:42](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L42) + +Get global reputation score for a user + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `user` | `` `0x${string}` `` | User address | + +#### Returns + +`Promise`\<`number`\> + +Reputation score + +*** + +### getReputationBreakdown() + +> **getReputationBreakdown**(`user`): `Promise`\<\{ `activityBonus`: `number`; `baseScore`: `number`; `penaltyDeduction`: `number`; `stakingBonus`: `number`; `total`: `number`; \}\> + +Defined in: [index.ts:77](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L77) + +Get reputation score breakdown + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `user` | `` `0x${string}` `` | User address | + +#### Returns + +`Promise`\<\{ `activityBonus`: `number`; `baseScore`: `number`; `penaltyDeduction`: `number`; `stakingBonus`: `number`; `total`: `number`; \}\> + +Detailed reputation breakdown (Mock implementation awaiting contract V4) + +*** + +### submitReputationProof() + +> **submitReputationProof**(`params`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/index.ts#L101) + +Submit reputation proof (off-chain data to on-chain) + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params` | \{ `proofData`: `string`; `proofType`: `"github"` \| `"twitter"` \| `"on-chain-activity"`; `signature`: `` `0x${string}` ``; \} | Proof parameters | +| `params.proofData` | `string` | - | +| `params.proofType` | `"github"` \| `"twitter"` \| `"on-chain-activity"` | - | +| `params.signature` | `` `0x${string}` `` | - | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash diff --git a/0.16.23/api/@aastar/identity/functions/checkMySBT.md b/0.16.23/api/@aastar/identity/functions/checkMySBT.md new file mode 100644 index 000000000..a5c16fb80 --- /dev/null +++ b/0.16.23/api/@aastar/identity/functions/checkMySBT.md @@ -0,0 +1,17 @@ +> **checkMySBT**(`client`, `sbtAddress`, `user`): `Promise`\<\{ `balance?`: `bigint`; `hasSBT`: `boolean`; \}\> + +Defined in: [mysbt.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/mysbt.ts#L8) + +Check if user holds MySBT token (identity verification). + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `sbtAddress` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | + +## Returns + +`Promise`\<\{ `balance?`: `bigint`; `hasSBT`: `boolean`; \}\> diff --git a/0.16.23/api/@aastar/identity/functions/getMySBTId.md b/0.16.23/api/@aastar/identity/functions/getMySBTId.md new file mode 100644 index 000000000..5cfaecd26 --- /dev/null +++ b/0.16.23/api/@aastar/identity/functions/getMySBTId.md @@ -0,0 +1,18 @@ +> **getMySBTId**(`client`, `sbtAddress`, `user`): `Promise`\<`bigint` \| `null`\> + +Defined in: [mysbt.ts:35](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/identity/src/mysbt.ts#L35) + +Fetch MySBT token ID for a specific user (if unique/SBT). +Note: Depends on whether the contract supports getTokenId or similar. + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `sbtAddress` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | + +## Returns + +`Promise`\<`bigint` \| `null`\> diff --git a/0.16.23/api/@aastar/identity/index.md b/0.16.23/api/@aastar/identity/index.md new file mode 100644 index 000000000..350c4441c --- /dev/null +++ b/0.16.23/api/@aastar/identity/index.md @@ -0,0 +1,8 @@ +## Classes + +- [ReputationClient](classes/ReputationClient.md) + +## Functions + +- [checkMySBT](functions/checkMySBT.md) +- [getMySBTId](functions/getMySBTId.md) diff --git a/0.16.23/api/@aastar/operator/classes/OperatorLifecycle.md b/0.16.23/api/@aastar/operator/classes/OperatorLifecycle.md new file mode 100644 index 000000000..03ab2aca4 --- /dev/null +++ b/0.16.23/api/@aastar/operator/classes/OperatorLifecycle.md @@ -0,0 +1,689 @@ +Defined in: [operator/src/OperatorLifecycle.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L19) + +OperatorLifecycle - L3 Pattern + +Responsibilities: +1. Managing the complete lifecycle of a Paymaster Operator +2. Unifying setup (onboard), operation (config), and exit (withdraw) + +## Extends + +- [`PaymasterOperatorClient`](PaymasterOperatorClient.md) + +## Constructors + +### Constructor + +> **new OperatorLifecycle**(`config`): `OperatorLifecycle` + +Defined in: [operator/src/OperatorLifecycle.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L21) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`OperatorClientConfig`](../interfaces/OperatorClientConfig.md) | + +#### Returns + +`OperatorLifecycle` + +#### Overrides + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`constructor`](PaymasterOperatorClient.md#constructor) + +## Properties + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`client`](PaymasterOperatorClient.md#client) + +*** + +### entryPointAddress? + +> `protected` `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:11 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`entryPointAddress`](PaymasterOperatorClient.md#entrypointaddress) + +*** + +### ethUsdPriceFeed + +> **ethUsdPriceFeed**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L23) + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`ethUsdPriceFeed`](PaymasterOperatorClient.md#ethusdpricefeed) + +*** + +### gTokenAddress? + +> `protected` `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:8 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`gTokenAddress`](PaymasterOperatorClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `protected` `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:9 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`gTokenStakingAddress`](PaymasterOperatorClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`paymasterFactoryAddress`](PaymasterOperatorClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`publicClient`](PaymasterOperatorClient.md#publicclient) + +*** + +### registryAddress? + +> `protected` `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:7 + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`registryAddress`](PaymasterOperatorClient.md#registryaddress) + +*** + +### superPaymasterAddress + +> **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L21) + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`superPaymasterAddress`](PaymasterOperatorClient.md#superpaymasteraddress) + +*** + +### tokenAddress? + +> `optional` **tokenAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L22) + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`tokenAddress`](PaymasterOperatorClient.md#tokenaddress) + +*** + +### xpntsFactory + +> **xpntsFactory**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L24) + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`xpntsFactory`](PaymasterOperatorClient.md#xpntsfactory) + +## Methods + +### addGasToken() + +> **addGasToken**(`token`, `price`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:415](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L415) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | +| `price` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`addGasToken`](PaymasterOperatorClient.md#addgastoken) + +*** + +### checkReadiness() + +> **checkReadiness**(): `Promise`\<[`OperatorStatus`](../interfaces/OperatorStatus.md)\> + +Defined in: [operator/src/OperatorLifecycle.ts:33](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L33) + +Check if the account is ready to become an operator +(e.g., has GToken, has ROLE_COMMUNITY, etc.) + +#### Returns + +`Promise`\<[`OperatorStatus`](../interfaces/OperatorStatus.md)\> + +*** + +### configureOperator() + +> **configureOperator**(`xPNTsToken?`, `treasury?`, `exchangeRate?`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:327](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L327) + +Configure operator parameters (Token, Treasury, Exchange Rate). +If parameters are undefined, existing values are preserved. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `xPNTsToken?` | `` `0x${string}` `` | +| `treasury?` | `` `0x${string}` `` | +| `exchangeRate?` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`configureOperator`](PaymasterOperatorClient.md#configureoperator) + +*** + +### deployAndRegisterPaymasterV4() + +> **deployAndRegisterPaymasterV4**(`params?`, `options?`): `Promise`\<\{ `deployHash`: `` `0x${string}` ``; `paymasterAddress`: `` `0x${string}` ``; `registerHash`: `` `0x${string}` ``; \}\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:142](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L142) + +Deploy a new Paymaster V4 and Register as AOA Operator (one-stop API). +This method handles: +1. Checks prerequisites (ROLE_COMMUNITY) +2. Predicts new Paymaster address +3. Deploys Paymaster V4 via Factory +4. Registers ROLE_PAYMASTER_AOA with staking + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params?` | \{ `priceFeed?`: `` `0x${string}` ``; `salt?`: `bigint`; `stakeAmount?`: `bigint`; `version?`: `string`; \} | Deployment parameters | +| `params.priceFeed?` | `` `0x${string}` `` | - | +| `params.salt?` | `bigint` | - | +| `params.stakeAmount?` | `bigint` | - | +| `params.version?` | `string` | - | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | Transaction options | + +#### Returns + +`Promise`\<\{ `deployHash`: `` `0x${string}` ``; `paymasterAddress`: `` `0x${string}` ``; `registerHash`: `` `0x${string}` ``; \}\> + +Object containing new paymaster address and transaction hashes + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`deployAndRegisterPaymasterV4`](PaymasterOperatorClient.md#deployandregisterpaymasterv4) + +*** + +### depositCollateral() + +> **depositCollateral**(`amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:283](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L283) + +Deposit collateral (aPNTs/GToken) to SuperPaymaster. +This is a helper method used by registerAsSuperPaymasterOperator. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`depositCollateral`](PaymasterOperatorClient.md#depositcollateral) + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`getAddress`](PaymasterOperatorClient.md#getaddress) + +*** + +### getOperatorDetails() + +> **getOperatorDetails**(`operator?`): `Promise`\<`any`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:378](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L378) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operator?` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`getOperatorDetails`](PaymasterOperatorClient.md#getoperatordetails) + +*** + +### getOperatorStats() + +> **getOperatorStats**(): `Promise`\<`any`\> + +Defined in: [operator/src/OperatorLifecycle.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L94) + +#### Returns + +`Promise`\<`any`\> + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`getStartPublicClient`](PaymasterOperatorClient.md#getstartpublicclient) + +*** + +### getTokenPrice() + +> **getTokenPrice**(`token`): `Promise`\<`bigint`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:428](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L428) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`getTokenPrice`](PaymasterOperatorClient.md#gettokenprice) + +*** + +### initiateExit() + +> **initiateExit**(`options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/OperatorLifecycle.ts:105](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L105) + +Start the exit process: Unstake from Registry/SuperPaymaster and Unlock funds + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Overrides + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`initiateExit`](PaymasterOperatorClient.md#initiateexit) + +*** + +### isOperator() + +> **isOperator**(`operator`): `Promise`\<`boolean`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:368](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L368) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operator` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`boolean`\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`isOperator`](PaymasterOperatorClient.md#isoperator) + +*** + +### registerAsSuperPaymasterOperator() + +> **registerAsSuperPaymasterOperator**(`params?`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L50) + +Register as SuperPaymaster Operator (one-stop API). +This method handles all necessary steps: +1. Checks prerequisites (must have ROLE_COMMUNITY) +2. Checks and approves GToken to GTokenStaking +3. Registers ROLE_PAYMASTER_SUPER +4. Optionally deposits collateral to SuperPaymaster + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params?` | \{ `depositAmount?`: `bigint`; `stakeAmount?`: `bigint`; \} | Registration parameters | +| `params.depositAmount?` | `bigint` | - | +| `params.stakeAmount?` | `bigint` | - | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | Transaction options | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash of role registration + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`registerAsSuperPaymasterOperator`](PaymasterOperatorClient.md#registerassuperpaymasteroperator) + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`requireEntryPoint`](PaymasterOperatorClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`requireGToken`](PaymasterOperatorClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`requireGTokenStaking`](PaymasterOperatorClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`requirePaymasterFactory`](PaymasterOperatorClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`requireRegistry`](PaymasterOperatorClient.md#requireregistry) + +*** + +### setupNode() + +> **setupNode**(`params`, `options?`): `Promise`\<`` `0x${string}` ``[]\> + +Defined in: [operator/src/OperatorLifecycle.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L50) + +One-click Setup: Register + Deposit + Deploy Node +Wraps existing registerAsSuperPaymasterOperator or deployAndRegisterPaymasterV4 + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `depositAmount?`: `bigint`; `stakeAmount?`: `bigint`; `type`: `"V4"` \| `"SUPER"`; \} | +| `params.depositAmount?` | `bigint` | +| `params.stakeAmount?` | `bigint` | +| `params.type?` | `"V4"` \| `"SUPER"` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``[]\> + +*** + +### setupPaymasterDeposit() + +> **setupPaymasterDeposit**(`params`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:437](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L437) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `amount`: `bigint`; `paymaster`: `` `0x${string}` ``; `token`: `` `0x${string}` ``; `user`: `` `0x${string}` ``; \} | +| `params.amount` | `bigint` | +| `params.paymaster?` | `` `0x${string}` `` | +| `params.token?` | `` `0x${string}` `` | +| `params.user?` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`setupPaymasterDeposit`](PaymasterOperatorClient.md#setuppaymasterdeposit) + +*** + +### updateExchangeRate() + +> **updateExchangeRate**(`exchangeRate`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:319](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L319) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `exchangeRate` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`updateExchangeRate`](PaymasterOperatorClient.md#updateexchangerate) + +*** + +### withdrawAllFunds() + +> **withdrawAllFunds**(`to?`, `options?`): `Promise`\<`` `0x${string}` ``[]\> + +Defined in: [operator/src/OperatorLifecycle.ts:113](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L113) + +Finalize exit: Withdraw all funds (Collateral + Rewards) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `to?` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``[]\> + +*** + +### withdrawCollateral() + +> **withdrawCollateral**(`to`, `amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:355](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L355) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `to` | `` `0x${string}` `` | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`withdrawCollateral`](PaymasterOperatorClient.md#withdrawcollateral) + +*** + +### withdrawStake() + +> **withdrawStake**(`to`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:399](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L399) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `to` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Inherited from + +[`PaymasterOperatorClient`](PaymasterOperatorClient.md).[`withdrawStake`](PaymasterOperatorClient.md#withdrawstake) diff --git a/0.16.23/api/@aastar/operator/classes/PaymasterOperatorClient.md b/0.16.23/api/@aastar/operator/classes/PaymasterOperatorClient.md new file mode 100644 index 000000000..3fdf4a825 --- /dev/null +++ b/0.16.23/api/@aastar/operator/classes/PaymasterOperatorClient.md @@ -0,0 +1,546 @@ +Defined in: [operator/src/PaymasterOperatorClient.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L20) + +Client for Paymaster Operators (ROLE_PAYMASTER_SUPER) + +## Extends + +- [`BaseClient`](../../core/classes/BaseClient.md) + +## Extended by + +- [`OperatorLifecycle`](OperatorLifecycle.md) + +## Constructors + +### Constructor + +> **new PaymasterOperatorClient**(`config`): `PaymasterOperatorClient` + +Defined in: [operator/src/PaymasterOperatorClient.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L26) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`OperatorClientConfig`](../interfaces/OperatorClientConfig.md) | + +#### Returns + +`PaymasterOperatorClient` + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`constructor`](../../core/classes/BaseClient.md#constructor) + +## Properties + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`client`](../../core/classes/BaseClient.md#client) + +*** + +### entryPointAddress? + +> `protected` `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:11 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`entryPointAddress`](../../core/classes/BaseClient.md#entrypointaddress) + +*** + +### ethUsdPriceFeed + +> **ethUsdPriceFeed**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:23](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L23) + +*** + +### gTokenAddress? + +> `protected` `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:8 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenAddress`](../../core/classes/BaseClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `protected` `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:9 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenStakingAddress`](../../core/classes/BaseClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`paymasterFactoryAddress`](../../core/classes/BaseClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`publicClient`](../../core/classes/BaseClient.md#publicclient) + +*** + +### registryAddress? + +> `protected` `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:7 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`registryAddress`](../../core/classes/BaseClient.md#registryaddress) + +*** + +### superPaymasterAddress + +> **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:21](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L21) + +*** + +### tokenAddress? + +> `optional` **tokenAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L22) + +*** + +### xpntsFactory + +> **xpntsFactory**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:24](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L24) + +## Methods + +### addGasToken() + +> **addGasToken**(`token`, `price`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:415](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L415) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | +| `price` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### configureOperator() + +> **configureOperator**(`xPNTsToken?`, `treasury?`, `exchangeRate?`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:327](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L327) + +Configure operator parameters (Token, Treasury, Exchange Rate). +If parameters are undefined, existing values are preserved. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `xPNTsToken?` | `` `0x${string}` `` | +| `treasury?` | `` `0x${string}` `` | +| `exchangeRate?` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### deployAndRegisterPaymasterV4() + +> **deployAndRegisterPaymasterV4**(`params?`, `options?`): `Promise`\<\{ `deployHash`: `` `0x${string}` ``; `paymasterAddress`: `` `0x${string}` ``; `registerHash`: `` `0x${string}` ``; \}\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:142](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L142) + +Deploy a new Paymaster V4 and Register as AOA Operator (one-stop API). +This method handles: +1. Checks prerequisites (ROLE_COMMUNITY) +2. Predicts new Paymaster address +3. Deploys Paymaster V4 via Factory +4. Registers ROLE_PAYMASTER_AOA with staking + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params?` | \{ `priceFeed?`: `` `0x${string}` ``; `salt?`: `bigint`; `stakeAmount?`: `bigint`; `version?`: `string`; \} | Deployment parameters | +| `params.priceFeed?` | `` `0x${string}` `` | - | +| `params.salt?` | `bigint` | - | +| `params.stakeAmount?` | `bigint` | - | +| `params.version?` | `string` | - | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | Transaction options | + +#### Returns + +`Promise`\<\{ `deployHash`: `` `0x${string}` ``; `paymasterAddress`: `` `0x${string}` ``; `registerHash`: `` `0x${string}` ``; \}\> + +Object containing new paymaster address and transaction hashes + +*** + +### depositCollateral() + +> **depositCollateral**(`amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:283](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L283) + +Deposit collateral (aPNTs/GToken) to SuperPaymaster. +This is a helper method used by registerAsSuperPaymasterOperator. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getAddress`](../../core/classes/BaseClient.md#getaddress) + +*** + +### getOperatorDetails() + +> **getOperatorDetails**(`operator?`): `Promise`\<`any`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:378](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L378) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operator?` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getStartPublicClient`](../../core/classes/BaseClient.md#getstartpublicclient) + +*** + +### getTokenPrice() + +> **getTokenPrice**(`token`): `Promise`\<`bigint`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:428](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L428) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### initiateExit() + +> **initiateExit**(`options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:388](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L388) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### isOperator() + +> **isOperator**(`operator`): `Promise`\<`boolean`\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:368](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L368) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operator` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### registerAsSuperPaymasterOperator() + +> **registerAsSuperPaymasterOperator**(`params?`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:50](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L50) + +Register as SuperPaymaster Operator (one-stop API). +This method handles all necessary steps: +1. Checks prerequisites (must have ROLE_COMMUNITY) +2. Checks and approves GToken to GTokenStaking +3. Registers ROLE_PAYMASTER_SUPER +4. Optionally deposits collateral to SuperPaymaster + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `params?` | \{ `depositAmount?`: `bigint`; `stakeAmount?`: `bigint`; \} | Registration parameters | +| `params.depositAmount?` | `bigint` | - | +| `params.stakeAmount?` | `bigint` | - | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | Transaction options | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash of role registration + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireEntryPoint`](../../core/classes/BaseClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGToken`](../../core/classes/BaseClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGTokenStaking`](../../core/classes/BaseClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requirePaymasterFactory`](../../core/classes/BaseClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireRegistry`](../../core/classes/BaseClient.md#requireregistry) + +*** + +### setupPaymasterDeposit() + +> **setupPaymasterDeposit**(`params`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:437](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L437) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `params` | \{ `amount`: `bigint`; `paymaster`: `` `0x${string}` ``; `token`: `` `0x${string}` ``; `user`: `` `0x${string}` ``; \} | +| `params.amount` | `bigint` | +| `params.paymaster?` | `` `0x${string}` `` | +| `params.token?` | `` `0x${string}` `` | +| `params.user?` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### updateExchangeRate() + +> **updateExchangeRate**(`exchangeRate`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:319](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L319) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `exchangeRate` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### withdrawCollateral() + +> **withdrawCollateral**(`to`, `amount`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:355](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L355) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `to` | `` `0x${string}` `` | +| `amount` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### withdrawStake() + +> **withdrawStake**(`to`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/PaymasterOperatorClient.ts:399](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L399) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `to` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/operator/classes/ProtocolClient.md b/0.16.23/api/@aastar/operator/classes/ProtocolClient.md new file mode 100644 index 000000000..d1ed7e5ab --- /dev/null +++ b/0.16.23/api/@aastar/operator/classes/ProtocolClient.md @@ -0,0 +1,375 @@ +Defined in: [operator/src/ProtocolClient.ts:25](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L25) + +Client for Protocol Governors and Validators (Infrastructure) + +## Extends + +- [`BaseClient`](../../core/classes/BaseClient.md) + +## Constructors + +### Constructor + +> **new ProtocolClient**(`config`): `ProtocolClient` + +Defined in: [operator/src/ProtocolClient.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`ProtocolClientConfig`](../interfaces/ProtocolClientConfig.md) | + +#### Returns + +`ProtocolClient` + +#### Overrides + +[`BaseClient`](../../core/classes/BaseClient.md).[`constructor`](../../core/classes/BaseClient.md#constructor) + +## Properties + +### blsAggregatorAddress? + +> `optional` **blsAggregatorAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:27](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L27) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:5 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`client`](../../core/classes/BaseClient.md#client) + +*** + +### dvtValidatorAddress + +> **dvtValidatorAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L26) + +*** + +### entryPointAddress? + +> `protected` `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:11 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`entryPointAddress`](../../core/classes/BaseClient.md#entrypointaddress) + +*** + +### gTokenAddress? + +> `protected` `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:8 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenAddress`](../../core/classes/BaseClient.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `protected` `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:9 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`gTokenStakingAddress`](../../core/classes/BaseClient.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `protected` `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:10 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`paymasterFactoryAddress`](../../core/classes/BaseClient.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/BaseClient.d.ts:6 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`publicClient`](../../core/classes/BaseClient.md#publicclient) + +*** + +### registryAddress? + +> `protected` `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:7 + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`registryAddress`](../../core/classes/BaseClient.md#registryaddress) + +*** + +### superPaymasterAddress? + +> `optional` **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:28](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L28) + +## Methods + +### createProposal() + +> **createProposal**(`target`, `calldata`, `description`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:44](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L44) + +Create a new proposal + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `target` | `` `0x${string}` `` | +| `calldata` | `` `0x${string}` `` | +| `description` | `string` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### executeWithProof() + +> **executeWithProof**(`proposalId`, `signatures`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:78](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L78) + +Execute a proposal with collected signatures + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `proposalId` | `bigint` | +| `signatures` | `` `0x${string}` ``[] | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### getAddress() + +> **getAddress**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:16 + +Get the account address of the connected wallet + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getAddress`](../../core/classes/BaseClient.md#getaddress) + +*** + +### getStartPublicClient() + +> **getStartPublicClient**(): [`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +Defined in: core/dist/clients/BaseClient.d.ts:20 + +Helper to ensure public client exists or fallback to wallet client (if it supports read) + +#### Returns + +[`PublicClient`](../../core/interfaces/PublicClient.md) \| [`WalletClient`](../../core/interfaces/WalletClient.md)\<[`Transport`](https://viem.sh/docs/index.html), [`Chain`](https://viem.sh/docs/index.html) \| `undefined`, [`Account`](https://viem.sh/docs/index.html) \| `undefined`\> + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`getStartPublicClient`](../../core/classes/BaseClient.md#getstartpublicclient) + +*** + +### registerBLSKey() + +> **registerBLSKey**(`publicKey`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:101](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L101) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicKey` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### requireEntryPoint() + +> `protected` **requireEntryPoint**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:25 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireEntryPoint`](../../core/classes/BaseClient.md#requireentrypoint) + +*** + +### requireGToken() + +> `protected` **requireGToken**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:22 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGToken`](../../core/classes/BaseClient.md#requiregtoken) + +*** + +### requireGTokenStaking() + +> `protected` **requireGTokenStaking**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:23 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireGTokenStaking`](../../core/classes/BaseClient.md#requiregtokenstaking) + +*** + +### requirePaymasterFactory() + +> `protected` **requirePaymasterFactory**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:24 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requirePaymasterFactory`](../../core/classes/BaseClient.md#requirepaymasterfactory) + +*** + +### requireRegistry() + +> `protected` **requireRegistry**(): `` `0x${string}` `` + +Defined in: core/dist/clients/BaseClient.d.ts:21 + +#### Returns + +`` `0x${string}` `` + +#### Inherited from + +[`BaseClient`](../../core/classes/BaseClient.md).[`requireRegistry`](../../core/classes/BaseClient.md#requireregistry) + +*** + +### setProtocolFee() + +> **setProtocolFee**(`bps`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:123](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L123) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `bps` | `bigint` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### setTreasury() + +> **setTreasury**(`treasury`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:139](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L139) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `treasury` | `` `0x${string}` `` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### signProposal() + +> **signProposal**(`proposalId`, `signature`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [operator/src/ProtocolClient.ts:62](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L62) + +#### Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `proposalId` | `bigint` | `undefined` | +| `signature` | `` `0x${string}` `` | `'0x'` | +| `options?` | [`TransactionOptions`](../../core/interfaces/TransactionOptions.md) | `undefined` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/operator/enumerations/ProposalState.md b/0.16.23/api/@aastar/operator/enumerations/ProposalState.md new file mode 100644 index 000000000..7d3524f77 --- /dev/null +++ b/0.16.23/api/@aastar/operator/enumerations/ProposalState.md @@ -0,0 +1,65 @@ +Defined in: [operator/src/ProtocolClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L11) + +## Enumeration Members + +### Active + +> **Active**: `1` + +Defined in: [operator/src/ProtocolClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L13) + +*** + +### Canceled + +> **Canceled**: `2` + +Defined in: [operator/src/ProtocolClient.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L14) + +*** + +### Defeated + +> **Defeated**: `3` + +Defined in: [operator/src/ProtocolClient.ts:15](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L15) + +*** + +### Executed + +> **Executed**: `7` + +Defined in: [operator/src/ProtocolClient.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L19) + +*** + +### Expired + +> **Expired**: `6` + +Defined in: [operator/src/ProtocolClient.ts:18](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L18) + +*** + +### Pending + +> **Pending**: `0` + +Defined in: [operator/src/ProtocolClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L12) + +*** + +### Queued + +> **Queued**: `5` + +Defined in: [operator/src/ProtocolClient.ts:17](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L17) + +*** + +### Succeeded + +> **Succeeded**: `4` + +Defined in: [operator/src/ProtocolClient.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L16) diff --git a/0.16.23/api/@aastar/operator/index.md b/0.16.23/api/@aastar/operator/index.md new file mode 100644 index 000000000..bb17c821f --- /dev/null +++ b/0.16.23/api/@aastar/operator/index.md @@ -0,0 +1,16 @@ +## Enumerations + +- [ProposalState](enumerations/ProposalState.md) + +## Classes + +- [OperatorLifecycle](classes/OperatorLifecycle.md) +- [PaymasterOperatorClient](classes/PaymasterOperatorClient.md) +- [ProtocolClient](classes/ProtocolClient.md) + +## Interfaces + +- [OperatorClientConfig](interfaces/OperatorClientConfig.md) +- [OperatorStatus](interfaces/OperatorStatus.md) +- [ProtocolClientConfig](interfaces/ProtocolClientConfig.md) +- [SponsorshipPolicy](interfaces/SponsorshipPolicy.md) diff --git a/0.16.23/api/@aastar/operator/interfaces/OperatorClientConfig.md b/0.16.23/api/@aastar/operator/interfaces/OperatorClientConfig.md new file mode 100644 index 000000000..9205561be --- /dev/null +++ b/0.16.23/api/@aastar/operator/interfaces/OperatorClientConfig.md @@ -0,0 +1,151 @@ +Defined in: [operator/src/PaymasterOperatorClient.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L5) + +Base configuration for all L2 Business Clients + +## Extends + +- [`ClientConfig`](../../core/interfaces/ClientConfig.md) + +## Properties + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/types.d.ts:11 + +Viem WalletClient for write operations. +Must have an account attached. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`client`](../../core/interfaces/ClientConfig.md#client) + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:41 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`entryPointAddress`](../../core/interfaces/ClientConfig.md#entrypointaddress) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:40 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`ethUsdPriceFeedAddress`](../../core/interfaces/ClientConfig.md#ethusdpricefeedaddress) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:28 + +GToken contract address. +Required for operations involving token approvals and transfers. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenAddress`](../../core/interfaces/ClientConfig.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:33 + +GTokenStaking contract address. +Required for role registration that involves staking. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenStakingAddress`](../../core/interfaces/ClientConfig.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:38 + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`paymasterFactoryAddress`](../../core/interfaces/ClientConfig.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/types.d.ts:18 + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`publicClient`](../../core/interfaces/ClientConfig.md#publicclient) + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:23 + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`registryAddress`](../../core/interfaces/ClientConfig.md#registryaddress) + +*** + +### superPaymasterAddress + +> **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L6) + +*** + +### tokenAddress? + +> `optional` **tokenAddress**: `` `0x${string}` `` + +Defined in: [operator/src/PaymasterOperatorClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L7) + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:39 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`xpntsFactoryAddress`](../../core/interfaces/ClientConfig.md#xpntsfactoryaddress) diff --git a/0.16.23/api/@aastar/operator/interfaces/OperatorStatus.md b/0.16.23/api/@aastar/operator/interfaces/OperatorStatus.md new file mode 100644 index 000000000..52dbd1ee7 --- /dev/null +++ b/0.16.23/api/@aastar/operator/interfaces/OperatorStatus.md @@ -0,0 +1,25 @@ +Defined in: [operator/src/OperatorLifecycle.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L6) + +## Properties + +### balance + +> **balance**: `bigint` + +Defined in: [operator/src/OperatorLifecycle.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L9) + +*** + +### isActive + +> **isActive**: `boolean` + +Defined in: [operator/src/OperatorLifecycle.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L8) + +*** + +### isConfigured + +> **isConfigured**: `boolean` + +Defined in: [operator/src/OperatorLifecycle.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/OperatorLifecycle.ts#L7) diff --git a/0.16.23/api/@aastar/operator/interfaces/ProtocolClientConfig.md b/0.16.23/api/@aastar/operator/interfaces/ProtocolClientConfig.md new file mode 100644 index 000000000..c025cc6f2 --- /dev/null +++ b/0.16.23/api/@aastar/operator/interfaces/ProtocolClientConfig.md @@ -0,0 +1,159 @@ +Defined in: [operator/src/ProtocolClient.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L5) + +Base configuration for all L2 Business Clients + +## Extends + +- [`ClientConfig`](../../core/interfaces/ClientConfig.md) + +## Properties + +### blsAggregatorAddress? + +> `optional` **blsAggregatorAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L7) + +*** + +### client + +> **client**: [`WalletClient`](../../core/interfaces/WalletClient.md) + +Defined in: core/dist/clients/types.d.ts:11 + +Viem WalletClient for write operations. +Must have an account attached. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`client`](../../core/interfaces/ClientConfig.md#client) + +*** + +### dvtValidatorAddress + +> **dvtValidatorAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L6) + +*** + +### entryPointAddress? + +> `optional` **entryPointAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:41 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`entryPointAddress`](../../core/interfaces/ClientConfig.md#entrypointaddress) + +*** + +### ethUsdPriceFeedAddress? + +> `optional` **ethUsdPriceFeedAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:40 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`ethUsdPriceFeedAddress`](../../core/interfaces/ClientConfig.md#ethusdpricefeedaddress) + +*** + +### gTokenAddress? + +> `optional` **gTokenAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:28 + +GToken contract address. +Required for operations involving token approvals and transfers. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenAddress`](../../core/interfaces/ClientConfig.md#gtokenaddress) + +*** + +### gTokenStakingAddress? + +> `optional` **gTokenStakingAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:33 + +GTokenStaking contract address. +Required for role registration that involves staking. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`gTokenStakingAddress`](../../core/interfaces/ClientConfig.md#gtokenstakingaddress) + +*** + +### paymasterFactoryAddress? + +> `optional` **paymasterFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:38 + +PaymasterFactory contract address. +Required for deploying new PaymasterV4 instances. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`paymasterFactoryAddress`](../../core/interfaces/ClientConfig.md#paymasterfactoryaddress) + +*** + +### publicClient? + +> `optional` **publicClient**: [`PublicClient`](../../core/interfaces/PublicClient.md) + +Defined in: core/dist/clients/types.d.ts:18 + +Optional PublicClient for read operations. +If not provided, one will be derived from the WalletClient or created internally if possible (but usually explicit is better). +Currently L1 actions use PublicClient | WalletClient, so WalletClient is enough for both if it has a provider. +However, explicitly accepting PublicClient encourages separation. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`publicClient`](../../core/interfaces/ClientConfig.md#publicclient) + +*** + +### registryAddress? + +> `optional` **registryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:23 + +Registry contract address. +Essential for looking up other contracts if not provided explicitly. + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`registryAddress`](../../core/interfaces/ClientConfig.md#registryaddress) + +*** + +### superPaymasterAddress? + +> `optional` **superPaymasterAddress**: `` `0x${string}` `` + +Defined in: [operator/src/ProtocolClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/ProtocolClient.ts#L8) + +*** + +### xpntsFactoryAddress? + +> `optional` **xpntsFactoryAddress**: `` `0x${string}` `` + +Defined in: core/dist/clients/types.d.ts:39 + +#### Inherited from + +[`ClientConfig`](../../core/interfaces/ClientConfig.md).[`xpntsFactoryAddress`](../../core/interfaces/ClientConfig.md#xpntsfactoryaddress) diff --git a/0.16.23/api/@aastar/operator/interfaces/SponsorshipPolicy.md b/0.16.23/api/@aastar/operator/interfaces/SponsorshipPolicy.md new file mode 100644 index 000000000..e0abcf35e --- /dev/null +++ b/0.16.23/api/@aastar/operator/interfaces/SponsorshipPolicy.md @@ -0,0 +1,25 @@ +Defined in: [operator/src/PaymasterOperatorClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L10) + +## Properties + +### globalLimit + +> **globalLimit**: `bigint` + +Defined in: [operator/src/PaymasterOperatorClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L11) + +*** + +### itemPrice + +> **itemPrice**: `bigint` + +Defined in: [operator/src/PaymasterOperatorClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L13) + +*** + +### userLimit + +> **userLimit**: `bigint` + +Defined in: [operator/src/PaymasterOperatorClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/operator/src/PaymasterOperatorClient.ts#L12) diff --git a/0.16.23/api/@aastar/paymaster/classes/PaymasterClient.md b/0.16.23/api/@aastar/paymaster/classes/PaymasterClient.md new file mode 100644 index 000000000..81db95aab --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/classes/PaymasterClient.md @@ -0,0 +1,261 @@ +Defined in: [V4/PaymasterClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L10) + +PaymasterClient +Focus: Integration, Funding, Interaction. + +## Methods + +### approveGasToken() + +> `static` **approveGasToken**(`wallet`, `token`, `spender`, `amount`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterClient.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L54) + +Approve the Paymaster (or any spender) to spend gas tokens. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `token` | `` `0x${string}` `` | +| `spender` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### depositFor() + +> `static` **depositFor**(`wallet`, `address`, `user`, `token`, `amount`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterClient.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L41) + +Deposit tokens to Paymaster for a user (enables gasless transactions). + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### encodeExecution() + +> `static` **encodeExecution**(`target`, `value`, `data`): `` `0x${string}` `` + +Defined in: [V4/PaymasterClient.ts:488](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L488) + +Helper: Encode a SimpleAccount execution. +Wraps the inner call into: `execute(target, value, data)` +This is the payload signed by the user. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `target` | `` `0x${string}` `` | +| `value` | `bigint` | +| `data` | `` `0x${string}` `` | + +#### Returns + +`` `0x${string}` `` + +*** + +### encodeTokenTransfer() + +> `static` **encodeTokenTransfer**(`recipient`, `amount`): `` `0x${string}` `` + +Defined in: [V4/PaymasterClient.ts:475](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L475) + +Helper: Encode a standardized ERC-20 Transfer. +Returns the raw function data: `transfer(to, amount)` + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `recipient` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`` `0x${string}` `` + +*** + +### estimateUserOperationGas() + +> `static` **estimateUserOperationGas**(`client`, `wallet`, `aaAddress`, `entryPoint`, `paymasterAddress`, `token`, `bundlerUrl`, `callData`, `options?`): `Promise`\<\{ `callGasLimit`: `bigint`; `paymasterPostOpGasLimit`: `bigint`; `paymasterVerificationGasLimit`: `bigint` \| `undefined`; `preVerificationGas`: `bigint`; `verificationGasLimit`: `bigint`; \}\> + +Defined in: [V4/PaymasterClient.ts:67](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L67) + +Estimate Gas for a UserOperation. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `wallet` | `any` | +| `aaAddress` | `` `0x${string}` `` | +| `entryPoint` | `` `0x${string}` `` | +| `paymasterAddress` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `bundlerUrl` | `string` | +| `callData` | `` `0x${string}` `` | +| `options?` | \{ `factory?`: `` `0x${string}` ``; `factoryData?`: `` `0x${string}` ``; `operator?`: `` `0x${string}` ``; `validityWindow?`: `number`; \} | +| `options.factory?` | `` `0x${string}` `` | +| `options.factoryData?` | `` `0x${string}` `` | +| `options.operator?` | `` `0x${string}` `` | +| `options.validityWindow?` | `number` | + +#### Returns + +`Promise`\<\{ `callGasLimit`: `bigint`; `paymasterPostOpGasLimit`: `bigint`; `paymasterVerificationGasLimit`: `bigint` \| `undefined`; `preVerificationGas`: `bigint`; `verificationGasLimit`: `bigint`; \}\> + +*** + +### getDepositedBalance() + +> `static` **getDepositedBalance**(`publicClient`, `address`, `user`, `token`): `Promise`\<`bigint`\> + +Defined in: [V4/PaymasterClient.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L20) + +Get user's deposited balance on the Paymaster. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `address` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getFeeFromReceipt() + +> `static` **getFeeFromReceipt**(`receipt`, `paymasterAddress`): \{ `actualGasCostWei`: `bigint`; `tokenCost`: `bigint`; \} \| `null` + +Defined in: [V4/PaymasterClient.ts:435](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L435) + +Helper to extract the actual Gas Token fee from a UserOperation receipt. +Looks for the 'PostOpProcessed' event emitted by the Paymaster. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `receipt` | `any` | +| `paymasterAddress` | `` `0x${string}` `` | + +#### Returns + +\{ `actualGasCostWei`: `bigint`; `tokenCost`: `bigint`; \} \| `null` + +*** + +### getTransactionFee() + +> `static` **getTransactionFee**(`publicClient`, `txHash`, `paymasterAddress`): `Promise`\<\{ `actualGasCostWei`: `bigint`; `tokenCost`: `bigint`; \} \| `null`\> + +Defined in: [V4/PaymasterClient.ts:462](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L462) + +Get the fee for a specific transaction hash. +Fetches the receipt (no scanning required) and decodes the log. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `txHash` | `` `0x${string}` `` | +| `paymasterAddress` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<\{ `actualGasCostWei`: `bigint`; `tokenCost`: `bigint`; \} \| `null`\> + +*** + +### submitGaslessUserOperation() + +> `static` **submitGaslessUserOperation**(`client`, `wallet`, `aaAddress`, `entryPoint`, `paymasterAddress`, `token`, `bundlerUrl`, `callData`, `options?`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [V4/PaymasterClient.ts:249](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L249) + +High-level API to submit a gasless UserOperation. +Automatically handles nonce fetching, gas estimation (if not provided), signing, and submission. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `wallet` | `any` | +| `aaAddress` | `` `0x${string}` `` | +| `entryPoint` | `` `0x${string}` `` | +| `paymasterAddress` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `bundlerUrl` | `string` | +| `callData` | `` `0x${string}` `` | +| `options?` | \{ `autoEstimate?`: `boolean`; `callGasLimit?`: `bigint`; `factory?`: `` `0x${string}` ``; `factoryData?`: `` `0x${string}` ``; `maxFeePerGas?`: `bigint`; `maxPriorityFeePerGas?`: `bigint`; `operator?`: `` `0x${string}` ``; `paymasterPostOpGasLimit?`: `bigint`; `paymasterVerificationGasLimit?`: `bigint`; `preVerificationGas?`: `bigint`; `validityWindow?`: `number`; `verificationGasLimit?`: `bigint`; \} | +| `options.autoEstimate?` | `boolean` | +| `options.callGasLimit?` | `bigint` | +| `options.factory?` | `` `0x${string}` `` | +| `options.factoryData?` | `` `0x${string}` `` | +| `options.maxFeePerGas?` | `bigint` | +| `options.maxPriorityFeePerGas?` | `bigint` | +| `options.operator?` | `` `0x${string}` `` | +| `options.paymasterPostOpGasLimit?` | `bigint` | +| `options.paymasterVerificationGasLimit?` | `bigint` | +| `options.preVerificationGas?` | `bigint` | +| `options.validityWindow?` | `number` | +| `options.verificationGasLimit?` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +*** + +### waitForUserOperation() + +> `static` **waitForUserOperation**(`bundlerClient`, `hash`, `timeout`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterClient.ts:500](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterClient.ts#L500) + +More robust version of waitForUserOperationReceipt. +Catches timeouts and returns a cleaner result. + +#### Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `bundlerClient` | `any` | `undefined` | +| `hash` | `` `0x${string}` `` | `undefined` | +| `timeout` | `number` | `60000` | + +#### Returns + +`Promise`\<`any`\> diff --git a/0.16.23/api/@aastar/paymaster/classes/PaymasterOperator.md b/0.16.23/api/@aastar/paymaster/classes/PaymasterOperator.md new file mode 100644 index 000000000..b24337ed8 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/classes/PaymasterOperator.md @@ -0,0 +1,330 @@ +Defined in: [V4/PaymasterOperator.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L8) + +PaymasterOperator +Focus: Deployment, Configuration, Maintenance, Keeper Bots. + +## Constructors + +### Constructor + +> **new PaymasterOperator**(): `PaymasterOperator` + +#### Returns + +`PaymasterOperator` + +## Methods + +### addDeposit() + +> `static` **addDeposit**(`wallet`, `address`, `amount`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:107](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L107) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### addGasToken() + +> `static` **addGasToken**(`wallet`, `address`, `token`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:117](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L117) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### addStake() + +> `static` **addStake**(`wallet`, `address`, `amount`, `unstakeDelaySec`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:96](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L96) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `amount` | `bigint` | +| `unstakeDelaySec` | `number` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### checkGaslessReadiness() + +> `static` **checkGaslessReadiness**(`publicClient`, `entryPoint`, `paymasterAddress`, `user`, `token`): `Promise`\<[`GaslessReadinessReport`](../type-aliases/GaslessReadinessReport.md)\> + +Defined in: [V4/PaymasterOperator.ts:169](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L169) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `entryPoint` | `` `0x${string}` `` | +| `paymasterAddress` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<[`GaslessReadinessReport`](../type-aliases/GaslessReadinessReport.md)\> + +*** + +### ensurePriceInitialized() + +> `static` **ensurePriceInitialized**(`wallet`, `publicClient`, `address`): `Promise`\<`boolean`\> + +Defined in: [V4/PaymasterOperator.ts:87](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L87) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `publicClient` | `any` | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`boolean`\> + +*** + +### getCachedPrice() + +> `static` **getCachedPrice**(`publicClient`, `address`): `Promise`\<\{ `price`: `bigint`; `updatedAt`: `bigint`; \}\> + +Defined in: [V4/PaymasterOperator.ts:36](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L36) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<\{ `price`: `bigint`; `updatedAt`: `bigint`; \}\> + +*** + +### getDepositedBalance() + +> `static` **getDepositedBalance**(`publicClient`, `address`, `user`, `token`): `Promise`\<`bigint`\> + +Defined in: [V4/PaymasterOperator.ts:69](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L69) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `address` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getTokenPrice() + +> `static` **getTokenPrice**(`publicClient`, `address`, `token`): `Promise`\<`bigint`\> + +Defined in: [V4/PaymasterOperator.ts:54](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L54) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `publicClient` | `any` | +| `address` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### prepareGaslessEnvironment() + +> `static` **prepareGaslessEnvironment**(`operatorWallet`, `publicClient`, `entryPoint`, `paymasterAddress`, `token`, `options`): `Promise`\<`object`[]\> + +Defined in: [V4/PaymasterOperator.ts:229](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L229) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operatorWallet` | `any` | +| `publicClient` | `any` | +| `entryPoint` | `` `0x${string}` `` | +| `paymasterAddress` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `options` | \{ `minDeposit?`: `bigint`; `minStake?`: `bigint`; `tokenPriceUSD?`: `bigint`; \} | +| `options.minDeposit?` | `bigint` | +| `options.minStake?` | `bigint` | +| `options.tokenPriceUSD?` | `bigint` | + +#### Returns + +`Promise`\<`object`[]\> + +*** + +### removeGasToken() + +> `static` **removeGasToken**(`wallet`, `address`, `token`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:127](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L127) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setMaxGasCostCap() + +> `static` **setMaxGasCostCap**(`wallet`, `address`, `cap`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:147](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L147) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `cap` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setServiceFeeRate() + +> `static` **setServiceFeeRate**(`wallet`, `address`, `rate`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:137](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L137) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `rate` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setTokenPrice() + +> `static` **setTokenPrice**(`wallet`, `address`, `token`, `priceUSD`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:26](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L26) + +Set the token price (in 8 decimals, e.g., 1e8 = $1 USD). + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `priceUSD` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### updatePrice() + +> `static` **updatePrice**(`wallet`, `address`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:14](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L14) + +Update the cached ETH/USD price from Chainlink Oracle. +Must be called if cachedPrice is 0 (uninitialized). + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### withdrawPNT() + +> `static` **withdrawPNT**(`wallet`, `address`, `to`, `token`, `amount`): `Promise`\<`any`\> + +Defined in: [V4/PaymasterOperator.ts:157](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterOperator.ts#L157) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `address` | `` `0x${string}` `` | +| `to` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`any`\> diff --git a/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md b/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md new file mode 100644 index 000000000..0e098e5f1 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md @@ -0,0 +1,144 @@ +Defined in: [SuperPaymaster/index.ts:95](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L95) + +Admin Client for SuperPaymaster V3 + +## Constructors + +### Constructor + +> **new SuperPaymasterAdminClient**(`client`, `paymasterAddress`): `SuperPaymasterAdminClient` + +Defined in: [SuperPaymaster/index.ts:99](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L99) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `paymasterAddress` | `` `0x${string}` `` | + +#### Returns + +`SuperPaymasterAdminClient` + +## Methods + +### getOperator() + +> **getOperator**(`operator`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:104](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L104) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `operator` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### configureOperator() + +> `static` **configureOperator**(`wallet`, `paymaster`, `token`, `treasury`, `exchangeRate`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:113](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L113) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `treasury` | `` `0x${string}` `` | +| `exchangeRate` | `bigint` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setAPNTsToken() + +> `static` **setAPNTsToken**(`wallet`, `paymaster`, `token`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:149](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L149) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setOperatorPaused() + +> `static` **setOperatorPaused**(`wallet`, `paymaster`, `operator`, `paused`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:129](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L129) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `operator` | `` `0x${string}` `` | +| `paused` | `boolean` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### setXPNTsFactory() + +> `static` **setXPNTsFactory**(`wallet`, `paymaster`, `factory`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:159](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L159) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `factory` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`any`\> + +*** + +### updateReputation() + +> `static` **updateReputation**(`wallet`, `paymaster`, `operator`, `score`): `Promise`\<`any`\> + +Defined in: [SuperPaymaster/index.ts:139](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L139) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `operator` | `` `0x${string}` `` | +| `score` | `bigint` | + +#### Returns + +`Promise`\<`any`\> diff --git a/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterClient.md b/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterClient.md new file mode 100644 index 000000000..63883e37c --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/classes/SuperPaymasterClient.md @@ -0,0 +1,30 @@ +Defined in: [V4/SuperPaymasterClient.ts:20](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L20) + +SuperPaymasterClient +High-level API for SuperPaymaster operations, including dynamic gas estimation. + +## Methods + +### submitGaslessTransaction() + +> `static` **submitGaslessTransaction**(`client`, `wallet`, `aaAddress`, `entryPoint`, `bundlerUrl`, `config`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [V4/SuperPaymasterClient.ts:32](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L32) + +Submit a gasless transaction using SuperPaymaster. +Automatically handles gas estimation with a smart efficiency buffer. + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `wallet` | `any` | +| `aaAddress` | `` `0x${string}` `` | +| `entryPoint` | `` `0x${string}` `` | +| `bundlerUrl` | `string` | +| `config` | [`GaslessTransactionConfig`](../type-aliases/GaslessTransactionConfig.md) | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> diff --git a/0.16.23/api/@aastar/paymaster/functions/buildPaymasterData.md b/0.16.23/api/@aastar/paymaster/functions/buildPaymasterData.md new file mode 100644 index 000000000..5cc9ad35b --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/buildPaymasterData.md @@ -0,0 +1,21 @@ +> **buildPaymasterData**(`paymasterAddress`, `token`, `options?`): `` `0x${string}` `` + +Defined in: [V4/PaymasterUtils.ts:58](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L58) + +Build paymasterAndData for gasless UserOperation. +Layout: [Paymaster(20)] [VerificationGasLimit(16)] [PostOpGasLimit(16)] [Token(20)] [ValidUntil(6)] [ValidAfter(6)] + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `paymasterAddress` | `` `0x${string}` `` | +| `token` | `` `0x${string}` `` | +| `options?` | \{ `postOpGasLimit?`: `bigint`; `validityWindow?`: `number`; `verificationGasLimit?`: `bigint`; \} | +| `options.postOpGasLimit?` | `bigint` | +| `options.validityWindow?` | `number` | +| `options.verificationGasLimit?` | `bigint` | + +## Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/paymaster/functions/buildSuperPaymasterData.md b/0.16.23/api/@aastar/paymaster/functions/buildSuperPaymasterData.md new file mode 100644 index 000000000..88aeebaa6 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/buildSuperPaymasterData.md @@ -0,0 +1,26 @@ +> **buildSuperPaymasterData**(`paymasterAddress`, `operator`, `options?`): `` `0x${string}` `` + +Defined in: [V4/PaymasterUtils.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L94) + +Build paymasterAndData for SuperPaymaster V3. +Layout: [Paymaster(20)] [verGas(16)] [postGas(16)] [operator(20)] [maxRate(32)] +Total: 104 bytes + +IMPORTANT: SuperPaymaster contract generates validUntil internally using: + validUntil = cachedPrice.updatedAt + priceStalenessThreshold +Do NOT include validUntil/validAfter in paymasterAndData! + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `paymasterAddress` | `` `0x${string}` `` | +| `operator` | `` `0x${string}` `` | +| `options?` | \{ `maxRate?`: `bigint`; `postOpGasLimit?`: `bigint`; `verificationGasLimit?`: `bigint`; \} | +| `options.maxRate?` | `bigint` | +| `options.postOpGasLimit?` | `bigint` | +| `options.verificationGasLimit?` | `bigint` | + +## Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/paymaster/functions/checkEligibility.md b/0.16.23/api/@aastar/paymaster/functions/checkEligibility.md new file mode 100644 index 000000000..a298e266b --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/checkEligibility.md @@ -0,0 +1,19 @@ +> **checkEligibility**(`client`, `paymaster`, `user`, `operator`): `Promise`\<\{ `credit?`: `bigint`; `eligible`: `boolean`; `token?`: `` `0x${string}` ``; \}\> + +Defined in: [SuperPaymaster/index.ts:49](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L49) + +Enhanced eligibility check for SuperPaymaster V3. +Validates that user has sufficient credit with the given operator. + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `paymaster` | `` `0x${string}` `` | +| `user` | `` `0x${string}` `` | +| `operator` | `` `0x${string}` `` | + +## Returns + +`Promise`\<\{ `credit?`: `bigint`; `eligible`: `boolean`; `token?`: `` `0x${string}` ``; \}\> diff --git a/0.16.23/api/@aastar/paymaster/functions/formatUserOpV07.md b/0.16.23/api/@aastar/paymaster/functions/formatUserOpV07.md new file mode 100644 index 000000000..9172cd0fd --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/formatUserOpV07.md @@ -0,0 +1,15 @@ +> **formatUserOpV07**(`userOp`): `any` + +Defined in: [V4/PaymasterUtils.ts:119](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L119) + +Helper to format UserOp for Alchemy/Standard Bundlers (v0.7 Decomposed) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `userOp` | `any` | + +## Returns + +`any` diff --git a/0.16.23/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md b/0.16.23/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md new file mode 100644 index 000000000..edf4476aa --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md @@ -0,0 +1,31 @@ +> **getPaymasterV4Middleware**(`config`): `object` + +Defined in: [V4/PaymasterUtils.ts:31](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L31) + +Constructs the middleware for Paymaster V4. +Returns the `paymasterAndData` hex string. + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`PaymasterV4MiddlewareConfig`](../type-aliases/PaymasterV4MiddlewareConfig.md) | + +## Returns + +`object` + +### sponsorUserOperation() + +> **sponsorUserOperation**: (`args`) => `Promise`\<\{ `paymasterAndData`: `` `0x${string}` ``; `preVerificationGas`: `any`; `verificationGasLimit`: `bigint`; \}\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `userOperation`: `any`; \} | +| `args.userOperation` | `any` | + +#### Returns + +`Promise`\<\{ `paymasterAndData`: `` `0x${string}` ``; `preVerificationGas`: `any`; `verificationGasLimit`: `bigint`; \}\> diff --git a/0.16.23/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md b/0.16.23/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md new file mode 100644 index 000000000..403e344a6 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md @@ -0,0 +1,31 @@ +> **getSuperPaymasterMiddleware**(`config`): `object` + +Defined in: [SuperPaymaster/index.ts:19](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L19) + +Constructs the middleware for SuperPaymaster. +Returns the `paymasterAndData` hex string. + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `config` | [`PaymasterConfig`](../type-aliases/PaymasterConfig.md) | + +## Returns + +`object` + +### sponsorUserOperation() + +> **sponsorUserOperation**: (`args`) => `Promise`\<\{ `paymasterAndData`: `` `0x${string}` ``; `preVerificationGas`: `any`; `verificationGasLimit`: `bigint`; \}\> + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `args` | \{ `userOperation`: `any`; \} | +| `args.userOperation` | `any` | + +#### Returns + +`Promise`\<\{ `paymasterAndData`: `` `0x${string}` ``; `preVerificationGas`: `any`; `verificationGasLimit`: `bigint`; \}\> diff --git a/0.16.23/api/@aastar/paymaster/functions/getUserOpHashV07.md b/0.16.23/api/@aastar/paymaster/functions/getUserOpHashV07.md new file mode 100644 index 000000000..d41f99fae --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/getUserOpHashV07.md @@ -0,0 +1,15 @@ +> **getUserOpHashV07**(`userOp`, `entryPoint`, `chainId`): `` `0x${string}` `` + +Defined in: [V4/PaymasterUtils.ts:169](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L169) + +## Parameters + +| Parameter | Type | +| ------ | ------ | +| `userOp` | `any` | +| `entryPoint` | `` `0x${string}` `` | +| `chainId` | `bigint` | + +## Returns + +`` `0x${string}` `` diff --git a/0.16.23/api/@aastar/paymaster/functions/tuneGasLimit.md b/0.16.23/api/@aastar/paymaster/functions/tuneGasLimit.md new file mode 100644 index 000000000..a3b1be8d7 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/functions/tuneGasLimit.md @@ -0,0 +1,18 @@ +> **tuneGasLimit**(`estimate`, `nominalActual`, `targetEfficiency`): `bigint` + +Defined in: [V4/PaymasterUtils.ts:193](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L193) + +Tune gas limit using a dynamic nominal ceiling to satisfy Bundler efficiency (0.4) +Target: Actual / Limit >= targetEfficiency + +## Parameters + +| Parameter | Type | Default value | +| ------ | ------ | ------ | +| `estimate` | `bigint` | `undefined` | +| `nominalActual` | `bigint` | `undefined` | +| `targetEfficiency` | `number` | `0.45` | + +## Returns + +`bigint` diff --git a/0.16.23/api/@aastar/paymaster/index.md b/0.16.23/api/@aastar/paymaster/index.md new file mode 100644 index 000000000..49d8d8ff7 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/index.md @@ -0,0 +1,24 @@ +## Classes + +- [PaymasterClient](classes/PaymasterClient.md) +- [PaymasterOperator](classes/PaymasterOperator.md) +- [SuperPaymasterAdminClient](classes/SuperPaymasterAdminClient.md) +- [SuperPaymasterClient](classes/SuperPaymasterClient.md) + +## Type Aliases + +- [GaslessReadinessReport](type-aliases/GaslessReadinessReport.md) +- [GaslessTransactionConfig](type-aliases/GaslessTransactionConfig.md) +- [PaymasterConfig](type-aliases/PaymasterConfig.md) +- [PaymasterV4MiddlewareConfig](type-aliases/PaymasterV4MiddlewareConfig.md) + +## Functions + +- [buildPaymasterData](functions/buildPaymasterData.md) +- [buildSuperPaymasterData](functions/buildSuperPaymasterData.md) +- [checkEligibility](functions/checkEligibility.md) +- [formatUserOpV07](functions/formatUserOpV07.md) +- [getPaymasterV4Middleware](functions/getPaymasterV4Middleware.md) +- [getSuperPaymasterMiddleware](functions/getSuperPaymasterMiddleware.md) +- [getUserOpHashV07](functions/getUserOpHashV07.md) +- [tuneGasLimit](functions/tuneGasLimit.md) diff --git a/0.16.23/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md b/0.16.23/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md new file mode 100644 index 000000000..aaa07c3f1 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md @@ -0,0 +1,55 @@ +> **GaslessReadinessReport** = `object` + +Defined in: [V4/PaymasterUtils.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L10) + +## Properties + +### details + +> **details**: `object` + +Defined in: [V4/PaymasterUtils.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L13) + +#### ethUsdPrice + +> **ethUsdPrice**: `bigint` + +#### paymasterDeposit + +> **paymasterDeposit**: `bigint` + +#### paymasterStake + +> **paymasterStake**: `bigint` + +#### tokenPrice + +> **tokenPrice**: `bigint` + +#### tokenSupported + +> **tokenSupported**: `boolean` + +#### userPaymasterDeposit + +> **userPaymasterDeposit**: `bigint` + +#### userTokenBalance + +> **userTokenBalance**: `bigint` + +*** + +### isReady + +> **isReady**: `boolean` + +Defined in: [V4/PaymasterUtils.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L11) + +*** + +### issues + +> **issues**: `string`[] + +Defined in: [V4/PaymasterUtils.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L12) diff --git a/0.16.23/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md b/0.16.23/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md new file mode 100644 index 000000000..7592b1723 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md @@ -0,0 +1,59 @@ +> **GaslessTransactionConfig** = `object` + +Defined in: [V4/SuperPaymasterClient.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L6) + +## Properties + +### amount + +> **amount**: `bigint` + +Defined in: [V4/SuperPaymasterClient.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L9) + +*** + +### factory? + +> `optional` **factory**: `Address` + +Defined in: [V4/SuperPaymasterClient.ts:12](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L12) + +*** + +### factoryData? + +> `optional` **factoryData**: [`Hex`](https://viem.sh/docs/index.html) + +Defined in: [V4/SuperPaymasterClient.ts:13](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L13) + +*** + +### operator + +> **operator**: `Address` + +Defined in: [V4/SuperPaymasterClient.ts:10](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L10) + +*** + +### paymasterAddress + +> **paymasterAddress**: `Address` + +Defined in: [V4/SuperPaymasterClient.ts:11](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L11) + +*** + +### recipient + +> **recipient**: `Address` + +Defined in: [V4/SuperPaymasterClient.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L8) + +*** + +### token + +> **token**: `Address` + +Defined in: [V4/SuperPaymasterClient.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/SuperPaymasterClient.ts#L7) diff --git a/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterConfig.md b/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterConfig.md new file mode 100644 index 000000000..79602ac51 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterConfig.md @@ -0,0 +1,43 @@ +> **PaymasterConfig** = `object` + +Defined in: [SuperPaymaster/index.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L4) + +## Properties + +### maxRate? + +> `optional` **maxRate**: `bigint` + +Defined in: [SuperPaymaster/index.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L7) + +*** + +### operator + +> **operator**: `Address` + +Defined in: [SuperPaymaster/index.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L6) + +*** + +### paymasterAddress + +> **paymasterAddress**: `Address` + +Defined in: [SuperPaymaster/index.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L5) + +*** + +### postOpGasLimit? + +> `optional` **postOpGasLimit**: `bigint` + +Defined in: [SuperPaymaster/index.ts:9](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L9) + +*** + +### verificationGasLimit? + +> `optional` **verificationGasLimit**: `bigint` + +Defined in: [SuperPaymaster/index.ts:8](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/SuperPaymaster/index.ts#L8) diff --git a/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md b/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md new file mode 100644 index 000000000..3e5c06540 --- /dev/null +++ b/0.16.23/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md @@ -0,0 +1,35 @@ +> **PaymasterV4MiddlewareConfig** = `object` + +Defined in: [V4/PaymasterUtils.ts:3](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L3) + +## Properties + +### gasToken + +> **gasToken**: `Address` + +Defined in: [V4/PaymasterUtils.ts:5](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L5) + +*** + +### paymasterAddress + +> **paymasterAddress**: `Address` + +Defined in: [V4/PaymasterUtils.ts:4](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L4) + +*** + +### postOpGasLimit? + +> `optional` **postOpGasLimit**: `bigint` + +Defined in: [V4/PaymasterUtils.ts:7](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L7) + +*** + +### verificationGasLimit? + +> `optional` **verificationGasLimit**: `bigint` + +Defined in: [V4/PaymasterUtils.ts:6](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/paymaster/src/V4/PaymasterUtils.ts#L6) diff --git a/0.16.23/api/@aastar/sdk.md b/0.16.23/api/@aastar/sdk.md new file mode 100644 index 000000000..4a8c6f575 --- /dev/null +++ b/0.16.23/api/@aastar/sdk.md @@ -0,0 +1,189 @@ +# AAstar SDK + +The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem. +AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。 + +[![npm version](https://img.shields.io/npm/v/@aastar/sdk.svg)](https://www.npmjs.com/package/@aastar/sdk) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +--- + +## 🌟 Introduction | 简介 + +AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors. + +AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。 + +### Core Modules | 核心模块 + +- **[`@aastar/community`](https://docs.aastar.io/api/@aastar/community)**: Launch & manage DAOs. (启动和管理 DAO) +- **[`@aastar/operator`](https://docs.aastar.io/api/@aastar/operator)**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益) +- **[`@aastar/enduser`](https://docs.aastar.io/api/@aastar/enduser)**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易) +- **[`@aastar/analytics`](https://docs.aastar.io/api/@aastar/analytics)**: Monitor ecosystem data. (监控生态系统数据) +- **[`@aastar/tokens`](https://docs.aastar.io/api/@aastar/tokens)**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具) +- **[`@aastar/identity`](https://docs.aastar.io/api/@aastar/identity)**: Reputation & SBT management. (声誉和 SBT 管理) +- **[`@aastar/account`](https://docs.aastar.io/api/@aastar/account)**: Smart Account (ERC-4337) utilities. (智能账户工具) +- **[`@aastar/core`](https://docs.aastar.io/api/@aastar/core)**: Shared logic, Roles, and configuration. (共享逻辑、角色和配置) +- **[`@aastar/paymaster`](https://docs.aastar.io/api/@aastar/paymaster)**: Low-level Paymaster interactions. (低层级 Paymaster 交互) +- **[`@aastar/dapp`](https://docs.aastar.io/api/@aastar/dapp)**: Pre-built UI components and React hooks. (预建 UI 组件和 React hooks) + +--- + +## 📦 Installation | 安装 + +```bash +pnpm add @aastar/sdk viem +# or +npm install @aastar/sdk viem +``` + +--- + +## 📚 Documentation | 文档导航 + +- **Docs Home**: https://docs.aastar.io/ +- **API Reference**: https://docs.aastar.io/api/ +- **Examples**: https://docs.aastar.io/examples/ +- **Deployments**: https://docs.aastar.io/guide/deployments/verify.sepolia.contracts +- **Configuration Sync**: https://docs.aastar.io/guide/docs/Configuration_Sync +- **Regression Testing**: https://docs.aastar.io/guide/docs/Regression_Testing_Guide +- **Gasless Tester Guide**: https://docs.aastar.io/guide/docs/TESTER_GUIDE_GASLESS +- **Price Keeper Guide**: [docs/guide/keeper.md](../../docs/guide/keeper.md) + +--- + +## 🚀 Usage | 使用指南 + +### 1. Initialize Client | 初始化客户端 + +```typescript +import { createPublicClient, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { CommunityClient, OperatorClient } from '@aastar/sdk'; + +// 1. Setup VIEM clients +const publicClient = createPublicClient({ chain: sepolia, transport: http() }); +const walletClient = createWalletClient({ chain: sepolia, transport: http() }); + +// 2. Initialize AAstar Clients +const communityClient = new CommunityClient(publicClient, walletClient); +const operatorClient = new OperatorClient(publicClient, walletClient); +``` + +### 2. "Pre-check" Pattern | "预检查" 模式 + +Avoid reverts and save gas by checking requirements off-chain first. +通过链下预检查避免交易回滚并节省 Gas。 + +```typescript +// ❌ Old Way (Prone to errors) +// await communityClient.launchCommunity(...); + +// ✅ New AAstar Way +const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33")); + +if (!check.hasEnoughGToken) { + console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`); + // Output: "Need 33 GT, have 10 GT" +} else { + // Safe to execute + await communityClient.launchCommunity({ + name: "My DAO", + tokenSymbol: "MDAO" + }); +} +``` + +### 3. Key Scenarios | 核心场景 + +#### 🏛️ For Community Owners (社区创建者) + +```typescript +// Configure SBT rules for your community +await communityClient.configureSBTRules({ + communityId: myCommunityId, + rule: { + minScore: 100, + requiredTags: ["OG"] + } +}); +``` + +#### ⚙️ For Operators (运营商) + +```typescript +// Check if you are ready to be a Super Paymaster +const status = await operatorClient.checkResources(myAddress); + +if (status.hasRole) { + await operatorClient.withdrawCollateral(parseEther("50")); +} else { + console.log(status.recommendations); + // "Fund aPNTs for collateral", "Stake GToken" +} +``` + +#### 📊 For Analysts (分析师) + +```typescript +import { AnalyticsClient } from '@aastar/sdk'; + +const analytics = new AnalyticsClient(publicClient); + +// Get real-time GToken metrics +const metrics = await analytics.getSupplyMetrics(); +console.log(`Deflation Rate: ${metrics.deflationRate}%`); +``` + +--- + +## 🔧 Architecture | 架构 + +AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives. + +AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。 + +| Package | Functionality (功能) | +|---------|---------------------| +| `@aastar/core` | Shared logic, Roles, RequirementChecker | +| `@aastar/community` | DAO Registry, XPNTs issuance | +| `@aastar/operator` | Paymaster ops, Staking management | +| `@aastar/enduser` | User onboarding, SBT minting | +| `@aastar/tokens` | Finance, Tokenomics, Approval flows | +| `@aastar/identity` | Reputation, Credit limits, ZK Proofs | +| `@aastar/paymaster` | EntryPoint & Paymaster low-level API | +| `@aastar/dapp` | React Components & Integration Hooks | + +--- + +## 📊 Gas Analytics & Reporting | Gas 分析与报表 +The SDK includes a powerful **Gas Analytics Module** for analyzing Paymaster efficiency, tracking costs, and generating industry comparison reports. +SDK 包含一个强大的 **Gas 分析模块**,用于分析 Paymaster 效率、追踪成本并生成行业对比报告。 + +### Quick Start | 快速开始 +Generate a real-time analysis of recent Sepolia transactions: +生成最近 Sepolia 交易的实时分析: +```bash +npx tsx packages/analytics/src/gas-analyzer-v4.ts +``` + +### Key Features | 核心功能 +- **Double-Layer Analysis (双层分析)**: Intrinsic EVM Efficiency vs. Economic USD Costs +- **Industry Benchmarking (行业对标)**: Compare AAStar vs. Optimism, Alchemy, Pimlico +- **Profit Tracking (利润追踪)**: Transparent breakdown of Protocol Revenue & Profit +- **L2 Simulation (L2 模拟)**: Estimate savings for migrating UserOps to Optimism + +👉 **[View Full Analytics Documentation | 查看完整分析文档](https://docs.aastar.io/guide/packages/analytics/)** + +--- + +## 🤝 Contributing | 贡献 + +We welcome contributions! Please see our Contributing Guide for details. +欢迎贡献!更多详情请参考贡献指南。 + +--- + +

+ Built with ❤️ by the AAstar Community +

diff --git a/0.16.23/api/@aastar/sdk/index.md b/0.16.23/api/@aastar/sdk/index.md new file mode 100644 index 000000000..4a8c6f575 --- /dev/null +++ b/0.16.23/api/@aastar/sdk/index.md @@ -0,0 +1,189 @@ +# AAstar SDK + +The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem. +AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。 + +[![npm version](https://img.shields.io/npm/v/@aastar/sdk.svg)](https://www.npmjs.com/package/@aastar/sdk) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +--- + +## 🌟 Introduction | 简介 + +AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors. + +AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。 + +### Core Modules | 核心模块 + +- **[`@aastar/community`](https://docs.aastar.io/api/@aastar/community)**: Launch & manage DAOs. (启动和管理 DAO) +- **[`@aastar/operator`](https://docs.aastar.io/api/@aastar/operator)**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益) +- **[`@aastar/enduser`](https://docs.aastar.io/api/@aastar/enduser)**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易) +- **[`@aastar/analytics`](https://docs.aastar.io/api/@aastar/analytics)**: Monitor ecosystem data. (监控生态系统数据) +- **[`@aastar/tokens`](https://docs.aastar.io/api/@aastar/tokens)**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具) +- **[`@aastar/identity`](https://docs.aastar.io/api/@aastar/identity)**: Reputation & SBT management. (声誉和 SBT 管理) +- **[`@aastar/account`](https://docs.aastar.io/api/@aastar/account)**: Smart Account (ERC-4337) utilities. (智能账户工具) +- **[`@aastar/core`](https://docs.aastar.io/api/@aastar/core)**: Shared logic, Roles, and configuration. (共享逻辑、角色和配置) +- **[`@aastar/paymaster`](https://docs.aastar.io/api/@aastar/paymaster)**: Low-level Paymaster interactions. (低层级 Paymaster 交互) +- **[`@aastar/dapp`](https://docs.aastar.io/api/@aastar/dapp)**: Pre-built UI components and React hooks. (预建 UI 组件和 React hooks) + +--- + +## 📦 Installation | 安装 + +```bash +pnpm add @aastar/sdk viem +# or +npm install @aastar/sdk viem +``` + +--- + +## 📚 Documentation | 文档导航 + +- **Docs Home**: https://docs.aastar.io/ +- **API Reference**: https://docs.aastar.io/api/ +- **Examples**: https://docs.aastar.io/examples/ +- **Deployments**: https://docs.aastar.io/guide/deployments/verify.sepolia.contracts +- **Configuration Sync**: https://docs.aastar.io/guide/docs/Configuration_Sync +- **Regression Testing**: https://docs.aastar.io/guide/docs/Regression_Testing_Guide +- **Gasless Tester Guide**: https://docs.aastar.io/guide/docs/TESTER_GUIDE_GASLESS +- **Price Keeper Guide**: [docs/guide/keeper.md](../../docs/guide/keeper.md) + +--- + +## 🚀 Usage | 使用指南 + +### 1. Initialize Client | 初始化客户端 + +```typescript +import { createPublicClient, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { CommunityClient, OperatorClient } from '@aastar/sdk'; + +// 1. Setup VIEM clients +const publicClient = createPublicClient({ chain: sepolia, transport: http() }); +const walletClient = createWalletClient({ chain: sepolia, transport: http() }); + +// 2. Initialize AAstar Clients +const communityClient = new CommunityClient(publicClient, walletClient); +const operatorClient = new OperatorClient(publicClient, walletClient); +``` + +### 2. "Pre-check" Pattern | "预检查" 模式 + +Avoid reverts and save gas by checking requirements off-chain first. +通过链下预检查避免交易回滚并节省 Gas。 + +```typescript +// ❌ Old Way (Prone to errors) +// await communityClient.launchCommunity(...); + +// ✅ New AAstar Way +const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33")); + +if (!check.hasEnoughGToken) { + console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`); + // Output: "Need 33 GT, have 10 GT" +} else { + // Safe to execute + await communityClient.launchCommunity({ + name: "My DAO", + tokenSymbol: "MDAO" + }); +} +``` + +### 3. Key Scenarios | 核心场景 + +#### 🏛️ For Community Owners (社区创建者) + +```typescript +// Configure SBT rules for your community +await communityClient.configureSBTRules({ + communityId: myCommunityId, + rule: { + minScore: 100, + requiredTags: ["OG"] + } +}); +``` + +#### ⚙️ For Operators (运营商) + +```typescript +// Check if you are ready to be a Super Paymaster +const status = await operatorClient.checkResources(myAddress); + +if (status.hasRole) { + await operatorClient.withdrawCollateral(parseEther("50")); +} else { + console.log(status.recommendations); + // "Fund aPNTs for collateral", "Stake GToken" +} +``` + +#### 📊 For Analysts (分析师) + +```typescript +import { AnalyticsClient } from '@aastar/sdk'; + +const analytics = new AnalyticsClient(publicClient); + +// Get real-time GToken metrics +const metrics = await analytics.getSupplyMetrics(); +console.log(`Deflation Rate: ${metrics.deflationRate}%`); +``` + +--- + +## 🔧 Architecture | 架构 + +AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives. + +AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。 + +| Package | Functionality (功能) | +|---------|---------------------| +| `@aastar/core` | Shared logic, Roles, RequirementChecker | +| `@aastar/community` | DAO Registry, XPNTs issuance | +| `@aastar/operator` | Paymaster ops, Staking management | +| `@aastar/enduser` | User onboarding, SBT minting | +| `@aastar/tokens` | Finance, Tokenomics, Approval flows | +| `@aastar/identity` | Reputation, Credit limits, ZK Proofs | +| `@aastar/paymaster` | EntryPoint & Paymaster low-level API | +| `@aastar/dapp` | React Components & Integration Hooks | + +--- + +## 📊 Gas Analytics & Reporting | Gas 分析与报表 +The SDK includes a powerful **Gas Analytics Module** for analyzing Paymaster efficiency, tracking costs, and generating industry comparison reports. +SDK 包含一个强大的 **Gas 分析模块**,用于分析 Paymaster 效率、追踪成本并生成行业对比报告。 + +### Quick Start | 快速开始 +Generate a real-time analysis of recent Sepolia transactions: +生成最近 Sepolia 交易的实时分析: +```bash +npx tsx packages/analytics/src/gas-analyzer-v4.ts +``` + +### Key Features | 核心功能 +- **Double-Layer Analysis (双层分析)**: Intrinsic EVM Efficiency vs. Economic USD Costs +- **Industry Benchmarking (行业对标)**: Compare AAStar vs. Optimism, Alchemy, Pimlico +- **Profit Tracking (利润追踪)**: Transparent breakdown of Protocol Revenue & Profit +- **L2 Simulation (L2 模拟)**: Estimate savings for migrating UserOps to Optimism + +👉 **[View Full Analytics Documentation | 查看完整分析文档](https://docs.aastar.io/guide/packages/analytics/)** + +--- + +## 🤝 Contributing | 贡献 + +We welcome contributions! Please see our Contributing Guide for details. +欢迎贡献!更多详情请参考贡献指南。 + +--- + +

+ Built with ❤️ by the AAstar Community +

diff --git a/0.16.23/api/@aastar/tokens/classes/FinanceClient.md b/0.16.23/api/@aastar/tokens/classes/FinanceClient.md new file mode 100644 index 000000000..0c0d661b6 --- /dev/null +++ b/0.16.23/api/@aastar/tokens/classes/FinanceClient.md @@ -0,0 +1,307 @@ +Defined in: [index.ts:16](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L16) + +## Constructors + +### Constructor + +> **new FinanceClient**(`publicClient`, `walletClient`): `FinanceClient` + +Defined in: [index.ts:22](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L22) + +Initialize FinanceClient + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `publicClient` | [`PublicClient`](../../core/interfaces/PublicClient.md) | The public client for queries | +| `walletClient` | [`WalletClient`](../../core/interfaces/WalletClient.md) | The wallet client for transactions | + +#### Returns + +`FinanceClient` + +## Methods + +### approveAndStake() + +> **approveAndStake**(`amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:159](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L159) + +One-step stake: Approve (if needed) + Stake + +#### Parameters + +| Parameter | Type | Description | +| ------ | ------ | ------ | +| `amount` | `bigint` | Amount of GToken to stake | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +Transaction hash of the stake action + +*** + +### getAPNTsBalance() + +> **getAPNTsBalance**(`address`): `Promise`\<`bigint`\> + +Defined in: [index.ts:143](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L143) + +Get aPNTs balance + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getCirculatingSupply() + +> **getCirculatingSupply**(): `Promise`\<\{ `circulating`: `bigint`; `locked`: `bigint`; `total`: `bigint`; \}\> + +Defined in: [index.ts:197](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L197) + +Get circulating supply (total - locked) + +#### Returns + +`Promise`\<\{ `circulating`: `bigint`; `locked`: `bigint`; `total`: `bigint`; \}\> + +*** + +### getGTokenBalance() + +> **getGTokenBalance**(`address`): `Promise`\<`bigint`\> + +Defined in: [index.ts:130](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L130) + +Get GToken balance + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `address` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +*** + +### getTokenomicsOverview() + +> **getTokenomicsOverview**(): `Promise`\<\{ `circulatingSupply`: `bigint`; `stakingRatio`: `number`; `totalBurned`: `bigint`; `totalStaked`: `bigint`; `totalSupply`: `bigint`; \}\> + +Defined in: [index.ts:224](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L224) + +Get comprehensive tokenomics data + +#### Returns + +`Promise`\<\{ `circulatingSupply`: `bigint`; `stakingRatio`: `number`; `totalBurned`: `bigint`; `totalStaked`: `bigint`; `totalSupply`: `bigint`; \}\> + +*** + +### ~~depositToEntryPoint()~~ + +> `static` **depositToEntryPoint**(`wallet`, `entryPoint`, `paymaster`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:82](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L82) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `entryPoint` | `` `0x${string}` `` | +| `paymaster` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~depositToPaymaster()~~ + +> `static` **depositToPaymaster**(`wallet`, `paymaster`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:30](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L30) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `paymaster` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~depositViaTransferAndCall()~~ + +> `static` **depositViaTransferAndCall**(`wallet`, `token`, `paymaster`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:41](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L41) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `token` | `` `0x${string}` `` | +| `paymaster` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~getEntryPointBalance()~~ + +> `static` **getEntryPointBalance**(`client`, `entryPoint`, `account`): `Promise`\<`bigint`\> + +Defined in: [index.ts:94](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L94) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `client` | `any` | +| `entryPoint` | `` `0x${string}` `` | +| `account` | `` `0x${string}` `` | + +#### Returns + +`Promise`\<`bigint`\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~operatorDeposit()~~ + +> `static` **operatorDeposit**(`wallet`, `paymaster`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:104](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L104) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `paymaster` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~operatorNotifyDeposit()~~ + +> `static` **operatorNotifyDeposit**(`wallet`, `paymaster`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:115](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L115) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `paymaster` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~stakeGToken()~~ + +> `static` **stakeGToken**(`wallet`, `stakingAddr`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:60](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L60) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `stakingAddr` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead + +*** + +### ~~withdrawProtocolRevenue()~~ + +> `static` **withdrawProtocolRevenue**(`wallet`, `paymaster`, `to`, `amount`): `Promise`\<`` `0x${string}` ``\> + +Defined in: [index.ts:71](https://github.com/AAStarCommunity/aastar-sdk/blob/9c654bccf291bedf59c180131227065a5460e904/packages/tokens/src/index.ts#L71) + +#### Parameters + +| Parameter | Type | +| ------ | ------ | +| `wallet` | [`WalletClient`](../../core/interfaces/WalletClient.md) | +| `paymaster` | `` `0x${string}` `` | +| `to` | `` `0x${string}` `` | +| `amount` | `bigint` | + +#### Returns + +`Promise`\<`` `0x${string}` ``\> + +#### Deprecated + +Use instance methods instead diff --git a/0.16.23/api/@aastar/tokens/index.md b/0.16.23/api/@aastar/tokens/index.md new file mode 100644 index 000000000..b32b51b5a --- /dev/null +++ b/0.16.23/api/@aastar/tokens/index.md @@ -0,0 +1,3 @@ +## Classes + +- [FinanceClient](classes/FinanceClient.md) diff --git a/0.16.23/api/index.md b/0.16.23/api/index.md new file mode 100644 index 000000000..4a8c6f575 --- /dev/null +++ b/0.16.23/api/index.md @@ -0,0 +1,189 @@ +# AAstar SDK + +The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem. +AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。 + +[![npm version](https://img.shields.io/npm/v/@aastar/sdk.svg)](https://www.npmjs.com/package/@aastar/sdk) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +--- + +## 🌟 Introduction | 简介 + +AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors. + +AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。 + +### Core Modules | 核心模块 + +- **[`@aastar/community`](https://docs.aastar.io/api/@aastar/community)**: Launch & manage DAOs. (启动和管理 DAO) +- **[`@aastar/operator`](https://docs.aastar.io/api/@aastar/operator)**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益) +- **[`@aastar/enduser`](https://docs.aastar.io/api/@aastar/enduser)**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易) +- **[`@aastar/analytics`](https://docs.aastar.io/api/@aastar/analytics)**: Monitor ecosystem data. (监控生态系统数据) +- **[`@aastar/tokens`](https://docs.aastar.io/api/@aastar/tokens)**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具) +- **[`@aastar/identity`](https://docs.aastar.io/api/@aastar/identity)**: Reputation & SBT management. (声誉和 SBT 管理) +- **[`@aastar/account`](https://docs.aastar.io/api/@aastar/account)**: Smart Account (ERC-4337) utilities. (智能账户工具) +- **[`@aastar/core`](https://docs.aastar.io/api/@aastar/core)**: Shared logic, Roles, and configuration. (共享逻辑、角色和配置) +- **[`@aastar/paymaster`](https://docs.aastar.io/api/@aastar/paymaster)**: Low-level Paymaster interactions. (低层级 Paymaster 交互) +- **[`@aastar/dapp`](https://docs.aastar.io/api/@aastar/dapp)**: Pre-built UI components and React hooks. (预建 UI 组件和 React hooks) + +--- + +## 📦 Installation | 安装 + +```bash +pnpm add @aastar/sdk viem +# or +npm install @aastar/sdk viem +``` + +--- + +## 📚 Documentation | 文档导航 + +- **Docs Home**: https://docs.aastar.io/ +- **API Reference**: https://docs.aastar.io/api/ +- **Examples**: https://docs.aastar.io/examples/ +- **Deployments**: https://docs.aastar.io/guide/deployments/verify.sepolia.contracts +- **Configuration Sync**: https://docs.aastar.io/guide/docs/Configuration_Sync +- **Regression Testing**: https://docs.aastar.io/guide/docs/Regression_Testing_Guide +- **Gasless Tester Guide**: https://docs.aastar.io/guide/docs/TESTER_GUIDE_GASLESS +- **Price Keeper Guide**: [docs/guide/keeper.md](../../docs/guide/keeper.md) + +--- + +## 🚀 Usage | 使用指南 + +### 1. Initialize Client | 初始化客户端 + +```typescript +import { createPublicClient, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { CommunityClient, OperatorClient } from '@aastar/sdk'; + +// 1. Setup VIEM clients +const publicClient = createPublicClient({ chain: sepolia, transport: http() }); +const walletClient = createWalletClient({ chain: sepolia, transport: http() }); + +// 2. Initialize AAstar Clients +const communityClient = new CommunityClient(publicClient, walletClient); +const operatorClient = new OperatorClient(publicClient, walletClient); +``` + +### 2. "Pre-check" Pattern | "预检查" 模式 + +Avoid reverts and save gas by checking requirements off-chain first. +通过链下预检查避免交易回滚并节省 Gas。 + +```typescript +// ❌ Old Way (Prone to errors) +// await communityClient.launchCommunity(...); + +// ✅ New AAstar Way +const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33")); + +if (!check.hasEnoughGToken) { + console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`); + // Output: "Need 33 GT, have 10 GT" +} else { + // Safe to execute + await communityClient.launchCommunity({ + name: "My DAO", + tokenSymbol: "MDAO" + }); +} +``` + +### 3. Key Scenarios | 核心场景 + +#### 🏛️ For Community Owners (社区创建者) + +```typescript +// Configure SBT rules for your community +await communityClient.configureSBTRules({ + communityId: myCommunityId, + rule: { + minScore: 100, + requiredTags: ["OG"] + } +}); +``` + +#### ⚙️ For Operators (运营商) + +```typescript +// Check if you are ready to be a Super Paymaster +const status = await operatorClient.checkResources(myAddress); + +if (status.hasRole) { + await operatorClient.withdrawCollateral(parseEther("50")); +} else { + console.log(status.recommendations); + // "Fund aPNTs for collateral", "Stake GToken" +} +``` + +#### 📊 For Analysts (分析师) + +```typescript +import { AnalyticsClient } from '@aastar/sdk'; + +const analytics = new AnalyticsClient(publicClient); + +// Get real-time GToken metrics +const metrics = await analytics.getSupplyMetrics(); +console.log(`Deflation Rate: ${metrics.deflationRate}%`); +``` + +--- + +## 🔧 Architecture | 架构 + +AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives. + +AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。 + +| Package | Functionality (功能) | +|---------|---------------------| +| `@aastar/core` | Shared logic, Roles, RequirementChecker | +| `@aastar/community` | DAO Registry, XPNTs issuance | +| `@aastar/operator` | Paymaster ops, Staking management | +| `@aastar/enduser` | User onboarding, SBT minting | +| `@aastar/tokens` | Finance, Tokenomics, Approval flows | +| `@aastar/identity` | Reputation, Credit limits, ZK Proofs | +| `@aastar/paymaster` | EntryPoint & Paymaster low-level API | +| `@aastar/dapp` | React Components & Integration Hooks | + +--- + +## 📊 Gas Analytics & Reporting | Gas 分析与报表 +The SDK includes a powerful **Gas Analytics Module** for analyzing Paymaster efficiency, tracking costs, and generating industry comparison reports. +SDK 包含一个强大的 **Gas 分析模块**,用于分析 Paymaster 效率、追踪成本并生成行业对比报告。 + +### Quick Start | 快速开始 +Generate a real-time analysis of recent Sepolia transactions: +生成最近 Sepolia 交易的实时分析: +```bash +npx tsx packages/analytics/src/gas-analyzer-v4.ts +``` + +### Key Features | 核心功能 +- **Double-Layer Analysis (双层分析)**: Intrinsic EVM Efficiency vs. Economic USD Costs +- **Industry Benchmarking (行业对标)**: Compare AAStar vs. Optimism, Alchemy, Pimlico +- **Profit Tracking (利润追踪)**: Transparent breakdown of Protocol Revenue & Profit +- **L2 Simulation (L2 模拟)**: Estimate savings for migrating UserOps to Optimism + +👉 **[View Full Analytics Documentation | 查看完整分析文档](https://docs.aastar.io/guide/packages/analytics/)** + +--- + +## 🤝 Contributing | 贡献 + +We welcome contributions! Please see our Contributing Guide for details. +欢迎贡献!更多详情请参考贡献指南。 + +--- + +

+ Built with ❤️ by the AAstar Community +

diff --git a/0.16.23/api/modules/analytics.md b/0.16.23/api/modules/analytics.md new file mode 100644 index 000000000..8ba9794ef --- /dev/null +++ b/0.16.23/api/modules/analytics.md @@ -0,0 +1,440 @@ +# Analytics Package (AAStar Gas Analytics & Experimentation) + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It supports **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis with rigorous, on-chain ground truth verification. + +```bash +# 快速入口(从 aastar-sdk 根目录运行) + +# 收集 OP Mainnet paymaster 基线 +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts --network op-mainnet --n 50 + +# 收集 Paper7 专属数据 +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 + +# 全流程协调器 +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia + +# Gas 分析报告文档 +packages/analytics/docs/OP_Mainnet_Gas_Analysis_Report.md +``` + +--- + +## System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # Traffic Generation Logic +│ ├── collectors/ # Etherscan/RPC Fetchers +│ │ └── EventFetcher.ts # On-chain UserOperationEvent collector +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── scripts/ # ← All data collection scripts (consolidated) +│ ├── collect_paymaster_baselines.ts # OP mainnet V4/SuperPM baselines +│ ├── collect_eoa_erc20_baseline.ts # EOA ERC20 transfer baseline +│ ├── collect_industry_baseline.ts # Alchemy/Pimlico baselines +│ ├── compute_cost_summary.ts # Aggregated cost breakdown table +│ ├── gasless-collect.ts # Gasless data collector (OP mainnet) +│ ├── paper7-exclusive-data.ts # Paper7 closed-loop data (anvil) +│ ├── paper7_credit_loop.ts # Credit→Debt→Repay cycle runner +│ ├── paper7_reputation_credit.ts # Reputation→Credit mapping runner +│ ├── run_analytics_coordinator.ts # Full pipeline coordinator +│ ├── run_paper7_exclusive_data.sh # Paper7 shell wrapper (CI-friendly) +│ ├── fetch-tx-hashes.ts # TX hash fetcher utility +│ └── scrape-tx.ts # Puppeteer Etherscan scraper +├── docs/ # ← Research reports and analysis documents +│ └── OP_Mainnet_Gas_Analysis_Report.md # Paper3/Paper7 gas cost evidence +├── data/ # Raw data store +│ ├── gasless_data_collection.csv # T1/T2/T2.1/T5 baseline (v1) +│ ├── gasless_data_collection_v2.csv # Controlled single-UserOp (v2) +│ ├── gasless_metrics_detailed.csv # Full L1/L2 fee decomposition +│ ├── industry_paymaster_baselines.csv # Alchemy, Pimlico on-chain baselines +│ ├── eoa_erc20_baseline.csv # Raw EOA transfer baseline +│ ├── paper7_exclusive/ # Paper7 credit/reputation/liquidity +│ └── paper_gas_op_mainnet/ # Paper3 per-date controlled datasets +│ ├── 2026-02-17/ # V4 n=36, SuperPM n=43 +│ └── 2026-02-18/ # V4/SuperPM with sender (n=50) +└── reports/ # HTML/Markdown summaries +``` + +--- + +## Workflows + +### A. Collect OP Mainnet Paymaster Baselines (Paper3) +```bash +# V4 baseline: strict single UserOp + ERC20 transfer filter +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type v4 --n 50 --strict-transfer --single-userop + +# SuperPaymaster baseline +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type super --n 50 +``` + +### B. Run Full Experiment (Coordinator) +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia +``` + +### C. Fetch Historical Data Only +```bash +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### D. Transaction Scraper (Etherscan) +Reads from `data/gasless_data_collection.csv`, outputs to `data/gasless_metrics_detailed.csv`. +```bash +pnpm tsx packages/analytics/scripts/scrape-tx.ts +``` + +--- + +## Data Directory + +| File | Description | +|------|-------------| +| `data/gasless_data_collection.csv` | T1/T2/T2.1/T5 records with TxHash + Label | +| `data/gasless_data_collection_v2.csv` | High-fidelity controlled dataset (single-UserOp, ERC20) | +| `data/gasless_metrics_detailed.csv` | L1 Fee, L2 Fee, Gas Used (Puppeteer scraped) | +| `data/industry_paymaster_baselines.csv` | Alchemy (mean=257k) + Pimlico (mean=387k) on-chain baselines | +| `data/eoa_erc20_baseline.csv` | Raw EOA ERC20 transfer baseline | +| `data/paper7_exclusive/` | Credit cycle + reputation + liquidity simulation (Anvil) | +| `data/paper_gas_op_mainnet/2026-02-17/` | V4 n=36, SuperPM n=43 (strict filter) | +| `data/paper_gas_op_mainnet/2026-02-18/` | V4/SuperPM with sender field (n=50) | + +--- + +## Paper7 Exclusive Data (Credit / Reputation / Liquidity) + +Paper7 requires a distinct set of evidence to prove **CommunityFi closed-loop semantics**: + +- **Reputation → Credit**: contribution/reputation synced into Registry, credit limit observed to change +- **Credit → Debt → Repay**: debt recorded in Paymaster/Registry, cleared via xPNTs +- **Liquidity (Baseline)**: simulation curve showing gas-redeemable vs non-redeemable points over time + +### Running + +```bash +# Unified entry (Anvil auto-start, deploy, sync, run all subtasks) +pnpm exec tsx packages/analytics/scripts/paper7-exclusive-data.ts --network anvil --cycles 5 + +# Shell wrapper (CI-friendly) +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### Output Structure + +```text +data/paper7_exclusive// + credit_cycle_1.json # credit→debt→repay per account + ... + reputation_credit.json # reputation sync → credit limit mapping + liquidity_velocity_simulation.csv + synced_config.anvil.json +``` + +#### `credit_cycle_*.json` fields +- `creditLimitWei / creditLimitEth`: credit limit in Registry +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`: debt lifecycle +- `gasUsed.*`: per-step gas units (approve, setCreditTier, recordDebt, mint) + +#### `reputation_credit.json` fields +- `score` / `globalReputation` / `creditLimitWei`: reputation → credit mapping +- `gasUsed.*`: setRule, syncToRegistry, etc. + +#### `liquidity_velocity_simulation.csv` columns +- `day`: simulation step +- `points_gas_redeemable`: points stock when gas-redeemable +- `points_baseline`: points stock without gas redemption + +--- + +## Key Modules + +### 1. Traffic Generators (`src/generators/`) +- **EOAGenerator**: Baseline ETH transfers for network cost measurement. +- **SuperPaymasterGenerator**: Treatment group — credit/asset-oriented gasless model. +- **PaymasterV4Generator**: Treatment group B — deposit model for comparison. + +### 2. Data Collectors (`src/collectors/`) +- **HistoricalFetcher**: Etherscan/OptimismScan API for full transaction histories. +- **EventFetcher**: On-chain `UserOperationEvent` log collector with strict filtering. + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +- **Attribution**: L1 Security | L2 Execution | Protocol Overhead breakdown. +- **Comparison**: T1 vs T2 vs T2.1 vs T5 vs industry baselines. + + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It has been upgraded to support **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis, moving beyond simple log analysis to rigorous, on-chain ground truth verification. +工作流: + +收集数据(日常运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia +产生新实验数据(需要时运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --gen-traffic + +收集events +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --fetch-events + +分析报告(查看结果): +pnpm tsx packages/analytics/src/gas-analyzer-v4.ts --network sepolia + +步骤是解耦的,按需执行即可 +--- + +## 🏗 System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## 🧩 Key Modules + +### 1. Traffic Generators (`src/generators/`) +Responsible for creating controlled, verifiable traffic patterns on testnets (Sepolia, OP Sepolia) and mainnets. +- **EOAGenerator**: Baseline ETH transfers to measure intrinsic network costs. +- **StandardAAGenerator**: ERC-4337 flows using industry-standard Paymasters (Pimlico/Alchemy). +- **SuperPaymasterGenerator**: **Treatment Group**. Uses the `EndUserClient` to execute gasless transactions via the "Credit/Asset-Oriented" model (Dual-Token). +- **PaymasterV4Generator**: **Treatment Group B**. Uses the "Deposit" model (Single-Token) for comparative analysis. + +### 2. Data Collectors (`src/collectors/`) +Responsible for gathering "Ground Truth" data. +- **HistoricalFetcher**: Connects to Etherscan/OptimismScan APIs to retrieve full transaction histories for test accounts defined in `l4-state.json`. **Crucial for auditability.** +- **LogParser**: Legacy parser for development logs (kept for backward compatibility). + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +The brain of the operation. +- **Double-Layer Analysis**: + - **Intrinsic Layer**: Gas used, Blob gas, Calldata efficiency. + - **Economic Layer**: USD costs, Protocol Revenue, Net Profit. +- **Attribution**: Breaks down cost into L1 Security, L2 Execution, and Protocol Overhead. + +--- + +## 🚀 Workflows + +### A. Run Full Experiment (Coordinator) +The `run_analytics_coordinator.ts` script orchestrates the entire lifecycle. + +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +npx tsx scripts/run_analytics_coordinator.ts --network sepolia +``` + +### B. Fetch Historical Data Only +Useful for auditing existing accounts without spending gas. +```bash +npx tsx scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### C. Traffic Generation Only +Generate a specific number of transactions for a specific group. +```bash +npx tsx packages/analytics/src/generators/cli.ts --group superpaymaster --runs 10 +``` + +--- + +## 📊 Data & Metrics + +We prioritize **Intrinsic Metrics** to ensure scientific validity independent of market volatility. + +| Metric | Definition | Source | +| :--- | :--- | :--- | +| **Gas Used** | Total gas consumed by the transaction | `receipt.gasUsed` | +| **L1 Fee** | Cost of posting data to L1 (for L2s) | Oracle Contract / Header | +| **Latency** | Time from `UserOp` submission to inclusion | Client-side Timestamp | +| **Steps** | Number of signatures/interactions required | Protocol Definition | + +--- + +## 📂 Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # [NEW] Traffic Generation Logic +│ ├── collectors/ # [NEW] Etherscan/RPC Fetchers +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── data/ # Raw JSON Data Store +└── reports/ # HTML/Markdown Reports +``` + +--- + +## 🕷️ Transaction Scraper + +A Puppeteer-based scraper to extract detailed gas and fee metrics from Optimism Etherscan. + +### Prerequisites + +- Node.js & pnpm +- Chrome browser (Puppeteer will attempt to install this automatically, but you can run `npx puppeteer browsers install chrome` if needed) + +### Running the Scraper + +The scraper reads transaction hashes from `data/gasless_data_collection.csv` and outputs enriched metrics to `data/gasless_metrics_detailed.csv`. + +```bash +pnpm tsx scripts/scrape-tx.ts +``` + +## 📂 Data Directory (Paper7 Ground Truth) + +- `data/gasless_data_collection.csv`: 输入文件,包含 `Timestamp,Label,TxHash`,用于抓取交易详情。 +- `data/gasless_data_collection_v2.csv`: 主网/测试网的高保真样本集合(包含 `GasUsed(L2)`, `L2ExecutionFee(Wei)`, `L1DataFee(Wei)` 等列),用于论文/报告里的“真实网络成本与可用性”对照。 +- `data/gasless_metrics_detailed.csv`: 抓取后的明细输出(L1 Fee, L2 Fee, Gas Used 等),主要由 `scripts/scrape-tx.ts` 生成。 + +--- + +## 🧪 Paper7 专属数据:Credit / Reputation / Liquidity Loop + +Paper7 需要一组**与通用 gasless 基线不同**的专属证据,用来证明 CommunityFi 的闭环语义成立(而不仅是“能跑通 gasless”): + +- **Reputation → Credit**:将贡献/声誉同步进 Registry,并观察信用额度随之变化 +- **Credit → Debt → Repay**:在 Paymaster/Registry 侧记录债务,再用 xPNTs 完成清算归零 +- **Liquidity(Baseline Liquidity)**:用可复现实验/仿真曲线展示“积分可用于偿债/赞助”对流动性速度的影响(作为机制层证据,不依赖市场价格) + +### 1) 如何运行(推荐) + +统一入口脚本(负责启动 Anvil、必要时自动部署并同步配置,然后跑各子任务): + +```bash +pnpm exec tsx scripts/paper7-exclusive-data.ts --network anvil --cycles 5 +``` + +等价的 shell 包装(更适合 CI/重复跑批): + +```bash +./packages/analytics/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### 2) 脚本目标与流程定位 + +- `scripts/paper7-exclusive-data.ts` + - **目标**:生成 Paper7 专属闭环数据(credit cycles + reputation→credit + liquidity simulation)。 + - **作用位置**:属于“可重复的受控实验层”,用 gas units 固定地刻画合约路径开销与状态变化,避免 ETH/USD 等市场变量污染结论。 +- `scripts/paper7_credit_loop.ts` + - **目标**:跑一次完整 **credit→debt→repay** 闭环(Anvil-only,依赖 `anvil_*` RPC)。 + - **产出**:每次运行写一个 `credit_cycle_*.json`。 +- `scripts/paper7_reputation_credit.ts` + - **目标**:跑一次 **reputation sync → registry credit update**,并记录关键读数与每笔交易 gasUsed。 + - **产出**:写 `reputation_credit.json`。 +- `liquidity_velocity_simulation.csv` + - **目标**:给论文提供“Baseline Liquidity 机制”的直观趋势证据(对比可用于 gas 清算 vs 不可清算时,积分存量随时间的衰减/累积差异)。 + +### 3) 数据产物(在哪里、是什么、怎么看) + +所有 Paper7 专属数据默认写入: + +`packages/analytics/data/paper7_exclusive//` + +典型结构如下: + +```text +paper7_exclusive// + credit_cycle_1.json + credit_cycle_2.json + ... + reputation_credit.json + liquidity_velocity_simulation.csv + anvil.log # 若自动启动/部署,保留日志便于审计 + deploy.log # 若触发自动部署,保留 forge 日志便于复现 + synced_config.anvil.json # 若触发自动同步,记录当次使用的合约地址快照 +``` + +#### A) `credit_cycle_*.json`(闭环清算) + +每个 cycle 都是一次独立账户的闭环验证,核心字段: + +- `creditLimitWei / creditLimitEth`:该账户在 Registry 的信用额度(用于赞助/欠款边界) +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`:欠款从 0 → 增加 → 清算归零 +- `gasUsed.*`:每一步合约调用的 gas units(`approve`, `setCreditTier`, `recordDebt`, `mint`) +- `tx.*`:对应交易哈希(便于回溯 receipts / debug) + +#### B) `reputation_credit.json`(声誉到信用映射) + +用于证明 Reputation sync 后,Registry 中的 `globalReputation` 与 `getCreditLimit` 发生预期变化,并给出每步 gas units: + +- `score`:ReputationSystem 计算出的 score +- `globalReputation`:Registry 聚合后的全局声誉 +- `creditLimitWei / creditLimitEth`:映射后的信用额度 +- `gasUsed.*`:`setRule`, `setReputationSource`, `setEntropyFactor`, `syncToRegistry` + +#### C) `liquidity_velocity_simulation.csv`(基线流动性趋势) + +列定义: + +- `day`:仿真步(天) +- `points_gas_redeemable`:积分可用于 gas 清算/赞助时的积分存量曲线 +- `points_baseline`:积分不可清算(仅基础用途)时的积分存量曲线 diff --git a/0.16.23/api/modules/sdk.md b/0.16.23/api/modules/sdk.md new file mode 100644 index 000000000..4a8c6f575 --- /dev/null +++ b/0.16.23/api/modules/sdk.md @@ -0,0 +1,189 @@ +# AAstar SDK + +The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem. +AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。 + +[![npm version](https://img.shields.io/npm/v/@aastar/sdk.svg)](https://www.npmjs.com/package/@aastar/sdk) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +--- + +## 🌟 Introduction | 简介 + +AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors. + +AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。 + +### Core Modules | 核心模块 + +- **[`@aastar/community`](https://docs.aastar.io/api/@aastar/community)**: Launch & manage DAOs. (启动和管理 DAO) +- **[`@aastar/operator`](https://docs.aastar.io/api/@aastar/operator)**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益) +- **[`@aastar/enduser`](https://docs.aastar.io/api/@aastar/enduser)**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易) +- **[`@aastar/analytics`](https://docs.aastar.io/api/@aastar/analytics)**: Monitor ecosystem data. (监控生态系统数据) +- **[`@aastar/tokens`](https://docs.aastar.io/api/@aastar/tokens)**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具) +- **[`@aastar/identity`](https://docs.aastar.io/api/@aastar/identity)**: Reputation & SBT management. (声誉和 SBT 管理) +- **[`@aastar/account`](https://docs.aastar.io/api/@aastar/account)**: Smart Account (ERC-4337) utilities. (智能账户工具) +- **[`@aastar/core`](https://docs.aastar.io/api/@aastar/core)**: Shared logic, Roles, and configuration. (共享逻辑、角色和配置) +- **[`@aastar/paymaster`](https://docs.aastar.io/api/@aastar/paymaster)**: Low-level Paymaster interactions. (低层级 Paymaster 交互) +- **[`@aastar/dapp`](https://docs.aastar.io/api/@aastar/dapp)**: Pre-built UI components and React hooks. (预建 UI 组件和 React hooks) + +--- + +## 📦 Installation | 安装 + +```bash +pnpm add @aastar/sdk viem +# or +npm install @aastar/sdk viem +``` + +--- + +## 📚 Documentation | 文档导航 + +- **Docs Home**: https://docs.aastar.io/ +- **API Reference**: https://docs.aastar.io/api/ +- **Examples**: https://docs.aastar.io/examples/ +- **Deployments**: https://docs.aastar.io/guide/deployments/verify.sepolia.contracts +- **Configuration Sync**: https://docs.aastar.io/guide/docs/Configuration_Sync +- **Regression Testing**: https://docs.aastar.io/guide/docs/Regression_Testing_Guide +- **Gasless Tester Guide**: https://docs.aastar.io/guide/docs/TESTER_GUIDE_GASLESS +- **Price Keeper Guide**: [docs/guide/keeper.md](../../docs/guide/keeper.md) + +--- + +## 🚀 Usage | 使用指南 + +### 1. Initialize Client | 初始化客户端 + +```typescript +import { createPublicClient, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { CommunityClient, OperatorClient } from '@aastar/sdk'; + +// 1. Setup VIEM clients +const publicClient = createPublicClient({ chain: sepolia, transport: http() }); +const walletClient = createWalletClient({ chain: sepolia, transport: http() }); + +// 2. Initialize AAstar Clients +const communityClient = new CommunityClient(publicClient, walletClient); +const operatorClient = new OperatorClient(publicClient, walletClient); +``` + +### 2. "Pre-check" Pattern | "预检查" 模式 + +Avoid reverts and save gas by checking requirements off-chain first. +通过链下预检查避免交易回滚并节省 Gas。 + +```typescript +// ❌ Old Way (Prone to errors) +// await communityClient.launchCommunity(...); + +// ✅ New AAstar Way +const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33")); + +if (!check.hasEnoughGToken) { + console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`); + // Output: "Need 33 GT, have 10 GT" +} else { + // Safe to execute + await communityClient.launchCommunity({ + name: "My DAO", + tokenSymbol: "MDAO" + }); +} +``` + +### 3. Key Scenarios | 核心场景 + +#### 🏛️ For Community Owners (社区创建者) + +```typescript +// Configure SBT rules for your community +await communityClient.configureSBTRules({ + communityId: myCommunityId, + rule: { + minScore: 100, + requiredTags: ["OG"] + } +}); +``` + +#### ⚙️ For Operators (运营商) + +```typescript +// Check if you are ready to be a Super Paymaster +const status = await operatorClient.checkResources(myAddress); + +if (status.hasRole) { + await operatorClient.withdrawCollateral(parseEther("50")); +} else { + console.log(status.recommendations); + // "Fund aPNTs for collateral", "Stake GToken" +} +``` + +#### 📊 For Analysts (分析师) + +```typescript +import { AnalyticsClient } from '@aastar/sdk'; + +const analytics = new AnalyticsClient(publicClient); + +// Get real-time GToken metrics +const metrics = await analytics.getSupplyMetrics(); +console.log(`Deflation Rate: ${metrics.deflationRate}%`); +``` + +--- + +## 🔧 Architecture | 架构 + +AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives. + +AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。 + +| Package | Functionality (功能) | +|---------|---------------------| +| `@aastar/core` | Shared logic, Roles, RequirementChecker | +| `@aastar/community` | DAO Registry, XPNTs issuance | +| `@aastar/operator` | Paymaster ops, Staking management | +| `@aastar/enduser` | User onboarding, SBT minting | +| `@aastar/tokens` | Finance, Tokenomics, Approval flows | +| `@aastar/identity` | Reputation, Credit limits, ZK Proofs | +| `@aastar/paymaster` | EntryPoint & Paymaster low-level API | +| `@aastar/dapp` | React Components & Integration Hooks | + +--- + +## 📊 Gas Analytics & Reporting | Gas 分析与报表 +The SDK includes a powerful **Gas Analytics Module** for analyzing Paymaster efficiency, tracking costs, and generating industry comparison reports. +SDK 包含一个强大的 **Gas 分析模块**,用于分析 Paymaster 效率、追踪成本并生成行业对比报告。 + +### Quick Start | 快速开始 +Generate a real-time analysis of recent Sepolia transactions: +生成最近 Sepolia 交易的实时分析: +```bash +npx tsx packages/analytics/src/gas-analyzer-v4.ts +``` + +### Key Features | 核心功能 +- **Double-Layer Analysis (双层分析)**: Intrinsic EVM Efficiency vs. Economic USD Costs +- **Industry Benchmarking (行业对标)**: Compare AAStar vs. Optimism, Alchemy, Pimlico +- **Profit Tracking (利润追踪)**: Transparent breakdown of Protocol Revenue & Profit +- **L2 Simulation (L2 模拟)**: Estimate savings for migrating UserOps to Optimism + +👉 **[View Full Analytics Documentation | 查看完整分析文档](https://docs.aastar.io/guide/packages/analytics/)** + +--- + +## 🤝 Contributing | 贡献 + +We welcome contributions! Please see our Contributing Guide for details. +欢迎贡献!更多详情请参考贡献指南。 + +--- + +

+ Built with ❤️ by the AAstar Community +

diff --git a/0.16.23/changelog.md b/0.16.23/changelog.md new file mode 100644 index 000000000..dbce35957 --- /dev/null +++ b/0.16.23/changelog.md @@ -0,0 +1,189 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [Unreleased] + +## [0.16.23] - 2026-02-24 +**SDK Code Integrity Hash**: `9b02e91aaae2081b68b8ddfcf4c3dd52d450b4f368a8746b5896e0024e441db7` +*(Excludes metadata/markdown to ensure stability / 排除文档文件以确保哈希稳定)* +### ⛽ Gas Fee Strategy (PaymasterClient) +- **[FIX]** **Testnet/Mainnet Split Gas Pricing**: + - Testnets (Sepolia, OP-Sepolia, Anvil, chainId 11155111/11155420/31337): apply `0.5 Gwei` floor on `maxPriorityFeePerGas` / `1.0 Gwei` floor on `maxFeePerGas`. Fixes `WaitForUserOperationReceiptTimeoutError` caused by Alchemy bundler's minimum fee requirement being higher than OP Sepolia's near-zero network fee. + - Mainnet: pure dynamic `estimateFeesPerGas() × 1.2` (reduced from 1.5× — saves ~20% on reported maxFee while maintaining sufficient overhead for OP FIFO sequencer). + - Strategy applied in both `estimateUserOperationGas` and `submitGaslessUserOperation`. + - Added diagnostic log: `[PaymasterClient] Gas Pricing: TESTNET (0.5 Gwei floor) | priority=... maxFee=...` +- **[FIX]** **Retry Loop Extended**: max attempts 3→5 (`attempt < 4` guard), handles compound PVG + fee bump errors within a single retry pass. + +### 🧰 Keeper (Price Updater) +- **[FIX]** **`cast send` Hang Prevention**: `runCastSend()` now applies a hard 90-second `SIGKILL` timeout. Previously `--timeout 60` only controlled receipt polling, not the subprocess itself—causing the keeper to block indefinitely when Alchemy rate-limited `eth_estimateGas`. +- **[FIX]** **Explicit Gas Price**: before each `sendUpdate`, keeper fetches `getGasPrice()` and passes it via `--gas-price` to `cast send`, eliminating cast's own `eth_estimateGas` call (which was the source of the hang). +- **[IMPROVED]** Print on-chain `priceStalenessThreshold()` for both SuperPaymaster and PaymasterV4 during INIT. +- **[IMPROVED]** Keeper anomaly docs: Chainlink stale + external/Chainlink deviation + external short-term volatility alerts documented. + +### 🌐 Network Config +- **[FIX]** OP Sepolia `blockExplorer` URL changed from `optimism-sepolia.blockscout.com` → `sepolia-optimism.etherscan.io`. Affects all scripts/tests that use `getTxUrl('op-sepolia', ...)`. + +### 📊 Analytics (Paper3 / Paper7) +- **[ADDED]** `packages/analytics/data/paper_gas_op_mainnet/2026-02-17/`: PaymasterV4 (n=36) and SuperPaymaster (n=43) baseline CSVs with strict single-UserOp + ERC20-transfer filter. +- **[ADDED]** `packages/analytics/data/paper_gas_op_mainnet/2026-02-18/`: Relaxed-filter datasets with sender field; `super_t2_sender.csv` (n=50) satisfies Paper3 SuperPaymaster sample target. +- **[ADDED]** `packages/analytics/data/industry_paymaster_baselines.csv`: Alchemy Gas Manager (n=50, mean=257k gas) and Pimlico ERC-20 PM (n=50, mean=387k gas) on-chain baselines for industry comparison. +- **[ADDED]** `packages/analytics/data/gasless_metrics_detailed.csv`: 21 records with full L1/L2 fee decomposition (L2GasUsed, L1GasUsed, L1FeesPaid, L2FeesPaid, ActualGasUsed). +- **[ADDED]** Paper7 exclusive datasets: credit cycle JSON records and liquidity velocity simulation CSVs under `data/paper7_exclusive/`. +- **[ADDED]** `packages/analytics/run_paper7_exclusive_data.sh` for Paper7 data pipeline. +- **[CHANGED]** `gasless_data_collection.csv` (v1): +31 rows; `gasless_data_collection_v2.csv`: +28 rows including T1=22, T2_SP_Credit=22, T5=20. +- **[ADDED]** `scripts/collect_paymaster_baselines.ts`: reproducible on-chain event collection with `--strict-transfer`, `--single-userop`, `--n`, `--append`, `--dedupe` flags. +- **[ADDED]** `scripts/collect_eoa_erc20_baseline.ts`: raw EOA ERC20 transfer baseline for comparison. +- **[ADDED]** `scripts/compute_cost_summary.ts`: aggregation script for cost breakdown tables. + +### 📚 Docs +- **[CHANGED]** Regenerated API markdown output under `docs/api/`. +- **[ADDED]** `docs/guide/keeper.md`: keeper quickstart, anomaly detection, Telegram setup. + +### 🗂️ Analytics Consolidation +- **[REFACTOR]** Moved all data collection scripts from `scripts/` root into `packages/analytics/scripts/` (git mv, history preserved): + `collect_paymaster_baselines`, `collect_eoa_erc20_baseline`, `collect_industry_baseline`, `compute_cost_summary`, `gasless-collect`, `paper7-exclusive-data`, `paper7_credit_loop`, `paper7_reputation_credit`, `run_analytics_coordinator`, `run_paper7_exclusive_data.sh`, `fetch-tx-hashes` +- **[ADDED]** `packages/analytics/docs/OP_Mainnet_Gas_Analysis_Report.md`: gas cost evidence for Paper3/Paper7 (L1/L2 breakdown, PVG analysis, industry comparison, Mermaid pie charts). +- **[UPDATED]** `packages/analytics/README.md`: new directory tree, updated all command paths to `packages/analytics/scripts/...`. +- **Note**: Root shell scripts (`run-keeper-main.sh`, `run-optimism-tx-data.sh`, etc.) are unaffected — they only call `scripts/l4-*.ts` and `scripts/keeper.ts` which remain in place. + +### 🔒 SDK Integrity +**SDK Code Integrity Hash**: `cebb1de2edab0fb63cd47684ab977488410262fa50e485045abc5901894a3f6f` +*(Excludes metadata/markdown to ensure stability / 排除文档文件以确保哈希稳定)* + + +## [0.16.22] - 2026-02-11 +**SDK Code Integrity Hash**: `89da8c80ebe6ad8b06adbd4946a00817b18ae79296550709b20bd9ca3af424f9` +*(Excludes metadata/markdown to ensure stability / 排除文档文件以确保哈希稳定)* + +### 🌍 Multi-Chain & Infrastructure +- **[FEATURE]** **Optimism Mainnet Canonical Addresses**: + - Embedded canonical contract addresses for Optimism (Chain ID: 10) in `@aastar/core`. + - `NETWORK=optimism` now resolves `CHAIN_ID=10` by default when `CHAIN_ID` is not provided. + +## [0.16.21] - 2026-02-11 +**SDK Code Integrity Hash**: `8d5b71dda17e2cb746e4a70a98020b9c7a4f2b390a82804f7e5924b0bf5a51d5` +*(Excludes metadata/markdown to ensure stability / 排除文档文件以确保哈希稳定)* + +### ⚡ Gasless Execution +- **[FIX]** **Paymaster V4 Cached Price Staleness**: + - `PaymasterClient` now treats stale `cachedPrice` as invalid. + - Testnets auto-refresh via `updatePrice()` when needed; mainnet requires a running keeper. +- **[FIX]** **Native UserOp Gas Defaults**: + - Reduced `UserOpScenarioType.NATIVE` `verificationGasLimit` to a more realistic default. + +### 🧰 Tooling & Regression +- **[ADDED]** EIP-2537 precompile verification script and historical check dataset. + +## [0.16.20] - 2026-02-07 +**SDK Code Integrity Hash**: `0a9c8a4a778bb1b64fac6fd29d8a61b2f9b02566f33b2de65e2c26e536f9fff8` +*(Excludes metadata/markdown to ensure stability / 排除文档文件以确保哈希稳定)* + +### 🌍 Infrastructure & Distribution +- **[FEATURE]** **Canonical Address Solidification**: + - Hardcoded canonical contract addresses for Sepolia and OP Sepolia within `@aastar/core`. + - SDK is now self-contained and ready for NPM distribution without requiring local JSON configuration files. + - Maintained三级优先级 (ENV > Local Config > Canonical Defaults) to support flexible development. +- **[FIX]** **SuperPaymaster Price Refresh**: + - Fixed "UserOperation expired" errors by enabling automated owner-based price refreshes in `l4-setup.ts`. + - Added Chainlink fallback logic for robust price synchronization on testnets. + +### 🛡️ Integrity +- **[ADDED]** **SDK Source Integrity Monitoring**: + - Introduced a unique SHA-256 hash for the entire SDK source tree to ensure verifiable releases. + +## [0.16.17] - 2026-02-07 + +### 🌍 Infrastructure & Compatibility +- **[FEATURE]** **Universal Browser Support**: + - Refactored `@aastar/core` to support dual entry points via `package.json` exports. + - **Browser**: Adds `dist/index.js` (Pure ESM) which is free of Node.js specific code (`createRequire`, `fs`), ensuring seamless integration with Vite/Next.js. + - **Node.js**: Adds `dist/index.node.js` which automatically loads local `config.{network}.json` for backward compatibility. + - Refactored `constants.ts` to support dynamic configuration injection via `applyConfig()`. + +## 🛡️ SDK Integrity Verification + +> [!IMPORTANT] +> **Security First**: To ensure you are using an official release and protect your private keys, always verify the integrity of the SDK code immediately after installation. + +**Current Code Integrity Hash (v0.16.22)**: +`89da8c80ebe6ad8b06adbd4946a00817b18ae79296550709b20bd9ca3af424f9` + +To verify, run this stable command (excludes non-code markdown files): +```bash +git ls-files -z | grep -zvE '\.md$' | xargs -0 sha256sum | sha256sum +``` +The resulting hash must match the one listed in the [Changelog](./CHANGELOG.md). + +## [0.16.14] - 2026-01-24 + +### 🌍 Multi-Chain & Infrastructure +- **[FEATURE]** **Standardized Config Loader**: + - Restructured `config.ts` to implement a robust multi-chain loading priority. + - Internal Protocol Contracts (Registry, Paymasters, GToken) now strictly prioritize `config.{network}.json`. + - Infrastructure Contracts (EntryPoint, PriceFeed) and URLs (RPC, Bundler) are now sourced primarily from `.env.{network}`. +- **[FIX]** **Hardcoded Dependencies Cleanup**: + - Successfully removed all remaining hardcoded `0x` addresses and `sepolia` string literals across all `tests/` and `examples/` scripts. + - Every script now supports the `--network` parameter for dynamic environment switching. +- **[REPAIR]** **Reputation Activity Metrics**: Corrected the `opName` lookup string in `l4-reputation-tiers.ts` to align with the latest `l4-setup.ts` state files. + +### ⚡ Gasless Execution Efficiency +- **[IMPROVED]** **SuperPaymaster Verification Tuning**: + - Implemented "Dynamic Nominal Gas Tuning" in `SuperPaymasterClient` to optimize `paymasterVerificationGasLimit`. + - Resolved "Efficiency too low" (AA30) errors on Alchemy/Optimism-Sepolia by maintaining a strict balance between execution safety and bundler efficiency ratios (>= 0.4). + +## [0.16.13] - 2026-01-23 + +### 🛡️ Security & Stability +- **[SECURITY]** **Strict Address Resolution**: + - Enforced strict environment variable lookup for third-party contract addresses (`entryPoint`, `simpleAccountFactory`, `priceFeed`) on non-Anvil networks. + - Eliminated fallback to outdated `config.json` files to prevent deployment misconfigurations. +- **[SECURITY]** **Token Transfer Limits**: + - Updated ABI to reflect new `MAX_SINGLE_TX_LIMIT` enforcement in `xPNTsToken`. SDK transactions respecting standard limits will continue to work; anomalous high-value transfers may now revert at the contract level. +- **[SECURITY]** **Operator Firewall**: + - Updated ABI to reflect `autoApprovedSpenders` logic. + +### ⚙️ Core Improvements +- **[FIX]** **xPNTsToken Initialization**: Adjusted factory logic to support EIP-1167 Minimal Clones using `initialize()` pattern. +- **[SYNC]** **Contract ABIs**: Synchronized all ABIs with `SuperPaymaster` `v3.6.3`, including new governance functions `renounceFactory` and `emergencyRevokePaymaster`. + + +## [0.16.11] - 2026-01-19 + +### 📊 Gas Analytics & Reporting (New Package) +- **[NEW]** Added `@aastar/analytics` package for comprehensive gas analysis. +- **[FEATURE]** `CostCalculator`: Calculates true L1/L2 gas costs, protocol profit (10% premium + buffer), and user savings. +- **[FEATURE]** `AttributionAnalyzer`: Simulates L2 costs (Optimism model) to provide "Apple-to-Apple" competitiveness comparisons. +- **[REPORT]** `gas-analyzer-v4.ts`: Generates detailed reports showing ~28% protocol profit margin and ~400x savings vs. Ethereum L1. + +### SDK & Core Enhancements +- **[FIX]** **Anni Gasless Fix**: Updated `l4-setup.ts` to use `updatePriceDVT` for refreshing stale SuperPaymaster price cache, preventing "UserOperation expired" errors. +- **[FIX]** **Duplicate Build Fix**: Resolved merge conflicts and duplicate identifiers in `packages/core` actions (e.g., `contracts.ts`, `actions/index.ts`). +- **[FIX]** **Build System**: Removed residual `*.test.ts` files in modification directories to ensure clean `tsc` builds. + +### Regression & Testing +- **[IMPROVED]** `L4 Regression`: Full automation for Setup -> Funding -> Gasless Transactions -> Analytics. +- **[FEATURE]** `DVT Price Update`: Integrated DVT signature generation in test setup to simulate authenticated price updates. + +- **[BREAKING]** Decoupled development and production build configurations. + - Added `tsconfig.build.json` for strictly clean production builds (`pnpm build`). + - Updated root `tsconfig.json` to retain `paths` mappings for rapid development (`tsx`). + - Updated all `packages/*/tsconfig.json` to extend the build configuration. +- Fixed `packages/core` build output to correctly generate type definitions (`.d.ts`). + +### SDK Core (`@aastar/core`) +- **[CHANGED]** `BaseClient` visibility update. + - Changed `client` and `getStartPublicClient` from `protected` to `public` to allow easier extension and debugging in consuming applications. +- **[Check]** Standardized ABI exports. + - Updated `abis/index.ts` to support both array-based and object-based (`{ abi: [] }`) ABI JSON formats, resolving compatibility issues with external artifacts. + +### SDK Operator (`@aastar/operator`) +- **[FIXED]** ABI Property Access. + - Fixed runtime error where `PaymasterOperatorClient` attempted to access `.abi` on a raw ABI array. Now uses the standardized `PaymasterABI` export. + +### SDK EndUser (`@aastar/enduser`) +- **[FIXED]** `UserClient` build failure due to `BaseClient` visibility issues. + +### Testing & Regression +- **[ADDED]** `run_sdk_regression.sh` now supports a strict `sepolia` environment mode with correct `.env` loading (`set -a`). +- **[ADDED]** `extract_v3_abis.sh` integration for reliable ABI synchronization from the SuperPaymaster project. diff --git a/0.16.23/examples/README.md b/0.16.23/examples/README.md new file mode 100644 index 000000000..e6382ec23 --- /dev/null +++ b/0.16.23/examples/README.md @@ -0,0 +1,18 @@ +# Complete Examples Overview + +This section contains complete, end-to-end examples of how to use the AAStar SDK for various roles and use cases. + +## Available Examples + +- **[Operator Flow](./operator-flow)**: Staking and managing a SuperPaymaster. +- **[Community Flow](./community-flow)**: Registering a community and setting up reputation rules. +- **[End User Flow](./enduser-flow)**: Sending gasless transactions using community credit. +- **[Multi-Chain Setup](./multi-chain)**: Configuring and using the SDK across different networks. + +## Running Examples Locally + +Most examples can be run against a local Anvil instance. Ensure you have the [AAStar Contracts](https://github.com/AAStarCommunity/SuperPaymaster) deployed locally first. + +```bash +pnpm run example:local +``` diff --git a/0.16.23/examples/community-flow.md b/0.16.23/examples/community-flow.md new file mode 100644 index 000000000..c0fda364a --- /dev/null +++ b/0.16.23/examples/community-flow.md @@ -0,0 +1,34 @@ +# Community Flow Example + +This example demonstrates how to manage a community, issue SBTs, and configure reputation. + +## Steps + +1. **Registration**: Register your community name and metadata on-chain. +2. **SBT Issuance**: Mint Soul-Bound Tokens to members to define their roles. +3. **Reputation Setup**: Define rules that calculate member reputation based on activity. + +## Code Preview + +```typescript +import { createCommunityClient } from '@aastar/sdk'; + +const community = createCommunityClient({ + account, + chain: sepolia +}); + +// Launch community and deploy community token +const { tokenAddress, txs } = await community.launch({ + name: 'Alpha DAO', + tokenName: 'Alpha Points', + tokenSymbol: 'ALP', + description: 'A research-focused community', +}); + +// Mint SBT +await community.mintSBT({ + to: memberAddress, + tokenId: 1n, +}); +``` diff --git a/0.16.23/examples/enduser-flow.md b/0.16.23/examples/enduser-flow.md new file mode 100644 index 000000000..210593a4d --- /dev/null +++ b/0.16.23/examples/enduser-flow.md @@ -0,0 +1,27 @@ +# End User Flow Example + +This example demonstrates how an end user sends a gasless transaction using community credit. + +## Steps + +1. **Eligibility Check**: Verify the user has sufficient reputation or SBTs to use community sponsorship. +2. **UserOperation Construction**: Create a signed UserOperation targeting a dapp contract. +3. **Paymaster Sponsorship**: Request the SuperPaymaster to sign the UserOperation for gasless execution. + +## Code Preview + +```typescript +import { createEndUserClient } from '@aastar/sdk'; + +const user = createEndUserClient({ + account, + paymasterUrl: 'https://paymaster.aastar.io' +}); + +// Execute Gasless Transaction +const hash = await user.executeGasless({ + target: dappAddress, + data: callData, + operator: operatorAddress, // Operator to sponsor gas +}); +``` diff --git a/0.16.23/examples/index.md b/0.16.23/examples/index.md new file mode 100644 index 000000000..7bcc25fee --- /dev/null +++ b/0.16.23/examples/index.md @@ -0,0 +1,29 @@ +# Complete Examples Overview + +This section contains end-to-end examples of how to use the AAStar SDK for various roles and use cases. + +## Available Examples + +- **[Operator Flow](./operator-flow)**: Staking and managing a SuperPaymaster. +- **[Community Flow](./community-flow)**: Registering a community and setting up reputation rules. +- **[End User Flow](./enduser-flow)**: Sending gasless transactions using community credit. +- **[Multi-Chain Setup](./multi-chain)**: Configuring and using the SDK across different networks. + +## More “Real” Examples (Scripts) + +Besides the markdown examples above, the SDK repo also contains runnable scripts that cover more edge-cases and full regression flows: + +- **Regression Testing Guide**: `/guide/docs/Regression_Testing_Guide` +- **L4 Manual Test CheatSheet**: `/guide/docs/L4_Manual_Test_CheatSheet` +- **Sepolia Env Reference**: `/guide/docs/SEPOLIA_ENV_REFERENCE` +- **Lifecycle API (L3) Developer Guide**: `/guide/docs/L3_Lifecycle_Developer_Guide` + +## Running Examples Locally + +To actually run scripts/examples, clone the SDK repo and run them from the monorepo root. Most examples can be run against a local Anvil instance. Ensure you have the [AAStar Contracts](https://github.com/AAStarCommunity/SuperPaymaster) deployed locally first. + +```bash +pnpm install +pnpm build +pnpm run example:local +``` diff --git a/0.16.23/examples/multi-chain.md b/0.16.23/examples/multi-chain.md new file mode 100644 index 000000000..835e4ebc3 --- /dev/null +++ b/0.16.23/examples/multi-chain.md @@ -0,0 +1,31 @@ +# Multi-Chain Setup Example + +This example demonstrates how to configure and switch between different networks using the AAStar SDK. + +## Supported Networks + +- **Ethereum Sepolia**: Recommended for testing. +- **Optimism**: Low cost production environment. +- **Anvil**: Local development and rapid prototyping. + +## Code Preview + +```typescript +import { createPublicClient, http } from 'viem'; +import { sepolia, optimism } from 'viem/chains'; +import { getNetwork } from '@aastar/core'; + +// Switch to Sepolia +const sepoliaConfig = getNetwork('sepolia'); +const sepoliaClient = createPublicClient({ + chain: sepolia, + transport: http(sepoliaConfig.rpcUrl), +}); + +// Switch to Optimism +const opConfig = getNetwork('optimism'); +const opClient = createPublicClient({ + chain: optimism, + transport: http(opConfig.rpcUrl), +}); +``` diff --git a/0.16.23/examples/operator-flow.md b/0.16.23/examples/operator-flow.md new file mode 100644 index 000000000..34d445a5d --- /dev/null +++ b/0.16.23/examples/operator-flow.md @@ -0,0 +1,41 @@ +# Operator Flow Example + +This example demonstrates how to set up and manage a SuperPaymaster as an Operator. + +## Steps + +1. **Staking**: Deposit GTokens into the staking contract to become an authorized operator. +2. **Paymaster Deposit**: Add ETH or other tokens to the SuperPaymaster's deposit pool for gas sponsorship. +3. **Monitoring**: Track gas usage and reputation metrics. + +## Code Preview + +```typescript +import { createOperatorClient } from '@aastar/sdk'; +import { parseEther, keccak256, stringToBytes, erc20Abi } from 'viem'; + +const operator = createOperatorClient({ account, chain, transport }); + +const stakeAmount = parseEther('100'); +const GTOKEN_ADDRESS = '0x...'; +const STAKING_ADDRESS = '0x...'; +const ROLE_ID = keccak256(stringToBytes('PAYMASTER_SUPER')); + +// 1. Manual Approval +const approveTx = await operator.writeContract({ + address: GTOKEN_ADDRESS, + abi: erc20Abi, + functionName: 'approve', + args: [STAKING_ADDRESS, stakeAmount], +}); +await operator.waitForTransactionReceipt({ hash: approveTx }); + +// 2. Lock Stake via StakingActions +await operator.lockStake({ + user: operator.account.address, + roleId: ROLE_ID, + stakeAmount: stakeAmount, + entryBurn: 0n, + payer: operator.account.address +}); +``` diff --git a/0.16.23/guide/ABI_MAINTENANCE_PLAN.md b/0.16.23/guide/ABI_MAINTENANCE_PLAN.md new file mode 100644 index 000000000..6b6fe365c --- /dev/null +++ b/0.16.23/guide/ABI_MAINTENANCE_PLAN.md @@ -0,0 +1,132 @@ +# SDK ABI 维护计划 + +## 命名策略(最终版) + +**统一无版本号命名**: +- 文件名:`BLSAggregator.json`(无 V3 后缀) +- 版本信息:通过 ABI 的 `version()` 函数获取 +- 同步时自动去除版本号后缀 + +## 最终 ABI 配置(20个) + +### 从 SuperPaymaster 同步(16个) + +#### 核心合约(13个) +来源:`SuperPaymaster/abis/*.json`(同步时去除版本号) + +- BLSAggregator.json ← BLSAggregatorV3.json +- BLSValidator.json +- DVTValidator.json ← DVTValidatorV3.json +- GToken.json +- GTokenStaking.json +- MySBT.json +- PaymasterFactory.json +- PaymasterV4_2.json +- Registry.json +- ReputationSystem.json ← ReputationSystemV3.json +- SuperPaymaster.json ← SuperPaymasterV3.json +- xPNTsFactory.json +- xPNTsToken.json + +#### AA 标准(3个) +来源:`SuperPaymaster/out/*.sol/*.json`(提取 `.abi` 字段) + +- EntryPoint.json +- SimpleAccount.json +- SimpleAccountFactory.json + +### SDK 自维护(4个) + +- SimpleAccountV08.json +- SimpleAccountFactoryV08.json +- Simple7702Account.json +- Eip7702Support.json +- SenderCreator.json +- LegacyAccount.json +- UserOperationLib.json + +## 自动同步流程 + +### 触发 +每次运行回归测试前自动同步: +```bash +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +### 同步步骤 + +**步骤1**:合约地址 +- `SuperPaymaster/deployments/sepolia.json` → SDK `.env.sepolia` + +**步骤2.1**:核心合约 ABI(13个) +- `SuperPaymaster/abis/*.json` → SDK `packages/core/src/abis/` +- **自动去除版本号**:`BLSAggregatorV3.json` → `BLSAggregator.json` + +**步骤2.2**:AA 标准 ABI(3个) +- 从 `SuperPaymaster/out/` 提取纯 ABI 数组 + +**步骤3**:环境配置(可选) +- 提示手动复制 `.env.sepolia` + +## 典型使用场景 + +### 场景1:更新核心合约(最常见) + +```bash +# 在 SuperPaymaster 修改合约 +cd SuperPaymaster +forge build +./extract_abis.sh + +# 切换到 SDK,运行测试(自动同步) +cd ../aastar-sdk +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +**自动执行**: +1. 同步合约地址 +2. 同步 ABI(自动去除版本号) +3. 验证合约环境 + +### 场景2:查看合约版本 + +```typescript +import { SuperPaymasterABI } from '@aastar/core'; +import { createPublicClient } from 'viem'; + +const version = await client.readContract({ + address: superPaymasterAddress, + abi: SuperPaymasterABI, + functionName: 'version' +}); +// 返回: "SuperPaymaster-3.2.0" +``` + +## 维护检查清单 + +### 每次合约更新后 +- [ ] SuperPaymaster 编译成功 +- [ ] `extract_abis.sh` 已运行 +- [ ] SDK 测试自动同步 ABI +- [ ] SDK 构建成功(`pnpm build`) + +### 定期检查 +- [ ] 确认无重复 ABI 文件 +- [ ] 确认 `index.ts` 导出完整 +- [ ] 确认命名统一(无版本号后缀) + +## 总结 + +**核心原则**: +1. **单一数据源**:SuperPaymaster 是唯一来源 +2. **自动同步**:每次测试前自动更新 +3. **统一命名**:文件名无版本号,版本信息在 ABI 内 +4. **无重复**:一个合约一个 ABI 文件 + +**日常使用**: +```bash +# 更新合约 → 编译 → 运行 SDK 测试 → 自动同步 ✅ +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +大多数时候只更新13个核心 ABI,AA 标准和辅助 ABI 基本不变。 diff --git a/0.16.23/guide/API_REFERENCE.md b/0.16.23/guide/API_REFERENCE.md new file mode 100644 index 000000000..85283b0b4 --- /dev/null +++ b/0.16.23/guide/API_REFERENCE.md @@ -0,0 +1,796 @@ +# AAStar SDK API Documentation + +## Overview + +AAStar SDK is a comprehensive TypeScript SDK for interacting with the AAStar Public Goods Infrastructure and create Your Own Protocol (YOP), providing Account Abstraction (ERC-4337) capabilities with advanced features like gasless SuperPaymaster(AOA+), EOA RainBow Bridge and community management, and reputation systems. + +**Version**: 0.14.0 +**License**: MIT +**Repository**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk) + +--- + +## Table of Contents + +1. [Installation](#installation) +2. [Quick Start](#quick-start) +3. [Core Module](#core-module) +4. [Account Module](#account-module) +5. [Paymaster Module](#paymaster-module) +6. [Tokens Module](#tokens-module) +7. [Identity Module](#identity-module) +8. [DApp Module](#dapp-module) +9. [Complete Examples](#complete-examples) + +--- + +## Installation + +```bash +pnpm add @aastar/sdk +# or individual packages +pnpm add @aastar/core @aastar/account @aastar/paymaster +``` + +--- + +## Quick Start + +```typescript +import { createOperatorClient, createEndUserClient } from '@aastar/core'; +import { sepolia } from 'viem/chains'; + +// Create an Operator client +const operatorClient = createOperatorClient({ + chain: sepolia, + transport: http('https://rpc.sepolia.org'), + account: privateKeyToAccount('0x...'), +}); + +// Stake GTokens +const stakeTx = await operatorClient.stake({ + amount: parseEther('100'), +}); +``` + +--- + +## Core Module + +### `@aastar/core` + +Core configuration, contract addresses, and client creation utilities. + +#### Exports + +```typescript +export * from './branding'; +export * from './contract-addresses'; +export * from './contracts'; +export * from './contract-versions'; +export * from './networks'; +export * from './constants'; +export * from './communities'; +export * from './abis'; +export * from './clients'; +export * from './actions'; +``` + +--- + +### Networks + +#### `getNetwork(network)` + +Get network configuration for a supported network. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name ('sepolia' | 'optimism' | 'optimism-sepolia' | 'anvil') + +**Returns:** Network configuration object + +**Example:** +```typescript +import { getNetwork } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +console.log(network.rpcUrl); // 'https://rpc.sepolia.org' +``` + +--- + +#### `getTxUrl(network, txHash)` + +Get block explorer URL for a transaction. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name +- `txHash`: `string` - Transaction hash + +**Returns:** `string` - Full transaction URL + +**Example:** +```typescript +import { getTxUrl } from '@aastar/core'; + +const url = getTxUrl('sepolia', '0x123...'); +// 'https://sepolia.etherscan.io/tx/0x123...' +``` + +--- + +#### `getAddressUrl(network, address)` + +Get block explorer URL for an address. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name +- `address`: `string` - Contract or wallet address + +**Returns:** `string` - Full address URL + +**Example:** +```typescript +import { getAddressUrl } from '@aastar/core'; + +const url = getAddressUrl('sepolia', '0xabc...'); +// 'https://sepolia.etherscan.io/address/0xabc...' +``` + +--- + +#### `getChainId(network)` + +Get chain ID for a network. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name + +**Returns:** `number` - Chain ID + +**Example:** +```typescript +import { getChainId } from '@aastar/core'; + +const chainId = getChainId('sepolia'); // 11155111 +``` + +--- + +### Contract Addresses + +#### `CONTRACTS` + +Object containing all contract addresses for supported networks. + +**Structure:** +```typescript +{ + sepolia: { + registry: Address, + superPaymaster: Address, + gToken: Address, + gTokenStaking: Address, + // ... more contracts + }, + // ... other networks +} +``` + +**Example:** +```typescript +import { CONTRACTS } from '@aastar/core'; + +const registryAddress = CONTRACTS.sepolia.registry; +console.log(registryAddress); // '0x...' +``` + +--- + +### Constants + +#### Protocol Constants + +```typescript +import { + SERVICE_FEE_RATE, // 200 (2%) + MAX_SERVICE_FEE, // 1000 (10%) + BPS_DENOMINATOR, // 10000 + ROLE_ENDUSER, // Keccak256 hash + ROLE_COMMUNITY, // Keccak256 hash + ROLE_PAYMASTER_SUPER, // Keccak256 hash +} from '@aastar/core'; +``` + +--- + +### Client Creation + +#### `createOperatorClient(config)` + +Create a client for Paymaster operators. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` - Viem chain object + - `transport`: `Transport` - Viem transport + - `account`: `Account` - Operator account + +**Returns:** `OperatorClient` with extended actions + +**Example:** +```typescript +import { createOperatorClient } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const client = createOperatorClient({ + chain: sepolia, + transport: http('https://rpc.sepolia.org'), + account: privateKeyToAccount(process.env.OPERATOR_KEY), +}); + +// Available actions: +await client.stake({ amount: parseEther('100') }); +await client.deposit({ amount: parseEther('10') }); +await client.withdraw({ amount: parseEther('5') }); +``` + +--- + +#### `createCommunityClient(config)` + +Create a client for community managers. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - Community admin account + +**Returns:** `CommunityClient` with extended actions + +**Example:** +```typescript +import { createCommunityClient } from '@aastar/core'; + +const client = createCommunityClient({ + chain: sepolia, + transport: http(), + account: communityAccount, +}); + +// Available actions: +await client.registerCommunity({ name: 'MyDAO' }); +await client.mintSBT({ to: userAddress, tokenId: 1n }); +await client.setReputationRules({ rules: [...] }); +``` + +--- + +#### `createEndUserClient(config)` + +Create a client for end users. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - User account + +**Returns:** `EndUserClient` with extended actions + +**Example:** +```typescript +import { createEndUserClient } from '@aastar/core'; + +const client = createEndUserClient({ + chain: sepolia, + transport: http(), + account: userAccount, +}); + +// Available actions: +const credit = await client.getCreditLimit(); +await client.repayDebt({ amount: parseEther('1') }); +``` + +--- + +#### `createAdminClient(config)` + +Create a client for protocol administrators. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - Admin account + +**Returns:** `AdminClient` with extended actions + +**Example:** +```typescript +import { createAdminClient } from '@aastar/core'; + +const client = createAdminClient({ + chain: sepolia, + transport: http(), + account: adminAccount, +}); + +// Available actions: +await client.slashOperator({ operator: address, amount: parseEther('10') }); +await client.setGlobalParameters({ exitFee: 100n }); +``` + +--- + +## Account Module + +### `@aastar/account` + +Account Abstraction utilities for creating and managing smart accounts. + +#### `createSmartAccount(config)` + +Create a new smart account (ERC-4337). + +**Parameters:** +- `config`: `SmartAccountConfig` + - `owner`: `Address` - EOA owner address + - `salt`: `bigint` - Salt for deterministic address + - `factoryAddress`: `Address` - Account factory address + +**Returns:** `SmartAccount` object + +**Example:** +```typescript +import { createSmartAccount } from '@aastar/account'; + +const account = await createSmartAccount({ + owner: '0x...', + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); + +console.log(account.address); // Predicted smart account address +``` + +--- + +#### `getAccountAddress(config)` + +Get the deterministic address for a smart account. + +**Parameters:** +- `config`: `SmartAccountConfig` + +**Returns:** `Promise
` - Smart account address + +**Example:** +```typescript +import { getAccountAddress } from '@aastar/account'; + +const address = await getAccountAddress({ + owner: ownerAddress, + salt: 0n, + factoryAddress: factoryAddress, +}); +``` + +--- + +## Paymaster Module + +### `@aastar/paymaster` + +Paymaster utilities for gas sponsorship. + +#### `getPaymasterAndData(userOp, paymasterConfig)` + +Generate paymaster data for a UserOperation. + +**Parameters:** +- `userOp`: `UserOperation` - User operation object +- `paymasterConfig`: `PaymasterConfig` + - `paymasterAddress`: `Address` + - `communityAddress`: `Address` + - `xPNTsAddress`: `Address` + - `verificationGasLimit`: `bigint` + - `postOpGasLimit`: `bigint` + +**Returns:** `Hex` - Encoded paymaster and data + +**Example:** +```typescript +import { getPaymasterAndData } from '@aastar/paymaster'; + +const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress: '0x...', + xPNTsAddress: '0x...', + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, +}); +``` + +--- + +#### `checkEligibility(user, community, rpcUrl)` + +Check if a user is eligible for gas sponsorship. + +**Parameters:** +- `user`: `Address` - User address +- `community`: `Address` - Community address +- `rpcUrl`: `string` - RPC endpoint + +**Returns:** `Promise` - Eligibility status + +**Example:** +```typescript +import { checkEligibility } from '@aastar/paymaster'; + +const isEligible = await checkEligibility( + userAddress, + communityAddress, + 'https://rpc.sepolia.org' +); + +if (isEligible) { + // Proceed with sponsored transaction +} +``` + +--- + +## Tokens Module + +### `@aastar/tokens` + +Token utilities for GToken, xPNTs, and SBTs. + +#### `mintGToken(client, to, amount)` + +Mint GTokens (test/development only). + +**Parameters:** +- `client`: `WalletClient` - Wallet client with minter role +- `to`: `Address` - Recipient address +- `amount`: `bigint` - Amount to mint (in wei) + +**Returns:** `Promise` - Transaction hash + +**Example:** +```typescript +import { mintGToken } from '@aastar/tokens'; + +const txHash = await mintGToken( + client, + recipientAddress, + parseEther('1000') +); +``` + +--- + +#### `approveGToken(client, spender, amount)` + +Approve GToken spending. + +**Parameters:** +- `client`: `WalletClient` +- `spender`: `Address` - Spender address (e.g., staking contract) +- `amount`: `bigint` - Approval amount + +**Returns:** `Promise` - Transaction hash + +**Example:** +```typescript +import { approveGToken } from '@aastar/tokens'; + +await approveGToken( + client, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') +); +``` + +--- + +#### `getGTokenBalance(client, address)` + +Get GToken balance for an address. + +**Parameters:** +- `client`: `PublicClient` +- `address`: `Address` + +**Returns:** `Promise` - Balance in wei + +**Example:** +```typescript +import { getGTokenBalance } from '@aastar/tokens'; + +const balance = await getGTokenBalance(client, userAddress); +console.log(formatEther(balance)); // "1000.0" +``` + +--- + +## Identity Module + +### `@aastar/identity` + +Identity and reputation management. + +#### `getSBTBalance(client, user, tokenId)` + +Get SBT (Soul-Bound Token) balance. + +**Parameters:** +- `client`: `PublicClient` +- `user`: `Address` +- `tokenId`: `bigint` + +**Returns:** `Promise` - SBT balance (0 or 1) + +**Example:** +```typescript +import { getSBTBalance } from '@aastar/identity'; + +const hasSBT = await getSBTBalance(client, userAddress, 1n); +console.log(hasSBT > 0n); // true if user has the SBT +``` + +--- + +#### `getReputationScore(client, user, community)` + +Get user's reputation score in a community. + +**Parameters:** +- `client`: `PublicClient` +- `user`: `Address` +- `community`: `Address` + +**Returns:** `Promise` - Reputation score + +**Example:** +```typescript +import { getReputationScore } from '@aastar/identity'; + +const score = await getReputationScore( + client, + userAddress, + communityAddress +); +console.log(score); // 850n +``` + +--- + +## DApp Module + +### `@aastar/dapp` + +React hooks and utilities for DApp integration. + +#### `useAAStar(config)` + +React hook for AAStar SDK integration. + +**Parameters:** +- `config`: `AAStarConfig` + - `network`: `SupportedNetwork` + - `rpcUrl`: `string` + +**Returns:** `AAStarContext` object + +**Example:** +```typescript +import { useAAStar } from '@aastar/dapp'; + +function MyComponent() { + const { client, account, connect, disconnect } = useAAStar({ + network: 'sepolia', + rpcUrl: 'https://rpc.sepolia.org', + }); + + return ( + + ); +} +``` + +--- + +## Complete Examples + +### Example 1: Operator Staking Flow + +```typescript +import { createOperatorClient, CONTRACTS } from '@aastar/core'; +import { mintGToken, approveGToken } from '@aastar/tokens'; +import { http, parseEther } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +async function operatorStakingFlow() { + // 1. Create operator client + const operator = createOperatorClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.OPERATOR_KEY), + }); + + // 2. Mint GTokens (testnet only) + await mintGToken( + operator, + operator.account.address, + parseEther('1000') + ); + + // 3. Approve staking contract + await approveGToken( + operator, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') + ); + + // 4. Stake tokens + const stakeTx = await operator.stake({ + amount: parseEther('100'), + }); + + console.log('Staked! TX:', stakeTx); + + // 5. Deposit to Paymaster + const depositTx = await operator.deposit({ + amount: parseEther('10'), + }); + + console.log('Deposited! TX:', depositTx); +} +``` + +--- + +### Example 2: Community Registration + +```typescript +import { createCommunityClient, CONTRACTS } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; + +async function registerCommunity() { + const community = createCommunityClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: communityAccount, + }); + + // Register community + await community.registerCommunity({ + name: 'MyAwesomeDAO', + metadata: 'ipfs://...', + }); + + // Mint SBT to member + await community.mintSBT({ + to: memberAddress, + tokenId: 1n, + }); + + // Set reputation rules + await community.setReputationRules({ + rules: [ + { metric: 'activity', weight: 30 }, + { metric: 'contribution', weight: 70 }, + ], + }); +} +``` + +--- + +### Example 3: End User Gasless Transaction + +```typescript +import { createEndUserClient, checkEligibility } from '@aastar/core'; +import { getPaymasterAndData } from '@aastar/paymaster'; + +async function sendGaslessTransaction() { + const user = createEndUserClient({ + chain: sepolia, + transport: http(), + account: userAccount, + }); + + // Check eligibility + const eligible = await checkEligibility( + user.account.address, + communityAddress, + process.env.RPC_URL + ); + + if (!eligible) { + throw new Error('Not eligible for gas sponsorship'); + } + + // Create UserOperation + const userOp = { + sender: user.account.address, + nonce: 0n, + // ... other fields + }; + + // Get paymaster data + const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, + }); + + // Submit to bundler + const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, + }); + + console.log('Gasless TX:', txHash); +} +``` + +--- + +## Error Handling + +All SDK functions may throw errors. Always wrap in try-catch: + +```typescript +try { + await client.stake({ amount: parseEther('100') }); +} catch (error) { + if (error.message.includes('insufficient balance')) { + console.error('Not enough GTokens'); + } else { + console.error('Staking failed:', error); + } +} +``` + +--- + +## TypeScript Support + +The SDK is fully typed. Use TypeScript for the best development experience: + +```typescript +import type { + OperatorClient, + CommunityClient, + EndUserClient, + AdminClient, + SupportedNetwork, +} from '@aastar/core'; +``` + +--- + +## Support + +- **Documentation**: [docs.aastar.io](https://docs.aastar.io) +- **GitHub**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk) +- **Discord**: [Join our community](https://discord.gg/aastar) + +--- + +## License + +MIT © AAStar Community diff --git a/0.16.23/guide/CLI_GUIDE.md b/0.16.23/guide/CLI_GUIDE.md new file mode 100644 index 000000000..e661f5069 --- /dev/null +++ b/0.16.23/guide/CLI_GUIDE.md @@ -0,0 +1,65 @@ +# SuperPaymaster V3 SDK 测试指南 (CLI) + +本文档面向开发者,提供 SuperPaymaster V3 系统在本地 Anvil 环境下的各种测试和初始化命令。 + +## 🛠 准备工作 +在开始任何测试前,请确保: +1. 本地 `anvil` 已启动 (`anvil`)。 +2. 位于 `projects/aastar-sdk` 目录。 +3. `.env.v3` 文件存在(如果不存在,运行初始化脚本会自动创建)。 + +--- + +## 🚀 常用指令集 + +### 1. 初始化运行 (Init & Setup) +**场景**: 第一次运行测试,或者 Anvil 重启后需要重新同步合约状态。 +```bash +./run_full_regression.sh --init-only +# 或者直接运行全量回归,它会自动包含初始化 +pnpm run test:full +``` + +### 2. 快速回归测试 (Fast Test / Pre-commit) +**场景**: 日常开发中,快速验证核心安全逻辑(权限检查、影子账户等)。这也集成在 Git Pre-commit Hook 中。 +```bash +pnpm run test:fast +``` +*运行脚本: `scripts/99_bug_hunting_fast.ts`* + +### 3. 全量场景回归 (Full Regression) +**场景**: 发布前验收,验证全部 72 个真实业务场景。包括重新部署、同步配置和运行所有核心测试脚本。 +```bash +pnpm run test:full +``` +*包含脚本: 01, 06, 08, 09, 10, 11, 12, 13, 14, 98, 99 系列* + +### 4. 特定模块测试 (Module Specific) +如果你只想测试某个特定模块,可以使用以下快捷命令: + +- **核心管理流程 (Registry/Admin)**: + ```bash + pnpm run test:admin + ``` +- **信用与还款系统**: + ```bash + pnpm run test:credit + ``` +- **安全与重入攻击**: + ```bash + pnpm run test:reentrancy + ``` + +--- + +## 📊 测试报告解析 +测试完成后,你会看到一个统一的报告。 + +> [!IMPORTANT] +> **报喜也报忧**: 我们的测试套件会截获每个脚本的内部 Revert。如果脚本输出中包含 "reverted" 或 "Error",即便脚本没退出,回归套件也会将其标记为 **FAILED**。 + +--- + +## 🔍 故障排查 +- **Panic: Allocated too much memory**: 这是 Anvil 在处理复杂 `roleData` 时的已知限制。如果遇到此错误,请尝试减小 `roleData` 中的字符串长度或清空 Anvil 重新运行。 +- **DepositNotVerified**: 确保在调用 `notifyDeposit` 前,对应账户已向 Paymaster 合约转入足够的 aPNTs 代币。 diff --git a/0.16.23/guide/Configuration_Sync.md b/0.16.23/guide/Configuration_Sync.md new file mode 100644 index 000000000..e2d5815ba --- /dev/null +++ b/0.16.23/guide/Configuration_Sync.md @@ -0,0 +1,47 @@ +# SDK & Contract Repository Configuration Sync + +This document outlines the synchronization mechanism between the `SuperPaymaster` (Contracts) repository and the `aastar-sdk`. + +## Overview + +The SDK relies on two artifacts from the contract repository: +1. **ABIs**: JSON files defining the contract interfaces. +2. **Configuration**: JSON files defining deployed contract addresses and source code verification hashes. + +## Sync Workflow + +The synchronization is automated via the `run_sdk_complete_regression.sh` script (and standalone `sync_to_sdk.sh` in SuperPaymaster). + +### 1. Artifact Generation (SuperPaymaster Side) +* **ABIs**: `forge build` generates artifacts. `extract_v3_abis.sh` extracts verified ABIs to `abis/*.json`. +* **Config**: Deployment scripts (e.g., `DeployAnvil.s.sol`) generate `deployments/config.{network}.json`. This file includes: + * Contract Addresses (Registry, SuperPaymaster, etc.) + * `srcHash`: SHA-256 hash of the `contracts/src` directory for integrity checks. + +### 2. Synchronization Bridge +Artifacts are copied to the SDK: +* `abis/*.json` -> `packages/core/src/abis/` +* `deployments/config.{network}.json` -> `config.{network}.json` (SDK Root) + +### 3. SDK Abstraction Layer (`constants.ts`) +The SDK avoids hardcoding addresses or reading JSON files directly in business logic. +* **File**: `packages/core/src/constants.ts` +* **Mechanism**: + * Reads `process.env.NETWORK` (default: 'anvil'). + * Dynamically loads `config.{network}.json`. + * Exports constants like `REGISTRY_ADDRESS`, `SUPER_PAYMASTER_ADDRESS`. +* **Legacy Support**: `contract-addresses.ts` has been refactored to consume `constants.ts`, ensuring backward compatibility. + +## Verification (`verify_onchain_milestone.ts`) + +A verification script (`scripts/verify_onchain_milestone.ts`) ensures the SDK is in sync with the chain: +1. Loads `config.{network}.json` via `constants.ts`. +2. Verifies `srcHash` existence. +3. Checks on-chain code presence for all critical contracts using `viem`. + +## Usage + +To run the full regression with sync and verification: +```bash +./run_sdk_complete_regression.sh --env anvil +``` diff --git a/0.16.23/guide/DAO_Mining_Distribution_Plan.md b/0.16.23/guide/DAO_Mining_Distribution_Plan.md new file mode 100644 index 000000000..6832e6070 --- /dev/null +++ b/0.16.23/guide/DAO_Mining_Distribution_Plan.md @@ -0,0 +1,522 @@ +# GToken DAO 治理挖矿分配机制 + +## 概述 + +基于动态 CAP 管理的 GToken 挖矿分配系统,通过 DAO 委员会治理,实现对基础设施节点贡献的公平奖励。 + +--- + +## 一、核心机制 + +### 1.1 动态供应管理 + +```solidity +// GToken.sol 已实现 +uint256 public constant MAX_SUPPLY = 21_000_000 ether; + +function remainingMintableSupply() external view returns (uint256) { + return cap() - totalSupply(); +} +``` + +**关键特性**: +- ✅ 硬顶 2100万 GToken +- ✅ burn() 自动创造铸造空间 +- ✅ 无需额外存储变量 +- ✅ totalSupply() 是唯一真理源 + +### 1.2 授权铸造逻辑 + +```solidity +// 只要 remainingMintableSupply > 0, 即可 mint +function mint(address to, uint256 amount) external onlyOwner { + _mint(to, amount); // ERC20Capped 自动检查 cap +} +``` + +**无需新增接口**: +- ERC20Capped 已内置 cap 检查 +- 只需查询 `remainingMintableSupply()` + +--- + +## 二、基础设施节点贡献分类 + +### 2.1 计算类别 + +| 类别 | 描述 | 权重基数 | 示例 | +|------|------|----------|------| +| **Validator** | 出块验证节点 | 10 | 验证交易、生成区块 | +| **Indexer** | 数据索引节点 | 7 | 提供 GraphQL API、历史数据查询 | +| **RPC Provider** | RPC 服务节点 | 8 | eth_call, eth_sendTransaction | +| **Bundler** | UserOp 打包节点 | 9 | AA 交易打包、Gas 优化 | +| **Paymaster** | Gas 赞助节点 | 6 | SuperPaymaster Operator | +| **Storage** | 存储节点 | 5 | IPFS, Arweave 网关 | +| **Relay** | 中继节点 | 4 | MEV 保护、隐私交易 | + +### 2.2 贡献量化指标 + +#### Validator 节点 +``` +贡献分 = 出块数量 × 10 + + 验证成功率 × 5 + + 在线时长(小时) × 0.01 +``` + +#### RPC Provider 节点 +``` +贡献分 = 请求响应数量 / 1000 × 8 + + 平均响应时间(ms) × (-0.01) // 越快分数越高 + + 正常运行时间(%) × 2 +``` + +#### Bundler 节点 +``` +贡献分 = UserOp 打包数量 / 100 × 9 + + Gas 节省率(%) × 5 + + 提交成功率 × 3 +``` + +#### Paymaster 节点 +``` +贡献分 = 赞助交易数量 / 50 × 6 + + 赞助金额(ETH) × 10 + + xPNTs 销毁量 × 0.5 +``` + +### 2.3 贡献数据采集 + +**链上数据**: +- 区块链事件日志(Block Produced, UserOp Executed) +- 合约调用记录(Paymaster Deposits, Slash Events) + +**链下数据**(经 Oracle 验证): +- RPC 请求日志 → Chainlink Oracle +- 节点在线时长 → 多签验证者签名 +- 响应时间统计 → TEE 可信计算 + +--- + +## 三、DAO 委员会份额分配策略 + +### 3.1 分配周期 + +**建议**: 每季度(Epoch)进行一次分配 + +```solidity +uint256 public constant EPOCH_DURATION = 90 days; +uint256 public lastMintEpoch; + +modifier onlyNewEpoch() { + require(block.timestamp >= lastMintEpoch + EPOCH_DURATION, "Epoch not ready"); + _; +} +``` + +### 3.2 份额分配比例 + +**DAO 委员会投票决定**: 当前 Epoch 使用 `remainingMintableSupply` 的百分比 + +```solidity +struct EpochAllocation { + uint256 epochId; + uint256 totalAvailable; // remainingMintableSupply 快照 + uint256 allocationPercent; // DAO 投票决定 (basis points, 2000 = 20%) + uint256 actualMinted; + mapping(address => uint256) nodeRewards; +} +``` + +**示例场景**: +- Epoch 1: `remainingMintableSupply` = 5,000,000 +- DAO 投票: 使用 20% (1,000,000 GToken) +- 剩余: 4,000,000 继续留存 + +### 3.3 委员会决策流程 + +``` +1. Oracle 提交链下数据 → Merkle Root +2. DAO 委员会审核 → 投票 +3. 投票通过 → 执行链上分配 +4. 节点领取 → Merkle Proof 验证 +``` + +--- + +## 四、智能合约架构 + +### 4.1 核心合约: MiningDistributor + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import "@openzeppelin/contracts/access/AccessControl.sol"; +import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; +import "./GToken.sol"; + +/** + * @title MiningDistributor + * @notice DAO-governed mining reward distribution for infrastructure nodes + * @dev Uses Merkle Tree for efficient reward claiming + */ +contract MiningDistributor is AccessControl { + + bytes32 public constant DAO_ROLE = keccak256("DAO_ROLE"); + bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE"); + + GToken public immutable gToken; + + uint256 public currentEpoch; + uint256 public constant EPOCH_DURATION = 90 days; + uint256 public epochStartTime; + + struct Epoch { + bytes32 merkleRoot; // 节点奖励 Merkle 树根 + uint256 totalAllocated; // 本 Epoch 总分配量 + uint256 allocationPercent; // 使用百分比 (basis points) + uint256 mintedAmount; // 已铸造总量 + mapping(address => bool) claimed; // 领取记录 + } + + mapping(uint256 => Epoch) public epochs; + + event EpochProposed(uint256 indexed epochId, bytes32 merkleRoot, uint256 allocation); + event EpochApproved(uint256 indexed epochId, uint256 totalMinted); + event RewardClaimed(uint256 indexed epochId, address indexed node, uint256 amount); + + constructor(address _gToken, address _daoAdmin) { + gToken = GToken(_gToken); + _grantRole(DEFAULT_ADMIN_ROLE, _daoAdmin); + _grantRole(DAO_ROLE, _daoAdmin); + epochStartTime = block.timestamp; + } + + /** + * @notice DAO 提案新 Epoch 的分配方案 + * @param merkleRoot 节点奖励 Merkle 树根 + * @param allocationPercent 使用 remainingMintableSupply 的百分比 (basis points) + */ + function proposeEpoch( + bytes32 merkleRoot, + uint256 allocationPercent + ) external onlyRole(DAO_ROLE) { + require(block.timestamp >= epochStartTime + EPOCH_DURATION, "Epoch not ready"); + require(allocationPercent <= 5000, "Max 50% per epoch"); // 安全上限 + + uint256 newEpochId = currentEpoch + 1; + uint256 available = gToken.remainingMintableSupply(); + uint256 allocation = available * allocationPercent / 10000; + + epochs[newEpochId].merkleRoot = merkleRoot; + epochs[newEpochId].allocationPercent = allocationPercent; + epochs[newEpochId].totalAllocated = allocation; + + emit EpochProposed(newEpochId, merkleRoot, allocation); + } + + /** + * @notice DAO 批准并执行分配(进入新 Epoch) + */ + function approveEpoch() external onlyRole(DAO_ROLE) { + uint256 newEpochId = currentEpoch + 1; + require(epochs[newEpochId].merkleRoot != bytes32(0), "No proposal"); + + currentEpoch = newEpochId; + epochStartTime = block.timestamp; + + emit EpochApproved(newEpochId, epochs[newEpochId].totalAllocated); + } + + /** + * @notice 节点领取奖励 + * @param epochId Epoch ID + * @param amount 奖励数量 + * @param proof Merkle 证明 + */ + function claimReward( + uint256 epochId, + uint256 amount, + bytes32[] calldata proof + ) external { + require(epochId <= currentEpoch, "Future epoch"); + require(!epochs[epochId].claimed[msg.sender], "Already claimed"); + + // 验证 Merkle Proof + bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount)); + require( + MerkleProof.verify(proof, epochs[epochId].merkleRoot, leaf), + "Invalid proof" + ); + + epochs[epochId].claimed[msg.sender] = true; + epochs[epochId].mintedAmount += amount; + + // 铸造奖励(GToken owner 需授权此合约) + gToken.mint(msg.sender, amount); + + emit RewardClaimed(epochId, msg.sender, amount); + } + + /** + * @notice 查询节点在指定 Epoch 的奖励领取状态 + */ + function hasClaimed(uint256 epochId, address node) external view returns (bool) { + return epochs[epochId].claimed[node]; + } + + /** + * @notice 获取当前可分配总量 + */ + function getAvailableForMinting() external view returns (uint256) { + return gToken.remainingMintableSupply(); + } +} +``` + +--- + +## 五、DAO 治理流程 + +### 5.1 提案阶段 + +**输入**: +1. Oracle 提交链下数据汇总(Merkle Root) +2. 包含所有符合条件节点的贡献分及奖励金额 + +**DAO 审核**: +- 验证 Oracle 数据真实性 +- 检查分配比例合理性 +- 投票决定 `allocationPercent` + +### 5.2 投票标准 + +```solidity +// 简单多签 DAO (可升级为 Governor) +contract SimpleDAO { + uint256 public constant QUORUM = 3; // 最少投票数 + uint256 public constant THRESHOLD = 2; // 通过阈值 + + mapping(bytes32 => uint256) public proposalVotes; + mapping(bytes32 => mapping(address => bool)) public hasVoted; + + function vote(bytes32 proposalId) external onlyMember { + require(!hasVoted[proposalId][msg.sender], "Already voted"); + hasVoted[proposalId][msg.sender] = true; + proposalVotes[proposalId]++; + + if (proposalVotes[proposalId] >= THRESHOLD) { + // 执行提案 + distributor.approveEpoch(); + } + } +} +``` + +### 5.3 执行与领取 + +1. **批准执行**: DAO 调用 `approveEpoch()` +2. **节点领取**: 节点自行调用 `claimReward()` + Merkle Proof +3. **Gas 优化**: 只需链上存储 Merkle Root,节点数据存储在 IPFS + +--- + +## 六、Merkle Tree 生成(链下) + +### 6.1 数据结构 + +```typescript +interface NodeReward { + address: string; + contributionScore: number; + rewardAmount: bigint; + category: string; +} + +const nodeRewards: NodeReward[] = [ + { + address: "0xValidator1...", + contributionScore: 1250, + rewardAmount: parseEther("50000"), + category: "Validator" + }, + { + address: "0xRPC_Provider...", + contributionScore: 890, + rewardAmount: parseEther("35000"), + category: "RPC Provider" + }, + // ... +]; +``` + +### 6.2 Merkle Tree 构建 + +```typescript +import { MerkleTree } from 'merkletreejs'; +import { keccak256, solidityPacked } from 'ethers'; + +function generateMerkleTree(rewards: NodeReward[]): { root: string, tree: MerkleTree } { + const leaves = rewards.map(r => + keccak256(solidityPacked(['address', 'uint256'], [r.address, r.rewardAmount])) + ); + + const tree = new MerkleTree(leaves, keccak256, { sortPairs: true }); + const root = tree.getHexRoot(); + + return { root, tree }; +} + +function getProof(tree: MerkleTree, address: string, amount: bigint): string[] { + const leaf = keccak256(solidityPacked(['address', 'uint256'], [address, amount])); + return tree.getHexProof(leaf); +} +``` + +### 6.3 IPFS 发布 + +```typescript +// 将完整奖励数据发布到 IPFS +const ipfsHash = await ipfs.add(JSON.stringify({ + epochId: 5, + merkleRoot: root, + totalAllocated: parseEther("1000000"), + rewards: nodeRewards, + timestamp: Date.now() +})); + +// DAO 链上只需存储 +distributor.proposeEpoch(root, 2000); // 使用20% +``` + +--- + +## 七、实施路线图 + +### Phase 1: 合约部署 (Week 1-2) + +- [x] GToken v2.1.0 (已完成) +- [x] GTokenStaking v3.1.0 (已完成) +- [ ] MiningDistributor v1.0.0 +- [ ] SimpleDAO / Governor + +### Phase 2: Oracle 集成 (Week 3-4) + +- [ ] Chainlink Oracle 适配器 +- [ ] 链下数据聚合脚本 +- [ ] Merkle Tree 生成工具 + +### Phase 3: DAO 治理测试 (Week 5-6) + +- [ ] Testnet 部署 +- [ ] 首个 Epoch 模拟投票 +- [ ] 节点领取流程验证 + +### Phase 4: 主网上线 (Week 7-8) + +- [ ] 安全审计 +- [ ] 主网部署 +- [ ] 社区公告与教育 + +--- + +## 八、安全考量 + +### 8.1 防止滥用 + +**单 Epoch 上限**: +```solidity +require(allocationPercent <= 5000, "Max 50% per epoch"); +``` + +**时间锁**: +```solidity +uint256 public constant PROPOSAL_DELAY = 3 days; +``` + +**紧急暂停**: +```solidity +bool public paused; + +modifier whenNotPaused() { + require(!paused, "Paused"); + _; +} +``` + +### 8.2 Oracle 安全 + +**多 Oracle 验证**: +```solidity +mapping(bytes32 => uint256) public oracleConfirmations; +uint256 public constant REQUIRED_CONFIRMATIONS = 3; +``` + +**数据时效性**: +```solidity +require(block.timestamp - dataTimestamp < 1 days, "Stale data"); +``` + +--- + +## 九、常见问题 + +### Q1: remainingMintableSupply 如何实时追踪? + +**A**: 无需追踪!`totalSupply()` 已实时更新: + +```solidity +// 每次 burn 调用时 +function _burn(address account, uint256 amount) internal virtual { + _totalSupply -= amount; // 自动减少 + // ... +} + +// 查询时 +function remainingMintableSupply() external view returns (uint256) { + return cap() - totalSupply(); // 实时计算 +} +``` + +### Q2: DAO 可以无限 mint 吗? + +**A**: 不可以! `ERC20Capped._mint()` 强制检查: + +```solidity +function _mint(address account, uint256 amount) internal virtual { + require(totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded"); + super._mint(account, amount); +} +``` + +### Q3: 如何激励节点长期运行? + +**A**: 引入"质押乘数": + +```solidity +贡献分 = 基础分 × (1 + stakingDuration / 365 days × 0.5) +``` + +运行满1年的节点,贡献分增加50%。 + +--- + +## 十、总结 + +✅ **已实现**: +- GToken v2.1.0: Burnable + remainingMintableSupply +- GTokenStaking v3.1.0: True Burn + +🔄 **待实施**: +- MiningDistributor 合约 +- DAO 治理合约 +- Oracle 数据聚合 + +📊 **核心优势**: +- 透明: totalSupply = 唯一真理 +- 灵活: DAO 动态调整分配比例 +- 高效: Merkle Tree 节省 Gas +- 公平: 基于量化贡献的分配 + +> [!NOTE] +> 这是一个完全链上治理的分配系统,无需信任中心化实体,所有分配决策由 DAO 投票决定。 diff --git a/0.16.23/guide/DEMO_REFACTOR_PLAN.md b/0.16.23/guide/DEMO_REFACTOR_PLAN.md new file mode 100644 index 000000000..697d57aef --- /dev/null +++ b/0.16.23/guide/DEMO_REFACTOR_PLAN.md @@ -0,0 +1,289 @@ +# Demo 重构计划 + +## 项目目标 +创建一个基于 SDK 高层 API (99%) 的交互式演示系统,提供清晰的左右分栏界面,展示 AAStar 生态系统的完整生命周期。 + +## UI/UX 架构设计 + +### 界面布局 +``` +┌─────────────────────────────────────────────────────────┐ +│ AAStar Demo │ +├──────────────┬──────────────────────────────────────────┤ +│ │ │ +│ 左侧导航栏 │ 右侧内容区域 │ +│ │ │ +│ ┌────────┐ │ ┌─────────────────────────────────────┐ │ +│ │ Step 1 │ │ │ │ │ +│ │Accounts│ │ │ 当前步骤的详细信息和操作界面 │ │ +│ └────────┘ │ │ │ │ +│ ┌────────┐ │ │ - 显示历史记录 │ │ +│ │ Step 2 │ │ │ - 显示当前状态 │ │ +│ │Community│ │ │ - 提供操作按钮 │ │ +│ └────────┘ │ │ - 实时反馈 │ │ +│ ┌────────┐ │ │ │ │ +│ │ Step 3 │ │ └─────────────────────────────────────┘ │ +│ │Operator│ │ │ +│ └────────┘ │ │ +│ ┌────────┐ │ │ +│ │ Step 4 │ │ │ +│ │End User│ │ │ +│ └────────┘ │ │ +│ │ │ +└──────────────┴──────────────────────────────────────────┘ +``` + +### 分步骤功能设计 + +#### Step 1: Account Management (账户管理) +**右侧显示内容** +- 账户列表表格 + +| 名称 | 地址 | ETH 余额 | GToken 余额 | 操作 | +|---------|-------------------|----------|-------------|---------| +| Alice | 0xB6D3... | 0.1000 | 200.00 | [选择] | +| Bob | 0x2944... | 0.1000 | 200.00 | [选择] | +| Charlie | 0xa74f... | 0.1000 | 100.00 | [选择] | + +**操作按钮** +- `+ 新建账户` - 生成新的 EOA 账户 +- `刷新余额` - 更新所有账户余额 +- `充值选中账户` - 为选中账户充值 ETH 和 GToken + +**SDK API 需求** +- ✅ `KeyManager.generateAccount()` - 生成账户 +- ✅ `FundingManager.fundWithETH()` - ETH 充值 +- ✅ `FundingManager.fundWithToken()` - Token 充值 +- 🆕 `StateValidator.getAccountBalances()` - 批量查询余额 + +#### Step 2: Launch Community (启动社区) +**右侧显示内容** +- 当前账户状态卡片 + ``` + 选中账户: Alice (0xB6D3...) + ┌─────────────────────────────────────┐ + │ 社区状态 │ + ├─────────────────────────────────────┤ + │ ✅ 已注册 COMMUNITY 角色 │ + │ ✅ 已部署社区 Token │ + │ │ + │ Token 地址: 0xb65D... │ + │ Token 名称: DemoDAO_xxx │ + │ 注册时间: 2024-12-29 11:37 │ + └─────────────────────────────────────┘ + ``` + +**操作流程** +- 如果未注册:显示 `[启动新社区]` 表单 + - 社区名称输入框 + - ENS 名称(可选) + - 描述(可选) + - `[确认启动]` 按钮 +- 如果已注册:显示社区详情 + `[查看 Token 详情]` + +**SDK API 需求** +- ✅ `CommunityClient.launch()` - 启动社区 +- 🆕 `CommunityClient.getCommunityInfo(account)` - 查询社区信息 + ```typescript + { + hasRole: boolean; + tokenAddress: Address | null; + communityData: { + name: string; + ensName: string; + createdAt: number; + } | null; + } + ``` + +#### Step 3: Setup Operator (运营商设置) +**右侧显示内容** +- 运营商类型选择 + ``` + 选中账户: Bob (0x2944...) + 请选择运营商类型: + ┌──────────────────────────────────────┐ + │ ⭕ SuperPaymaster (推荐) │ + │ - 跨社区共享流动性 │ + │ - 支持多 Token 支付 │ + │ - 需要质押 50 GToken + 存入 aPNTs │ + └──────────────────────────────────────┘ + ┌──────────────────────────────────────┐ + │ ⭕ Paymaster V4 (独立) │ + │ - 社区独立部署 │ + │ - 单一 Token 支付 │ + │ - 需要指定 Token 和 SBT │ + └──────────────────────────────────────┘ + ``` + +- 已注册状态显示 + ``` + ┌─────────────────────────────────────┐ + │ SuperPaymaster 运营商 │ + ├─────────────────────────────────────┤ + │ ✅ 已质押: 50 GToken │ + │ ✅ 已存入: 100 aPNTs │ + │ 📊 可用余额: 75 aPNTs │ + │ 🏦 Treasury: 0x2944... │ + │ 📈 Exchange Rate: 1:1 │ + └─────────────────────────────────────┘ + ``` + +**操作:** +- `[追加存款]` `[提取余额]` `[修改配置]` + +**SDK API 需求** +- ✅ `OperatorClient.onboardOperator()` - 注册运营商(SuperPaymaster) +- ✅ `OperatorClient.deployPaymasterV4()` - 部署 Paymaster V4 +- 🆕 `OperatorClient.getOperatorInfo(account)` - 查询运营商状态 + ```typescript + { + type: 'super' | 'v4' | null; + superPaymaster: { + isConfigured: boolean; + balance: bigint; + exchangeRate: bigint; + treasury: Address; + } | null; + paymasterV4: { + address: Address; + token: Address; + balance: bigint; + } | null; + } + ``` +- 🆕 `OperatorClient.depositFunds(amount)` - 追加存款 +- 🆕 `OperatorClient.withdrawFunds(amount)` - 提取余额 + +#### Step 4: Onboard End User (用户入驻) +**右侧显示内容** +- 用户账户来源选择 + ``` + 选择用户账户类型: + ┌──────────────────────────────────────┐ + │ ⭕ 从现有 EOA 创建 │ + │ 选择账户: [下拉列表] │ + │ [创建 AA 账户] │ + └──────────────────────────────────────┘ + ┌──────────────────────────────────────┐ + │ ⭕ 生成新的 Simple Account │ + │ 盐值: [自动生成] │ + │ [部署新账户] │ + └──────────────────────────────────────┘ + ``` + +- 用户状态显示 + ``` + ┌─────────────────────────────────────┐ + │ AA Account: 0x1234... │ + ├─────────────────────────────────────┤ + │ 📍 已部署 │ + │ 👤 Owner: Alice (0xB6D3...) │ + │ 💰 余额: │ + │ - 0.05 ETH │ + │ - 50 xPNTs (社区 Token) │ + │ - 100 aPNTs │ + │ │ + │ 🎫 SBT 持有: │ + │ - MySBT #1234 (已mint) │ + └─────────────────────────────────────┘ + ``` + +**操作:** +- `[充值 xPNTs]` `[Mint SBT]` `[发送 UserOp]` + +**SDK API 需求** +- 🆕 `EndUserClient.deployAccount(owner, salt?)` - 部署 AA 账户 +- 🆕 `EndUserClient.getAccountInfo(address)` - 查询 AA 账户信息 +- 🆕 `EndUserClient.mintSBT(account)` - 为用户 Mint SBT +- 🆕 `EndUserClient.fundWithXPNTs(account, amount)` - 充值社区 Token +- ✅ `EndUserClient.sendUserOp()` - 发送 UserOperation + +## SDK API 增强计划 + +### 优先级分类 +**P0 - 立即实现(状态查询类)** +- `CommunityClient.getCommunityInfo(account: Address)` +- `OperatorClient.getOperatorInfo(account: Address)` +- `StateValidator.getAccountBalances(addresses: Address[])` + +**P1 - 高优先级(核心功能)** +- `EndUserClient.deployAccount(owner: Address, salt?: bigint)` +- `EndUserClient.mintSBT(account: Address)` +- `OperatorClient.depositFunds(amount: bigint)` +- `OperatorClient.withdrawFunds(amount: bigint)` + +**P2 - 中优先级(增强功能)** +- `EndUserClient.getAccountInfo(address: Address)` +- `EndUserClient.fundWithXPNTs(account: Address, amount: bigint)` + +### 回归脚本分析 +需要从以下脚本中提取功能: + +**社区相关** +- ✅ `01_register_community_raw.ts` - 已提取为 `CommunityClient.launch()` +- 📋 `09_local_test_community_lifecycle.ts` - 社区生命周期完整流程 + +**运营商相关** +- 📋 `deploy_paymaster_v4.ts` - Paymaster V4 部署逻辑 +- 📋 `05_test_superpaymaster.ts` - SuperPaymaster 完整设置流程 + - Line 114-199: `setupOperator` 函数(包含配置和存款) + +**用户相关** +- 📋 `deploy_test_accounts.ts` - AA 账户部署逻辑 +- 📋 `03_test_standard_aa.ts` - AA 交互流程 + +## 实现路线图 + +### 阶段 1: 修复当前错误 ✅ +- [x] 修复 account undefined 错误 +- [x] 修复 gToken undefined 错误 +- [x] 确保 SDK 构建成功 + +### 阶段 2: SDK API 增强 (1-2天) +- [ ] 实现 P0 状态查询 API +- [ ] 从回归脚本提取 `setupOperator` 的配置逻辑 +- [ ] 从 `deploy_test_accounts.ts` 提取 AA 部署逻辑 +- [ ] 添加单元测试 + +### 阶段 3: UI 重构 (2-3天) +- [ ] 重构 index.html 为左右分栏布局 +- [ ] 实现 Step 1: Account Management +- [ ] 实现 Step 2: Launch Community(状态查询 + 操作) +- [ ] 实现 Step 3: Setup Operator(类型选择 + 状态查询) +- [ ] 实现 Step 4: Onboard End User + +### 阶段 4: 集成测试 (1天) +- [ ] 端到端流程测试 +- [ ] 性能优化 +- [ ] 错误处理完善 + +## 技术细节 + +### 前端状态管理 +```javascript +const demoState = { + selectedAccount: null, // 当前选中的账户 + currentStep: 1, // 当前步骤 + accounts: [], // 账户列表 + communityInfo: {}, // 社区信息缓存 + operatorInfo: {}, // 运营商信息缓存 + aaAccounts: [] // AA 账户列表 +}; +``` + +### API 响应格式规范 +所有 SDK API 应返回统一格式: +```typescript +interface SDKResponse { + success: boolean; + data?: T; + error?: string; + txHashes?: Hash[]; +} +``` + +## 下一步行动 +- ✅ 立即修复: 修复 operator 设置中的地址问题 +- 📝 规划审查: 用户审查本计划,提供反馈 +- 🔨 开始实施: 按阶段实施 diff --git a/0.16.23/guide/DOCUMENTATION_PLAN.md b/0.16.23/guide/DOCUMENTATION_PLAN.md new file mode 100644 index 000000000..c28a7aac0 --- /dev/null +++ b/0.16.23/guide/DOCUMENTATION_PLAN.md @@ -0,0 +1,455 @@ +# AAStar SDK 文档生成和发布方案 + +## 概述 + +本文档定义了AAStar SDK的完整文档生成、维护和发布流程。 + +--- + +## 1. 技术栈选择 + +### 推荐方案: VitePress + +**优势**: +- ⚡ 基于Vite,构建速度极快 +- 📝 原生Markdown支持 +- 🎨 Vue组件集成 +- 🔍 内置全文搜索 +- 📱 响应式设计 +- 🚀 零配置部署到GitHub Pages/Vercel + +**替代方案**: Docusaurus (React生态) + +--- + +## 2. 仓库架构 + +### 2.1 SDK仓库 (`aastar-sdk`) + +``` +aastar-sdk/ +├── packages/ # SDK源码 +│ ├── core/ +│ ├── account/ +│ ├── paymaster/ +│ └── ... +├── docs/ # 文档源文件 +│ ├── guide/ # 手写指南 +│ │ ├── getting-started.md +│ │ ├── concepts.md +│ │ └── use-cases/ +│ │ ├── community-management.md +│ │ ├── gasless-transactions.md +│ │ └── operator-staking.md +│ ├── api/ # 自动生成的API文档 +│ │ ├── core.md +│ │ ├── account.md +│ │ └── ... +│ └── examples/ # 完整示例 +│ ├── operator-flow.md +│ ├── community-flow.md +│ └── enduser-flow.md +├── scripts/ +│ ├── generate-api-docs.ts # API文档生成脚本 +│ └── sync-to-docs-repo.sh # 同步到文档仓库 +└── package.json +``` + +### 2.2 文档仓库 (`aastar-docs`) + +``` +aastar-docs/ +├── .vitepress/ +│ ├── config.ts # VitePress配置 +│ ├── theme/ # 自定义主题 +│ └── components/ # Vue组件 +├── public/ # 静态资源 +│ ├── logo.svg +│ └── images/ +├── index.md # 首页 +├── guide/ # 从SDK repo同步 +├── api/ # 从SDK repo同步 +├── examples/ # 从SDK repo同步 +└── package.json +``` + +--- + +## 3. 自动化工作流 + +### 3.1 API文档自动生成 + +使用 **TypeDoc** 或 **API Extractor** 从TypeScript源码提取API文档。 + +**脚本**: `scripts/generate-api-docs.ts` + +```typescript +import { Application } from 'typedoc'; + +async function generateAPIDocs() { + const app = new Application(); + + app.options.addReader(new TypeDocReader()); + app.bootstrap({ + entryPoints: ['packages/*/src/index.ts'], + out: 'docs/api', + plugin: ['typedoc-plugin-markdown'], + }); + + const project = app.convert(); + await app.generateDocs(project, 'docs/api'); +} +``` + +### 3.2 文档同步流程 + +文档同步使用 `scripts/extract-docs.sh` 腳本,手動調用命令為 `pnpm run docs:sync`。 + +**流程**: +1. 在 `aastar-sdk` 運行 `pnpm run docs:generate` 生成最新 API 文檔。 +2. 運行 `pnpm run docs:sync` 將 `docs/` 文件夾內容同步到 `aastar-docs`。 +3. 同步過程會保持相同的目錄結構 (`guide/`, `api/`, `examples/`)。 + +**Shell 腳本核心邏輯**: +\`\`\`bash +# 同步 Guide +cp -r "$SDK_REPO/docs/guide/"* "$DOCS_REPO/guide/" +# 同步 API +cp -r "$SDK_REPO/docs/api/"* "$DOCS_REPO/api/" +# 同步 Examples +cp -r "$SDK_REPO/docs/examples/"* "$DOCS_REPO/examples/" +\`\`\` + + + +### 3.3 文档站点部署 + +Use docs repo shell to deploy. +--- + +## 4. 文档结构设计 + +### 4.1 首页 (index.md) + +```markdown +# AAStar SDK + +> Build Your Own Protocol (YOP) with Account Abstraction + +## Features +- 🚀 Gasless Transactions (SuperPaymaster AOA+) +- 🌈 EOA Rainbow Bridge +- 🏛️ Community Management +- 🎯 Reputation System + +## Quick Start +[Get Started →](/0.16.23/guide/getting-started) +``` + +### 4.2 指南结构 + +``` +guide/ +├── index.md # 指南概览 +├── getting-started.md # 快速开始 +├── concepts/ +│ ├── account-abstraction.md +│ ├── superpaymaster.md +│ └── reputation-system.md +├── use-cases/ +│ ├── community-management.md +│ ├── gasless-transactions.md +│ ├── operator-staking.md +│ └── rainbow-bridge.md +└── advanced/ + ├── custom-paymaster.md + └── multi-chain.md +``` + +### 4.3 API文档结构 (按角色组织) + +``` +api/ +├── index.md # API概览 +├── roles/ +│ ├── operator.md # Operator角色API +│ ├── community.md # Community角色API +│ ├── enduser.md # EndUser角色API +│ └── admin.md # Admin角色API +├── modules/ +│ ├── core.md # Core模块 +│ ├── account.md # Account模块 +│ ├── paymaster.md # Paymaster模块 +│ ├── tokens.md # Tokens模块 +│ └── identity.md # Identity模块 +└── types/ + ├── common.md # 通用类型 + └── errors.md # 错误类型 +``` + +--- + +## 5. API文档模板 + +### 5.1 模块文档模板 + +```markdown +# @aastar/core + +Core configuration and client creation utilities. + +## Installation + +\`\`\`bash +pnpm add @aastar/core +\`\`\` + +## Exports + +- [Networks](#networks) +- [Contracts](#contracts) +- [Clients](#clients) +- [Constants](#constants) + +--- + +## Networks + +### getNetwork() + +Get network configuration for a supported network. + +**Signature:** +\`\`\`typescript +function getNetwork(network: SupportedNetwork): NetworkConfig +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| network | `SupportedNetwork` | Network name ('sepolia' \| 'optimism' \| 'anvil') | + +**Returns:** +| Type | Description | +|------|-------------| +| `NetworkConfig` | Network configuration object | + +**Type Definitions:** +\`\`\`typescript +type SupportedNetwork = 'sepolia' | 'optimism' | 'optimism-sepolia' | 'anvil'; + +interface NetworkConfig { + chainId: number; + name: string; + rpcUrl: string; + blockExplorer: string; + nativeCurrency: { + name: string; + symbol: string; + decimals: number; + }; +} +\`\`\` + +**Example:** +\`\`\`typescript +import { getNetwork } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +console.log(network.rpcUrl); // 'https://rpc.sepolia.org' +\`\`\` + +**Errors:** +- Throws if network is not supported + +**See Also:** +- [getTxUrl()](#gettxurl) +- [getChainId()](#getchainid) +``` + +### 5.2 角色文档模板 + +```markdown +# Operator API + +API reference for Paymaster operators. + +## Overview + +Operators are responsible for: +- Staking GTokens +- Depositing to Paymaster +- Managing withdrawals +- Monitoring performance + +## Client Creation + +### createOperatorClient() + +Create a client for Paymaster operators. + +[详细文档...] + +## Actions + +### stake() + +Stake GTokens to become an operator. + +**Context:** Use this when you want to register as a Paymaster operator. + +**Prerequisites:** +- Must have GTokens +- Must approve GTokenStaking contract + +**Signature:** +\`\`\`typescript +stake(params: StakeParams): Promise +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| params.amount | `bigint` | Amount to stake (in wei) | + +**Returns:** +| Type | Description | +|------|-------------| +| `Promise` | Transaction hash | + +**Example:** +\`\`\`typescript +import { createOperatorClient } from '@aastar/core'; +import { parseEther } from 'viem'; + +const operator = createOperatorClient({...}); + +// Approve first +await operator.approveGToken({ + spender: CONTRACTS.sepolia.gTokenStaking, + amount: parseEther('100'), +}); + +// Then stake +const txHash = await operator.stake({ + amount: parseEther('100'), +}); +\`\`\` + +**Errors:** +- `InsufficientBalance` - Not enough GTokens +- `InsufficientAllowance` - Need to approve first +- `MinimumStakeNotMet` - Amount below minimum + +**Events Emitted:** +- `Staked(operator, amount)` + +**See Also:** +- [deposit()](#deposit) +- [withdraw()](#withdraw) +``` + +--- + +## 6. 实施步骤 + +### Phase 1: 基础设施搭建 (1-2天) + +- [ ] 创建`aastar-docs`仓库 +- [ ] 安装VitePress并配置 +- [ ] 设置GitHub Actions自动部署 +- [ ] 配置自定义域名`docs.aastar.io` + +### Phase 2: API文档生成 (2-3天) + +- [ ] 安装TypeDoc和相关插件 +- [ ] 编写`generate-api-docs.ts`脚本 +- [ ] 为每个模块生成API文档 +- [ ] 添加类型定义和错误说明 + +### Phase 3: 指南编写 (3-5天) + +- [ ] 编写快速开始指南 +- [ ] 编写核心概念文档 +- [ ] 编写用例文档(社区管理、无Gas交易等) +- [ ] 编写高级主题文档 + +### Phase 4: 角色文档 (2-3天) + +- [ ] 按角色组织API文档 +- [ ] 为每个角色编写完整工作流 +- [ ] 添加实际代码示例 +- [ ] 添加最佳实践 + +### Phase 5: 自动化和优化 (1-2天) + +- [ ] 设置自动同步workflow +- [ ] 添加文档搜索功能 +- [ ] 优化移动端显示 +- [ ] 添加代码playground (可选) + +--- + +## 7. 维护流程 + +### 日常维护 + +1. **代码变更时**: + - 开发者提交PR + - CI自动运行`pnpm run docs:generate` + - 检查API文档变更 + - 合并后自动同步到docs repo + +2. **手动文档更新**: + - 在SDK repo的`docs/`目录编辑 + - 提交后自动同步 + +3. **版本发布**: + - 打tag时自动生成版本化文档 + - 保留历史版本文档 + +### 质量保证 + +- [ ] 文档链接检查 +- [ ] 代码示例可运行性测试 +- [ ] TypeScript类型检查 +- [ ] Markdown格式检查 + +--- + +## 8. 工具和脚本 + +### package.json scripts + +```json +{ + "scripts": { + "docs:generate": "tsx scripts/generate-api-docs.ts", + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs", + "docs:sync": "bash scripts/sync-to-docs-repo.sh" + } +} +``` + +--- + +## 9. 参考资源 + +- [VitePress官方文档](https://vitepress.dev) +- [TypeDoc文档](https://typedoc.org) +- [Viem文档](https://viem.sh) (参考其文档结构) +- [Ethers.js文档](https://docs.ethers.org) (参考其API组织方式) + +--- + +## 11. 論文數據採集指南 (PhD Data collection) + +詳細指南請參見: [paper-data-collection.md](file:///Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/docs/paper-data-collection.md) + +**核心要點**: +- 所有實驗必須使用 `aastar-sdk` 實作。 +- 使用 `run_automated_experiment.sh` 進行自動化運行。 +- 數據採集涵蓋: Gas Usage, Latency, Throughput (TPS), Cost (USD)。 diff --git a/0.16.23/guide/ENV_SEPOLIA_UPDATE.md b/0.16.23/guide/ENV_SEPOLIA_UPDATE.md new file mode 100644 index 000000000..dea6b2338 --- /dev/null +++ b/0.16.23/guide/ENV_SEPOLIA_UPDATE.md @@ -0,0 +1,68 @@ +# .env.sepolia Configuration Update + +## Summary +Cleaned and updated `.env.sepolia` with latest Sepolia deployment addresses from `SuperPaymaster/script/v3/config/deployed.json`. + +## Key Changes + +### Removed Duplicates +- Removed old/duplicate contract addresses (e.g., multiple GTOKEN_ADDRESS entries) +- Consolidated to single source of truth + +### Latest Contract Addresses + +#### Paymaster Contracts +- **PaymasterV4 Proxy**: `0x0F9019Dd30C7Cc5774d4883fba933aA0Caba9424` +- **PaymasterV4 Implementation**: `0x720472c8ce72c2A2D711333e064ABD3E6BbEAdd3` +- **SuperPaymaster**: `0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D` +- **Paymaster Factory**: `0x5c74c94173F05dA1720953407cbb920F3DF9f887` + +#### Core Contracts +- **GToken**: `0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d` +- **Staking**: `0xC9a43158891282A2B1475592D5719c001986Aaec` +- **Registry**: `0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb` +- **MySBT**: `0x1c85638e118b37167e9298c2268758e058DdfDA0` +- **ReputationSystem**: `0xCace1b78160AE76398F486c8a18044da0d66d86D` + +#### Token Contracts +- **aPNTs**: `0x49fd2BE640DB2910c2fAb69bB8531Ab6E76127ff` +- **xPNTs Factory**: `0xA4899D35897033b927acFCf422bc745916139776` + +#### EntryPoint & Validators +- **EntryPoint V0.7**: `0x2B0d36FACD61B71CC05ab8F3D2355ec3631C0dd5` +- **BLS Aggregator**: `0xF8e31cb472bc70500f08Cd84917E5A1912Ec8397` +- **DVT Validator**: `0xD5ac451B0c50B9476107823Af206eD814a2e2580` + +#### SimpleAccount Factory +- **Factory**: `0x4b6aB5F819A515382B0dEB6935D793817bB4af28` + +### Test Account Configuration +- **TEST_SIMPLE_ACCOUNT_A**: `0x11595E52131Ffd571ce5e00C44472FBf94c99937` + - ✅ Has PIM tokens deposited + - ✅ Ready for Pimlico paymaster tests +- **TEST_OWNER_EOA_A**: `0xda7f83CafAe1b76Bd4446a4aB2B8e88770CfA927` +- **TEST_OWNER_KEY_A**: (stored in .env.sepolia) + +### Bundler RPC Configuration +- **Primary RPC**: `SEPOLIA_RPC_URL` (Alchemy) +- **Bundler RPC**: `SEPOLIA_RPC_URL2` (Alchemy bundler endpoint) + - Used for AA UserOp submission + +## For Experiment Runner + +The experiment runner now uses: +1. **PAYMASTER_ADDRESS**: `0x0F9019Dd30C7Cc5774d4883fba933aA0Caba9424` (PaymasterV4 Proxy) +2. **SUPERPAYMASTER_ADDRESS**: `0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D` +3. **SEPOLIA_RPC_URL2**: Alchemy bundler RPC for Groups 3 & 4 + +## Next Steps +Run the experiment runner to test all 4 groups: +```bash +pnpm tsx scripts/19_sdk_experiment_runner.ts +``` + +Expected results: +- ✅ Group 1 (EOA): Should pass +- ✅ Group 2 (Pimlico): Should pass with PIM tokens +- ✅ Group 3 (AOA/PaymasterV4): Should pass with new address +- ✅ Group 4 (SuperPaymaster): Should pass with new address diff --git a/0.16.23/guide/L2_BUSINESS_CLIENTS_PLAN.md b/0.16.23/guide/L2_BUSINESS_CLIENTS_PLAN.md new file mode 100644 index 000000000..26152e339 --- /dev/null +++ b/0.16.23/guide/L2_BUSINESS_CLIENTS_PLAN.md @@ -0,0 +1,394 @@ +# L2 Business Clients 开发计划 + +## 🎯 L2 层目标 + +基于完整的 L1 Core Actions,构建**角色导向**的高层业务客户端,封装端到端业务逻辑。 + +--- + +## 📋 L2 架构设计 + +### 核心原则 + +1. **角色导向** - 按用户角色划分 Client +2. **业务完整** - 封装完整业务流程 +3. **简化接口** - 隐藏底层复杂性 +4. **组合 L1** - 复用所有 L1 actions + +### 四大角色 Client + +``` +L2 Business Clients +├── CommunityClient - 社区管理者 +├── PaymasterOperatorClient - Paymaster 运营商 +├── UserClient - 终端用户 +└── DAOClient - DAO 治理者 +``` + +--- + +## 1️⃣ CommunityClient - 社区管理者 + +### 目标用户 +社区创建者和管理员 + +### 核心功能 + +#### 1.1 社区创建与配置 +- `createCommunity(name, ensName)` - 创建社区并注册 +- `deployCommunityToken(name, symbol)` - 部署社区代币(xPNTs) +- `configureCommunity(config)` - 配置社区参数 + +#### 1.2 成员管理 +- `getMemberships()` - 获取所有成员 +- `getActiveMemberships()` - 获取活跃成员 +- `verifyCommunityMembership(user)` - 验证成员资格 +- `airdropSBT(users, metadata)` - 批量空投 SBT + +#### 1.3 角色管理 +- `createRole(name, config)` - 创建自定义角色 +- `configureRole(roleId, config)` - 配置角色参数 +- `assignRole(user, roleId)` - 分配角色 +- `revokeRole(user, roleId)` - 撤销角色 + +#### 1.4 信誉系统 +- `setReputationRule(ruleId, rule)` - 设置信誉规则 +- `computeMemberScore(user)` - 计算成员积分 +- `getCommunityRanking()` - 获取排行榜 + +### 使用示例 + +```typescript +import { CommunityClient } from '@aastar/enduser'; + +const community = new CommunityClient({ + registryAddress: REGISTRY, + sbtAddress: MYSBT, + factoryAddress: XPNTS_FACTORY, + client: walletClient, +}); + +// 创建社区 +const { communityAddress, tokenAddress } = await community.createCommunity({ + name: 'Web3 Builders', + ensName: 'web3builders.eth', + tokenSymbol: 'W3B', +}); + +// 空投 SBT +await community.airdropSBT({ + users: ['0x...', '0x...'], + metadata: { tier: 'founder' }, +}); + +// 设置信誉规则 +await community.setReputationRule({ + ruleId: '0x01', + rule: { + activityWeight: 50, + contributionWeight: 50, + }, +}); +``` + +--- + +## 2️⃣ PaymasterOperatorClient - Paymaster 运营商 + +### 目标用户 +Paymaster 运营商(赞助交易的服务提供者) + +### 核心功能 + +#### 2.1 运营商注册与配置 +- `registerAsOperator()` - 注册为 Paymaster 运营商 +- `configureOperator(config)` - 配置运营参数 +- `deployPaymaster(owner)` - 部署自己的 Paymaster + +#### 2.2 资金管理 +- `deposit(amount)` - 充值到 SuperPaymaster +- `withdraw(amount)` - 提取资金 +- `getBalance()` - 查询余额 +- `getAvailableCredit(user)` - 查询用户额度 + +#### 2.3 赞助策略 +- `setSponsorshipPolicy(policy)` - 设置赞助策略 +- `updateExchangeRate(rate)` - 更新兑换率 +- `setPause(paused)` - 暂停/恢复服务 +- `setOperatorLimits(limits)` - 设置运营限制 + +#### 2.4 监控与审计 +- `getOperatorStats()` - 获取运营统计 +- `getSlashHistory()` - 查询 Slash 历史 +- `getReputationScore()` - 查询信誉评分 +- `getRevenueReport()` - 获取收益报告 + +### 使用示例 + +```typescript +import { PaymasterOperatorClient } from '@aastar/operator'; + +const operator = new PaymasterOperatorClient({ + superPaymasterAddress: SUPER_PAYMASTER, + registryAddress: REGISTRY, + client: walletClient, +}); + +// 注册并配置 +await operator.registerAsOperator(); + +await operator.configureOperator({ + xPNTsToken: TOKEN_ADDRESS, + treasury: TREASURY_ADDRESS, + exchangeRate: 100n, // 1 xPNTs = 100 wei +}); + +// 充值 +await operator.deposit({ amount: parseEther('10') }); + +// 设置赞助策略 +await operator.setSponsorshipPolicy({ + maxGasPerOp: 500000n, + dailyLimit: parseEther('1'), + whitelistedUsers: ['0x...'], +}); + +// 监控 +const stats = await operator.getOperatorStats(); +console.log('Today sponsored:', stats.sponsoredCount); +console.log('Revenue:', stats.revenue); +``` + +--- + +## 3️⃣ UserClient - 终端用户 + +### 目标用户 +普通终端用户(使用 AA 账户的用户) + +### 核心功能 + +#### 3.1 账户管理 +- `createAccount(owner, salt)` - 创建 AA 账户 +- `getAccountAddress(owner, salt)` - 预测账户地址 +- `getNonce()` - 获取 nonce + +#### 3.2 SBT 管理 +- `mintSBT(roleId)` - 铸造 SBT +- `getMySBTs()` - 获取我的 SBTs +- `getMemberships()` - 获取社区成员资格 +- `leaveCommunity(community)` - 退出社区 + +#### 3.3 积分操作 +- `getBalance(token)` - 查询代币余额 +- `transfer(to, amount, token)` - 转账 +- `claimRewards()` - 领取奖励 + +#### 3.4 赞助操作 +- `executeWithSponsorship(target, calldata)` - 使用赞助执行操作 +- `batchExecuteWithSponsorship(calls)` - 批量执行 +- `getAvailableCredit(operator)` - 查询可用额度 + +### 使用示例 + +```typescript +import { UserClient } from '@aastar/enduser'; + +const user = new UserClient({ + accountAddress: MY_ACCOUNT, + registryAddress: REGISTRY, + sbtAddress: MYSBT, + superPaymasterAddress: SUPER_PAYMASTER, + client: walletClient, +}); + +// 铸造 SBT +const tokenId = await user.mintSBT({ + roleId: ROLE_ENDUSER, +}); + +// 查看我的成员资格 +const memberships = await user.getMemberships(); +console.log('I am member of:', memberships.length, 'communities'); + +// 使用赞助执行操作 +const hash = await user.executeWithSponsorship({ + target: NFT_CONTRACT, + calldata: mintCalldata, + operator: OPERATOR_ADDRESS, +}); +``` + +--- + +## 4️⃣ DAOClient - DAO 治理者 + +### 目标用户 +DAO 成员、提案者、投票者 + +### 核心功能 + +#### 4.1 提案管理 +- `createProposal(target, calldata, description)` - 创建提案 +- `getProposal(proposalId)` - 查询提案 +- `getProposalState(proposalId)` - 获取提案状态 +- `cancelProposal(proposalId)` - 取消提案 + +#### 4.2 投票管理 +- `signProposal(proposalId)` - 签名支持提案 +- `hasVoted(proposalId, validator)` - 检查是否已投票 +- `getSignatureCount(proposalId)` - 获取签名数 + +#### 4.3 执行操作 +- `executeWithProof(proposalId, signatures)` - 执行提案(DVT) +- `executeWithBLS(proposalId, blsSignature)` - 执行提案(BLS) + +#### 4.4 验证器管理 +- `getValidators()` - 获取验证器列表 +- `addValidator(validator)` - 添加验证器 +- `removeValidator(validator)` - 移除验证器 +- `setThreshold(threshold)` - 设置阈值 + +### 使用示例 + +```typescript +import { DAOClient } from '@aastar/operator'; + +const dao = new DAOClient({ + dvtValidatorAddress: DVT_VALIDATOR, + blsAggregatorAddress: BLS_AGGREGATOR, + client: walletClient, +}); + +// 创建提案 +const proposalId = await dao.createProposal({ + target: TREASURY, + calldata: transferCalldata, + description: 'Transfer 10 ETH to community fund', +}); + +// 签名提案 +await dao.signProposal({ proposalId }); + +// 检查状态 +const state = await dao.getProposalState({ proposalId }); +if (state === ProposalState.Succeeded) { + // 执行 + await dao.executeWithProof({ + proposalId, + signatures: collectedSignatures, + }); +} +``` + +--- + +## 📦 实现计划 + +### Phase 1: 基础架构 (1-2天) + +1. 创建 L2 packages + - `packages/enduser/` - CommunityClient + UserClient + - `packages/operator/` - PaymasterOperatorClient + DAOClient + +2. 定义基础类型和接口 + - `ClientConfig` + - `TransactionOptions` + - `BusinessResult` + +3. 实现基类 `BaseClient` + - 统一的 client 管理 + - 通用的错误处理 + - 日志和监控 + +### Phase 2: CommunityClient (2-3天) + +1. 社区创建与配置 +2. 成员管理 +3. 角色管理 +4. 信誉系统 + +### Phase 3: PaymasterOperatorClient (2-3天) + +1. 运营商注册 +2. 资金管理 +3. 赞助策略 +4. 监控审计 + +### Phase 4: UserClient (1-2天) + +1. 账户管理 +2. SBT 管理 +3. 积分操作 +4. 赞助操作 + +### Phase 5: DAOClient (1-2天) + +1. 提案管理 +2. 投票管理 +3. 执行操作 +4. 验证器管理 + +### Phase 6: 测试与文档 (2-3天) + +1. 单元测试 +2. 集成测试 +3. E2E 示例 +4. API 文档 + +--- + +## 🎯 预期成果 + +### 代码交付 + +``` +packages/ +├── enduser/ +│ ├── src/ +│ │ ├── CommunityClient.ts +│ │ ├── UserClient.ts +│ │ └── types.ts +│ └── tests/ +└── operator/ + ├── src/ + │ ├── PaymasterOperatorClient.ts + │ ├── DAOClient.ts + │ └── types.ts + └── tests/ +``` + +### 使用体验 + +**L1 - 底层调用** (现在): +```typescript +// 需要多步操作 +const registry = registryActions(REGISTRY); +const factory = xPNTsFactoryActions(FACTORY); + +await registry(client).registerRole(...); +await factory(client).createToken(...); +await registry(client).setCommunityToken(...); +``` + +**L2 - 业务封装** (目标): +```typescript +// 一步完成 +const community = new CommunityClient({ ... }); +await community.createCommunity({ + name: 'My Community', + tokenSymbol: 'MYC', +}); +``` + +--- + +## 📝 下一步 + +1. ✅ 完成 L1 API Demo +2. 🔄 审核 L2 设计 +3. ⏭️ 开始 Phase 1: 基础架构 +4. ⏭️ 实现 CommunityClient +5. ⏭️ 完整 L2 测试 + +**准备开始 L2 开发!** 🚀 diff --git a/0.16.23/guide/L3-demo-API-and-simple-demo-walk-through.md b/0.16.23/guide/L3-demo-API-and-simple-demo-walk-through.md new file mode 100644 index 000000000..ee4129ea7 --- /dev/null +++ b/0.16.23/guide/L3-demo-API-and-simple-demo-walk-through.md @@ -0,0 +1,294 @@ +# AAstar SDK: L3 Demo API 审查与 Simple Demo 对比指南 + +## 第一部分:L3 Complete Demo - SDK API 使用审查报告 + +### 审查目标 +确认 `examples/l3-complete-demo.ts` 中所有基础流程都依赖 SDK API,而不是直接使用 `writeContract`。 + +### 审查结果:✅ 通过 +所有关键操作均已使用 SDK 提供的高层 API,无直接底层合约调用。 + +### API 使用明细 + +#### 1. ⛏️ Token Minting(资金准备) +**操作**: 为 Alice 铸造 GToken 和 aPNTs +**SDK API 使用**: +```typescript +// GToken Minting +const gToken = gTokenActions()(supplierClient); +await gToken.mint({ + token: config.contracts.gToken, + to: aliceAcc.address, + amount: parseEther('100'), + account: supplierAcc +}); + +// aPNTs Minting +const aPNTsToken = tokenActions()(supplierClient); +await aPNTsToken.mint({ + token: config.contracts.aPNTs, + to: aliceAcc.address, + amount: parseEther('4000'), + account: supplierAcc +}); +``` +- **位置**: 第 120-139 行 +- **状态**: ✅ 使用 SDK API + +#### 2. 🏛️ Community Creation(社区创建) +**操作**: Alice 创建并启动社区 +**SDK API 使用**: +```typescript +const aliceCommunity = new CommunityClient({ ... }); +const res = await aliceCommunity.setupCommunity({ + name: communityName, + tokenName: `${communityName} Token`, + tokenSymbol: "ALICE", + description: "Demo Community", + stakeAmount: parseEther('30') +}); +``` +- **位置**: 第 160-192 行 +- **状态**: ✅ 使用 SDK API (`CommunityClient.setupCommunity`) + +#### 3. 🔗 Link Token to SuperPaymaster(Token 关联) +**操作**: 将 xPNTs Token 链接到 SuperPaymaster +**SDK API 使用** (🆕 本次修复): +```typescript +const xPNTsToken = tokenActions()(aliceClient); +const hLink = await xPNTsToken.setSuperPaymasterAddress({ + token: tokenAddress, + spAddress: config.contracts.superPaymaster, + account: aliceAcc +}); +``` +- **位置**: 第 203-209 行 +- **修复前**: ❌ 使用 `aliceClient.writeContract(...)` +- **修复后**: ✅ 使用 SDK API (`tokenActions().setSuperPaymasterAddress`) + +#### 4. ⚙️ Operator Node Setup(Operator 节点设置) +**操作**: Alice 设置 SuperPaymaster Operator 节点 +**SDK API 使用**: +```typescript +const aliceL3 = new OperatorLifecycle({ ... }); +const hSetup = await aliceL3.setupNode({ + type: 'SUPER', + stakeAmount: parseEther('50'), + depositAmount: 0n +}); +``` +- **位置**: 第 142-223 行 +- **状态**: ✅ 使用 SDK API (`OperatorLifecycle.setupNode`) + +#### 5. 💰 Deposit Collateral(抵押品存款) +**操作**: Alice 存入 aPNTs 作为抵押 +**SDK API 使用**: +```typescript +const hDeposit = await aliceL3.depositCollateral(parseEther('4000')); +``` +- **位置**: 第 241-243 行 +- **状态**: ✅ 使用 SDK API (`OperatorLifecycle.depositCollateral`) + +#### 6. 🔧 Configure Operator(配置 Operator) +**操作**: 配置 Operator 参数(xPNTs Token, Treasury, ExchangeRate) +**SDK API 使用**: +```typescript +const hConfig = await aliceL3.configureOperator( + tokenAddress, + aliceAcc.address, + parseEther('1') +); +``` +- **位置**: 第 246-252 行 +- **状态**: ✅ 使用 SDK API (`OperatorLifecycle.configureOperator`) + +#### 7. 🔄 Update Oracle Price(价格更新) +**操作**: 通过 DVT 签名更新 ETH/USD 价格 +**SDK API 使用**: +```typescript +const hPrice = await superPaymasterActions(superPM)(supplierClient).updatePriceDVT({ + price: newPrice, + updatedAt: timestamp, + proof: signature, + account: supplierAcc +}); +``` +- **位置**: 第 276-283 行 +- **状态**: ✅ 使用 SDK API (`superPaymasterActions().updatePriceDVT`) + +#### 8. 🚀 Deploy AA Account(部署 AA 账户) +**操作**: 为 Bob 部署 SimpleAccount(AA) +**SDK API 使用**: +```typescript +const { accountFactoryActions } = await import('@aastar/core'); +const factoryActions = accountFactoryActions(config.contracts.simpleAccountFactory); + +// Get predicted address +const bobAA = await factoryActions(publicClient).getAddress({ + owner: bobAcc.address, + salt +}); + +// Deploy +const hDeploy = await factoryActions(bobClient).createAccount({ + owner: bobAcc.address, + salt, + account: bobAcc +}); +``` +- **位置**: 第 301-327 行 +- **状态**: ✅ 使用 SDK API (`accountFactoryActions().getAddress` + `createAccount`) + +#### 9. 📝 User Onboarding(用户注册) +**操作**: Bob 注册加入 Alice 的社区 +**SDK API 使用**: +```typescript +const bobL3 = new UserLifecycle({ ... }); +// Check eligibility +const canJoin = await bobL3.checkEligibility(aliceAcc.address); +// Onboard +const res = await bobL3.onboard(aliceAcc.address, parseEther('0.4')); +``` +- **位置**: 第 337-377 行 +- **状态**: ✅ 使用 SDK API (`UserLifecycle.checkEligibility` + `onboard`) + +#### 10. ⚡ Gasless Transaction(Gasless 交易) +**操作**: Bob 执行 Gasless 的 GToken 转账(由 Alice 的 Operator 赞助) +**SDK API 使用**: +```typescript +const { SuperPaymasterClient } = await import('../packages/paymaster/src/V4/SuperPaymasterClient.js'); +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction( + publicClient, + bobClient, + bobAA, + config.contracts.entryPoint, + config.bundlerUrl!, + { + token: config.contracts.gToken, + recipient: aliceAcc.address, + amount: parseEther('1'), + operator: aliceAcc.address, + paymasterAddress: config.contracts.superPaymaster + } +); +``` +- **位置**: 第 383-401 行 +- **状态**: ✅ 使用 SDK API (`SuperPaymasterClient.submitGaslessTransaction`) + +#### 11. 🚪 User Exit(用户退出) +**操作**: Bob 退出社区 +**SDK API 使用**: +```typescript +const hLeave = await bobL3.leaveCommunity(aliceAcc.address); +``` +- **位置**: 第 421 行 +- **状态**: ✅ 使用 SDK API (`UserLifecycle.leaveCommunity`) + +#### 12. 🏁 Operator Exit(Operator 退出) +**操作**: Alice 退出 Operator 角色 +**SDK API 使用**: +```typescript +const hExit = await aliceL3.exit(); +``` +- **位置**: 第 428 行 +- **状态**: ✅ 使用 SDK API (`OperatorLifecycle.exit`) + +### 辅助操作(读取) +以下操作为只读查询,使用 SDK 提供的 Actions 进行标准化访问: + +| 操作 | SDK API | 位置 | +| :--- | :--- | :--- | +| 检查 Operator 就绪状态 | `OperatorLifecycle.checkReadiness()` | 156, 290 | +| 查询 Registry Role | `registryActions().hasRole()` | 232, 361 | +| 查询 GToken 余额 | `gTokenActions().balanceOf()` | 365 | +| 获取 AA 地址 | `accountFactoryActions().getAddress()` | 307 | +| 获取 AA 代码 | `publicClient.getBytecode()` | 320 | + +### 🎯 总结 +- ✅ **所有 12 个核心业务流程** 均使用 SDK 高层 API 实现 +- ✅ **0 个直接 `writeContract` 调用**(已全部替换为 SDK API) +- ✅ **完全符合 SDK 使用最佳实践** + +### 修复记录 +- **修复项**: Token 链接操作(第 203-209 行) +- **修复前**: 直接使用 `aliceClient.writeContract({ ... })` +- **修复后**: 使用 `tokenActions().setSuperPaymasterAddress({ ... })` + +### 建议 +`l3-complete-demo.ts` 现在是一个完整的 SDK API 使用示范,可以作为: +1. 📚 **教学材料**:展示如何使用 AAstar SDK 完成全生命周期操作 +2. 🧪 **集成测试**:验证 SDK 各模块的正确性和互操作性 +3. 📖 **文档示例**:作为官方文档的参考实现 + +--- + +## 第二部分:Simple SuperPaymaster Demo 机制分析与对比 + +本部分将 `l3-complete-demo.ts` 与极简版本的 `simple-superpaymaster-demo.ts` (由 `./simple-test-superpaymaster.sh` 触发) 进行全面对比。 + +### 1. 运行机制 +- **Simple Demo**: 依赖于 `l4-setup` 预先生成的 `scripts/l4-state.${network}.json` 状态文件。它从状态文件中直接读取已存在的 Operator 和 AA 账户地址,忽略了所有 Onboarding 步骤。 +- **L3 Demo**: 全生命周期示范,自动生成账户、创建社区并配置节点,是一套完整的自完备流程。 + +### 2. 核心代码实现对比 + +#### Simple Demo (极简写法) +```typescript +// 直接调用高层封装的支付客户端 +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction( + client, + wallet, + aaAccount, + entryPoint, + bundlerUrl, + { + token, + recipient, + amount: parseEther('1'), + operator, + paymasterAddress + } +); +``` + +#### L3 Demo (全生命周期写法) +涉及 `CommunityClient`, `OperatorLifecycle`, `UserLifecycle` 等多个类协同工作: +```typescript +// 1. 创建社区 +await aliceCommunity.setupCommunity({...}); +// 2. 注册节点 +await aliceL3.setupNode({...}); +// 3. 用户上车 +await bobL3.onboard(aliceAddress, stakeAmount); +// 4. 发起 Gasless 交易 +await SuperPaymasterClient.submitGaslessTransaction({...}); +``` + +### 3. 全面对比表 + +| 特性 | L3 Complete Demo (`l3-complete-demo.ts`) | Simple SuperPaymaster Demo (`simple-superpaymaster-demo.ts`) | +| :--- | :--- | :--- | +| **目标定位** | **全生命周期示范**。模拟生态构建全过程。 | **核心能力示范**。展示最纯粹的 Gasless 交易。 | +| **自完备性** | **高**。自动生成环境,无需预设状态。 | **低**。必须配合 `l4-setup` 运行。 | +| **复杂度** | **中高**。涉及 3 个主要的 Lifecycle/Client 类。 | **极低**。仅使用 `SuperPaymasterClient`。 | +| **执行时间** | **长** (~5-8 分钟)。包含 10+ 笔链上确认。 | **短** (~30-60 秒)。仅 1 笔 UserOperation。 | +| **Gas 调优** | 在 `UserClient` 内部通过参数驱动调优。 | 在 `SuperPaymasterClient` 内部自动调优。 | +| **适用场景** | 开发者集成参考、端到端回归测试。 | 快速验证环境联通性。 | + +--- + +## 第三部分:底层机制深度解析 + +虽然表现形式不同,但两者共享相同的 **SBT 绑定安全模型** 与 **Gas 调优机制 (Efficiency Guard)**。 + +### 1. 🛡️ 身份验证 (SBT 绑定) +SuperPaymaster 在执行前会通过 `Registry` 检查 `aaAccount` 是否持有对应社区的合约权限。无论通过 `onboard()` 实时绑定还是预先绑定,底层逻辑一致。 + +### 2. ⛽ Gas 调优 (Efficiency Guard) +这是修复 `SUPER_PAYMASTER` 报错的核心。Bundler 要求 `actual_gas / gas_limit >= 0.4`。两个脚本均通过以下公式强制满足准入条件: +`tuneGasLimit(bundlerEstimate, 60_000n, 0.45)` + +--- + +> [!TIP] +> 建议开发者在调试时先通过 `simple-test-superpaymaster.sh` 确保环境联通,再参考 `l3-complete-demo.ts` 进行完整的业务集成。 diff --git a/0.16.23/guide/L4_Manual_Test_CheatSheet.md b/0.16.23/guide/L4_Manual_Test_CheatSheet.md new file mode 100644 index 000000000..d3556d3c5 --- /dev/null +++ b/0.16.23/guide/L4_Manual_Test_CheatSheet.md @@ -0,0 +1,172 @@ +# L4 Gasless 调试备忘录 (L4 Debug Cheat Sheet) + +这份文档旨在协助进行 L4 Gasless 场景的人工调试和验证。适用于 Sepolia, Anvil 或其他 EVM 网络。 + +> **注意**: 部分地址 (Token, Paymaster) 是在运行 `l4-setup.ts` 脚本时动态生成的,请参照 `scripts/l4-state.json` 文件获取最新值。 + +## 1. 核心账户配置 (Keys & Accounts) + +请确保你的 ENV 文件 (`.env.sepolia` 或 `.env.anvil`) 中包含以下私钥配置。 + +| 角色 (Role) | 变量名 (ENV Variable) | 说明 (Description) | +| :--- | :--- | :--- | +| **资金提供方** | `PRIVATE_KEY_SUPPLIER` | Used for Minting GToken, Initial ETH funding. | +| **Operator A** | `PRIVATE_KEY_JASON` | Jason (AAStar Operator). Paymaster V4 + aPNTs. | +| **Operator B** | `PRIVATE_KEY_BOB` | Bob (Bread Operator). Paymaster V4 + bPNTs. | +| **Operator C** | `PRIVATE_KEY_ANNI` | Anni (Demo Operator). SuperPaymaster + cPNTs. | + +## 2. 全局合约 (Global Contracts) + +### 2.1 说明 (Concepts) + +PaymasterFactory是有注册实例(PaymasterV4Impl)的工厂合约,任何社区可以无许可的发行自己的Gas Token,然后从工厂clone 实例proxy来完成低gas部署和绑定自己的Gas Token(例如bPNTs,cPNTs),从而为自己的社区提供Gasless服务(需要自行充值到EntryPoint和维护运营)。 + +而SuperPaymaster是多租户的公共基础设施,它是一个全局唯一Paymaster,同时也是一个多租户的合约,社区在注册和发行自己的gas token后,需要购买此合约的唯一服务方AAStar社区发行的aPNTs并deposite到SuperPaymaster,然后自己的社区成员可以获得该社区的bPNTs,cPNTs等,作为gas token无感支付(AAStar社区会维护运营)。 + +无论是Paymaster V4还是SuperPaymaster,都是标准的ERC4337 Paymaster,本测试会为几个测试账户分别部署两个不同的Paymaster V4,注册一个SuperPaymaster(全局唯一,无需部署,注册即可)。 + +GToken是Mycelium的治理代币,2100万硬顶,除了社区投票和治理外,核心作用是公共物品花园的门票。所有协议的参与者(例如节点运营商、Paymaster服务商和SuperPaymaster注册服务商等)和使用者(普通的用户等),都需要stake & locky一定数量的GToken来获得入场资格,永久一次性门票,可退票。Mycelium协议致力于维护和提供一套不断产生数字公共物品的流程和基建,包括Infrastucture, Protocol, DApp三个层级的协作和支持。GTokenStaking是对应的管理合约,在注册和质押GToken时使用,需要一次性approve一定的额度范围(例如普通用户大约需要0.45,注册社区需要33, 启动Paymaster大约需要33, 注册启动SuperPaymaster大约需要55等等,此配置可由协议治理多签进行调整)。 + +MySBT是Mycelium的灵魂绑定的一个数字白板,归属于第一次mint的用户,当你注册为Mycelium协议成员或者任意协议社区时自动mint。白板秉持隐私保护策略,owner全权控制显示哪些信息,自动绑定了Gasless加油卡,接受所有协议内的社区自己发行的Gas Token,自动绑定了数字公共物品花园的门票,同时被动接受社区自定义的reputation规则的更新和全局reputation的更新。Reputation越高,获得Mycelium内部DApp启动的早期邀请和airdrop的概率越大。同时也是一个可以设置头像的NFT,可配置profile等。 + +xPNTsFactory和xPNTs,是工厂合约和泛指任意社区发行的ERC20Gas Token,只要拥有加油卡(MySBT+充值xPNTs)即可无感支付Gas,自由交易。 + +### 2.2 合约地址 (Addresses) + +这些是部署在网络上的核心系统合约 (请检查 `config..json`)。 + +| 合约名称 (Contract) | 说明 | +| :--- | :--- | +| **Registry** | 核心注册表,管理权限与角色 | +| **EntryPoint** | ERC-4337 官方入口点 (v0.7) | +| **GToken** | 系统 Gas Token (ERC-20) | +| **GTokenStaking** | Paymaster 质押合约 (Locking) | +| **SBT** | 灵魂绑定代币合约 (Identity) | +| **ReputationSystem**| 信誉系统合约 | +| **PaymasterFactory**| 部署 Paymaster V4 的工厂 | +| **SuperPaymaster** | 超级 Paymaster (代理合约) | + +## 3. 动态环境配置 (Dynamic Setup) + +运行 `pnpm tsx scripts/l4-setup.ts --network=` 后,以下信息会更新到 `scripts/l4-state.json`。 + +| 社区名称 | Operator | Token Symbol | Paymaster 类型 | 获取地址方式 (l4-state.json) | +| :--- | :--- | :--- | :--- | :--- | +| **AAStar** | Jason | **aPNTs** | **V4** | `jason.tokenAddress` / `jason.paymasterAddress` | +| **Bread** | Bob | **bPNTs** | **V4** | `bob.tokenAddress` / `bob.paymasterAddress` | +| **Demo** | Anni | **cPNTs** | **Super** | `anni.tokenAddress` / `anni.superPaymasterAddress` | + +## 4. 自动化初始化检查清单 (Setup Checklist) + +`scripts/l4-setup.ts` 会自动执行以下检查与修复动作 (Idempotent)。此脚本适配不同网络,基于 `config..json` 加载配置。 + +| # | 检查项 (Item) | 逻辑 (Logic) | 预期 (Expectation) | +| :--- | :--- | :--- | :--- | +| **1** | **Check/Deploy AA** | 使用 0.7 Factory 计算并部署 AA 账户 | Jason, Bob, Anni 的 AA 账户已部署 | +| **2** | **Operator Funding** | 检查 AA & EOA 的 ETH/GToken 余额 | ETH > 0.05, GToken > 1000 | +| **3** | **Community Role** | `registry.hasRole(COMMUNITY)` | Operator 均注册为 Community | +| **4** | **Token Deployment** | `factory.getTokenAddress(owner)` | aPNTs, bPNTs, cPNTs 已部署 | +| **5** | **Paymaster V4** | `pmFactory.getPaymaster(owner)` | Jason & Bob 拥有 Paymaster V4 实例 | +| **6** | **SuperPaymaster**| Operator Client Registration | Anni 注册为 SuperPaymaster Operator | +| **7** | **Deposits** | `entryPoint.balanceOf(pm)` | Paymaster 在 EntryPoint 存款 > 0.1 ETH | + +## 5. 常用调试命令 + +```bash +# 1. 运行环境配置 (幂等,推荐每次测试前运行) +pnpm tsx scripts/l4-setup.ts --network=sepolia + +# 2. 运行 Gasless 回归测试 +pnpm tsx tests/regression/l4-gasless.ts --network=sepolia + +# 3. 查看状态文件 +cat scripts/l4-state.json +``` + +## 6. 新建 AA 账户 & Gasless 开发指南 (Developer Workflow) + +如果你需要测试一个新的 AA 账户 (SimpleAccount),请遵循以下标准流程: + +### Step 1: 账户生成与初始化 (Client SDK) + +无需手动部署 Factory,使用 `UserClient` 即可。 + +```typescript +import { UserClient } from '@aastar/enduser'; +import { createWalletClient, http } from 'viem'; +import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; + +// 1. 本地生成/读取私钥 +const pKey = generatePrivateKey(); +const account = privateKeyToAccount(pKey); + +// 2. 初始化 Client (自动关联 EntryPoint v0.7) +// 注意:configs 应从 network config 加载,不应 hardcode +const client = new UserClient({ + client: createWalletClient({ + account, + chain: chainConfig, + transport: http(rpcUrl) + }), + entryPointAddress: CONFIG.entryPoint, + registryAddress: CONFIG.registry + // ... 其他地址 +}); +console.log(`New AA Address: ${client.accountAddress}`); +``` + +### Step 2: 资金准备 (Admin Actions) + +新账户需要 Gas Token 来通过 Paymaster 验证。 + +* **Operator (Admin)** 调用 SDK 发放代币: + ```typescript + await tokenActions(operatorClient).mint({ + token: aPNTsAddress, + to: client.accountAddress, // AA 地址 + amount: parseEther('100') + }); + ``` +* **Supplier** 发放少量 ETH (可选,如果 Token 不支持 Permit 或是首次 Approve 需要): + ```typescript + await supplier.sendTransaction({ to: client.accountAddress, value: parseEther('0.05') }); + ``` + +### Step 3: Approve Paymaster (User Actions) + +在发起 Gasless 交易前,必须授权 Paymaster 扣款。 + +```typescript +// 普通 ERC20 Approve +const tx = await tokenActions(client.client).approve({ + token: aPNTsAddress, + spender: paymasterAddress, + amount: parseEther('1000') +}); +// 等待 Approve 上链 (Approve 本身需要 ETH Gas) +``` + +### Step 4: 发送 Gasless 交易 (User Actions) + +使用 `executeGasless` 自动构建 UserOp。 + +```typescript +import { encodeFunctionData } from 'viem'; + +// 1. 业务逻辑 (如: 注册自己) +const callData = encodeFunctionData({ + abi: RegistryABI, + functionName: 'registerRoleSelf', + args: [ROLE_COMMUNITY, '0x'] +}); + +// 2. 提交 +const hash = await client.executeGasless({ + target: registryAddress, + value: 0n, + data: callData, + paymaster: paymasterAddress, + paymasterType: 'V4' // 或 'Super' +}); +console.log(`UserOp Hash: ${hash}`); +``` diff --git a/0.16.23/guide/Plan.md b/0.16.23/guide/Plan.md new file mode 100644 index 000000000..a886088d8 --- /dev/null +++ b/0.16.23/guide/Plan.md @@ -0,0 +1,266 @@ +# AAStar计划 + + +## V2 + +好的,完全理解你的思路!MVP阶段聚焦核心功能,快速验证,是非常明智的选择。 + +根据你的优先级分析: + +* **最高优先级 (High Priority - H)**: + 1. 核心账户功能 (二次签名验证 + 整体集成,包括Relay) + 2. Demo 应用 (页面JS版本 + 简单后端配合,为后续集成COS72做准备) +* **中等优先级 (Medium Priority - M)**: + 1. 基础的Gasless功能对接 (SuperPaymaster的初步集成) +* **低优先级 (Low Priority - L)**: + 1. SDSS的完全去中心化 (先采用中心化或简化版) + 2. 完整的SDK化 + 3. 其他高级功能和研究性课题 + +现在,我们基于这个思路,从你之前的详细任务列表中筛选和重组,形成一个更聚焦的MVP计划表格。 + +--- + +## AirAccount MVP 开发计划 (V2) + +### 一、最高优先级 (High Priority - H) + +#### H1. 核心账户功能与集成 (Core Account Functionality & Integration) + - [ ] **H1.1 账户基础与二次签名验证 (Account Primitives & Dual-Signature Verification)** + - [ ] H1.1.1 最小版二次签名验证账户的合约实现 (BLS with DVT or simplified approach for MVP, plan EIP-7212 for future) + - [ ] H1.1.2 账户的注册、生成流程实现 + - [ ] H1.1.3 指纹 (Passkey) 绑定与账户管理 (添加、查询) 的基本API和逻辑 + - [ ] **H1.2 TEE 集成与核心钱包逻辑 (TEE Integration & Core Wallet Logic)** + - [ ] H1.2.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) 的核心功能 (私钥安全存储与签名) + - [ ] H1.2.2 不可信应用 (CA) 与 TEE API 的基础交互逻辑 (用于Demo调用) + - [ ] H1.2.3 CA 与 TA 的核心交互流程联调 (签名请求与响应) + - [ ] **H1.3 Relay 与 Bundler 核心功能 (Relay & Bundler Core Functionality)** + - [ ] H1.3.1 内部 Bundler 的核心实现 (打包UserOperation) + - [ ] H1.3.2 Relay 的核心实现 (接收CA请求,与TEE交互,与Bundler交互,提交交易) + - [ ] **H1.4 整体核心流程联调 (Overall Core Flow Integration & Testing)** + - [ ] H1.4.1 从用户发起操作 (CA) -> Relay -> TEE签名 -> Bundler打包 -> 交易上链 的核心流程联调 + - [ ] H1.4.2 部署与测试环境搭建 (例如,本地测试网,目标硬件初步验证 NXP iMX93) + +#### H2. Demo 应用与初步用户体验 (Demo Application & Initial UX) + - [ ] **H2.1 Demo 前端页面 (JS 版本) (Demo Frontend - JS Version)** + - [ ] H2.1.1 核心账户操作的用户界面 (账户创建、指纹绑定、发起简单交易) + - [ ] H2.1.2 与后端/Relay交互的API调用实现 + - [ ] H2.1.3 基本的用户反馈和状态显示 + - [ ] **H2.2 Demo 简易后端/模拟服务 (Demo Simplified Backend/Mock Service)** + - [ ] H2.2.1 (如果需要) 提供必要的后端API支持Demo前端 (例如,用户管理、状态查询的简化版) + - [ ] H2.2.2 (如果需要) 模拟部分链上交互或TEE行为,以便前端独立开发和测试 + - [ ] **H2.3 Demo 流程验证与用户体验初步打磨 (Demo Flow Validation & Initial UX Refinement)** + - [ ] H2.3.1 完整演示核心账户创建、绑定、使用流程 + - [ ] H2.3.2 收集初步用户体验反馈,进行界面和流程优化 + +### 二、中等优先级 (Medium Priority - M) + +#### M1. 基础 Gasless 功能对接 (Basic Gasless Functionality Integration) + - [ ] **M1.1 SuperPaymaster 初步集成 (Initial SuperPaymaster Integration)** + - [ ] M1.1.1 部署或对接一个基础功能的 Paymaster 合约 + - [ ] M1.1.2 实现 AirAccount 账户与该 Paymaster 的交互逻辑 (例如,允许特定ERC20代付) + - [ ] M1.1.3 在 Demo 应用中集成基础的 Gasless 交易体验 (例如,特定操作免Gas) + - [ ] **M1.2 Gasless 流程测试与验证 (Gasless Flow Testing & Validation)** + - [ ] M1.2.1 测试通过 Paymaster 完成 ERC20 代付的流程 + - [ ] M1.2.2 验证 Gasless 交易的正确性和稳定性 + +--- + +**计划V2说明与思考:** + +1. **聚焦核心**: 这个版本严格筛选了任务,确保所有高优先级任务都直接服务于“可用的核心账户”和“能展示核心价值的Demo”。 +2. **二次签名验证的简化**: 在H1.1.1中提到 "BLS with DVT or simplified approach for MVP",意味着MVP阶段可以考虑一个更易于快速实现的二次签名方案,后续再升级到更复杂的链上验证方案。 +3. **TEE的核心价值**: H1.2 强调了TEE在私钥安全存储和签名方面的核心作用,这是AirAccount安全性的基石。 +4. **Relay是枢纽**: H1.3 将Relay和Bundler作为核心集成部分,它们是连接用户、TEE和区块链的关键。 +5. **Demo驱动**: H2 的目标是快速构建一个能跑通核心流程的Demo,用于验证、展示和收集早期反馈。先有JS版本,后续再考虑集成到COS72。 +6. **Gasless作为重要加分项**: M1 将基础的Gasless功能作为中等优先级,因为它能显著提升用户体验,是账户抽象的一个重要特性。MVP阶段实现基础对接即可。 +7. **隐含的任务**: + * **合约部署与管理**: 部署账户合约、Paymaster合约等。 + * **测试用例编写**: 对核心功能进行单元测试和集成测试。 + * **文档**: 核心API和流程的初步文档。 +8. **后续迭代**: + * **低优先级任务**: SDSS的去中心化、完整的SDK、社交恢复、ERC-7702、更多应用协议、AI集成等都放在MVP成功验证之后。 + * **COS72集成**: 在Demo JS版本稳定后,再考虑将其能力集成到更成熟的COS72框架中。 + +这个V2计划更加精炼,目标更明确,希望能帮助你的团队高效推进MVP的开发。记住,MVP的关键在于“最小”和“可行”,快速迭代,持续优化。 + +-------- +下面是V1的 + +------ + +好的,这是一个非常详细和全面的开发计划!我将根据你提供的架构思考、Research重点和明细开发任务,帮你整理成一个包含checkbox的计划表格。 + +**重要说明:** + +* **层级与拆解**: 你提到了“表格罗列两层任务足够”,但你提供的明细任务非常细致,很多可以看作是第三层甚至第四层的任务。为了保持表格的可读性,我会尽量将相关的细致任务组织在更大的特性或模块下。 +* **负责人与时间**: 这个表格**不包含**负责人和预计完成时间,这些需要你和你的团队根据实际情况来分配。 +* **依赖关系**: 很多任务之间存在依赖关系,这个表格主要关注任务列表,具体的依赖管理需要在项目管理工具中体现。 +* **动态调整**: 这是一个初步的计划,实际开发过程中肯定会遇到变化,需要灵活调整。 +* **N0-N3**: 我理解这是指不同的部署阶段或节点类型,在相关任务中会体现。 + +**开发计划表格 (Markdown格式)** + +--- + +## AirAccount 开发计划 + +### 一、基础设施 (Infrastructure) + +#### 1. 核心账户与签名 (Core Account & Signature) + - [ ] **1.1 账户基础 (Account Primitives)** + - [ ] 1.1.1 最小版二次签名验证账户的注册、生成 (BLS with DVT, plan EIP-7212) + - [ ] 1.1.2 指纹 (Passkey) 绑定与账户管理 (添加、查询) + - [ ] **1.2 Paymaster 与 Gas 管理 (Paymaster & Gas Management)** + - [ ] 1.2.1 使用 Paymaster 完成 ERC20 代付 + - [ ] 1.2.2 Gas Card 设计:查询、绑定、ERC20 代扣 + - [ ] **1.3 Bundler 与 Relay (Bundler & Relay)** + - [ ] 1.3.1 Bundler 实现:从外部依赖过渡到内部 Bundler + - [ ] 1.3.2 优化:内部 Bundler 与 Paymaster Relay 合并,实现一步提交 + - [ ] **1.4 TEE 集成与硬件钱包交互 (TEE Integration & HW Wallet Interaction)** + - [ ] 1.4.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) + - [ ] 1.4.2 不可信应用 (CA) 开发 + - [ ] 1.4.3 CA 通过 TEE API 调用可信应用 TA (硬件钱包) 的联合调试 + - [ ] **1.5 社交恢复与账户升级 (Social Recovery & Account Upgrade)** + - [ ] 1.5.1 AirAccount 社交恢复的多签账户设计与实现 + - [ ] 1.5.2 AirAccount 账户升级到社交恢复多签账户的流程 + - [ ] 1.5.3 (可选) ERC-7702 账户集成与多签恢复嵌入 + - [ ] **1.6 整体联调与测试 (Overall Integration & Testing)** + - [ ] 1.6.1 整体 AirAccount 基础设施联调 (目标平台: NXP iMX93 或更低配置) + +#### 2. SDSS (Standardized Decentralized Service System) - V0.1 + - [ ] **2.1 核心服务与API (Core Services & API)** + - [ ] 2.1.1 SDSS ENS (或类似域名服务) 实现 + - [ ] 2.1.2 SDSS API 服务基础框架搭建 + - [ ] 2.1.3 路由注册、发现机制 + - [ ] 2.1.4 API 标准数据提交、更新、缓存、错误处理机制 + - [ ] **2.2 核心提交服务 (Core Submission Service)** + - [ ] 2.2.1 SDSS Submit 服务基础:一次提交 (Gas Sponsor + Bundler 上链) + +#### 3. 客户端与工具 (Client & Tools) + - [ ] **3.1 Tauri 客户端 (Tauri Client)** + - [ ] 3.1.1 Tauri 客户端多端发布与测试 + - [ ] 3.1.2 Tauri 集成测试:COS72 基础 Web 版本开发与集成 + - [ ] **3.2 SSO 与 SDK (SSO & SDK)** + - [ ] 3.2.1 SSO (单点登录) 插件/JS/SDK 开发与测试 + +### 二、框架层 (Framework) + +#### 4. AAStar SDK 与集成 + - [ ] **4.1 AAStar SDK 开发 (AAStar SDK Development)** + - [ ] 4.1.1 AAStar SDK Web 版本开发与测试 + - [ ] **4.2 COS72 与 AAStar SDK 集成 (COS72 & AAStar SDK Integration)** + - [ ] 4.2.1 COS72 与 AAStar SDK 集成测试 + +#### 5. Relay 技术栈演进与集成 (Relay Stack Evolution & Integration) + - [ ] **5.1 Relay 版本统一 (Relay Version Unification)** + - [ ] 5.1.1 Go 版本 Relay 与 Rust 版本 Relay 的尝试合并/搬迁 + - [ ] **5.2 Rust Relay 集成 (Rust Relay Integration)** + - [ ] 5.2.1 Rust 版本 Relay 集成到 COS72 (N0-N3 部署) + +#### 6. SDSS 服务集成到 COS72 (SDSS Service Integration into COS72) + - [ ] **6.1 文件服务 SDSS (File Service SDSS)** + - [ ] 6.1.1 文件服务 SDSS 集成到 COS72 + - [ ] **6.2 Supabase SDSS (Supabase SDSS)** + - [ ] 6.2.1 Supabase (或类似 BaaS) SDSS 集成到 COS72 + - [ ] **6.3 硬件钱包 SDSS (Hardware Wallet SDSS)** + - [ ] 6.3.1 硬件钱包 SDSS 集成到 COS72 + +#### 7. COS72 可定制化与发布 (COS72 Customization & Release) + - [ ] **7.1 可定制化 COS72 (Customizable COS72)** + - [ ] 7.1.1 COS72 配置化方案设计与实现 + - [ ] 7.1.2 COS72 构建 (Build) 流程优化 + - [ ] 7.1.3 COS72 发布流程建立 + +### 三、应用层 (Application) + +#### 8. 核心协议与应用 (Core Protocols & Applications) + - [ ] **8.1 OpenPNTs (Programmable Non-fungible Tokens)** + - [ ] 8.1.1 OpenPNTs 协议设计与基础应用开发 + - [ ] 8.1.2 OpenPNTs 集成到 COS72 + - [ ] **8.2 OpenCards** + - [ ] 8.2.1 OpenCards 协议设计与基础应用开发 + - [ ] 8.2.2 OpenCards 集成到 COS72 + - [ ] **8.3 Uniswap V4 Launchpad (可选/探索)** + - [ ] 8.3.1 Uniswap V4 Launchpad 功能开发 + +#### 9. PNTs 发行与演示 (PNTs Issuance & Demo) + - [ ] **9.1 PNTs 发行流程设计 (PNTs Issuance Flow Design)** + - [ ] 9.1.1 PNTs 发行流程 (线上线下、链上) Demo 设计 + - [ ] **9.2 PNTs 发行流程开发 (PNTs Issuance Flow Development)** + - [ ] 9.2.1 PNTs 发行流程功能开发 + +#### 10. COS72 版本发布 (COS72 Release) + - [ ] **10.1 COS72 V0.14 发布** + - [ ] 10.1.1 实现无侵入使用特性 + - [ ] 10.1.2 实现随时解绑账户特性 + - [ ] 10.1.3 支持用户发行自己的积分和 GasCard + +#### 11. AAStar 生态应用 (AAStar Ecosystem Applications) + - [ ] **11.1 AAStar 积分 (aPNTs)** + - [ ] 11.1.1 AAStar 发行自己的积分 aPNTs (基于 OpenPNTs) + - [ ] 11.1.2 aPNTs 引入 SDSS,管理积分发行 + +#### 12. Arcadia (探索性项目) + - [ ] **12.1 Arcadia 设计与 Demo 开发** + - [ ] 12.1.1 Arcadia 概念讨论与哲学 AI 基础研究 + - [ ] 12.1.2 Arcadia Demo2 开发 + +#### 13. 插件生态 (Plugin Ecosystem) + - [ ] **13.1 插件规划** + - [ ] 13.1.1 ~20+ 插件的思考、规划与优先级排序 + +### 四、AI 集成 (AI Integration) - (探索与研究阶段为主) + +#### 14. AI 辅助决策与知识库 (AI-Assisted Decision Making & Knowledge Base) + - [ ] **14.1 人生路径与未来知识库** + - [ ] 14.1.1 知识库构建与使用场景探索 + - [ ] **14.2 常规选择与决策 AI 辅助** + - [ ] 14.2.1 AI 辅助模型研究与原型 + - [ ] **14.3 消费决策 AI** + - [ ] 14.3.1 消费决策 AI 模型研究与原型 + +#### 15. Crypto + AI (Asset3) + - [ ] **15.1 Asset3 概念与实现探索** + - [ ] 15.1.1 Crypto 资产与 AI 结合的创新应用探索 + +### 五、Research 重点 (与开发并行或指导开发) + +*(这些是研究方向,可能不会直接转化为开发任务,但会影响设计和实现)* + - [ ] **R1. 签名方案研究** + - [ ] R1.1 当前签名方案优化与安全性分析 (BLS, EIP-7212 等) + - [ ] R1.2 后量子密码 (PQC) 签名方案调研与集成可行性分析 + - [ ] **R2. TEE 可信方案研究** + - [ ] R2.1 TEE 技术栈选择与安全性评估 (e.g., Intel SGX, ARM TrustZone) + - [ ] R2.2 TEE 证明与远程认证机制研究 + - [ ] **R3. 漏洞与作恶防范研究** + - [ ] R3.1 硬件层面漏洞分析与防范 (TEE, Secure Element) + - [ ] R3.2 应用层面安全设计与代码审计方法研究 + - [ ] R3.3 智能合约安全审计与形式化验证方法研究 + - [ ] **R4. 隐私保护技术研究** + - [ ] R4.1 ZKP (零知识证明) 在账户抽象和 SDSS 中的应用研究 + - [ ] R4.2 匿名地址与隐私交易方案研究 + - [ ] **R5. SDSS V0.1 性能评估** + - [ ] R5.1 SDSS V0.1 效率、吞吐量、延迟等性能指标测试与分析 + - [ ] **R6. SDSS V0.2 (P2P) 演进研究** + - [ ] R6.1 SDSS 引入 P2P 网络后的架构变化、性能影响、去中心化程度分析 + +--- + +**使用建议:** + +1. **优先级排序**: 你的任务列表非常庞大。强烈建议根据 MVP (最小可行产品) 原则,对这些任务进行优先级排序。哪些是核心功能,哪些是后续迭代? +2. **分配负责人和时间**: 将每个 `- [ ]` 任务分配给具体的负责人,并估算完成时间。 +3. **工具**: 使用专业的项目管理工具 (如 Jira, Trello, Asana, Notion, ClickUp 等) 来跟踪这些任务、依赖关系和进度。这个 Markdown 表格可以作为初始导入或高级概览。 +4. **迭代**: 将开发过程划分为多个 Sprint 或迭代,每个迭代有明确的目标。 +5. **定期同步**: 团队内部需要定期开会同步进度、讨论问题和调整计划。 + +这个计划表非常宏大,预祝你的项目顺利推进! + +分析和思考: +当务之急是MVP,因此 +1. 低优先级:SDSS是去中心化的,可以独立和分离,因此降低优先级,先中心化,再去中心,迁移难度不大 +2. 低优先级:相对独立的Superpaymaster,Gasless是独立的,可选的,因此中等优先级,完成基础的对接和基础的gasless即可 +3. 最高优先级:账户是串联所有的基础,目前核心是二次签名验证+整体集成(relay等),非SDK(后面再整合为sdk) +4. 考虑demo也是高优先级,因此需要页面和服务器配合,先有页面js版本,再集成到cos72 +5. 所以计划的第二个版本,只设计高优先级(两个)和中等优先级(1个),请按这个思路筛选,不必那么严苛任务数量 diff --git a/0.16.23/guide/Regression_Testing_Guide.md b/0.16.23/guide/Regression_Testing_Guide.md new file mode 100644 index 000000000..43be4bfb1 --- /dev/null +++ b/0.16.23/guide/Regression_Testing_Guide.md @@ -0,0 +1,70 @@ +# 回归测试脚本使用说明 + +## 仅使用两个回归脚本 + +### 1. `run_full_regression.sh` - 完整回归测试 + +**用途**: Anvil本地完整测试套件 + +**包含内容**: +- Anvil启动与清理 +- 合约部署(DeployV3FullLocal.s.sol) +- 配置同步 +- 24个测试脚本: + - ✅ V2回归测试 (6个): 00-05 + - ✅ V3核心测试 (6个): 06-11 + - ✅ 高级功能测试 (12个): 12-23, 98-99 + +**运行方式**: +```bash +# Anvil模式(默认) +./run_full_regression.sh + +# Sepolia模式(跳过部署) +./run_full_regression.sh --env sepolia +``` + +--- + +### 2. `run_sdk_regression.sh` - SDK独立测试 + +**用途**: SDK API层面的独立功能测试 + +**包含内容**: +- BLS签名测试 +- Middleware测试 +- 不依赖Anvil的纯SDK功能 + +**运行方式**: +```bash +./run_sdk_regression.sh +``` + +--- + +## ⚠️ 已删除脚本 + +- ❌ `scripts/run_regression.sh` (冗余,已合并到run_full_regression.sh) + +--- + +## 快速使用指南 + +### 本地开发验证 +```bash +./run_full_regression.sh +``` + +### Sepolia测试网验证 +```bash +./run_full_regression.sh --env sepolia +``` + +### SDK功能测试 +```bash +./run_sdk_regression.sh +``` + +--- + +**结论**: 只需要这两个脚本即可完成所有回归测试! ✅ diff --git a/0.16.23/guide/Reputation-to-Credit_Mapping_Whitepaper.md b/0.16.23/guide/Reputation-to-Credit_Mapping_Whitepaper.md new file mode 100644 index 000000000..7f6c0586e --- /dev/null +++ b/0.16.23/guide/Reputation-to-Credit_Mapping_Whitepaper.md @@ -0,0 +1,242 @@ +# Reputation-to-Credit 技术映射白皮书 + +## 1. 设计初衷与哲学 (Design Philosophy) + +AAStar 协议的核心愿景是构建一个“赋能社区、简化开发”的账户抽象基础设施。在这个体系中,**Reputation (声誉)** 和 **Credit (信用/授信)** 是连接链上资产与社交共识的桥梁。 + +### 核心理念: +- **Reputation 是主观度量**:它代表了社区成员之间的共识。声誉不是单纯的数字,而是基于用户活动(Entropic Factor)和社交关系(Social Graph)的综合评分。 +- **Credit 是经济表现**:信用是将主观声誉转化为客观支付能力的机制。通过信用系统,用户可以“预支”Gas 费用,实现真正的无感交互。 +- **去中心化的安全底线**:通过 DVT (Distributed Validator Technology) 和 BLS 聚合签名,确保声誉的更新不依赖于任何单一中心化实体。 + +--- + +## 2. 技术架构与映射逻辑 + +### 2.1 声誉增长路径 (The Three Tiers) + +系统设计了三种平行的声誉更新路径,以适应不同的信任级别: + +| 级别 | 名称 | 触发逻辑 | 验证机制 | 适用场景 | +| :--- | :--- | :--- | :--- | :--- | +| **Tier 1** | **Manual Inject** | 管理员手动设定 | 合约 Owner 权限 | 测试、紧急干预、初始数据导入 | +| **Tier 2** | **Rule-based Sync** | 链上规则自动累加 | 预定义智能合约算法 | 质押奖励、固定活动积分 | +| **Tier 3** | **DVT Batch Sync** | 离线计算批量同步 | **BLS256 聚合签名证明** | 生产环境、综合行为建模、跨链声誉 | + +### 2.2 映射模型:从分数到额度 + +声誉分数的转换遵循以下三级映射: + +1. **Reputation Score (25分)**: 用户在特定社区或全局的活动积分。 +2. **Credit Level (Level 2)**: 在 `Registry` 中注册的等级阈值。 + - *配置示例*:Level 1 (>10分), Level 2 (>20分), Level 3 (>50分)。 +3. **Credit Limit (100 aPNTs)**: 每个等级对应一个全局的基础信用额度。 +4. **Community Limits (xPNTs)**: 各社区可基于全局额度进行微调或设置黑名单。 + +--- + +## 3. 用户场景与活动路径 + +### 场景 A:终端用户 Gasless 体验 (End-user Flow) +1. **活动产生**:用户在 App 内完成每日签到。 +2. **声誉增长**:`ReputationSystem` 根据 Tier 2 规则自动计算分数增长。 +3. **信用变现**:用户发起交易,`SuperPaymaster` 发现该用户 `Credit Level` 已达标。 +4. **代付执行**:`SuperPaymaster` 为用户垫付 Gas,并在 `xPNTsToken` 中记录债务(Debt)。 +5. **自动偿还**:当用户获得新的社区激励(Mint)时,债务先于余额自动扣除。 + +### 场景 B:社区管理员配置 (Admin Flow) +1. **启动社区**:通过 `createCommunityClient` 启动并部署社区专属 `xPNTsToken`。 +2. **定义规则**:调用 `ReputationSystem.setRule` 设置“质押 100 GT 每日增 1 分”的规则。 +3. **设置阈值**:在 `Registry` 中定义不同信用等级对应的 Airdrop 权限。 + +### 场景 C:生产级去中心化同步 (DVT Consensus Flow) +1. **离线分析**:DVT 节点群分析用户的跨链及链上行为。 +2. **共识签名**:多个 DVT 节点对更新后的声誉列表进行 BLS 签名。 +3. **批量注入**:调用 `Registry.batchUpdateGlobalReputation`。合约在毫秒内验证 BLS 证明。 +4. **权限锁死**:Owner 权限收缩,确保非 DVT 签名的声誉更新会被拒绝。 + +--- + +## 4. 关键初始化配置 (Default Setup) + +为了确保系统的“开箱即用”且安全,我们预设了以下基准配置: + +- **基础信用阈值 (Level Thresholds)**: + - Level 1: 13 points (入门级,支持基础转账代付)。 + - Level 2: 50 points (高级用户,支持复杂合约交互)。 +- **信用额度配额 (Credit Tiers)**: + - Level 1 Limit: 等值 $10 USD 的 aPNTs。 + - Level 2 Limit: 等值 $50 USD 的 aPNTs。 +- **安全拦截器 (Safety Interceptor)**: + - `SuperPaymaster` 采用**被动黑名单机制**。即使额度足够,若 DVT 标记 `isBlocked=true`,交易仍会被拒绝。 + +--- + +## 5. 结论 + +Reputation-to-Credit 映射不仅是一套算法,它是 AAStar 网络治理的核心。它通过将“社交声誉”转化为“链上信用”,解决了 Web3 用户进入门槛高的痛点,同时利用 DVT 技术确保了这套信用体系的公正与去中心化。 + +--- + +## 6. 核心数据结构与关系映射 (Core Data Structures & Relationships) + +为了深入理解系统如何从底层数据层面支撑声誉到信用的转换,本节整理了三大核心合约的关键数据对象及其交互关系。 + +### 6.1 对象关系图 (Object Relationship Diagram) + +```mermaid +classDiagram + class Registry { + +mapping(address => uint256) globalReputation + +mapping(uint256 => uint256) creditTierConfig + +uint256[] levelThresholds + +RoleConfig[] roleConfigs + +getCreditLimit(user) + } + + class ReputationSystem { + +mapping(community => Rule) communityRules + +mapping(user => score) communityReputations + +computeScore() + +syncToRegistry() + } + + class SuperPaymaster { + +mapping(operator => OperatorConfig) operators + +mapping(operator => user => UserOpState) userOpState + +validatePaymasterUserOp() + } + + class User { + +address account + +uint256 reputationScore + +uint256 creditLimit + } + + %% Relationships + ReputationSystem ..> Registry : 1. Sync Score (Write) + User --> Registry : 2. Check Level (Read) + Registry --> SuperPaymaster : 3. Credit Limit (Read) + SuperPaymaster ..> User : 4. Enforce Blocking (Read State) +``` + +### 6.2 核心数据对象 (Key Data Objects) + +#### A. Registry (Single Source of Truth) +Registry 是整个系统的状态中心,存储了用户的全局声誉和信用配置。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **Global Reputation** | `mapping` | 所有用户的全局声誉分 | `globalReputation[user] => uint256 score` | +| **Credit Tiers** | `mapping` | 等级与信用额度的映射 | `creditTierConfig[level] => uint256 limit (aPNTs)` | +| **Level Thresholds** | `array` | 晋升等级所需的分数线 | `levelThresholds[] = [13, 34, 89...]` | +| **Role Config** | `struct` | 角色行为定义 | `minStake`, `exitFeePercent`, `roleLockDuration` | + +#### B. ReputationSystem (Calculation Engine) +负责计算分数的逻辑层,支持规则定义和即时计算。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **Rule** | `struct` | 社区定义的声誉获取规则 | `baseScore`, `activityBonus`, `maxBonus` | +| **Community Rules** | `mapping` | 社区特有规则集 | `communityRules[community][ruleId] => Rule` | +| **Score Cache** | `mapping` | 社区内局部声誉缓存 | `communityReputations[community][user] => uint256` | + +#### C. SuperPaymaster (Execution Layer) +根据 Registry 的数据执行支付逻辑,并维护自身的风险控制状态。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **OperatorConfig** | `struct` | Paymaster 运营商配置 | `aPNTsBalance`, `exchangeRate`, `isPaused` | +| **UserOpState** | `struct` | 压缩的用户状态(省Gas) | `uint48 lastTimestamp`, `bool isBlocked` | +| **PriceCache** | `struct` | 代币价格预言机缓存 | `int256 price`, `uint256 updatedAt` | + +### 6.3 数据流转逻辑 (Data Flow) + +整个信用体系的数据流转遵循 **"计算 -> 存储 -> 消费"** 的闭环: + +1. **计算 (Compute)**: `ReputationSystem` 根据 `Rule` 和用户活动(Activities)计算出 `communityScore`。 +2. **同步 (Sync)**: 通过 `syncToRegistry` 或 DVT 共识,将计算结果写入 `Registry.globalReputation`。 +3. **映射 (Map)**: `Registry` 内部通过 `levelThresholds` 将分数动态映射为 `Credit Level`。 +4. **消费 (Consume)**: 用户发起交易时,`SuperPaymaster` 调用 `Registry.getCreditLimit(user)` 获取最新的信用额度。 +5. **校验 (Validate)**: `SuperPaymaster` 结合自身的 `UserOpState` (是否被屏蔽、频率限制) 和额度,决定是否为该 UserOperation 支付 Gas。 + +--- + +## 7. 深度解析:多社区协同与算法聚合 (Deep Dive: Multi-Community Aggregation) + +本节通过具体的用户案例(Alice)和运营视角,解析声誉系统如何在去中心化的环境下处理多源数据。 + +### 7.1 用户视角:Alice 的多重身份 (The User Journey) + +假设用户 **Alice** 加入了三个不同的 DAO 社区,并在每个社区通过不同的行为积累声誉。 + +#### A. 行为记录 +| 社区 | 角色/身份 | 参与活动 (Activity) | 原始积分 | +| :--- | :--- | :--- | :--- | +| **Panda DAO** | 治理成员 | **投票 (Vote)**: 参与了 15 次治理投票 | 150 pts | +| **Dev Guild** | 开发者 | **代码贡献 (PR)**: 合并了 3 个 PR | 300 pts | +| **Charity Fund**| 捐赠者 | **捐款 (Donate)**: 捐赠了 0.5 ETH | 500 pts | + +#### B. 数据展示与查询 +Alice 不需要去三个不同的应用查看积分。通过 Aggregator(聚合器)前端或 SDK,她可以调用统一的 ABI 获取全视图: +- **查询单社区分**:`ReputationSystem.calculateReputation(Alice, PandaDAO, 0)` -> 返回 `150`。 +- **查询全局分**:`Registry.globalReputation(Alice)` -> 返回聚合后的总分(如 `950`)。 +- **查询明细**:`ReputationSystem.getReputationBreakdown(Alice, DevGuild, ...)` -> 返回 `baseScore`, `activityBonus` 等。 + +### 7.2 运营视角:规则配置 (Operator Configuration) + +三个社区的 Operator (运营者账户) 可以在不修改合约代码的情况下,通过 ABI 设置各自的激励规则。 + +#### A. 规则定义 (Rule Definition) +通过调用 `ReputationSystem.setRule(bytes32 ruleId, uint base, uint bonus, uint max, string desc)`: + +1. **Panda DAO (投票)**: + - `ruleId`: `keccak256("VOTE_ACTION")` + - `base`: 10 (每次参与的基础分) + - `bonus`: 0 + - `max`: 1000 +2. **Dev Guild (PR)**: + - `ruleId`: `keccak256("PR_MERGED")` + - `base`: 50 + - `bonus`: 10 (代码量额外奖励) + - `max`: 500 + +#### B. 规则生效逻辑 +规则配置立即存储在链上 `communityRules[communityAddr][ruleId]` 中。只要 Alice 在该社区产生交互(触发 SDK 的 `l4-reputation-tiers.ts` 脚本或后端触发),积分计算逻辑会自动拉取最新的配置进行计算。 + +### 7.3 算法核心:熵增因子与聚合 (The Aggregation Algorithm) + +系统如何避免“积分通胀”?如何平衡不同社区的权重?核心在于 **内置的加权聚合算法**。 + +#### A. 当前算法逻辑 (Current Logic) +`ReputationSystem.computeScore` 采用线性加权求和模型: + +```solidity +// 伪代码逻辑 +function computeScore(user, communities, activities) { + totalScore = 0; + for (comm in communities) { + rawScore = rules[comm].base + (activity * rules[comm].bonus); + // 关键:熵增因子 (Entropy Factor) + // 1e18 = 1.0 (标准权重) + // 0.5e18 = 0.5 (低质量社区降权) + weight = entropyFactors[comm]; + totalScore += (rawScore * weight) / 1e18; + } + return totalScore; +} +``` + +- **Panda DAO** (权重 1.0): 150 * 1.0 = 150 +- **Dev Guild** (权重 1.5 - 技术公会): 300 * 1.5 = 450 +- **Charity Fund** (权重 0.8): 500 * 0.8 = 400 +- **Global Score**: 150 + 450 + 400 = **1000** + +这种设计允许 Registry 管理员(或 DAO 治理)通过调整 `entropyFactors` 来宏观调控不同社区对全局信用的贡献度,防止恶意刷分社区破坏系统平衡。 + +#### B. 未来演进:可插拔算法模块 (Pluggable Algorithm) +`ReputationSystem` 目前实现了 `IReputationCalculator` 接口。由于 `Registry` 与计算逻辑是**解耦**的(Registry 只存结果,不存过程),未来可以轻松升级: + +1. **外置模块化**: 可以部署 `ReputationSystemV2`(例如引入 PageRank 算法或通过 AI 模型分析链上行为)。 +2. **多源喂价**: `Registry.isReputationSource` 允许白名单机制。未来可以授权给 Chainlink Oracle 或 ZK-Verifier 合约,它们可以使用完全不同的链下算法计算分数,只需将最终结果 "Feed" 给 Registry。 +3. **无缝迁移**: 由于 Alice 的 Global Reputation 是累积的,新的算法可以基于旧分进行增量更新,或者通过 Epoch 版本号完全重置,实现平滑过渡。 diff --git a/0.16.23/guide/SDK_ABI_COVERAGE.md b/0.16.23/guide/SDK_ABI_COVERAGE.md new file mode 100644 index 000000000..b0103fe65 --- /dev/null +++ b/0.16.23/guide/SDK_ABI_COVERAGE.md @@ -0,0 +1,839 @@ +# SDK 合约 ABI Total + +完整覆盖率分析 + +## 1. 合约清单 + +我们有 **27 个合约** ABIs: + +### 核心合约 (Core Contracts) +1. **Registry** - 角色和社区管理 +2. **GTokenStaking** - 治理代币质押 +3. **GToken** - 治理代币 +4. **SuperPaymaster** - 超级支付主管 +5. **MySBT** - 灵魂绑定代币 +6. **ReputationSystem** - 信誉系统 + +### Paymaster 相关 +7. **PaymasterV4_2** - V4 支付主管 +8. **Paymaster** - 基础支付主管 +9. **PaymasterFactory** - 支付主管工厂 + +### 代币相关 +10. **aPNTs** - 全局积分代币 +11. **xPNTs** - 社区积分代币 +12. **xPNTsFactory** - 社区积分工厂 +13. **xPNTsToken** - 社区积分代币(别名) + +### AA 账户相关 +14. **EntryPoint** - ERC-4337 入口点 +15. **SimpleAccount** - 简单账户 v0.7 +16. **SimpleAccountV08** - 简单账户 v0.8 +17. **SimpleAccountFactory** - 账户工厂 v0.7 +18. **SimpleAccountFactoryV08** - 账户工厂 v0.8 +19. **LegacyAccount** - 遗留账户 +20. **Simple7702Account** - EIP-7702 账户 +21. **Eip7702Support** - EIP-7702 支持 +22. **SenderCreator** - 发送者创建器 + +### 验证器相关 +23. **DVTValidator** - DVT 验证器 +24. **BLSValidator** - BLS 验证器 +25. **BLSAggregator** - BLS 聚合器 + +### 工具 +26. **UserOperationLib** - 用户操作库 +27. **StateValidator** - 状态验证器 + +--- + +## 2. SDK Actions 映射 + +### packages/core/src/actions/ + +| Action 文件 | 目标合约 | 状态 | +|------------|---------|------| +| `registry.ts` | Registry | ✅ | +| `staking.ts` | GTokenStaking | ✅ | +| `tokens.ts` | GToken, aPNTs, xPNTs | ✅ | +| `superPaymaster.ts` | SuperPaymaster | ✅ | +| `sbt.ts` | MySBT | ✅ | +| `reputation.ts` | ReputationSystem | ✅ | +| `paymasterV4.ts` | PaymasterV4_2 | ✅ | +| `factory.ts` | PaymasterFactory, xPNTsFactory | ✅ | +| `dvt.ts` | DVTValidator | ✅ | +| `aggregator.ts` | BLSAggregator, BLSValidator | ✅ | +| `StateValidator.ts` | StateValidator | ✅ | + +### packages/sdk/src/clients/ + +| Client 文件 | 组合的 Actions | 状态 | +|------------|---------------|------| +| `community.ts` | registry + tokens + factory | ✅ | +| `operator.ts` | registry + staking + superPaymaster | ✅ | +| `endUser.ts` | registry + sbt + AA账户 | ✅ | +| `admin.ts` | registry + reputation + dvt | ✅ | +| `ExperimentClient.ts` | 性能测试包装器 | ✅ | + +--- + +## 3. 详细 ABI 覆盖率分析 + +### ✅ Registry (100% 覆盖) + +**核心函数**: +- `registerRole()` ✅ registry.ts +- `hasRole()` ✅ registry.ts +- `getCommunityInfo()` ✅ registry.ts +- `exitRole()` ✅ registry.ts +- `getRoleConfig()` ✅ registry.ts + +**SDK 层**: +- CommunityClient.launch() ✅ +- OperatorClient.onboardOperator() ✅ + +--- + +### ✅ GTokenStaking (100% 覆盖) + +**核心函数**: +- `stake()` ✅ staking.ts +- `unstake()` ✅ staking.ts +- `getStakedAmount()` ✅ staking.ts + +**SDK 层**: +- OperatorClient.onboardOperator() ✅ + +--- + +### ✅ SuperPaymaster (90% 覆盖) + +**已覆盖函数**: +- `depositFor()` ✅ superPaymaster.ts +- `configureOperator()` ✅ superPaymaster.ts +- `validatePaymasterUserOp()` ✅ superPaymaster.ts +- `operators()` ✅ superPaymaster.ts (查询) + +**未覆盖函数**: +- `withdrawTo()` ⏭️ (Admin 操作,低优先级) +- `setOperatorPaused()` ⏭️ (Admin 操作) +- `updateReputation()` ⏭️ (Admin 操作) + +**SDK 层**: +- OperatorClient.configureOperator() ✅ +- EndUserClient.executeGasless() ✅ (构建 paymasterAndData) + +--- + +### ✅ MySBT (80% 覆盖) + +**已覆盖函数**: +- `safeMint()` ✅ sbt.ts +- `balanceOf()` ✅ sbt.ts +- `tokenOfOwnerByIndex()` ✅ sbt.ts + +**未覆盖函数**: +- `burn()` ⏭️ (低频操作) +- `transferOwnership()` ⏭️ (Admin 操作) + +**SDK 层**: +- EndUserClient.joinAndActivate() ✅ + +--- + +### ✅ GToken / aPNTs / xPNTs (100% 覆盖) + +**核心 ERC20 函数**: +- `balanceOf()` ✅ tokens.ts +- `transfer()` ✅ tokens.ts +- `approve()` ✅ tokens.ts +- `mint()` ✅ tokens.ts (测试环境) + +**SDK 层**: +- CommunityClient (xPNTs 管理) ✅ +- OperatorClient (aPNTs 存款) ✅ + +--- + +### ✅ PaymasterFactory & xPNTsFactory (100% 覆盖) + +**核心函数**: +- `deployPaymaster()` / `createXPNTs()` ✅ factory.ts +- `calculateAddress()` ✅ factory.ts + +**SDK 层**: +- CommunityClient.deployXPNTs() ✅ +- OperatorClient.setupNode() ✅ + +--- + +### ⚠️ EntryPoint (50% 覆盖) + +**已覆盖函数**: +- `handleOps()` ✅ endUser.ts (executeGasless) +- `getNonce()` ✅ endUser.ts + +**未覆盖函数**: +- `simulateValidation()` ⏭️ (Bundler 层操作) +- `handleAggregatedOps()` ⏭️ (聚合器操作) +- `depositTo()` ⏭️ (低频操作) + +**说明**: EntryPoint 的大部分函数是 Bundler 层调用,SDK 只需要覆盖业务相关的函数。 + +--- + +### ⏭️ SimpleAccount / SimpleAccountFactory (基础覆盖) + +**已覆盖函数**: +- `createAccount()` ✅ endUser.ts (通过 factory) +- `execute()` ✅ endUser.ts (构建 callData) + +**未覆盖函数**: +- `validateUserOp()` ⏭️ (EntryPoint 调用) +- `addDeposit()` / `withdrawDepositTo()` ⏭️ (低频操作) + +**说明**: SimpleAccount 的验证逻辑由 EntryPoint 调用,SDK 不需要直接调用。 + +--- + +### ⏭️ DVT / BLS 验证器 (基础覆盖) + +**已覆盖函数**: +- `validateSignature()` ✅ aggregator.ts +- `aggregateSignatures()` ✅ aggregator.ts + +**说明**: 这些是高级功能,当前版本主要用于未来的去中心化验证。 + +--- + +## 4. 覆盖率统计 + +### 按合约类型 + +| 类别 | 合约数 | 核心函数覆盖率 | 说明 | +|------|-------|--------------|------| +| **核心业务** | 6 | **95%** | Registry, GTokenStaking, SuperPaymaster, MySBT, ReputationSystem, GToken | +| **代币系统** | 4 | **100%** | aPNTs, xPNTs, xPNTsFactory全覆盖 | +| **Paymaster** | 3 | **90%** | V4, Factory 完整,SuperPaymaster 少数 Admin 函数未覆盖 | +| **AA 账户** | 6 | **60%** | 业务函数全覆盖,验证函数由 EntryPoint 调用 | +| **验证器** | 3 | **70%** | 核心验证函数已覆盖 | +| **工具** | 2 | **100%** | UserOperationLib, StateValidator | + +### 按优先级 + +| 优先级 | 函数类型 | 覆盖率 | 状态 | +|--------|---------|--------|------| +| **P0** | 业务核心函数 | **98%** | ✅ | +| **P1** | 常用管理函数 | **85%** | ✅ | +| **P2** | 低频 Admin 函数 | **40%** | ⏭️ 按需添加 | +| **P3** | 内部/验证函数 | **20%** | ⏭️ 由合约调用 | + +--- + +## 5. 未覆盖函数清单 + +### 5.1 低优先级 Admin 函数 (P2) + +| 合约 | 函数 | 说明 | 是否需要 SDK | +|------|------|------|------------| +| SuperPaymaster | `withdrawTo()` | Admin 提现 | ⏭️ 低频 | +| SuperPaymaster | `setOperatorPaused()` | 暂停运营商 | ⏭️ 低频 | +| Registry | `setRoleOwner()` | 转移角色所有权 | ⏭️ 低频 | +| MySBT | `burn()` | 销毁 SBT | ⏭️ 低频 | + +### 5.2 内部/验证函数 (P3) + +| 合约 | 函数 | 说明 | 是否需要 SDK | +|------|------|------|------------| +| SimpleAccount | `validateUserOp()` | EntryPoint 调用 | ❌ 不需要 | +| EntryPoint | `simulateValidation()` | Bundler 调用 | ❌ 不需要 | +| PaymasterV4 | `validatePaymasterUserOp()` | EntryPoint 调用 | ❌ 不需要 | + +--- + +## 6. 测试覆盖验证 + +### Anvil 环境已测试的 API + +✅ **CommunityClient** (10/10): +- launch(), getCommunityInfo(), deployXPNTs(), registerCommunity(), exitCommunity() +- approve(), stake(), getRoleConfig(), hasRole(), getCommunityToken() + +✅ **OperatorClient** (12/12): +- onboardOperator(), configureOperator(), getOperatorStatus(), depositCollateral() +- stake(), approve(), deployPaymaster(), calculateAddress() +- hasRole(), registerRole(), getStakedAmount(), getBalance() + +✅ **EndUserClient** (8/8): +- createSmartAccount(), deploySmartAccount(), joinAndActivate() +- safeMint(), balanceOf(), tokenOfOwnerByIndex() +- ⏭️ executeGasless() (Nonce ✅, handleOps 留待 Sepolia) + +✅ **AdminClient** (5/5): +- updateReputation(), setOperatorPaused(), configureRole() +- validateSignature(), aggregateSignatures() + +--- + +## 7. 总结 + +### ✅ 核心成就 + +1. **业务函数 98% 覆盖**: 所有核心业务场景的合约函数都已封装为 SDK API +2. **结构化组织**: 通过 Actions (基础层) + Clients (业务层) 清晰分层 +3. **场景完整性**: 社区启动、运营商入驻、用户注册、Gasless 交易全流程覆盖 + +### ⏭️ 未覆盖部分 + +**有意不覆盖**: +- Admin 低频操作 (withdrawTo, setOperatorPaused 等) +- 内部验证函数 (由 EntryPoint/Bundler 调用) +- 遗留合约 (LegacyAccount, SimpleAccountV08 等) + +**原因**: 这些函数要么是低频操作,要么是合约内部调用,不是 SDK 的核心职责。 + +### 📊 最终覆盖率 + +- **业务核心函数**: 98% ✅ +- **全部合约函数**: 76% (包含低频和内部函数) +- **测试验证覆盖**: 85% (Anvil 环境) + +**结论**: SDK 已有组织、有结构地覆盖了所有核心业务合约的关键 ABI,未覆盖的都是低优先级或内部函数。 +-------- + +# SDK 合约与 API 覆盖情况完整总结 + +## � L2 Client Capability Matrix (New) + +| Client | Role | Coverage | Key Features Added | +| :--- | :--- | :--- | :--- | +| **`UserClient`** | End User | ✅ **95%** | Staking (`stakeForRole`), Lifecycle (`exitRole`, `leaveCommunity`) | +| **`CommunityClient`** | Community Manager | ✅ **90%** | SBT Revocation (`revokeMembership`), Token Transfer | +| **`PaymasterOperatorClient`** | Paymaster Operator | ✅ **95%** | Gas Tokens (`addGasToken`), Config (`configureOperator`) | +| **`ProtocolClient`** | Protocol Admin | ✅ **90%** | Global Params (`setProtocolFee`, `setTreasury`) | + +## �📋 完整的 25 个合约清单 + +### 核心业务合约 (6个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 1 | **Registry** | 60 | 42 | 70% | P0 ✅ | +| 2 | **SuperPaymaster** | 58 | 39 | 67% | P0 ✅ | +| 3 | **GTokenStaking** | 28 | 29 | 100% | P0 ✅ | +| 4 | **MySBT** | 49 | 29 | 59% | P0 ✅ | +| 5 | **ReputationSystem** | 20 | 1 | 5% | P1 ⚠️ | +| 6 | **GToken** | 18 | ~8 (tokens.ts) | 44% | P0 ✅ | + +### 代币系统 (4个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 7 | **aPNTs** | 37 | ~24 (tokens.ts通用) | 65% | P0 ✅ | +| 8 | **xPNTs** | 37 | ~24 (tokens.ts通用) | 65% | P0 ✅ | +| 9 | **xPNTsToken** | 37 | (同xPNTs) | 65% | - | +| 10 | **xPNTsFactory** | 28 | 6 | 21% | P1 ✅ | + +### Paymaster 系统 (3个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 11 | **PaymasterV4_2** | 48 | 20 | 42% | P1 ✅ 主要使用 | +| 12 | **Paymaster** | 48 | (废弃) | 0% | ⏭️ 旧版本,不需要 | +| 13 | **PaymasterFactory** | 24 | 6 | 25% | P2 ✅ | + +### AA 账户相关 (7个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 14 | **EntryPoint** | 22 | 5 (account.ts) | 23% | P1 ✅ 核心已覆盖 | +| 15 | **SimpleAccount** | 17 | 8 (account.ts) | 47% | P1 ✅ v0.7 主用 | +| 16 | **SimpleAccountV08** | 17 | - | 0% | ⏭️ v0.8 暂不用 | +| 17 | **LegacyAccount** | 17 | - | 0% | ⏭️ 遗留版本 | +| 18 | **Simple7702Account** | 10 | - | 0% | ⏭️ EIP-7702 未来 | +| 19 | **SimpleAccountFactory** | 4 | 2 (account.ts) | 50% | P1 ✅ | +| 20 | **SimpleAccountFactoryV08** | 4 | - | 0% | ⏭️ v0.8 暂不用 | + +### 验证器系统 (3个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 21 | **DVTValidator** | 15 | 4 | 27% | P2 ✅ | +| 22 | **BLSAggregator** | 18 | 3 | 17% | P2 ✅ | +| 23 | **BLSValidator** | 2 | - | 0% | P3 ⏭️ | + +### 工具合约 (2个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 24 | **SenderCreator** | 3 | - | 0% | ⏭️ 内部工具 | +| 25 | **UserOperationLib** | 3 | - | 0% | ⏭️ 库函数 | + +--- + +## 📊 总体统计 + +### 原始数据 +- **总合约数**: 25 +- **总函数数**: 624 +- **已实现 Actions**: 211 +- **原始覆盖率**: 33.8% + +### 实际业务覆盖率(去除无关合约) + +**应该覆盖的合约** (19个核心+业务合约): +- 核心业务: 6个 (Registry, SuperPaymaster, GTokenStaking, MySBT, ReputationSystem, GToken) +- 代币系统: 3个 (aPNTs, xPNTs, xPNTsFactory) - xPNTsToken 和 xPNTs 重复 +- Paymaster: 2个 (PaymasterV4_2, PaymasterFactory) - 去掉旧 Paymaster +- AA账户: 3个 (EntryPoint, SimpleAccount, SimpleAccountFactory) - 去掉 V08 和 Legacy +- 验证器: 2个 (DVTValidator, BLSAggregator) - BLSValidator 基础够用 +- 工具: 0个 (内部使用) + +**应该覆盖的函数总数**: +- 去掉重复和废弃: ~450 functions + +**实际业务覆盖率**: 211/450 = **46.9%** + +**核心功能覆盖率**: +- P0 核心合约 (6个): ~85% ✅ +- P1 重要合约 (8个): ~45% ✅ +- P2 扩展功能 (5个): ~20% ⏭️ + +--- + +## 🎯 Actual Usage Scenario Coverage (Updated) + +### ✅ User Scenarios (95%) +- **Basic:** Transfer, Account Info ✅ +- **Identity:** Check SBT, Join Community (via Airdrop) ✅ +- **Staking:** Stake to Operator, Unstake, Check Rewards ✅ **(Added in v0.14.3)** +- **Lifecycle:** Leave Community, Exit Role ✅ **(Added in v0.14.3)** + +### ✅ Community Scenarios (90%) +- **Setup:** Create Token, Register ✅ +- **Growth:** Airdrop SBT ✅ +- **Governance:** Set Reputation Rules ✅ +- **Management:** Revoke Membership, Transfer Token Ownership ✅ **(Added in v0.14.3)** + +### ✅ Operator Scenarios (95%) +- **Funds:** Deposit, Withdraw ✅ +- **Staking:** Stake (Register), Unstake ✅ +- **Configuration:** Set Gas Tokens, Configure Global Params ✅ **(Added in v0.14.3)** + +### ✅ Protocol Scenarios (90%) +- **Governance:** Create Proposal, Vote ✅ +- **Infra:** Register BLS Key ✅ +- **Admin:** Set Protocol Fee, Set Treasury ✅ **(Added in v0.14.3)** + +### ⚠️ Remaining Gaps +- **Advanced:** BLS multi-signature aggregation (low priority) +- **Edge Cases:** Force-exit of stuck roles (handled by Protocol Admin via slash) + +--- + +## 💡 建议 + +### 当前状态:✅ 可用 +**核心业务场景 95% 覆盖**,足以支持: +1. 社区启动和管理 +2. 用户注册和 Gasless 交易 +3. 运营商配置和管理 + +### 可选提升(按需) +1. **ReputationSystem**: 补充直接查询接口(当前通过 Registry) +2. **PaymasterV4**: 补充 ERC20 Gas Token 完整支持 +3. **BLS**: 补充完整的聚合签名验证 + +**结论**: 211 个 Actions 已足够支持所有核心业务流程。剩余函数大多是: +- 标准接口的完整性补充(如 ERC20/ERC721 的所有函数) +- 低频管理操作 +- 内部调用函数 +- 未来功能(EIP-7702) + +---------- + +# AAStar SDK API 分层架构设计 + +## 架构概览 + +``` +┌─────────────────────────────────────────────────────────────┐ +│ L3: Scenario Patterns │ +│ (面向业务开发者 - Business Developers) │ +│ DAO Launchpad | Operator Lifecycle | User Onboarding │ +└─────────────────────────────────────────────────────────────┘ + ↓ 编排组合 +┌─────────────────────────────────────────────────────────────┐ +│ L2: Business Clients │ +│ (面向集成开发者 - Integration Developers) │ +│ CommunityClient | OperatorClient | EndUserClient │ +└─────────────────────────────────────────────────────────────┘ + ↓ 函数组合 +┌─────────────────────────────────────────────────────────────┐ +│ L1: Core Actions │ +│ (面向资深开发者 - Advanced Developers) │ +│ registryActions | stakingActions | superPaymasterActions │ +└─────────────────────────────────────────────────────────────┘ + ↓ 直接映射 +┌─────────────────────────────────────────────────────────────┐ +│ Smart Contracts ABIs │ +│ Registry.sol | GTokenStaking.sol | SuperPaymaster.sol │ +└─────────────────────────────────────────────────────────────┘ +``` + +--- + +## L1: Core Actions (底层 ABI API) + +### 定位 +**1:1 映射智能合约 ABI 的纯函数接口** + +### 目标用户 +1. **SDK 内部开发者** (Primary) - 构建 L2/L3 的基础 +2. **资深区块链开发者** (Secondary) - 需要精细控制的自定义场景 + +### 特点 +- ✅ 完整覆盖所有合约函数(100% ABI Coverage) +- ✅ 无业务逻辑封装,纯粹的合约调用 +- ✅ 参数直接对应 Solidity 函数签名 +- ✅ 返回原始的交易哈希或链上数据 + +### 包结构 +``` +packages/core/src/actions/ +├── registry.ts # Registry 合约 60 个函数 +├── staking.ts # GTokenStaking 28 个函数 +├── superPaymaster.ts # SuperPaymaster 58 个函数 +├── sbt.ts # MySBT 49 个函数 +├── tokens.ts # GToken/aPNTs/xPNTs 所有 ERC20 +├── paymasterV4.ts # PaymasterV4 48 个函数 +├── factory.ts # Factories +├── reputation.ts # ReputationSystem +├── dvt.ts # DVT Validator +├── aggregator.ts # BLS Aggregator/Validator +└── account.ts # AA 账户相关 +``` + +### 使用示例 +```typescript +import { registryActions } from '@aastar/core'; + +// 底层 API - 直接调用合约 +const registry = registryActions(REGISTRY_ADDRESS)(client); +await registry.registerRole({ + roleId: ROLE_ID, + user: USER_ADDRESS, + data: encodedData, + account +}); +``` + +**适用场景**: +- 自定义复杂的多步骤流程 +- 调试和测试特定合约函数 +- 构建非标准的业务逻辑 + +--- + +## L2: Business Clients (业务组合 API) + +### 定位 +**面向特定角色的高层业务封装** + +### 目标用户 +1. **DApp 集成开发者** (Primary) - 快速集成 AAStar 功能 +2. **后端服务开发者** - 构建 API 服务 +3. **智能合约开发者** - 链下交互 + +### 特点 +- ✅ 角色导向:Community、Operator、EndUser、Admin +- ✅ 业务逻辑封装:自动处理前置条件、批量操作 +- ✅ 错误处理和重试机制 +- ✅ 参数验证和智能默认值 +- ✅ 返回结构化的业务对象 + +### 包结构 +``` +packages/sdk/src/clients/ +├── community.ts # 社区管理 +├── operator.ts # 运营商管理 +├── endUser.ts # 终端用户 +└── admin.ts # 管理员 + +每个 Client 内部调用 L1 Actions +``` + +### 使用示例 +```typescript +import { createCommunityClient } from '@aastar/sdk'; + +// 业务 API - 自动处理复杂流程 +const communityClient = createCommunityClient({ chain, transport, account }); + +// 一键启动社区(内部组合多个 L1 actions) +const result = await communityClient.launch({ + name: "My DAO", + tokenName: "DAO Token", + tokenSymbol: "DAO", + description: "A community DAO", + website: "https://mydao.com" +}); + +// 自动完成: +// 1. 生成唯一名称 +// 2. 编码 roleData +// 3. Approve GToken +// 4. 注册 COMMUNITY 角色 +// 5. 部署 xPNTs 代币 +// 6. 返回结构化结果 +``` + +**适用场景**: +- DApp 前端集成 +- 后端 API 服务 +- 标准业务流程快速实现 + +--- + +## L3: Scenario Patterns (场景化模式) + +### 定位 +**端到端业务场景的最佳实践模板** + +### 目标用户 +1. **产品开发者** (Primary) - 快速构建应用原型 +2. **业务分析师** - 理解业务流程 +3. **新手开发者** - 学习参考 + +### 特点 +- ✅ 完整的端到端流程 +- ✅ 最佳实践和安全模式 +- ✅ 包含前端 UI 示例 +- ✅ 可复制的代码模板 + +### 包结构 +``` +examples/scenarios/ +├── 01_dao_launchpad.ts # DAO 启动模式 +├── 02_operator_lifecycle.ts # 运营商全生命周期 +├── 03_user_onboarding.ts # 用户注册激活 +├── 04_gasless_transaction.ts # 免 gas 交易 +├── 05_credit_system.ts # 信用体系 +└── 06_reputation_staking.ts # 信誉质押 +``` + +### 使用示例 +```typescript +// Scenario Pattern - 完整的 DAO 启动流程 +import { DAOLaunchpadPattern } from '@aastar/patterns'; + +const pattern = new DAOLaunchpadPattern({ + chain, + transport, + adminAccount +}); + +// 一键完成 DAO 从 0 到 1 +const dao = await pattern.launch({ + community: { + name: "Research DAO", + description: "...", + initialStake: parseEther('100') + }, + governance: { + votingPeriod: 7 * 24 * 3600, + quorum: 0.2 + }, + treasury: { + initialFunds: parseEther('1000') + } +}); + +// 自动完成: +// 1. 社区注册 +// 2. 代币发行 +// 3. 多签设置 +// 4. 治理合约部署 +// 5. 初始资金注入 +// 6. 返回完整的 DAO 对象 +``` + +**适用场景**: +- 快速原型开发 +- 教学和演示 +- 标准化业务模板 + +--- + +## 分层对比表 + +| 层级 | 目标用户 | 抽象程度 | 易用性 | 灵活性 | 使用场景 | +|------|---------|---------|--------|--------|---------| +| **L3 Patterns** | 产品开发 | 最高 | ⭐⭐⭐⭐⭐ | ⭐⭐ | 标准业务快速实现 | +| **L2 Clients** | DApp 集成 | 中 | ⭐⭐⭐⭐ | ⭐⭐⭐ | 90% 业务需求 | +| **L1 Actions** | 资深开发 | 低 | ⭐⭐ | ⭐⭐⭐⭐⭐ | 自定义复杂逻辑 | + +--- + +## 当前实施状态 + +### ✅ L1: Core Actions (100% 目标) +- ✅ Registry (60 functions) - 已完成 +- ✅ GTokenStaking (28 functions) - 已完成 +- ⏳ SuperPaymaster (58 functions) - 进行中 +- ⏳ MySBT (49 functions) - 待补充 +- ⏳ Tokens (100+ functions) - 待补充 +- ⏳ 其他合约 (200+ functions) - 待补充 + +### ✅ L2: Business Clients (90% 完成) +- ✅ CommunityClient - 完整 +- ✅ OperatorClient - 完整 +- ✅ EndUserClient - 完整 +- ✅ AdminClient - 完整 + +### ✅ L3: Scenario Patterns (75% 完成) +- ✅ DAO Launchpad - 已实现 (Scenario 1) +- ✅ Operator Lifecycle - 已实现 (Scenario 2) +- ✅ User Onboarding - 已实现 (Scenario 3) +- ⏳ Gasless Transaction - 部分实现 (Scenario 4) +- ⏳ Credit System - 待实现 +- ⏳ Reputation Staking - 待实现 + +--- + +## 文档策略 + +### L1 文档 (API Reference) +**目标**:完整的技术参考手册 + +``` +docs/api-reference/ +├── L1-Core-Actions/ +│ ├── registry.md # 60 个函数详细说明 +│ ├── staking.md # 28 个函数详细说明 +│ └── ... +``` + +**内容**: +- 函数签名 +- 参数说明 +- 返回值类型 +- 使用示例 +- 对应的 Solidity 合约 + +### L2 文档 (Integration Guide) +**目标**:快速集成指南 + +``` +docs/integration/ +├── community-client.md # 社区管理集成 +├── operator-client.md # 运营商集成 +└── enduser-client.md # 用户集成 +``` + +**内容**: +- 业务流程图 +- 快速开始 +- 常见用例 +- 错误处理 +- 最佳实践 + +### L3 文档 (Tutorials) +**目标**:端到端教程 + +``` +docs/tutorials/ +├── launch-your-dao.md # 启动 DAO 教程 +├── become-an-operator.md # 成为运营商 +└── build-gasless-app.md # 构建免 gas 应用 +``` + +**内容**: +- 业务背景 +- 步骤详解 +- 完整代码 +- 视频演示 +- 故障排查 + +--- + +## 测试策略 + +### L1 测试:单元测试 +```typescript +// packages/core/tests/actions/registry.test.ts +describe('Registry Actions', () => { + it('should register role', async () => { + const result = await registry.registerRole({...}); + expect(result).toBeDefined(); + }); + + // 测试所有 60 个函数 +}); +``` + +### L2 测试:集成测试 +```typescript +// packages/sdk/tests/clients/community.test.ts +describe('Community Client', () => { + it('should launch community end-to-end', async () => { + const result = await communityClient.launch({...}); + expect(result.tokenAddress).toMatch(/^0x/); + }); +}); +``` + +### L3 测试:场景测试(已有) +```bash +./run_sdk_regression.sh --env anvil --scenarios-only +``` + +--- + +## 建议的 Package 暴露策略 + +### @aastar/core (L1) +```typescript +// 暴露所有底层 actions +export * from './actions/registry'; +export * from './actions/staking'; +// ... 所有 actions +``` + +### @aastar/sdk (L2 + L3) +```typescript +// 默认暴露 L2 Clients +export * from './clients/community'; +export * from './clients/operator'; +export * from './clients/endUser'; +export * from './clients/admin'; + +// 可选暴露 L1(给资深开发者) +export * as CoreActions from '@aastar/core/actions'; + +// 可选暴露 L3 Patterns +export * from './patterns'; +``` + +### 使用示例 +```typescript +// 一般开发者 - 使用 L2 +import { createCommunityClient } from '@aastar/sdk'; + +// 资深开发者 - 直接使用 L1 +import { CoreActions } from '@aastar/sdk'; +const { registryActions } = CoreActions; + +// 产品开发者 - 使用 L3 +import { DAOLaunchpadPattern } from '@aastar/sdk/patterns'; +``` + +--- + +## 总结 + +这个三层架构设计: +1. **L1 Actions** - 100% ABI 覆盖,服务资深开发者和 SDK 内部 +2. **L2 Clients** - 角色导向的业务封装,服务 90% 开发者 +3. **L3 Patterns** - 场景化模板,服务快速原型和学习 + +**当前任务**: +1. ✅ 继续完成 L1 的 100% ABI 覆盖 +2. ⏭️ 完成后统一测试 +3. ⏭️ 补充文档 + +继续执行 L1 补充工作! diff --git a/0.16.23/guide/SDK_COVERAGE_STRATEGY.md b/0.16.23/guide/SDK_COVERAGE_STRATEGY.md new file mode 100644 index 000000000..1e5d6c2f5 --- /dev/null +++ b/0.16.23/guide/SDK_COVERAGE_STRATEGY.md @@ -0,0 +1,397 @@ +# SDK 合约分类与覆盖策略 + +## 📋 合约分类体系 + +### ✅ 第一类:自研业务合约(已完成 93%+ 覆盖) + +**核心系统** (11个合约,355 functions) + +| # | 合约 | 函数数 | 说明 | 最终覆盖 | 状态 | +|---|------|--------|------|---------|------| +| 1 | **Registry** | 60 | 角色和社区注册中心 | 73/60 (121%) | ✅ 完成 | +| 2 | **SuperPaymaster** | 58 | 超级支付主管 | 61/58 (105%) | ✅ 完成 | +| 3 | **MySBT** | 49 | 灵魂绑定代币 | 58/49 (118%) | ✅ 完成 | +| 4 | **GTokenStaking** | 28 | 治理代币质押 | 29/28 (104%) | ✅ 完成 | +| 5 | **xPNTsFactory** | 28 | 社区代币工厂 | 22/28 (79%) | ✅ 完成 | +| 6 | **PaymasterFactory** | 24 | Paymaster 工厂 | 16/24 (67%) | ✅ 完成 | +| 7 | **ReputationSystem** | 20 | 信誉系统 | 20/20 (100%) | ✅ 完成 | +| 8 | **GToken** | 18 | 治理代币 (ERC20) | 20/18 (111%) | ✅ 完成 | +| 9 | **BLSAggregator** | 18 | BLS 签名聚合 | 18/18 (100%) | ✅ 完成 | +| 10 | **DVTValidator** | 15 | DVT 验证器 | 20/15 (133%) | ✅ 完成 | +| 11 | **aPNTs** | 37 | 全局积分代币 | 34/37 (92%) | ✅ 完成 | + +**小计**: 355 functions, **331/355 = 93.2% 覆盖** ✅ + +**成果**: **所有自研合约达到 90%+ 覆盖目标!** + +--- + +### ✅ 第二类:第三方标准合约(关键功能覆盖) + +**ERC-4337 基础设施** (仅覆盖业务必需) + +| # | 合约 | 函数数 | 需要覆盖 | 当前覆盖 | 说明 | +|---|------|--------|---------|---------|------| +| 12 | **EntryPoint** | 22 | 5 | 5/5 ✅ | handleOps, getNonce, getUserOpHash, getDepositInfo | +| 17 | **SimpleAccount** | 17 | 8 | 8/8 ✅ | execute, executeBatch, owner, entryPoint, getNonce | +| 21 | **SimpleAccountFactory** | 4 | 4 | 2/4 | createAccount, getAddress | + +**小计**: 17 functions 需要覆盖, **15/17 = 88% 覆盖** ✅ + +--- + +### ⚠️ 第三类:模板/实例合约(按需覆盖) + +| # | 合约 | 函数数 | 覆盖策略 | 当前覆盖 | +|---|------|--------|---------|---------| +| 4 | **Paymaster** (模板) | 48 | ❌ 不需要 SDK | 0 | +| 5 | **PaymasterV4_2** (实例) | 48 | ✅ 基础 API (20个) | 20/48 ✅ | + +**说明**: +- Paymaster 是抽象模板,供合约开发者参考 +- PaymasterV4_2 是具体实例,SDK 提供基础 API 即可 +- 社区可以基于 Paymaster 模板创建自定义 Paymaster + +--- + +### ❌ 第四类:重复/遗留合约(不覆盖) + +| # | 合约 | 函数数 | 说明 | 决策 | +|---|------|--------|------|------| +| 7 | ~~xPNTs~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 8 | ~~xPNTsToken~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 16 | ~~LegacyAccount~~ | 17 | **旧版 AA 账户** | ❌ 已废弃 | +| 18 | ~~SimpleAccountV08~~ | 17 | v0.8 版本 | ❌ 暂不支持 | +| 20 | ~~Simple7702Account~~ | 10 | EIP-7702 (未来) | ❌ 预留 | +| 22 | ~~SimpleAccountFactoryV08~~ | 4 | v0.8 工厂 | ❌ 暂不支持 | +| 23 | ~~SenderCreator~~ | 3 | 内部工具 | ❌ 不需要 | +| 24 | ~~UserOperationLib~~ | 3 | 库函数 | ❌ 不需要 | +| 25 | ~~BLSValidator~~ | 2 | 基础验证器 | ❌ BLSAggregator 已够用 | + +**说明**: +- **LegacyAccount**: 早期版本的 SimpleAccount,已被 v0.7 SimpleAccount 替代 +- **xPNTs/xPNTsToken**: 都是使用 `xPNTsToken` ABI,通过 `tokens.ts` 的通用接口调用不同地址即可 + +--- + +## 🎯 最终覆盖率统计 + +### 实际完成情况 + +| 类别 | 合约数 | 总函数数 | 目标覆盖 | 实际覆盖 | 达成率 | +|------|-------|---------|---------|---------|--------| +| **自研业务** | 11 | 355 | 320 (90%) | 331 (93.2%) | ✅ 103% | +| **第三方标准** | 3 | 43 | 17 (40%) | 15 (88%) | ✅ 88% | +| **模板实例** | 1 | 48 | 20 (42%) | 20 (100%) | ✅ 100% | +| **合计** | **15** | **446** | **357 (80%)** | **366 (82%)** | ✅ **102%** | + +**起始覆盖率**: 186/446 = **41.7%** +**最终覆盖率**: 366/446 = **82.0%** ✅ +**新增函数**: **180 functions** + +--- + +## 💡 核心设计原则 + +### 1. **通用性优先** - 基于地址调用 + +所有 actions 都支持传入任意合约地址,确保通用性: + +```typescript +// ✅ 正确:通用接口,支持任何部署实例 +const factory = xPNTsFactoryActions(FACTORY_ADDRESS)(client); +const tokenA = await factory.getTokenAddress({ community: COMMUNITY_A }); +const tokenB = await factory.getTokenAddress({ community: COMMUNITY_B }); + +// aPNTs, bPNTs, cPNTs... 都能用同一套 tokenActions +const apnts = tokenActions(APNTS_ADDRESS)(client); +const bpnts = tokenActions(BPNTS_ADDRESS)(client); +``` + +### 2. **自研合约全覆盖** + +所有 11 个自研合约均达到 90%+ 覆盖: +- Registry: 121% (73/60) +- SuperPaymaster: 105% (61/58) +- MySBT: 118% (58/49) +- GTokenStaking: 104% (29/28) +- ReputationSystem: 100% (20/20) +- BLSAggregator: 100% (18/18) +- DVTValidator: 133% (20/15) +- GToken: 111% (20/18) +- aPNTs: 92% (34/37) +- xPNTsFactory: 79% (22/28) +- PaymasterFactory: 67% (16/24) + +**平均覆盖率**: 93.2% ✅ + +### 3. **不重复** + +- xPNTs, xPNTsToken, aPNTs 使用同一套通用 `tokenActions` 接口 +- 不同地址实例调用同一套 API,避免代码重复 +- Paymaster template vs instance: 只实现 instance API + +### 4. **关联合约按需覆盖** + +- EntryPoint: 23% (5/22) - 只覆盖 handleOps, getNonce 等业务必需 +- SimpleAccount: 47% (8/17) - 只覆盖 execute, owner 等常用函数 +- 其他标准函数按实际业务需求补充 + +--- + +## 📝 合约说明补充 + +### LegacyAccount vs SimpleAccount + +- **LegacyAccount** (17 functions): + - SuperPaymaster v3.0 之前使用的账户实现 + - 基于早期的 ERC-4337 草案 + - **已废弃**,被 SimpleAccount v0.7 替代 + +- **SimpleAccount** (17 functions): + - 当前主要使用的 v0.7 账户实现 + - 符合最新的 ERC-4337 规范 + - ✅ **SDK 主要支持** + +### xPNTs 系列说明 + +- **xPNTs.json**: 社区积分代币 ABI(通用模板) +- **xPNTsToken.json**: 同上(别名) +- **aPNTs.json**: 全局积分代币 ABI + +**SDK 策略**: +- 使用 `tokens.ts` 中的通用接口 +- 通过传入不同的 token 地址来操作不同的代币 +- 不需要为每个代币类型创建单独的 actions + +--- + +## ✅ 完成总结 + +### 🎉 目标达成 + +- ✅ **自研合约覆盖**: 93.2% (超额完成 90% 目标) +- ✅ **总体覆盖率**: 82.0% (超额完成 80% 目标) +- ✅ **新增函数**: 180 functions +- ✅ **编译状态**: 全部通过 +- ✅ **代码质量**: 遵循通用性原则,类型安全 + +### 📦 交付物 + +**Actions 文件**: +- `registry.ts` - 73 actions (827 lines) +- `superPaymaster.ts` - 61 actions (720 lines) +- `sbt.ts` - 58 actions (671 lines) +- `staking.ts` - 29 actions (已有) +- `tokens.ts` - 通用 ERC20/xPNTs (已有) +- `gtokenExtended.ts` - 12 actions (144 lines) +- `factory.ts` - 38 actions (468 lines) +- `reputation.ts` - 20 actions (237 lines) +- `validators.ts` - 38 actions (441 lines) +- `account.ts` - 13 actions (已有) +- `paymasterV4.ts` - 20 actions (已有) + +**总代码量**: ~4,900 lines + +### 🚀 下一步 + +L1 Core Actions 已完整,可以开始: + +1. **L1 全回归测试** - 验证所有 API 与区块链交互 +2. **L2 Business Clients** - 角色导向的高层 API +3. **L3 Scenario Patterns** - 端到端业务场景模板 +4. **文档完善** - API 文档 + 使用示例 + +**核心价值**: L1 提供完整的底层 ABI 封装,为上层抽象打下坚实基础。 + + +## 📋 合约分类体系 + +### ✅ 第一类:自研业务合约(100% 覆盖) + +**核心系统** (11个合约,~350 functions) + +| # | 合约 | 函数数 | 说明 | 当前覆盖 | +|---|------|--------|------|---------| +| 1 | **Registry** | 60 | 角色和社区注册中心 | 42/60 (70%) | +| 2 | **SuperPaymaster** | 58 | 超级支付主管 | 39/58 (67%) | +| 3 | **MySBT** | 49 | 灵魂绑定代币 | 29/49 (59%) | +| 4 | **GTokenStaking** | 28 | 治理代币质押 | 29/28 (100%) ✅ | +| 5 | **xPNTsFactory** | 28 | 社区代币工厂 | 6/28 (21%) | +| 6 | **PaymasterFactory** | 24 | Paymaster 工厂 | 6/24 (25%) | +| 7 | **ReputationSystem** | 20 | 信誉系统 | 1/20 (5%) | +| 8 | **GToken** | 18 | 治理代币 (ERC20) | 8/18 (44%) | +| 9 | **BLSAggregator** | 18 | BLS 签名聚合 | 3/18 (17%) | +| 10 | **DVTValidator** | 15 | DVT 验证器 | 4/15 (27%) | +| 11 | **aPNTs** | 37 | 全局积分代币 | 24/37 (65%) | + +**小计**: 355 functions, **151/355 = 42.5% 覆盖** + +**目标**: 提升到 **90%+** (约 320 functions) + +--- + +### ✅ 第二类:第三方标准合约(关键功能覆盖) + +**ERC-4337 基础设施** (仅覆盖业务必需) + +| # | 合约 | 函数数 | 需要覆盖 | 当前覆盖 | 说明 | +|---|------|--------|---------|---------|------| +| 12 | **EntryPoint** | 22 | 5 | 5/5 ✅ | handleOps, getNonce, getUserOpHash, getDepositInfo | +| 17 | **SimpleAccount** | 17 | 8 | 8/8 ✅ | execute, executeBatch, owner, entryPoint, getNonce | +| 21 | **SimpleAccountFactory** | 4 | 4 | 2/4 | createAccount, getAddress | + +**小计**: 17 functions 需要覆盖, **15/17 = 88% 覆盖** ✅ + +--- + +### ⚠️ 第三类:模板/实例合约(按需覆盖) + +| # | 合约 | 函数数 | 覆盖策略 | 当前覆盖 | +|---|------|--------|---------|---------| +| 4 | **Paymaster** (模板) | 48 | ❌ 不需要 SDK | 0 | +| 5 | **PaymasterV4_2** (实例) | 48 | ✅ 基础 API (20个) | 20/48 ✅ | + +**说明**: +- Paymaster 是抽象模板,供合约开发者参考 +- PaymasterV4_2 是具体实例,SDK 提供基础 API 即可 +- 社区可以基于 Paymaster 模板创建自定义 Paymaster + +--- + +### ❌ 第四类:重复/遗留合约(不覆盖) + +| # | 合约 | 函数数 | 说明 | 决策 | +|---|------|--------|------|------| +| 7 | ~~xPNTs~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 8 | ~~xPNTsToken~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 16 | ~~LegacyAccount~~ | 17 | **旧版 AA 账户** | ❌ 已废弃 | +| 18 | ~~SimpleAccountV08~~ | 17 | v0.8 版本 | ❌ 暂不支持 | +| 20 | ~~Simple7702Account~~ | 10 | EIP-7702 (未来) | ❌ 预留 | +| 22 | ~~SimpleAccountFactoryV08~~ | 4 | v0.8 工厂 | ❌ 暂不支持 | +| 23 | ~~SenderCreator~~ | 3 | 内部工具 | ❌ 不需要 | +| 24 | ~~UserOperationLib~~ | 3 | 库函数 | ❌ 不需要 | +| 25 | ~~BLSValidator~~ | 2 | 基础验证器 | ❌ BLSAggregator 已够用 | + +**说明**: +- **LegacyAccount**: 早期版本的 SimpleAccount,已被 v0.7 SimpleAccount 替代 +- **xPNTs/xPNTsToken**: 都是使用 `xPNTsToken` ABI,通过 `tokens.ts` 的通用接口调用不同地址即可 + +--- + +## 🎯 修正后的覆盖目标 + +### 第一优先级:自研合约 100% 覆盖 + +**需要补充** (~170 functions): + +1. **Registry** (18 functions): + - 补充社区管理函数 (communityByENS, createNewRole) + - 补充角色锁定函数 (roleLockDurations, setRoleLockDuration) + +2. **SuperPaymaster** (19 functions): + - 补充完整的 Operator 管理 + - 补充 Credit 系统查询 + +3. **MySBT** (20 functions): + - 补充完整的 ERC721 Enumerable + - 补充批量铸造功能 + +4. **xPNTsFactory** (22 functions): + - 补充完整的创建和查询接口 + +5. **ReputationSystem** (19 functions): + - 补充信誉规则配置 + - 补充积分计算接口 + +6. **GToken** (10 functions): + - 补充完整的 ERC20 标准接口 + +7. **BLSAggregator** (15 functions): + - 补充签名验证接口 + - 补充密钥管理 + +8. **DVTValidator** (11 functions): + - 补充提案管理 + - 补充验证器管理 + +9. **aPNTs** (13 functions): + - 补充债务管理 + - 补充自动授权功能 + +### 第二优先级:标准合约关键功能 + +**SimpleAccountFactory** (2 functions): +- 补充 createAccount 的其他变体 + +--- + +## 📊 最终覆盖率目标 + +| 类别 | 合约数 | 总函数数 | 目标覆盖 | 当前覆盖 | 差距 | +|------|-------|---------|---------|---------|------| +| **自研业务** | 11 | 355 | 320 (90%) | 151 (42.5%) | +169 | +| **第三方标准** | 3 | 43 | 17 (40%) | 15 (88%) | +2 | +| **模板实例** | 1 | 48 | 20 (42%) | 20 (100%) | 0 ✅ | +| **合计** | **15** | **446** | **357** | **186** | **+171** | + +**当前实际覆盖率**: 186/446 = **41.7%** +**目标覆盖率**: 357/446 = **80%** + +--- + +## 💡 执行建议 + +### ✅ 立即执行 + +1. **补充自研合约剩余 70% 函数** (~170 functions) + - 按优先级:Registry → SuperPaymaster → MySBT → Factories → Reputation → Validators + +2. **测试验证** + - 每完成一个合约,立即编译测试 + - 确保所有自研合约 API 可用 + +### ⏭️ 未来扩展 + +- EIP-7702 支持 (Simple7702Account) +- v0.8 兼容性 (SimpleAccountV08) +- 自定义 Paymaster 模板指南 + +--- + +## 📝 合约说明补充 + +### LegacyAccount vs SimpleAccount + +- **LegacyAccount** (17 functions): + - SuperPaymaster v3.0 之前使用的账户实现 + - 基于早期的 ERC-4337 草案 + - **已废弃**,被 SimpleAccount v0.7 替代 + +- **SimpleAccount** (17 functions): + - 当前主要使用的 v0.7 账户实现 + - 符合最新的 ERC-4337 规范 + - ✅ **SDK 主要支持** + +### xPNTs 系列说明 + +- **xPNTs.json**: 社区积分代币 ABI(通用模板) +- **xPNTsToken.json**: 同上(别名) +- **aPNTs.json**: 全局积分代币 ABI + +**SDK 策略**: +- 使用 `tokens.ts` 中的通用接口 +- 通过传入不同的 token 地址来操作不同的代币 +- 不需要为每个代币类型创建单独的 actions + +--- + +## ✅ 结论 + +**精简后需要覆盖的合约**: 15 个 +**精简后需要覆盖的函数**: 446 个 +**当前已实现**: 186 个 (41.7%) +**目标**: 357 个 (80%) +**还需补充**: 171 个函数 + +**核心价值**: 专注自研业务合约 100% 覆盖,确保完整的业务能力。 diff --git a/0.16.23/guide/SDK_Optimization_Evaluation_Plan.md b/0.16.23/guide/SDK_Optimization_Evaluation_Plan.md new file mode 100644 index 000000000..df05ce7f5 --- /dev/null +++ b/0.16.23/guide/SDK_Optimization_Evaluation_Plan.md @@ -0,0 +1,51 @@ +# SDK & Contract Optimization Evaluation Plan (GBT5.2 Recommendations) + +## 概述 +本方案针对 GBT5.2 对 `aastar-sdk` 及相关合约 ABI 扫描后给出的建议进行评估,并制定后续优化计划。我们将建议分为 **SDK 优化**、**合约安全加固** 以及 **架构对齐** 三个维度,并根据优先级划定动作:**优化 (Optimize)**、**置之不理 (Ignore)** 或 **更好的方案 (Better Solution)**。 + +--- + +## 评估与动作列表 + +### 1. SDK 侧建议评估 (packages/superpaymaster & core) + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`getPaymasterAndData` 输入上界校验** | 高 | **优化 (Optimize)** | `uint128` 溢出或格式错误会导致 Bundler 端不可预测的失败。应在 SDK 侧拦截并抛出清晰错误。 | +| **`checkEligibility` 移除硬编码 Sepolia** | 中 | **优化 (Optimize)** | 支持多链是 SDK 的基本要求。应允许用户传入 `chainId` 或从 `provider` 自动获取。 | +| **`formatUserOpToBundlerV07` 字段长度严格断言** | 高 | **优化 (Optimize)** | V0.7 格式对字节长度(如 `0x...` 字符串长度)有严格要求,由于 JS 没有原生固定长度字节类型,SDK 必须代劳检查。 | + +### 2. 合约侧(基于 ABI 反推)建议评估 + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`PaymasterV4` 价格预言机新鲜度与权限校验** | 极高 | **优化 (Optimize)** | 关键安全路径。需确认合约源码中是否有 `updatedAt` 和 `roundId` 校验。SDK 侧无法修正,需同步到合约端。 | +| **`SuperPaymasterV3` 债务隔离与 Slash 路径** | 高 | **优化 (Optimize)** | 多运营方模式下,用户债务必须隔离。Slash 逻辑需严格绑定 BLS 证明,防止误伤或攻击。 | +| **`BLS/DVT` 聚合签名实操验证** | 极高 | **更好的方案 (Better Solution)** | 若目前仅为逻辑占位,主网前必须实现完整的 BLS 配对验证,或先行降级为多签治理方案以保安全。 | +| **`Registry` 重放攻击防御 (Epoch/Nonce)** | 中 | **优化 (Optimize)** | Reputation 同步必须单调递增或带 Nonce,防止过期状态覆盖新状态。 | +| **`ReputationSystemV3` 数组上限与 NFT 真实性** | 中 | **优化 (Optimize)** | 防止 Gas DoS 攻击。NFT Boost 必须做 `balanceOf` 校验而非仅仅依赖输入数组。 | + +--- + +## 执行计划与优先级 + +### 第一阶段:SDK 鲁棒性增强 (Priority: P0) +**目标**:确保 SDK 生成的 Payload 100% 符合规范,并能拦截低级输入错误。 +- [ ] 在 `getPaymasterAndData` 中增加 `uint128` 范围检查与地址合法性检查。 +- [ ] 重构 `checkEligibility`,支持从配置或环境中读取 `chainId`。 +- [ ] 为 `formatUserOpToBundlerV07` 增加对 `Hex` 长度的显式断言。 + +### 第二阶段:合约安全与逻辑核对 (Priority: P1) +**目标**:将 ABI 发现的高风险点在合约源码中进行逐一核对与修复。 +- [ ] 对接 `SuperPaymaster` 仓库,核对 `PaymasterV4` 和 `SuperPaymasterV3` 的关键权限代码。 +- [ ] 评估 `BLS/DVT` 的实现深度,并给出迁移/补全方案。 + +### 第三阶段:文档与标准对齐 (Priority: P2) +**目标**:更新技术文档,确保 SDK 行为与合约逻辑完全一致。 +- [ ] 更新 `projects/aastar-sdk/docs` 下的各组件文档。 + +--- + +## 备注 +> [!IMPORTANT] +> 由于本仓库仅包含 ABI 且当前处于 SDK 开发模式,上述合约侧建议需在切换至合约仓库时强制执行。SDK 的优化可即刻开始。 diff --git a/0.16.23/guide/SDK_REGRESSION_AND_API_PLAN.md b/0.16.23/guide/SDK_REGRESSION_AND_API_PLAN.md new file mode 100644 index 000000000..4da782d9c --- /dev/null +++ b/0.16.23/guide/SDK_REGRESSION_AND_API_PLAN.md @@ -0,0 +1,98 @@ +# SDK 重构与回归测试计划 (SDK Regression & API Plan) + +## 1. 项目目标与原则 +**核心目标**: 验证 SDK 构建完整性,基于分层架构完善 API(满足 Phase 3 场景),并执行全量回归测试。 + +**开发原则**: +1. **API 分层原则 (Layering)**: + * 优先使用 **基础层 API (Base/Core SDK)** 构建 **业务层 API (Business API)**。 + * 如果基础层缺失,**先补充基础层**,再构建业务层。 + * *例外情况*: 仅在性能瓶颈或极特殊逻辑下直接调用合约 ABI,且必须在代码中注释说明原因。 +2. **数据收集优先 (Data First)**: + * 集成博士论文所需的数据收集模块 (`TestCountManager`)。 + * 提供独立的 API 套件用于实验数据采集(Gas 消耗、TPS、成功率等)。 +3. **合约稳定性**: + * 基于 `SuperPaymaster` 项目提供的稳定 Sepolia 合约地址 (`.env.sepolia`)。 + * 仅在发现合约初始化缺陷时才回溯修改合约。 + +## 2. API 架构与差距分析 (Gap Analysis) + +### 2.1 基础层 API (Base Layer) - `packages/core`, `packages/contracts` +*封装底层合约交互、类型定义、基础工具。* + +* **P0 (缺失/需增强)**: + * [ ] `StateValidator.getAccountBalances(addresses[])`: 批量获取 ETH/GToken/aPNTs 余额。 + * [ ] `ContractConfigManager`: 适配 V3.1.1 配置读取(从 `.env` 或 Config 合约)。 + * [ ] `TestCountManager`: 封装实验计数器与数据打点基础方法。 + +### 2.2 业务层 API (Business Layer) - `packages/sdk` +*基于基础层构建,面向最终开发者场景。* + +* **P0 (状态查询 - Read)**: + * [ ] `CommunityClient.getCommunityInfo(account)`: 返回角色、Token 地址、元数据。 + * [ ] `OperatorClient.getOperatorInfo(account)`: 返回 Operator 类型 (Super/V4)、国库状态、质押额。 + * [ ] `ExperimentClient.collectMetrics(txHash)`: **(新增)** 收集单笔交易的实验数据(Gas, Cost, Status)。 + +* **P1 (核心写操作 - Write)**: + * [ ] `EndUserClient.deployAccount(owner, salt?)`: 封装 `SimpleAccountFactory` 部署逻辑。 + * [ ] `EndUserClient.mintSBT(account)`: 封装 "自动质押 + Mint" 的组合逻辑。 + * [ ] `OperatorClient.depositFunds(amount)` & `withdrawFunds()`: 简化质押金管理。 + * [ ] `ExperimentClient.recordBenchmark(scenarioId)`: **(新增)** 记录场景基准数据。 + +* **P2 (增强功能)**: + * [ ] `EndUserClient.fundWithXPNTs()`: 社区 Token 分发辅助方法。 + +## 3. 回归测试策略 (Scenarios) +我们将现有的散乱脚本重构为 **标准化场景测试 (Scenarios)**,位于 `tests/scenarios/`。 + +### 场景 1: 社区生命周期 (DAO Launchpad) +* **目标**: 注册社区 -> 发行 xPNTs -> 初始配置。 +* **原脚本**: `09_local_test_community_lifecycle.ts` +* **新测试**: `01_community_launch.test.ts` +* **API 验证**: `CommunityClient`, `RegistryClient` (Base)。 + +### 场景 2: 运营商入驻向导 (Operator Wizard) +* **目标**: 注册 SuperPaymaster Operator -> 质押 GToken -> 存入 aPNTs。 +* **原脚本**: `05_test_superpaymaster.ts` +* **新测试**: `02_operator_setup.test.ts` +* **API 验证**: `OperatorClient`, `FundingManager` (Base)。 + +### 场景 3: 终端用户体验 (Gasless UX) +* **目标**: 新 EOA -> 部署 AA 账户 -> 领取 SBT -> 发送 Gasless 交易。 +* **原脚本**: `03_test_standard_aa.ts` +* **新测试**: `03_end_user_gasless.test.ts` +* **API 验证**: `EndUserClient`, `PaymasterClient` (Base). + +### 场景 4: 实验数据收集 (PhD Data Collection) +* **目标**: 运行基准测试 (Baseline) vs 实验组,自动记录数据。 +* **原脚本**: `collect_industry_baseline.ts` +* **新测试**: `04_data_collection.test.ts` +* **API 验证**: `ExperimentClient`, `TestCountManager`. + +## 4. 执行计划 (Work Plan) + +### 阶段 1: 基础层与实验工具建设 (1-2天) +1. 完善 `packages/core` 中的基础读取方法。 +2. **重点**: 实现 `ExperimentClient` 和 `TestCountManager`,确保数据收集通道畅通。 + +### 阶段 2: 业务 API 实现 (2-3天) +1. 按 P0 -> P1 顺序实现 `packages/sdk` 中的业务方法。 +2. 严格遵守“基础层优先”原则,代码 Review 重点检查是否绕过 SDK 直接调用合约。 + +### 阶段 3: 场景回归与数据验证 (2天) +1. 迁移脚本至 `tests/scenarios/`。 +2. 运行全量回归:`pnpm test:scenarios`。 +3. 验证产生的实验数据格式是否符合论文要求。 + +### 阶段 4: Demo 重构 (P2 优先级) +* 在 `projects/aastar-sdk-demo` 仓库中进行。 +* 基于已验证的 SDK API 改造前端逻辑。 + +## 5. 启动指令 +```bash +# 1. 检查构建 +pnpm build + +# 2. 运行特定场景 (开发中) +pnpm test:scenarios --filter=01_community +``` diff --git a/0.16.23/guide/SDK_STAGE3_PLAN.md b/0.16.23/guide/SDK_STAGE3_PLAN.md new file mode 100644 index 000000000..b83e519e2 --- /dev/null +++ b/0.16.23/guide/SDK_STAGE3_PLAN.md @@ -0,0 +1,151 @@ +# SDK Stage 3: 全面回归测试与场景验证计划 + +## 当前状态总结 (Current Status) + +### ✅ 已完成的工作 +1. **工作区清理与配置修复**: + - 清理了所有外部参考仓库的编译产物 + - 恢复了 `.eslintrc.js`,加固了 `tsconfig.json` 和 `.gitignore` + - 配置了 `paths` 支持 IDE 代码跳转 + +2. **Anvil 环境回归测试**: + - ✅ Scenario 1: 社区注册(Onboard Community) + - ✅ Scenario 2: 运营商入驻(Onboard Operator) + - ✅ Scenario 3: 用户注册(Onboard User) + - ⚠️ Scenario 4: Gasless 交易流(getNonce 已修复,但 handleOps 仍失败) + +3. **SDK 基础层优化**: + - 修复了 `EndUserClient.executeGasless` 的 nonce 获取逻辑 + - 实现了 `ExperimentClient` 用于性能数据采集 + - 同步了最新的 SuperPaymasterV3 ABIs + +### ⚠️ 待解决的问题 +1. **Scenario 4 handleOps 回滚**: + - 问题:EntryPoint.handleOps 执行失败 + - 可能原因:Paymaster 验证失败、签名不正确或 Gas 参数问题 + - 影响:无法完成 Anvil 环境的完整 Gasless 流程验证 + +2. **Sepolia 环境测试**: + - 需要验证 Sepolia 环境的完整流程 + - 需要确认所有合约地址已正确同步到SDK + +--- + +## Stage 3 执行计划 (Implementation Roadmap) + +基于 `STAGE3.md` 文档,我们将分三个阶段完成SDK的全面验证: + +### 阶段 1: 基础层回归测试 (Base Layer Regression) + +#### 1.1 SDK 构建验证 +- [ ] 验证 `pnpm build` 正常完成 +- [ ] 检查所有 packages 的依赖关系 +- [ ] 确认类型声明文件正确生成 + +#### 1.2 核心 API 验证 +- [ ] **RegistryActions**: + - `registerCommunity`, `joinCommunity`, `getCommunityInfo` +- [ ] **SuperPaymasterActions**: + - `validatePaymasterUserOp`, `postOp` payment logic +- [ ] **GTokenStakingActions**: + - `stake`, `unstake`, `getStakedAmount` +- [ ] **PaymasterFactoryActions**: + - `deployPaymaster`, `calculateAddress` + +#### 1.3 ABI 同步验证 +- [ ] 确认所有 V3.1.1 合约的 ABI 已同步 +- [ ] 验证自定义错误解码器正常工作 +- [ ] 测试事件监听和解析 + +--- + +### 阶段 2: 业务层回归测试 (Business Layer Regression) + +#### 2.1 CommunityClient 验证 +- [ ] `onboardCommunity()` 组合操作 +- [ ] `getCommunityInfo()` 状态查询 +- [ ] `deployXPNTs()` 代币发行 + +#### 2.2 OperatorClient 验证 +- [ ] `setupNode()` 节点配置 +- [ ] `depositCollateral()` 质押充值 +- [ ] `getOperatorStatus()` 状态查询 + +#### 2.3 EndUserClient 验证 +- [ ] `joinAndActivate()` 用户注册 +- [ ] `deploySmartAccount()` AA 账户部署 +- [ ] `executeGasless()` 无 Gas 交易(**需修复**) + +--- + +### 阶段 3: 场景化测试 (Scenario Verification) + +#### 3.1 Anvil 环境场景测试 +- [x] Scenario 1: DAO Launchpad Pattern +- [x] Scenario 2: Operator Lifecycle +- [x] Scenario 3: User Onboarding & Credit +- [/] Scenario 4: High-Frequency Gasless UX (**handleOps 待修复**) + +#### 3.2 Sepolia 环境场景测试 +- [ ] 部署完整的 V3.1.1 合约栈 +- [ ] 验证 4 个核心场景在 Sepolia 上的执行 +- [ ] 采集性能数据(Gas 消耗、延迟等) + +#### 3.3 对比实验数据采集 +- [ ] Group A: EOA Baseline +- [ ] Group B: Pimlico/Alchemy Paymaster +- [ ] Group C1: Paymaster V4 +- [ ] Group C2: SuperPaymaster V3 + +--- + +## 优先级排序 (Priority Queue) + +### P0 - 紧急修复 +1. **修复 Scenario 4 的 handleOps 问题** + - 调试 EntryPoint 验证逻辑 + - 检查 paymasterAndData 格式 + - 验证 UserOp 签名 + +### P1 - 核心功能验证 +2. **完成 Anvil 环境的 4 个场景测试** +3. **验证 SDK 构建流程** +4. **确认所有核心 API 正常工作** + +### P2 - Sepolia 环境部署 +5. **部署 V3.1.1 合约至 Sepolia** +6. **运行 Sepolia 场景测试** + +### P3 - 数据采集与文档 +7. **采集对比实验数据** +8. **编写开发者指南** +9. **完成 Stage 3 报告** + +--- + +## 立即行动项 (Immediate Actions) + +1. ✅ 创建本计划文档 +2. ⏭️ 修复 Scenario 4 的 handleOps 问题 +3. ⏭️ 验证 SDK 构建流程 +4. ⏭️ 运行基础层 API 回归测试 + +--- + +## 预期交付物 (Deliverables) + +1. **测试报告**: + - `docs/STAGE_3_REGRESSION_REPORT.md` + - 包含所有测试用例的执行结果 + +2. **性能数据**: + - `docs/STAGE_3_BENCHMARK_DATA.json` + - 包含 4 组对比实验的详细数据 + +3. **开发者指南**: + - `docs/guide/patterns.md` + - 沉淀的 SDK Orchestration Patterns + +4. **修复记录**: + - `walkthrough.md` + - 记录所有发现和修复的问题 diff --git a/0.16.23/guide/SEPOLIA_ENV_REFERENCE.md b/0.16.23/guide/SEPOLIA_ENV_REFERENCE.md new file mode 100644 index 000000000..c87db82d4 --- /dev/null +++ b/0.16.23/guide/SEPOLIA_ENV_REFERENCE.md @@ -0,0 +1,51 @@ +# Sepolia Environment Configuration Reference + +Copy this configuration to your `.env.sepolia` file in `aastar-sdk/scripts/experiment/stage3/`: + +```bash +# Sepolia Testnet Configuration +SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/Bx4QRW1-vnwJUePSAAD7N +ETHERSCAN_API_KEY= + +# EntryPoint & Bundler +ENTRYPOINT_ADDRESS=0x0000000071727De22E5E9d8BAf0edAc6f37da032 +BUNDLER_URL=https://sepolia.g.alchemy.com/v2/Bx4QRW1-vnwJUePSAAD7N + +# V3 Core Components +GTOKEN_ADDRESS=0xbf0DD4c529cA321bCa8FBE23644a64eFA1BeaeB6 +GTOKENSTAKING_ADDRESS=0x5D5d930C295630e8f4130fef037E23105BE17B84 +MYSBT_ADDRESS=0x44088fE0Fc39FEE323aFc8a760E79C45D3c2fcF6 +REGISTRY_ADDRESS=0x0b72441C61D97D6c48F080E29F8Cd507A62Ce674 + +# V3 Factory & SuperPaymaster +XPNTS_FACTORY_ADDRESS=0xD127976771547966e1a86d5DdFA10756ae682c34 +APNTS_ADDRESS=0x7e4ACE9e0DACf6e1Bb86A53B1b12a825568273c7 +SUPERPAYMASTER_V3_ADDRESS=0x2D8Bb69A570c96E86F6A0F774975A90C30534d44 + +# Auxiliary Modules +REPUTATION_SYSTEM_ADDRESS=0xddF0b0283E88D809E711AA5CFcab1D5fA835c2Ca +BLS_AGGREGATOR_ADDRESS=0x77D381AE02C12cD826e14BC7642D43a85F9aB035 +DVT_VALIDATOR_ADDRESS=0xCD6d236D638a9991b423433BFF0C737112A0D4fB +BLS_VALIDATOR_ADDRESS=0xD6932C92d75be024a90002feDaFD4EE8768298e5 + +# V4 Paymaster Suite +PAYMASTER_FACTORY_V4_ADDRESS=0x81178D2CB3f4BB8b4020923b082a8bddbb27aFf0 +PAYMASTER_V4_IMPL_ADDRESS=0x8400209ADC02125747cfF360b7E4ABA83941DcA3 +PAYMASTER_V4_INSTANCE_ADDRESS=0xfBDAac70E9e1e978651A2dd40469C221096b7533 + +# Stage 3 Experiment Keys (NEVER COMMIT TO GIT) +ADMIN_PRIVATE_KEY= +EOA_PRIVATE_KEY= +AA_OWNER_PRIVATE_KEY= + +# Pimlico (for Group B - Standard AA) +PIMLICO_API_KEY= +``` + +## Quick Setup + +```bash +cd /Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/scripts/experiment/stage3 +cp .env.sepolia.example .env.sepolia +# Then fill in the private keys and API keys +``` diff --git a/0.16.23/guide/STAGE3.md b/0.16.23/guide/STAGE3.md new file mode 100644 index 000000000..8a25a7f39 --- /dev/null +++ b/0.16.23/guide/STAGE3.md @@ -0,0 +1,191 @@ +# Stage 3 Sepolia Experiment & Orchestration Pattern Design + +## 1. 背景与目标 (Context & Objectives) + +在 Phase 2 (Local Anvil) 阶段,我们验证了所有 17 个基础回归用例。进入 Phase 3 (Sepolia),我们的重点将从“功能验证”转向“**场景化业务流验证**”和“**基准性能评估**”。 + +本计划旨在通过四个核心业务场景,沉淀出 SDK 的**高阶抽象模式 (Orchestration Patterns)**,并为 SuperPaymaster 论文提供可信的实验数据。 + +--- +## 2. 实验分组与基准 (Experiment 呃,那个spoliia的回归已经完成了。那我们现在转入另外一个话题,就是SDK。首先呢我们要check一下SDK当前是不是能够正常的build。呃,然后呢包括我们规划的这个API是不是都正常实现了,进行一次全回归的测试和检查,包括它的设计目标是不是都实现了。嗯,这个需要啊两个维度,一个是基础的这种AABI的或者是reite contract的封装。呃,另外一个就是业务层面。业务层面的高维度,业务原语的封装。这个角度呢就是我们已经在进行带测试和这个整体的设计可能需要不断的迭代。嗯它的带。底层可能是SDK呃本身的一些API或者我们调用其他合约的ABI对,那这是我的一个背景信息。我希望你去查看我们这三个相关的文档。然后呢梳理一下之后给出一个完整的规划来,然后从基础的AAPI的回归到业务原API的完善和回归测试啊,包括啊这几个文档的整体规划的目标的实现。Groups & Baselines) + +为了评估 SuperPaymaster 的竞争力,我们将对比三组账户: + +| 分组 | 身份标识 | 支付机制 | 核心组件 | 预期优势 | +| :--- | :--- | :--- | :--- | :--- | +| Group A: EOA | Standard EOA | Self-pay (ETH) | WalletClient | Baseline (Min Overhead) | +| **Group B: Standard AA** | SimpleAccount v0.7 | 3rd Party Sponsor | Alchemy/Pimlico | Industry Standard | +| **Group C1: Paymaster V4** | SimpleAccount v0.7 | Token-based (v4) | PaymasterV4 Contract | Basic Token Sponsorship | +| **Group C2: SuperPaymaster** | SimpleAccount v0.7 | Asset-based Gasless | SuperPaymaster V3 | Fully Decoupled & Credit Flow | + +--- + +## 3. 场景化测试用例 (Scenario-driven Test Cases) + +我们不仅测试单个 API,而是测试完整的“业务链路”。 + +### 3.1 场景一:社区启动 (DAO Launchpad Pattern) +- **业务逻辑**: 协议管理员批准 -> 社区管理员注册项目 -> 初始质押 GToken -> 部署专属 xPNTs 代币。 +- **SDK 沉淀**: `CommunityClient.onboardCommunity()` 组合操作。 +- **验证点**: 注册事件监听、xPNTs 部署地址验证、质押状态同步。 + +### 3.2 场景二:运营商运维 (Operator Lifecycle) +- **业务逻辑**: 运营商质押 -> 获取节点经营权 -> 通过 Factory 部署私有 Paymaster -> 激活 SuperPaymaster 路由。 +- **SDK 沉淀**: `OperatorClient.setupNode()` 模式。 +- **验证点**: 合约确定性部署 (CREATE2)、SuperPaymaster 权限映射、国库充值流转。 + +### 3.3 场景三:终端用户旅程 (User Onboarding & Credit) +- **业务逻辑**: 用户加入社区 -> 铸造 SBT (Auto-stake) -> 信用额度激活 -> 查看实时 Reputation。 +- **SDK 沉淀**: `EndUserClient.joinAndActivate()`。 +- **验证点**: SBT 余额、信用上限计算逻辑、信用恢复速度。 + +### 3.4 场景四:极致 Gasless 体验 (High-Frequency UX) +- **业务逻辑**: 用户在无 ETH 状态下,连续发送 10 笔跨协议交互。 +- **SDK 沉淀**: `EndUserClient.sendGaslessTransaction()`。 +- **数据采集**: Gas消耗明细、UserOp 处理耗时、Paymaster 扣费准确性。 + +--- + +## 4. 实施规划 (Implementation Roadmap) + +### 4.1 目录结构 +在 `aastar-sdk` 下建立独立目录: +```text +scripts/experiment/stage3/ +├── .env.sepolia # Sepolia 环境专用私钥与地址 +├── 01_dao_launch.ts # 场景一脚本 +├── 02_operator_setup.ts # 场景二脚本 +├── 03_user_onboarding.ts # 场景三脚本 +├── 04_benchmarking.ts # 场景四 (数据采集) +└── setup.ts # 分组账号初始化与资金分发 +``` + +### 4.2 开发与执行顺序 +1. **环境初始化**: 部署 V3.3.0 核心合约至 Sepolia -> 填充 `.env.sepolia`。 +2. **场景脚本编写**: 按照 3.1-3.4 逐步实现,优先关注“组合 API”的开发。 +3. **数据采集**: 运行 `04_benchmarking.ts` 至少 30 组数据,生成 JSON 报告。 +4. **模式沉淀**: 将脚本中重复的 Orchestration 逻辑提取到 `packages/sdk` 的高阶函数中。 + +--- + +## 5. 预期交付物 + +1. **`docs/STAGE_3_SCENARIO_EXP_PLAN.md`**: 详细的业务用例设计方案(即本文件)。 +2. **`scripts/experiment/stage3/`**: 完整的可运行测试代码库。 +3. **`docs/STAGE_3_REPORT.json`**: 包含三组对比数据的实验报告。 +4. **SDK Patterns**: 在 `docs/guide/patterns.md` 中更新高阶业务开发模式。 + + +------- + + +# SDK 场景化案例设计 (User Case Design) + +本文档借鉴 `registry` 前端项目的用户交互逻辑,提取核心业务链路,设计了 SDK 在 Phase 3 (Sepolia) 阶段的场景化测试用例。我们的目标是**参考前端体验、沉淀 SDK 模式 (Orchestration Patterns)**,而非简单的接口复用。 + +## 场景角色定义 + +1. **Protocol Admin (协议管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,进行后续的全局配置、DVT 验证器管理、治理代币发行等。 +2. **Community Admin (社区管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,负责社区注册、xPNTs 发行、SBT 会员规则设定。 +3. **PM Operator (Paymaster 操作员)**: 部署时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 Paymaster 节点运维、质押充值、费用管理等。多数时候,早期社区管理员和Operator是一个EOA。 +4. **SuperPaymaster Operator**: 注册时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 SuperPaymaster参数配置和国库管理。多数时候,早期社区管理员和Operator是一个EOA。 +5. **DVT(Node) Operator**: 部署时期是一个EOA,完成部署后,**可选**交接给其他EOA或者自动Rotate 账户,负责 DVT 参数配置和治理代币管理。 +6. **EndUser (终端用户)**: 参与社区、获取 SBT 身份、使用社区信用进行 Gasless 交易。 + +--- + +## 核心测试用例 (Business Scenarios) +背景信息: +- GToken在测试阶段,来自于协议Admin直接铸造空投。 +- 未来GToken来自于独立的阶梯价格销售(Mint)合约/应用。 +- xPNTs在测试阶段,来自于社区Admin铸造空投。 +- 未来xPNTs来自于社区发行+Reputation机制+任务广场。 +- SBT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来SBT来自于社区Shops+Reputation机制+任务广场。 +- NFT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来NFT来自于社区Shops+Reputation机制+任务广场。 + +### 用例 1:社区“全流程”自动化 (DAO Launchpad Pattern) +**参考自**: `RegisterCommunity.tsx` +- **设计思路**: 前端是分步引导,SDK 应提供“原子组合”能力。模拟社区从 0 到 1 的全过程:授权 -> 质押 -> 基准配置 -> 关联 SBT。 +- **SDK 验证重点**: + - 组合调用:`GTokenClient` 与 `RegistryClient` 的无缝状态桥接。 + - `RegistryClient.registerCommunityWithAutoStake` + - 验证 `ContractConfigManager` 是否正确识别新注册的社区配置。 + - 社区发行自己的xPNTs,NFT。 + +### 用例 2:Paymaster 节点部署向导 (Operator Wizard) +**原型参考**: `DeployWizard.tsx` (3-Step Flow) +- **业务流程**: 操作员选择模式(AOA/AOA+)-> 资源自检(GToken 余额、质押状态)-> 部署合约并充值。 +- **SDK 验证重点**: + - `OperatorClient.checkResources` (模拟前端资源自检逻辑) + - `PaymasterFactory.deployPaymaster` + - `OperatorClient.depositCollateral` +- **预期结果**: 完成后,Operator拥有独立的`Paymaster`节点和 Gas Token(xPNTs),或者在 `SuperPaymaster` 的 aPNTs 余额可见且可用于支持自己社区成员使用xPNTs代付。 + +### 用例 3:用户身份获取与信誉激活 (SBT & Reputation) +**原型参考**: `GetSBT.tsx`, `MySBT.tsx` +- **业务流程**: 用户选择社区 -> 自动质押 0.4 GT -> 铸造 MySBT -> 查看全局信誉分。 +- **SDK 验证重点**: + - `EndUserClient.mintSBT` (包含 auto-stake 逻辑) + - `ReputationClient.getGlobalReputation` + - `RegistryClient.getCreditLimit` (验证信誉分是否正确转化为信用额度) + +### 用例 4:纯净 Gasless 交易体验 (Ultimate Gasless UX) +这也是我们PhD paper获取实验数据的阶段,包括baseline(EOA和Pimlico Paymaster,以及业界平均统计成本)和两个对比实验(Paymaster V4和SuperPaymaster)。 +**原型参考**: `DeveloperPortal.tsx` (集成示例) +- **业务流程**: 一个没有任何 ETH 的新账户,使用社区发放的 SBT 凭证,通过 SDK 发送一笔交易。 +- **SDK 验证重点**: + - `createEndUserClient` 初始化(无私钥签名模式或智能账户模式) + - `getSuperPaymasterMiddleware` 后台自动构建 `userOp.paymasterAndData` + - 验证 `SuperPaymaster` 的 `postOp` 阶段是否正确扣除用户信用或 xPNTs 代币。 + + +### 基础用例整合(后续TODO) +我们期望能够整合基础用例,给用户(社区)提供自主自助的launchpad以及管理平台。 +🎫 +Get GToken +Get protocol access permission GToken, become protocol member, join permissionless, quit anytime freely + +Get → +🏛️ +Register Community +Create and register your community on the AAstar Network + +Register → +💎 +Deploy xPNTs +Create your community gas token for payment abstraction + +Deploy → +🚀 +Launch Paymaster +Deploy your Paymaster contract and start serving gasless transactions to your community + +Launch Paymaster → → + +### 用例 X:更多用例,持续加入(后续TODO,不加入开发) + 用例 5:危机管理与 DVT 治理 (Governance & Slashing) +**原型参考**: `AdminBatchMint.tsx` (管理入口) +- **业务流程**: 管理员发现恶意行为 -> DVT 节点投票 -> 执行对社区质押额的 Slash。 +- **SDK 验证重点**: + - `DVTClient.proposeSlash` + - `DVTClient.signSlash` (模拟多节点聚合签名) + - `AdminClient.executeSlash` +--- + +## 开发计划 (Implementation Plan - 阶段 3) + +### 第一步:Sepolia 环境就绪 +- 部署全套合约 (V3.3.0+) 至 Sepolia。 +- 使用 `forge verify-contract` 完成 Etherscan 验证。 +- 更新 SDK `constants.ts` 中的 Sepolia 合约地址。 + +### 第二步:场景化示例开发 +- 在 `examples/` 目录下按上述 4 个用例创建独立的 目录和TS 脚本。 +- 编写配套的中文文档注释,确保其作为“开发者指南”的使用价值。 +- 结合SuperPaymaster Readme中的数据收集计划,完成PhD paper的数据收集。这部分可以独立目录。 + +### 第三步:全流程冒烟测试 +- 运行 `pnpm run test:sepolia` (新增脚本)。 +- 输出场景执行记录,作为 Phase 3 的交付证明。 diff --git a/0.16.23/guide/Script_Comparison_Report.md b/0.16.23/guide/Script_Comparison_Report.md new file mode 100644 index 000000000..4f6705e7b --- /dev/null +++ b/0.16.23/guide/Script_Comparison_Report.md @@ -0,0 +1,91 @@ +# 回归测试脚本对比验证 + +## 对比结果 + +### scripts/run_regression.sh (旧脚本) +**测试内容**: +``` +scripts/v2_regression/00_validate_env.ts +scripts/v2_regression/01_setup_and_fund.ts +scripts/v2_regression/02_operator_onboarding.ts +scripts/v2_regression/03_community_registry.ts +scripts/v2_regression/04_enduser_flow.ts +scripts/v2_regression/05_admin_audit.ts +``` +**特点**: 简单、仅运行V2回归测试、不处理Anvil启动 + +--- + +### run_full_regression.sh (新主脚本) +**测试内容** (包含上述所有6个 + 更多): +``` +✅ scripts/v2_regression/00_validate_env.ts +✅ scripts/v2_regression/01_setup_and_fund.ts +✅ scripts/v2_regression/02_operator_onboarding.ts +✅ scripts/v2_regression/03_community_registry.ts +✅ scripts/v2_regression/04_enduser_flow.ts +✅ scripts/v2_regression/05_admin_audit.ts + scripts/06_local_test_v3_admin.ts + scripts/06_local_test_v3_funding.ts + ...共24个测试 +``` +**特点**: +- ✅ 包含所有v2_regression测试 +- ✅ 自动启动Anvil +- ✅ 自动部署合约 +- ✅ 支持Sepolia模式 + +--- + +### run_sdk_regression.sh (SDK独立测试) +**测试内容**: +``` +22_test_bls_signing.ts +23_test_middleware.ts +20_sdk_full_capability.ts +18_sdk_e2e_verification.ts +19_sdk_experiment_runner.ts +``` +**特点**: +- SDK层面测试 +- 不依赖Anvil +- 不与scripts/run_regression.sh重复 + +--- + +## ✅ 验证结论 + +**scripts/run_regression.sh** 的所有功能已100%包含在: +- ✅ `run_full_regression.sh` (包含全部6个v2_regression测试) + +**无遗漏内容**: +- run_full_regression.sh 是 scripts/run_regression.sh 的**超集** +- 包含完全相同的测试 + 额外18个高级测试 + +**可以安全删除**: +- ✅ scripts/run_regression.sh (冗余) + +--- + +## 推荐使用 + +**V2回归测试** (仅6个基础测试): +```bash +# 直接在Sepolia运行 +REVISION_ENV=sepolia SDK_ENV_PATH=.env.sepolia \ + ./run_full_regression.sh --env sepolia --skip-deploy +``` + +**完整回归测试** (24个测试): +```bash +# Anvil本地 +./run_full_regression.sh + +# Sepolia +./run_full_regression.sh --env sepolia +``` + +**SDK独立测试**: +```bash +./run_sdk_regression.sh +``` diff --git a/0.16.23/guide/Security-solution.md b/0.16.23/guide/Security-solution.md new file mode 100644 index 000000000..f3ccb0c6d --- /dev/null +++ b/0.16.23/guide/Security-solution.md @@ -0,0 +1,106 @@ +除了 `pnpm audit`(主要针对已知 CVE 漏洞),一个健壮的 npm/TypeScript 项目还需要在**供应链安全**、**代码静态分析**、**密钥管理**和**CI/CD 集成**这几个维度建立防线。 + +针对你作为资深开发者的背景(Web3/Rust/Node),以下是更进阶的**最佳实践和工具推荐**: + +### 1. 供应链安全防御 (Supply Chain Security) + +`pnpm audit` 只能告诉你依赖包有没有“已知漏洞”,但无法检测**恶意代码注入**(如 typosquatting 或被劫持的包)。 + +* **Socket.dev (强烈推荐)** +* **作用:** 它不仅检查 CVE,还分析包的“行为”。比如:一个 UI 库突然开始读取环境变量或发送网络请求,Socket 会报警。 +* **集成:** 有 GitHub App,也可以作为 CLI 运行。它能拦截包含恶意 install script 的包。 + + +* **OSSF Scorecard** +* **作用:** Google 开源的工具,给依赖项打分。它会检查维护状态、是否有 CI、是否进行代码审查等,帮助你判断引入一个库是否“健康”。 + + +* **Lockfile 锁定** +* **实践:** 在 CI/CD 环境中必须使用 `pnpm install --frozen-lockfile`。这确保了 CI 构建使用的版本与你本地完全一致,防止在构建时悄悄拉取了被篡改的补丁版本。 + + + +### 2. 静态代码分析 (SAST) + +利用工具在代码运行前发现逻辑漏洞。 + +* **ESLint Security Plugins** +* 不要只用标准的 lint 规则,需添加安全专用插件: +* `eslint-plugin-security`: 识别潜在的热点(如正则表达式 DoS 攻击 ReDoS、不安全的 `eval` 等)。 +* `eslint-plugin-no-secrets`: 防止意外提交密钥。 + + +* **CodeQL (GitHub Native)** +* **作用:** 如果你的项目在 GitHub 上,开启 **Code Scanning**。CodeQL 是一种语义代码分析引擎,能发现数据流中的漏洞(如 SQL 注入、NoSQL 注入、XSS),比正则匹配更深入。 + + +* **SonarQube / SonarCloud** +* 企业级的代码质量和安全扫描,对于 TypeScript 的支持非常好,能发现复杂的逻辑漏洞(Code Smells)。 + + + +### 3. TypeScript 专有安全配置 + +TypeScript 本身就是第一道防线,但需要正确配置: + +* **启用 `strict: true**` +* 这是基础。除此之外,开启 `noImplicitAny` 和 `strictNullChecks` 可以消除绝大多数 `undefined` 导致的运行时崩溃(DoS 风险)。 + + +* **避免类型断言 (`as`) 和 `any**` +* 使用 `zod` 或 `io-ts` 进行**运行时数据验证 (Runtime Validation)**。不要盲目相信 API 返回的数据就是 TS 定义的类型。 +* **Bad:** `const data = await res.json() as User;` +* **Good:** `const data = UserSchema.parse(await res.json());` (这在 Web3 数据处理中尤为重要,防止恶意构造的 Payload 导致逻辑错误)。 + + + +### 4. 脚本与权限控制 (Scripts & Permissions) + +npm 的 `postinstall` 脚本是恶意软件最常见的入侵途径。 + +* **禁用 Install Scripts** +* 在 `.npmrc` 中设置 `ignore-scripts=true`。 +* 如果是必须运行脚本的依赖(如 `husky`, `esbuild`),使用 `pnpm approve-builds` (pnpm 特有功能) 或 `allow-scripts` 插件来**白名单**放行特定包。 + + +* **LavaMoat (进阶)** +* 由 MetaMask 团队开发(很适合你的背景)。它可以为每个 npm 包生成策略文件,限制某个包只能访问 `fs` 模块,或者只能访问特定的全局变量。 + + + +### 5. 密钥与硬编码扫描 + +Web3 项目最怕泄露私钥或 API Key。 + +* **GitGuardian / TruffleHog** +* **作用:** 在 commit 之前(pre-commit hook)或 CI 阶段扫描代码库,寻找像 AWS Key、Private Key、Infura Key 这种高熵字符串。 + + +* **Dotenv 最佳实践** +* 强制将 `.env` 加入 `.gitignore`。 +* 使用 `dotenv-safe` 或 `envalid` 库,在应用启动时校验必要的环境变量是否存在且符合格式,否则直接报错退出。 + + + +### 6. 自动化依赖更新 (Bot) + +* **Renovate Bot (优于 Dependabot)** +* 相比 Dependabot,Renovate 配置更灵活。你可以设置策略:补丁版本(Patch)自动合并,次要版本(Minor)需人工 Review。保持依赖最新可以大大减少被利用已知漏洞的窗口期。 + + + +### 总结:一份推荐的 CI/CD 安全检查清单 + +在你的 GitHub Actions / GitLab CI 中,建议包含以下步骤: + +1. **Checkout** +2. **Secret Scan:** 运行 `trufflehog` 检查本次 commit 是否包含密钥。 +3. **Dependency Integrity:** `pnpm install --frozen-lockfile --ignore-scripts`。 +4. **SCA Scan:** 运行 `socket` (Socket.dev) 或 `snyk test` 检查依赖风险。 +5. **Linting:** `pnpm lint` (包含 `eslint-plugin-security`)。 +6. **Build:** 确保构建成功(利用 TS 类型检查)。 +7. **Test:** 单元测试覆盖核心业务逻辑。 + +### 下一步 + +如果你对 **Socket.dev** 或 **LavaMoat** 感兴趣,我可以为你提供一个具体的配置示例,或者帮你写一个 GitHub Action 的 workflow 文件来集成这些工具。 \ No newline at end of file diff --git a/0.16.23/guide/Sepolia_Latest_Deployment.md b/0.16.23/guide/Sepolia_Latest_Deployment.md new file mode 100644 index 000000000..28a451c21 --- /dev/null +++ b/0.16.23/guide/Sepolia_Latest_Deployment.md @@ -0,0 +1,117 @@ +# Sepolia最新合约部署总结 + +**部署时间**: 2025-12-31 +**部署者**: Admin (0xb5600060e6de5E11D3636731964218E53caadf0E) + +--- + +## 已部署合约 ✅ + +| 合约 | 地址 | 版本 | 状态 | +|------|------|------|------| +| **GToken** | `0x8c76a083B38093dC690bcEa422Ec560a81fFA59b` | **v2.1.0** | ✅ Burn升级 | +| **GTokenStaking** | `0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8` | **v3.1.0** | ✅ Burn升级 | +| **Registry** | `0xd8168f6e9410fc0A1e727B271991709ae484d1dc` | v3.1.1 | ✅ | +| **MySBT** | `0x08f65A2Eebb28342990d41094c278990fFBC6BF7` | - | ✅ | +| **ReputationSystem** | `0x7b617Bad6fa7A7f9Bd34640170586F8C12c88278` | - | ✅ | +| **aPNTs** | `0x1a93Bb78e7DF973d2A0f6aba3c40A81aAddA8A70` | - | ✅ | +| **SuperPaymaster** | `0x62Eb2A9693CEF22d07Ea311E0d44d5A617EEDde3` | v3.1.1 | ✅ | +| **BLSAggregator** | `0xcC93E8dac22e6C63C1A0a6D47D8da87901b44ab1` | - | ✅ | +| **DVTValidator** | `0x6C1233Dd301459B5DD5653c5059669f5bf666889` | - | ✅ | +| **BLSValidator** | `0xD455A42de3b8d49a64A7329ce4782D6e9632aAd8` | - | ✅ | +| **xPNTsFactory** | `0x9f831C6B825f4Eef04F92050B1B43A6446abAE78` | - | ✅ | +| **PaymasterV4** | `0x90E793Aa46d11239cdC10625d59252F311338a12` | - | ✅ | +| **PaymasterFactory** | `0xD63C1305223Cc505f0c2D9b70cCC623870DEbdcf` | - | ✅ | + +--- + +## 🔥 核心升级: GToken Burn机制 + +### GToken v2.1.0 +**新增功能**: +- ✅ `ERC20Burnable` 继承(真实销毁) +- ✅ `remainingMintableSupply()` 查询函数 +- ✅ `_update()` 多重继承覆盖 + +**链上验证**: +```bash +cast call 0x8c76a083B38093dC690bcEa422Ec560a81fFA59b "VERSION()(string)" \ + --rpc-url https://ethereum-sepolia-rpc.publicnode.com +# 输出: "2.1.0" ✅ +``` + +### GTokenStaking v3.1.0 +**升级内容**: +- ✅ Entry burn使用真实销毁(替代黑洞转账) +- ✅ totalSupply自动减少 +- ✅ Gas优化76% (8,180 vs 34,900) + +**链上验证**: +```bash +cast call 0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8 "VERSION()(string)" \ + --rpc-url https://ethereum-sepolia-rpc.publicnode.com +# 输出: "3.1.0" ✅ +``` + +--- + +## 测试验证 ✅ + +### V2回归测试: 6/6通过 +``` +✅ 00_validate_env +✅ 01_setup_and_fund +✅ 02_operator_onboarding +✅ 03_community_registry +✅ 04_enduser_flow +✅ 05_admin_audit +``` + +### 运行命令 +```bash +REVISION_ENV=sepolia SDK_ENV_PATH=.env.sepolia \ + ./run_full_regression.sh --env sepolia +``` + +--- + +## 初始化状态 + +### 测试账户aPNTs余额 +| 账户 | 地址 | aPNTs余额 | +|------|------|-----------| +| Operator | `0x0376a69C8128190734cCbEa038F47e59e9dEc49F` | 100 aPNTs | +| Community | `0x060b0A80557069B72D8A16bcEf5F8ba9716bFFF5` | 100 aPNTs | +| User | `0x3E3b5CA4C41Ab87c8043960e3c7eB89267740198` | 100 aPNTs | + +--- + +## 浏览器验证 + +**Sepolia Etherscan**: +- GToken: https://sepolia.etherscan.io/address/0x8c76a083B38093dC690bcEa422Ec560a81fFA59b +- GTokenStaking: https://sepolia.etherscan.io/address/0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8 +- Registry: https://sepolia.etherscan.io/address/0xd8168f6e9410fc0A1e727B271991709ae484d1dc + +--- + +## 配置文件 + +所有地址已更新到: +- ✅ `.env.sepolia` (SDK配置) +- ✅ 部署日志: `broadcast/DeployV3FullSepolia.s.sol/11155111/run-latest.json` + +--- + +## 总结 + +✅ **全新部署完成** +✅ **Burn机制升级已上链** +✅ **所有测试通过** +✅ **环境已初始化** + +Sepolia测试网环境已完全就绪,可用于: +- 前端集成测试 +- 用户验收测试 +- 合约交互验证 +- Burn机制展示 diff --git a/0.16.23/guide/TESTER_GUIDE_GASLESS.md b/0.16.23/guide/TESTER_GUIDE_GASLESS.md new file mode 100644 index 000000000..45b8f675b --- /dev/null +++ b/0.16.23/guide/TESTER_GUIDE_GASLESS.md @@ -0,0 +1,409 @@ +# Paymaster V4 Gasless Test Guide + +> For external testers to run a gasless UserOperation on Sepolia. + +--- + +## Pre-configured Test Accounts + +Test accounts are dynamically configured via `l4-setup.ts` and stored in `scripts/l4-state.json`. + +Key test personas: +- **Jason**: Uses PaymasterV4, Token: aPNTs +- **Bob**: Uses PaymasterV4, Token: bPNTs +- **Anni**: Uses SuperPaymaster, Token: dPNTs +- **Charlie**: Uses PaymasterV4, Token: cPNTs + +Run `pnpm tsx scripts/l4-setup.ts` to view current addresses and status. + +--- + +## SDK Readiness & Preparation (NEW) + +The SDK now provides a "One-Click" readiness check to avoid common Bundler rejections. + +### 1. Check Readiness (Diagnostic) +Check if the Paymaster is staked, price is set, and user has deposit. + +```typescript +import { PaymasterOperator } from '@aastar/paymaster'; + +const report = await PaymasterOperator.checkGaslessReadiness( + publicClient, + entryPoint, + paymasterAddress, + userAA, + tokenAddress +); + +if (!report.isReady) { + console.error("Issues found:", report.issues); +} +``` + +### 2. Auto-Prepare (Operator Only) +Automatically fix missing stake, deposit, or prices. + +```typescript +const steps = await PaymasterOperator.prepareGaslessEnvironment( + operatorWallet, + publicClient, + entryPoint, + paymasterAddress, + tokenAddress, + { + tokenPriceUSD: 100000000n, // $1.00 (8 decimals) + minStake: parseEther('0.05'), // Reduced from 0.2 ETH + minDeposit: parseEther('0.1') // Minimum deposit required + } +); +console.log("Steps taken:", steps); +``` + +--- + +## Price Management APIs (For Operators) + +The SDK provides these APIs in `PaymasterV4Client`: + +```typescript +import { PaymasterOperator } from '@aastar/paymaster'; + +// Write APIs (owner/operator only) +await PaymasterOperator.updatePrice(walletClient, paymasterAddress); +await PaymasterOperator.setTokenPrice(walletClient, paymasterAddress, tokenAddress, priceUSD); + +// Read APIs (anyone) - also available in PaymasterOperator for convenience +const { price, updatedAt } = await PaymasterOperator.getCachedPrice(publicClient, paymasterAddress); +const tokenPrice = await PaymasterOperator.getTokenPrice(publicClient, paymasterAddress, tokenAddress); + +// 4. Instant Bill (via TxHash) - No scanning required +const fee = await PaymasterClient.getTransactionFee(publicClient, txHash, paymasterAddress); +console.log(`Cost: ${fee.tokenCost} dPNTs`); +``` + +--- + +## Zero-Friction Workflow (Simplified) + +For a streamlined experience, we provide ready-to-use scripts for both **Admin** (Environment Setup) and **Developer** (Transaction Submission). + +### 1. Admin / DevOps: One-Click Preparation +Ensure the Paymaster environment is fully ready (Staked, Funded, Priced). + +```bash +# Checks 7+ readiness criteria and fixes them automatically +npx tsx examples/prepare-gasless.ts +``` + +**What it does:** +- Checks EntryPoint Stake & Deposit +- verifying Oracle ETH/USD price +- Checks Token Support & Price +- Auto-seeds user deposit if low + +### 2. App Developer: One-Liner Submission (Code Walkthrough) + +To understand how to integrate Gasless features into your app, look at `examples/simple-gasless-demo.ts`. This script demonstrates the "Zero-Friction" Developer Experience (DX). + +**Reference Script**: [`examples/simple-gasless-demo.ts`](../examples/simple-gasless-demo.ts) + +#### Step 1: Setup Client & Wallet +Standard `viem` setup. You need a `WalletClient` (to sign the UserOp) and a `PublicClient` (to read data). + +```typescript +// 1. Setup Clients +const wallet = createWalletClient({ account, chain: sepolia, transport: http(rpcUrl) }); +const client = createPublicClient({ chain: sepolia, transport: http(rpcUrl) }); +``` + +#### Step 2: Define "User Intent" (CallData) +Instead of dealing with raw ABI encoding, use the SDK's semantic builders. + +```typescript +// 2A. Inner Action: Transfer 0.01 dPNTs +const innerCall = PaymasterClient.encodeTokenTransfer(recipient, parseEther('0.01')); + +// 2B. Outer Action: Execute via AA +const callData = PaymasterClient.encodeExecution( + tokenAddress, + 0n, + innerCall +); +``` + +#### Step 3: ✨ The Magic Line (Submission) ✨ +This is the core of the SDK. The `submitGaslessUserOperation` function handles all the complexity of Account Abstraction: +1. **Gas Estimation**: Automatically calls the Bundler to estimate usage. +2. **Dynamic Gas Pricing**: Fetches current network gas prices and applies 1.5x buffer for volatility (no hardcoded values). +3. **Efficiency Guard**: Applies optimized gas limits (no buffer for verification, 1.1x for execution) to pass strict Bundler rules. +4. **Data Encoding**: Packs the Paymaster data (time validity, deposit info). +5. **Signing**: Signs the UserOp with the user's private key (v0.7 compliant). +6. **Submission**: Sends the packet to the Bundler. + +```typescript +// 3. Submit Gasless UserOp (One-Liner) +// No need to specify gas prices - SDK auto-fetches from network! +const userOpHash = await PaymasterClient.submitGaslessUserOperation( + client, // Public Client for reads + wallet, // Wallet Client for signing + aaAccountAddress, // The User's AA Wallet Address + entryPointAddress, // Global EntryPoint + paymasterAddress, // The Paymaster paying the fees + tokenAddress, // The Token the user is "spending" (conceptually) + bundlerUrl, // Where to send the UserOp + callData // The action from Step 2 + // Optional: Pass custom gas prices via options if needed +); +``` + +#### Step 4: Wait for Receipt +The `userOpHash` is just a tracking ID. You must wait for the Bundler to bundle it into a real Ethereum Transaction. + +```typescript +// 4. Wait for Execution +const receipt = await bundlerClient.waitForUserOperationReceipt({ + hash: userOpHash +}); +console.log(`mined in tx: ${receipt.receipt.transactionHash}`); +``` + +#### Step 5: Instant Bill (Get Cost) +Since the fee is deducted from an internal Paymaster balance (not an external ERC-20 transfer), users might wonder "How much did I pay?". +The `getTransactionFee` helper instantly decodes the `PostOpProcessed` log from the receipt to give you the exact cost. + +```typescript +// 5. Instant Bill (No scanning required) +const feeInfo = PaymasterClient.getFeeFromReceipt(receipt.receipt, paymasterAddress); +console.log(`[Instant Bill] Cost: ${formatEther(feeInfo.tokenCost)} dPNTs`); +``` + +--- + +--- + +## Advanced: Remote Signing (KMS / MPC) + +If your AA Account's private key is stored in a KMS (AWS, Google) or MPC Node, you cannot export it. **Good news**: The SDK is compatible with any signer. + +**How to integrate:** +1. Create a custom `viem` Account that calls your KMS. +2. Pass this account to `createWalletClient`. +3. The SDK uses `wallet.account.signMessage(...)` internally. + +```typescript +// Example: Custom KMS Account +import { toAccount } from 'viem/accounts'; + +const kmsAccount = toAccount({ + address: '0xYourAAAddress', + async signMessage({ message }) { + // 1. Send 'message.raw' (the UserOpHash) to your KMS API + const signature = await myKmsClient.sign(message.raw); + // 2. Return the signature + return signature; + }, + // Implement other required methods (signTransaction, etc.) if needed +}); + +const wallet = createWalletClient({ account: kmsAccount, ... }); + +// Now just call the SDK as normal! +await PaymasterClient.submitGaslessUserOperation(..., wallet, ...); +``` + +--- + +--- + +## SuperPaymaster Integration (Credit-Based Gasless) + +SuperPaymaster allows users to pay gas using credits provided by an **Operator**. This model is ideal for ecosystem projects where a central entity (the Operator) sponsors transactions for its users. + +### 1. The SuperPaymaster Flow +1. **Operator Config**: An Operator (e.g., Anni) configures a credit line in the SuperPaymaster contract. +2. **User Action**: A user (UserOp Sender) initiates a transaction. +3. **Submission**: The app submits the UserOp specifying the `operator` address. +4. **Execution**: SuperPaymaster verifies the Operator's credit and sponsors the gas. + +### 2. Developer Workflow + +We provide a dedicated `SuperPaymasterClient` that abstracts gas estimation and operator data packing. + +**Reference Script**: [`examples/simple-superpaymaster-demo.ts`](../examples/simple-superpaymaster-demo.ts) + +#### Step 1: Configure App & Operator +You need the **User's** account (Signer) and the **Operator's** address. + +```typescript +import { SuperPaymasterClient } from '@aastar/paymaster'; + +const APP_CONFIG = { + superPaymaster: '0x...', // Contract Address + operator: '0x...', // Operator Address (Provider) + token: '0x...' // Logic Token (optional context) +}; +``` + +#### Step 2: Submit with Dynamic Gas Tuning +The `SuperPaymasterClient.submitGaslessTransaction` method automatically: +- **Estimates Gas**: Queries the Bundler. +- **Tunes Limits**: Adjusts `verificationGasLimit` to satisfy Bundler efficiency rules (> 0.4 ratio) while ensuring safe execution for Paymaster logic. +- **Packs Data**: Encodes the Operator address into the `paymasterAndData` field. + +```typescript +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction( + client, // Public Client + wallet, // Wallet (Signer - Local or KMS) + userAA, // User's AA Address + entryPoint, // EntryPoint Address + bundlerUrl, // Bundler RPC + { + token: APP_CONFIG.token, + recipient: recipientAddress, + amount: parseEther('1'), + operator: APP_CONFIG.operator, + paymasterAddress: APP_CONFIG.superPaymaster + } +); +``` + +### 3. Using KMS / MPC Signers +Just like the standard Paymaster usage, `SuperPaymasterClient` supports any `viem` Wallet Client. + +If your User keys are in a KMS (AWS, Google, Fireblocks): +1. Create a custom `viem` Account that forwards `signMessage` calls to your KMS. +2. Pass this account to `createWalletClient`. +3. Pass the `wallet` to `SuperPaymasterClient`. + +*(See "Advanced: Remote Signing" section above for code example).* + +--- + + +--- + +--- + +## Automated Faucet & Verification Script (New) + +We have implemented a **SepoliaFaucetAPI** that automates the tedious setup process for new test accounts (Funding ETH, Registering EndUser, Minting Tokens, Depositing to Paymaster). + +### Verification Script +Run the following script to create a fresh AA account, fund it, and execute a gasless transaction immediately: + +```bash +npx tsx scripts/test-faucet-and-gasless.ts +``` + +**What it does:** +1. **Identity**: Generates a random private key (Brand new user). +2. **Faucet**: Uses `SepoliaFaucetAPI.prepareTestAccount` to: + - Fund 0.02 ETH (if needed). + - Register `ENDUSER` role (attempts via Admin key; logs warning if no permission). + - Mint `cPNTs` tokens (for SuperPaymaster). + - Deposit tokens to Paymaster V4 (if needed). +3. **Action**: Calculates the AA address (undeployed). +4. **Submission**: Uses `SuperPaymasterClient` (with factory support) to deploy and execute a gasless transaction in one step. + +> **Note**: Requires `PRIVATE_KEY` (Deployer) or `PRIVATE_KEY_ANNI` in `.env.sepolia` to have Admin/Minter privileges. If specific permissions fail (like GrantRole), the script attempts to proceed. + +### 4. Code Sample: Using Faucet & KMS +For a complete example of how to combine the Faucet (for setup) and a Mock KMS (for signing), refer to `scripts/test-kms-gasless.ts`. + +#### Faucet Setup (One-Time) +```typescript +import { SepoliaFaucetAPI } from '@aastar/core'; + +await SepoliaFaucetAPI.prepareTestAccount( + adminWallet, // WalletClient with Admin Key + publicClient, + { + targetAA: '0x...', + token: '0x...', // GToken Address + registry: '0x...', // Registry Address + // Optional: + tokenAmount: parseEther('1000') + } +); +``` + +#### KMS / Remote Signer Integration +To use a remote signer (AWS KMS, Fireblocks, MPC), creates a custom `viem` account. + +```typescript +import { toAccount } from 'viem/accounts'; + +const remoteSigner = toAccount({ + address: '0xYourWalletAddress', + async signMessage({ message }) { + // message.raw is the UserOpHash + const sig = await myKmsClient.sign(message.raw); + // Ensure signature is valid 65-byte hex (r, s, v) + return sig; + }, + async signTransaction(tx) { + throw new Error("Not supported for Gasless"); + } +}); + +const wallet = createWalletClient({ account: remoteSigner, ... }); + +// Pass this wallet to SuperPaymasterClient +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction(..., wallet, ...); +``` + + +--- + +## Appendix: Real Transaction Analysis + +Below is an analysis of a fulfilled Gasless Transaction (executed via `l4-test-jason1-gasless.ts` on Sepolia). + +**Transaction Hash**: `0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb` +**Etherscan Link**: [View on Sepolia Etherscan](https://sepolia.etherscan.io/tx/0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb) + +### Data Breakdown + +| Field | Value / Description | Interpretation | +| :--- | :--- | :--- | +| **Status** | `Success` | The transaction was mined and executed successfully. | +| **From** | `0x4a1627CACf9bFb16ed955738b9932d511644e489` (Bundler EOA) | The Bundler/Relayer that submitted the batch. This is NOT the user. | +| **To** | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` (EntryPoint v0.7) | The central EntryPoint contract that constructs and executes the AA call. | +| **Transaction Action** | Transfer 0.1 dPNTs | The verified "User Intent". The AA account successfully called the Token contract. | +| **ERC-20 Tokens** | `0xECD9C07f648B09CFb78906302822Ec52Ab87dd70` (Jason AA1) → `0xEcAACb915f7D92e9916f449F7ad42BD0408733c9` (Anni) | **The Core Action**: Jason AA1 transferred 0.1 dPNTs to Anni. | +| **Gas Usage** | `165,824` / `409,844` (40.46%) | The Paymaster sponsored the gas. The Bundler overestimated (Limit), but actual usage was fair. | +| **Internal Txns** | Transfer 0.0000189 ETH (Refund) | The **Paymaster** (via EntryPoint) refunding the Bundler for the ETH gas cost. | +| **Burnt Fees** | `0.00000000047...` ETH | The portion of the gas fee burnt by the network (EIP-1559). | + +### Key Takeaways +1. **User Pays Zero ETH**: The `From` address (Bundler) paid the ETH gas. The Internal Transaction shows the Bundler getting reimbursed. +2. **User Spent dPNTs**: The `ERC-20 Token Transfer` shows the user moving `dPNTs`. This likely covers the service fee (gas + premium) in a real "Pay with Token" model, though in this "Gasless" mode, the dPNTs might just be the payload or a separate fee payment. +### Frequently Asked Questions (Analysis) + +#### 1. Why is "From" the Bundler, not the User? +In Account Abstraction (ERC-4337), the User does not send the transaction directly. +- **The Envelope**: The Bundler (`0x4a16...`) sends the Ethereum Transaction to the `EntryPoint`. They pay the ETH gas. +- **The Letter**: The `EntryPoint` opens the envelope and executes your **UserOperation**. +- **The Result**: Etherscan shows the "Envelope" (Bundler -> EntryPoint) as the top-level transaction. Your action (Token Transfer) is an *Internal Transaction* or *Log Event* triggered inside. + +#### 2. Where is the Gas Fee? "Value: 0 ETH"? +- The `Transaction Fee` shown on Etherscan (e.g., 0.000016 ETH) is paid by the **Bundler**. +- The **Paymaster** refunds the Bundler (visible in "Internal Transactions" as a transfer from Paymaster to Bundler). +- **Your Cost (in Tokens)**: Since this Paymaster uses a "Deposit Model", the fee is deducted from your internal balance within the Paymaster contract. + - **Visibility**: This deduction does NOT show up as an ERC-20 Transfer (because tokens didn't move wallets, only internal counters changed). + - **Verification**: Look at the **Logs** tab for the `PostOpProcessed` event. It explicitly lists `tokenCost` (the amount of dPNTs deducted). + +#### 3. Why is there only one ERC-20 Transfer? +- The transfer you see (`0.1 dPNTs` from Jason to Anni) is your **Actual execution payload**. +- If the Paymaster used "Token Paymaster Mode 1" (pulling tokens from your wallet), you would see a second transfer for the fee. +#### 4. "I can't see the Deducted Amount!" (How to Read Logs) +You mentioned you couldn't find the deduction. It is in **Log Index 2** (on Etherscan Logs tab). +- **Event Signature (Topic 0)**: `0x62544d7f...` (`PostOpProcessed`). +- **Data Field**: Contains 3 values (32 bytes each). + 1. **ActualGasCost (ETH)**: `0xc5ba77775be` -> `0.00001358 ETH` (The actual reimbursed amount). + 2. **TokenCost (dPNTs)**: `0x99ffeb21efcb3b` -> `43346900000000000` (Raw Units). + - Assuming 18 decimals: **0.0433469 dPNTs**. + 3. **ProtocolRevenue**: Same as above (no markup in this test). + +**Summary**: Your deposit was deducted by **0.0433 dPNTs**. diff --git a/0.16.23/guide/TEST_COMMANDS.md b/0.16.23/guide/TEST_COMMANDS.md new file mode 100644 index 000000000..2ada0bcd6 --- /dev/null +++ b/0.16.23/guide/TEST_COMMANDS.md @@ -0,0 +1,320 @@ +# 🚀 AAStar SDK 测试命令完整指南 + +本文档提供所有测试命令的详细说明,包括如何在不同网络间切换。 + +--- + +## 📋 快速参考 + +### 主要测试命令 + +| 命令 | 用途 | 网络依赖 | 时间 | +|------|------|---------|------| +| `pnpm run test:full_anvil` | 完整协议回归(72场景) | Anvil专用 | 5-10分钟 | +| `pnpm run test:full_sdk` | SDK功能验证(6场景) | **任意网络** | ~30秒 | +| `pnpm run test:init` | 环境初始化 | Anvil | ~2分钟 | + +--- + +## 🌐 网络切换指南(适用于 `test:full_sdk`) + +`test:full_sdk` 可以在任意EVM网络上运行,只需修改配置文件: + +### 方法1: 使用不同的 `.env` 文件 + +#### 步骤1: 创建网络专用配置文件 + +```bash +# Sepolia测试网配置 +cp .env.v3 .env.sepolia + +# Mainnet配置 +cp .env.v3 .env.mainnet +``` + +#### 步骤2: 编辑配置文件 + +**`.env.sepolia` 示例**: +```bash +# 网络RPC +RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY + +# 管理员私钥(请从加密存储中读取,不要硬编码!) +ADMIN_KEY=0x... + +# Sepolia上的合约地址 +REGISTRY_ADDRESS=0x1234... +GTOKEN_ADDRESS=0x5678... +GTOKEN_STAKING_ADDRESS=0x9abc... +SUPER_PAYMASTER_ADDRESS=0xdef0... +APNTS_ADDRESS=0x1111... +MYSBT_ADDRESS=0x2222... +``` + +**`.env.mainnet` 示例**: +```bash +# Mainnet RPC +RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY + +# 管理员私钥 +ADMIN_KEY=0x... + +# Mainnet合约地址 +REGISTRY_ADDRESS=0xMainnetRegistry... +GTOKEN_ADDRESS=0xMainnetGToken... +GTOKEN_STAKING_ADDRESS=0xMainnetStaking... +SUPER_PAYMASTER_ADDRESS=0xMainnetPaymaster... +APNTS_ADDRESS=0xMainnetAPNTs... +MYSBT_ADDRESS=0xMainnetSBT... +``` + +#### 步骤3: 运行测试时指定配置 + +修改 `scripts/99_final_v2_regression.ts` 第26行: + +```typescript +// 默认(Anvil本地) +dotenv.config({ path: path.resolve(process.cwd(), '.env.v3') }); + +// 切换到Sepolia +dotenv.config({ path: path.resolve(process.cwd(), '.env.sepolia') }); + +// 切换到Mainnet +dotenv.config({ path: path.resolve(process.cwd(), '.env.mainnet') }); +``` + +--- + +### 方法2: 使用环境变量覆盖(推荐) + +无需修改代码,直接在命令行传递参数: + +```bash +# Sepolia测试 +RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY \ +ADMIN_KEY=0xYourKey \ +REGISTRY_ADDRESS=0x... \ +pnpm run test:full_sdk + +# Mainnet测试(只读操作) +RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY \ +ADMIN_KEY=0xYourKey \ +REGISTRY_ADDRESS=0x... \ +pnpm run test:full_sdk +``` + +--- + +### 方法3: 创建网络专用脚本(最佳实践) + +在 `package.json` 中添加: + +```json +{ + "scripts": { + "test:sdk:sepolia": "dotenv -e .env.sepolia -- tsx scripts/99_final_v2_regression.ts", + "test:sdk:mainnet": "dotenv -e .env.mainnet -- tsx scripts/99_final_v2_regression.ts" + } +} +``` + +然后安装 `dotenv-cli`: +```bash +pnpm add -D dotenv-cli +``` + +使用: +```bash +pnpm run test:sdk:sepolia +pnpm run test:sdk:mainnet +``` + +--- + +## 📝 详细命令说明 + +### 1. **完整协议回归测试** - `test:full_anvil` + +```bash +pnpm run test:full_anvil +``` + +**特点**: +- 🔄 自动重启Anvil(干净状态) +- 📦 自动部署所有合约 +- 🔄 自动同步配置和ABI +- 🧪 运行17个独立测试脚本 +- ⚠️ **仅支持Anvil**(使用 `anvil_setBalance`, `anvil_impersonateAccount` 等特殊功能) + +**覆盖范围**: +- 72个完整场景 +- 95%分支覆盖率 +- 包含所有协议功能(Admin、Staking、Slashing、Credit、DVT、SBT等) + +**适用场景**: +- 本地开发验证 +- CI/CD集成测试 +- 完整功能回归 + +--- + +### 2. **SDK功能验证** - `test:full_sdk` + +```bash +pnpm run test:full_sdk +``` + +**特点**: +- 🌐 **支持任意EVM网络**(Anvil/Sepolia/Mainnet) +- 🚀 快速执行(~30秒) +- 🔍 验证SDK核心架构 +- ✅ 自动初始化(检测Anvil,自动运行 `test:init`) + +**测试场景** (6个核心): +1. ✅ Operator Staking (质押) +2. ✅ Paymaster Deposit (存款-Push模式) +3. ✅ Community Registration (社区注册) +4. ✅ SBT Minting (SBT铸造) +5. ✅ Admin Slashing (惩罚) +6. ✅ Credit Query (信用查询) + +**网络切换**: 参见上方 [🌐 网络切换指南](#🌐-网络切换指南(适用于-test_full_sdk)) + +--- + +### 3. **环境初始化** - `test:init` + +```bash +pnpm run test:init +``` + +**功能**: +- 重启Anvil节点 +- 部署所有合约到本地 +- 提取ABI到 `packages/core/src/abis/` +- 同步配置到 `.env.v3` + +**用途**: +- 手动调试前的环境准备 +- 合约更新后重新部署 + +--- + +### 4. **专项测试命令** + +#### 协议管理测试 +```bash +pnpm run test:admin +``` +测试角色配置、费用设置、暂停等管理功能。 + +#### 信用系统测试 +```bash +pnpm run test:credit +``` +测试信用限额、债务跟踪、自动还款。 + +#### 重入攻击测试 +```bash +pnpm run test:reentrancy +``` +测试重入保护机制。 + +--- + +## 🔧 常见问题排查 + +### 问题1: SDK测试失败,提示 "Contract not found" + +**原因**: 合约地址在目标网络上不存在 + +**解决**: +```bash +# 1. 检查.env配置 +cat .env.v3 + +# 2. 验证合约是否部署 +cast code $REGISTRY_ADDRESS --rpc-url $RPC_URL + +# 3. 如果未部署,需先部署合约(Sepolia/Mainnet) +cd ../SuperPaymaster +forge script script/v3/DeployV3Sepolia.s.sol --rpc-url $SEPOLIA_RPC --broadcast +``` + +### 问题2: RPC速率限制 + +**解决**: 使用付费RPC节点(Alchemy/Infura)或降低并发: + +```typescript +// 在测试脚本中添加延迟 +await new Promise(resolve => setTimeout(resolve, 1000)); // 1秒延迟 +``` + +### 问题3: Gas不足(Sepolia/Mainnet) + +**解决**: 确保测试账户有足够ETH: + +```bash +# 查看余额 +cast balance $ADMIN_ADDRESS --rpc-url $RPC_URL + +# Sepolia水龙头 +# https://sepoliafaucet.com/ +# https://www.alchemy.com/faucets/ethereum-sepolia +``` + +--- + +## 📊 测试覆盖率对比 + +| 测试套件 | 场景数 | 分支覆盖 | 网络支持 | 执行时间 | +|---------|-------|---------|---------|---------| +| `test:full_anvil` | 72 | 95% | Anvil | 5-10分钟 | +| `test:full_sdk` | 6 | SDK核心 | **任意** | ~30秒 | +| 专项测试 | 1-5/个 | 特定功能 | 视情况 | 10-60秒 | + +--- + +## 🎯 推荐工作流 + +### 本地开发 +```bash +# 1. 启动环境 +pnpm run test:init + +# 2. 快速SDK验证 +pnpm run test:full_sdk + +# 3. 完整回归(发版前) +pnpm run test:full_anvil +``` + +### 测试网验证 +```bash +# 1. 配置Sepolia环境 +cp .env.v3 .env.sepolia +# 编辑 .env.sepolia,填入Sepolia合约地址 + +# 2. 运行SDK测试 +dotenv -e .env.sepolia -- pnpm run test:full_sdk +``` + +### 生产环境只读验证 +```bash +# 仅查询,不执行交易 +RPC_URL=https://eth-mainnet.g.alchemy.com/v2/KEY \ +REGISTRY_ADDRESS=0xMainnetAddr \ +pnpm run test:full_sdk +``` + +--- + +## 🔗 相关资源 + +- **SDK开发指南**: [`README.md`](../README.md) +- **合约部署**: [`../SuperPaymaster/README.md`](../../SuperPaymaster/README.md) +- **架构设计**: [`docs/task_breakdown.md`](./task_breakdown.md) + +--- + +**由 AAStarCommunity 维护 | 最后更新: 2025-12-24** diff --git a/0.16.23/guide/TEST_COVERAGE_MATRIX.md b/0.16.23/guide/TEST_COVERAGE_MATRIX.md new file mode 100644 index 000000000..4abb12241 --- /dev/null +++ b/0.16.23/guide/TEST_COVERAGE_MATRIX.md @@ -0,0 +1,72 @@ +# SDK测试覆盖率矩阵 + +## 当前覆盖状态 (scripts/99_final_v2_regression.ts) + +### 角色覆盖率: 100% (4/4) + +| 角色 | 客户端 | 已覆盖场景 | 缺失场景 | 覆盖率 | +|------|--------|-----------|---------|--------| +| **运营商** | OperatorClient | Staking, Deposit (Push) | Withdraw, Pull Deposit, Treasury管理 | 40% | +| **社区** | CommunityClient | Registration, SBT Minting | xPNTs部署, 声誉规则配置, SBT空投 | 33% | +| **终端用户** | EndUserClient | Credit Query | Gasless Transaction, 债务还款 | 20% | +| **管理员** | AdminClient | Slashing | 全局参数, DVT配置, 费用调整 | 25% | + +### 用户场景覆盖率: 100% (17/17) ✅ **Phase 2 完成** + +#### ✅ 已覆盖场景 (6个) + +1. **Operator Staking** - 运营商质押GToken +2. **Paymaster Deposit (Push)** - 运营商存款(Push模式) +3. **Community Registration** - 社区注册 +4. **SBT Minting** - SBT铸造(通过registerRoleSelf) +5. **Admin Slashing** - 管理员惩罚 +6. **Credit Query** - 信用额度查询 + +#### ❌ 缺失场景 (5个 - Phase 2) + +**运营商场景** (2个): +13. Operator Pull Deposit - Pull模式存款 +14. Treasury Management - 国库地址管理 + +**社区场景** (1个): +15. Community Pause - 暂停/恢复社区 + +**管理员场景** (2个): +16. Global Parameters - 全局参数调整(完整实现) +17. Fee Configuration - 费用配置 + +--- + +## 扩展计划 + +### Phase 1: 核心场景补充 (优先级: P0) + +添加以下6个高优先级场景到 `99_final_v2_regression.ts`: + +1. **Operator Withdraw** - 验证提款逻辑 +2. **xPNTs Deployment** - 社区代币部署 +3. **Gasless Transaction** - 终端用户无Gas交易 +4. **Reputation Rules** - 声誉规则配置 +5. **SBT Airdrop** - 批量空投 +6. **Global Parameters** - 全局参数调整 + +### Phase 2: 完整覆盖 (优先级: P1) + +添加剩余5个场景,达到95%覆盖率 (16/17)。 + +--- + +## 目标 + +- **角色覆盖**: 100% (已达成) +- **场景覆盖**: 95% (16/17) - 当前35% (6/17) +- **分支覆盖**: 90%+ (核心逻辑) + +--- + +## 实施状态 + +- [x] 创建覆盖率矩阵文档 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 1) - 70%覆盖率达成 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 2) - **100%覆盖率达成** 🎉 +- [x] 验证100%覆盖率达成 diff --git a/0.16.23/guide/TODO_SDK_COVERAGE.md b/0.16.23/guide/TODO_SDK_COVERAGE.md new file mode 100644 index 000000000..07fd21612 --- /dev/null +++ b/0.16.23/guide/TODO_SDK_COVERAGE.md @@ -0,0 +1,55 @@ +# SDK Testing Coverage TODO + +This document tracks the test cases and scenarios that were skipped or identified for future coverage during the SDK regression enhancement phase (v2.1.0). + +## 1. Skipped Scenarios: Test 5 (V2 Regression) + +Test 5 in `run_sdk_regression.sh` was skipped due to persistent `RoleAlreadyGranted` errors arising from local blockchain state conflicts. + +### Tracked Interfaces +- `Registry.registerRoleSelf(bytes32 roleId, bytes roleData)` +- `SuperPaymaster.notifyDeposit(address community, uint256 amount)` + +### Background Context +The test attempts to register the `ROLE_COMMUNITY` and `ROLE_PAYMASTER_SUPER` roles. Even with `hasRole` guards, the transaction reverts if the address is already registered in a previous run with different metadata or state. + +### Action Plan +- **Status Update (2025-12-26)**: Even after synchronizing `ROLE_COMMUNITY` and `ROLE_PAYMASTER_SUPER` hashes across the SDK and contracts, the `RoleAlreadyGranted` error persists. This confirms a deep-seated blockchain state conflict where the test address is already registered in a way that bypasses simple hash-existence checks. +- [ ] Reset local Anvil state (`forge script scripts/SetupV3...` with fresh accounts). +- [ ] Re-enable Test 5 in `run_sdk_regression.sh`. +- [ ] Verify `notifyDeposit` balance updates on-chain. + +## 2. Technical Debt: Core Constants Synchronization + +- **Role Hash Discrepancy**: Standardize the generation of hashes across `core/constants.ts` and `Registry.sol`. +- **Wallet Client Export**: `createAAStarWalletClient` is currently omitted from `core` in favor of SDK-level role clients (`createAdminClient`). Evaluate if a generic public wallet constructor belongs in `core`. + +--- + +## 3. SDK 完备性核实与进阶优化 (2025-12-26 源码审计更正) + +经过对 SDK 源码的深度检索,核实多项安全审计报告(`12-26-2sdk-audit.md`)中提到的“缺失项”**实际上已经实现**。以下是修正后的技术现状与优化计划: + +### 3.1 Paymaster V4 管理端 (🔴 已实现,待集成验证) +- **现状核实**: 源码中已存在 `addGasToken`、`addSBT`、`withdrawPNT` 等接口(见 `packages/core/src/actions/paymasterV4.ts`)。 +- **后续行动**: + - [ ] **场景集成**: 在 Phase 3 的场景测试中,正式调用这些接口执行“管理员配置 Paymaster”的流程,确保 Sepolia 集成无误。 + - [ ] **文档补全**: 确保这些接口在开发者指南中清晰可见。 + +### 3.2 SuperPaymaster V3 动态定价 (🟠 已实现,待开启测试) +- **现状核实**: `setXPNTsFactory` 接口已在 `SuperPaymasterClient` 和 `core` action 中定义。 +- **后续行动**: + - [ ] **全链路验证**: 在 Sepolia 环境下开启该功能,验证 SDK 能否正确配合 Factory 进行 Gas 定价。 + +### 3.3 BLS 签名与 DVT 工具链 (🟠 已实现核心,待易用性增强) +- **现状核实**: `core/src/crypto/blsSigner.ts` 已包含 `BLSSigner` 工具类。 +- **后续行动**: + - [ ] **DVT 助手封装**: 在 `packages/dvt`(如后续拆分)中提供更高层的业务助手,进一步简化 `executeSlashWithProof` 的参数构造。 + +### 3.4 API 安全性与权限限制 (🟡 已标记,待物理隔离) +- **现状核实**: `StakingActions.lockStake` 已经添加了 `@internal` 注解和明确的警告。 +- **后续行动**: + - [ ] **物理隔离**: 考虑在未来的重构中将管理员相关的 Actions 从公共 Client 中完全剥离,实行物理上的权限解耦。 + +--- +*上次更新: 2025-12-26 (基于 SDK 源码深度审计结果)* diff --git a/0.16.23/guide/USER_CASE_DESIGN.md b/0.16.23/guide/USER_CASE_DESIGN.md new file mode 100644 index 000000000..b8f100494 --- /dev/null +++ b/0.16.23/guide/USER_CASE_DESIGN.md @@ -0,0 +1,110 @@ +# SDK 场景化案例设计 (User Case Design) + +本文档借鉴 `registry` 前端项目的用户交互逻辑,提取核心业务链路,设计了 SDK 在 Phase 3 (Sepolia) 阶段的场景化测试用例。我们的目标是**参考前端体验、沉淀 SDK 模式 (Orchestration Patterns)**,而非简单的接口复用。 + +## 场景角色定义 + +1. **Protocol Admin (协议管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,进行后续的全局配置、DVT 验证器管理、治理代币发行等。 +2. **Community Admin (社区管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,负责社区注册、xPNTs 发行、SBT 会员规则设定。 +3. **PM Operator (Paymaster 操作员)**: 部署时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 Paymaster 节点运维、质押充值、费用管理等。多数时候,早期社区管理员和Operator是一个EOA。 +4. **SuperPaymaster Operator**: 注册时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 SuperPaymaster参数配置和国库管理。多数时候,早期社区管理员和Operator是一个EOA。 +5. **DVT(Node) Operator**: 部署时期是一个EOA,完成部署后,**可选**交接给其他EOA或者自动Rotate 账户,负责 DVT 参数配置和治理代币管理。 +6. **EndUser (终端用户)**: 参与社区、获取 SBT 身份、使用社区信用进行 Gasless 交易。 + +--- + +## 核心测试用例 (Business Scenarios) +背景信息: +- GToken在测试阶段,来自于协议Admin直接铸造空投。 +- 未来GToken来自于独立的阶梯价格销售(Mint)合约/应用。 +- xPNTs在测试阶段,来自于社区Admin铸造空投。 +- 未来xPNTs来自于社区发行+Reputation机制+任务广场。 +- SBT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来SBT来自于社区Shops+Reputation机制+任务广场。 +- NFT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来NFT来自于社区Shops+Reputation机制+任务广场。 + +### 用例 1:社区“全流程”自动化 (DAO Launchpad Pattern) +**参考自**: `RegisterCommunity.tsx` +- **设计思路**: 前端是分步引导,SDK 应提供“原子组合”能力。模拟社区从 0 到 1 的全过程:授权 -> 质押 -> 基准配置 -> 关联 SBT。 +- **SDK 验证重点**: + - 组合调用:`GTokenClient` 与 `RegistryClient` 的无缝状态桥接。 + - `RegistryClient.registerCommunityWithAutoStake` + - 验证 `ContractConfigManager` 是否正确识别新注册的社区配置。 + - 社区发行自己的xPNTs,NFT。 + +### 用例 2:Paymaster 节点部署向导 (Operator Wizard) +**原型参考**: `DeployWizard.tsx` (3-Step Flow) +- **业务流程**: 操作员选择模式(AOA/AOA+)-> 资源自检(GToken 余额、质押状态)-> 部署合约并充值。 +- **SDK 验证重点**: + - `OperatorClient.checkResources` (模拟前端资源自检逻辑) + - `PaymasterFactory.deployPaymaster` + - `OperatorClient.depositCollateral` +- **预期结果**: 完成后,Operator拥有独立的`Paymaster`节点和 Gas Token(xPNTs),或者在 `SuperPaymaster` 的 aPNTs 余额可见且可用于支持自己社区成员使用xPNTs代付。 + +### 用例 3:用户身份获取与信誉激活 (SBT & Reputation) +**原型参考**: `GetSBT.tsx`, `MySBT.tsx` +- **业务流程**: 用户选择社区 -> 自动质押 0.4 GT -> 铸造 MySBT -> 查看全局信誉分。 +- **SDK 验证重点**: + - `EndUserClient.mintSBT` (包含 auto-stake 逻辑) + - `ReputationClient.getGlobalReputation` + - `RegistryClient.getCreditLimit` (验证信誉分是否正确转化为信用额度) + +### 用例 4:纯净 Gasless 交易体验 (Ultimate Gasless UX) +这也是我们PhD paper获取实验数据的阶段,包括baseline(EOA和Pimlico Paymaster,以及业界平均统计成本)和两个对比实验(Paymaster V4和SuperPaymaster)。 +**原型参考**: `DeveloperPortal.tsx` (集成示例) +- **业务流程**: 一个没有任何 ETH 的新账户,使用社区发放的 SBT 凭证,通过 SDK 发送一笔交易。 +- **SDK 验证重点**: + - `createEndUserClient` 初始化(无私钥签名模式或智能账户模式) + - `getSuperPaymasterMiddleware` 后台自动构建 `userOp.paymasterAndData` + - 验证 `SuperPaymaster` 的 `postOp` 阶段是否正确扣除用户信用或 xPNTs 代币。 + + +### 基础用例整合(后续TODO) +我们期望能够整合基础用例,给用户(社区)提供自主自助的launchpad以及管理平台。 +🎫 +Get GToken +Get protocol access permission GToken, become protocol member, join permissionless, quit anytime freely + +Get → +🏛️ +Register Community +Create and register your community on the AAstar Network + +Register → +💎 +Deploy xPNTs +Create your community gas token for payment abstraction + +Deploy → +🚀 +Launch Paymaster +Deploy your Paymaster contract and start serving gasless transactions to your community + +Launch Paymaster → → + +### 用例 X:更多用例,持续加入(后续TODO,不加入开发) + 用例 5:危机管理与 DVT 治理 (Governance & Slashing) +**原型参考**: `AdminBatchMint.tsx` (管理入口) +- **业务流程**: 管理员发现恶意行为 -> DVT 节点投票 -> 执行对社区质押额的 Slash。 +- **SDK 验证重点**: + - `DVTClient.proposeSlash` + - `DVTClient.signSlash` (模拟多节点聚合签名) + - `AdminClient.executeSlash` +--- + +## 开发计划 (Implementation Plan - 阶段 3) + +### 第一步:Sepolia 环境就绪 +- 部署全套合约 (V3.3.0+) 至 Sepolia。 +- 使用 `forge verify-contract` 完成 Etherscan 验证。 +- 更新 SDK `constants.ts` 中的 Sepolia 合约地址。 + +### 第二步:场景化示例开发 +- 在 `examples/` 目录下按上述 4 个用例创建独立的 目录和TS 脚本。 +- 编写配套的中文文档注释,确保其作为“开发者指南”的使用价值。 +- 结合SuperPaymaster Readme中的数据收集计划,完成PhD paper的数据收集。这部分可以独立目录。 + +### 第三步:全流程冒烟测试 +- 运行 `pnpm run test:sepolia` (新增脚本)。 +- 输出场景执行记录,作为 Phase 3 的交付证明。 diff --git a/0.16.23/guide/Verifier_L4_Gasless_Plan.md b/0.16.23/guide/Verifier_L4_Gasless_Plan.md new file mode 100644 index 000000000..0b4e5d03d --- /dev/null +++ b/0.16.23/guide/Verifier_L4_Gasless_Plan.md @@ -0,0 +1,454 @@ +# L4 无 Gas 交易验证测试计划 (L4 Gasless Transaction Verification Plan) + +本文档详细描述了在 Sepolia和其他网络参数的验证无 Gas 交易(Gasless Transactions)的详细步骤和要求。 +一些信息和要求: +1. L4是run_sdk_regression.sh 整体回归脚本的一部分,完成gasless的账户数据check和准备和交易测试。 +2. 所有私钥、RPC等私密信息,来自于根目录的.env.sepolia(或者对应的网络,例如.env.op-sepolia, .env.mainnet, .env.anvil) +3. 使用SDK 提供的合约ABI(来源是根目录的abis) +4. 所有合约地址来自于根目录的config.sepolia.json(或者对应的config.network.json),包括唯一hash。 +5. 所有L4的数据准备、检查、初始化和交易测试,要求是幂等的,即可以重复执行,不会对系统和要进行的测试计划造成影响。 +6. L4 测试的目标,是使用L1,L2,L3积累和验证过的API(就是根目录的 run_sdk_regression.sh),来完成可重复的gasless交易全过程。 +7. 兼容不同网络参数:sepolia, mainnet, op-sepolia, anvil等等,但是对于anvil,L4模拟entrypoint和useroperation有一定限制,我建议L4跳过anvil的测试,你来评估是否合理。 +8. 检查、生成和初始化,然后记录log或者config并输出测试准备结果 +9. 如果API没有需要的能力,则添加API,全部使用API能力完成数据准备校验初始化和gasless交易全过程。 +10. 如果API报错,则修复,全部使用API能力 +11. 可以参考SDK的ABI和合约代码来调试 +12. 语义化函数名,避免类似getBalance, deposit, withdraw, mint, burn等太通用的函数名,使用反映业务场景的名字,例depositAPNTsToSuperPaymaster,当然不一定这个名字,但要语义化,场景匹配。 +## 1. 测试账户准备 (Test Accounts) + +需要在 `.env.sepolia` 中配置以下账户私钥: + +1. **供应商账户 (Supplier)** + * **Env Var**: `PRIVATE_KEY_SUPPLIER` + * **用途**: 提供测试 ETH (ETH Supplier),同时也是 GToken 合约的所有者 (Owner)。 + +2. **社区运营者 (Operators - EOAs)** + * 需在 `.env.sepolia` 中添加以下私钥 (如果不存在则生成): + * `PRIVATE_KEY_JASON` (Admin for AAStar Community) -> 负责部署 aPNTs + * `PRIVATE_KEY_BOB` (Admin for Bread Community) -> 负责部署 bPNTs + * `PRIVATE_KEY_ANNI` (Admin for Demo Community) -> 负责部署 cPNTs & SuperPaymaster 操作 + +3. **测试 AA 账户 (AA Users)** + * **生成方式**: 使用 Jason, Bob, Anni 的私钥作为 Signer 生成 EntryPoint v0.7 兼容的 Smart Accounts。 + * **数量**: 6 个 (每个 Operator 对应 2 个,或者混合使用)。 + +## 2. 环境初始化要求 (Initialization Requirements) + +这些步骤作为“一次性准备工作”运行(One-time Setup),将通过 `scripts/l4-setup.ts` 完成。 + +### 2.1 资金分发 (Funding) +1. **GToken 分发**: 使用 Supplier Key (Owner) 铸造 (Mint) GToken: + * 给 **Jason**: 100,000 GToken (Stake for PaymasterV4) + * 给 **Bob**: 100,000 GToken (Stake for PaymasterV4) + * 给 **Anni**: **200,000 GToken** (100k for Community Stake + Extra for SuperPaymaster Stake/Deposit) +2. **ETH 分发**: 使用 Supplier Key 发送测试 ETH 给 3 个 Operator (确保足够 Gas 用于部署合约)。 + +### 2.2 社区与代币启动 (Community & Token Launch) +1. **AAStar Community (Jason)** + * 注册社区。 + * 部署社区代币 **aPNTs**。 + * 部署 **PaymasterV4** (常规 Paymaster)。 + * **Action**: Mint 100,000 aPNTs 给 Anni (用于 Anni 的 SuperPaymaster 存款)。 +2. **Bread Community (Bob)** + * 注册社区。 + * 部署社区代币 **bPNTs**。 + * 部署 **PaymasterV4** (常规 Paymaster,接受 bPNTs)。 +3. **Demo Community (Anni)** + * 注册社区。 + * 部署社区代币 **cPNTs**。 + +### 2.3 Paymaster 启动 +1. **Launch PaymasterV4s**: 确保 Jason 和 Bob 的 PaymasterV4 已部署并存入 ETH (Gas) 和 GToken (Stake)。 +2. **Launch SuperPaymasterV3**: 确保系统中有两个 SuperPaymasterV3 实例(只需在 Registry 注册)。 +3. **Anni's SuperPaymaster Setup**: + * Anni 使用额外 GToken 和 ETH 注册/启动一个 SuperPaymaster。 + * Anni 将 **aPNTs** (来自 Jason) 存入 SuperPaymaster 作为 Credit (Deposit)。这是 SuperPaymaster 在全局账本中的抵押品。 + +## 3. L4 无 Gas 交易测试场景 (Test Scenarios) + +### 3.1 预备步骤 (Preparation for AA) +1. **GToken Mint**: 给所有 测试 AA 账户 Mint 1,000 GToken (Source: Supplier)。 +2. **xPNTs Mint**: 使用对应的 Operator 给相关 AA 账户 Mint 10,000 个 aPNTs, bPNTs, cPNTs。 +3. **SBT & Deposit**: + * 确保所有 AA 账户拥有 MySBT (通过注册任意社区获取)。 + * 确保所有 AA 账户已存入 10,000 xPNTs 到对应的代币合约/社区 (Deposit)。 + +### 3.2 社区注册测试 (Community Registration via AA) +使用生成的 AA 账户测试注册流程: +1. **Case 1 (With ETH)**: 账户有测试 ETH -> 注册成功。 +2. **Case 2 (Gasless)**: 账户无测试 ETH -> 注册成功 (使用 Paymaster)。 +3. **Case 3 (First Time)**: 首次注册。 +4. **Case 4 (Re-register)**: 二次注册 (Re-register)。 +5. **Case 5 (Idempotency)**: 三次注册 (检查幂等性)。 + +### 3.3 PaymasterV4 交易 (常规代币 Gas) +1. **AAStar Paymaster (aPNTs)**: + * AA 账户 (Signer: Jason/Anni) 使用 **aPNTs** 支付 Gas。 + * 通过 AAStar 的 PaymasterV4 发起交易。 + * 验证:成功,扣除 AA 的 aPNTs。 +2. **Bread Paymaster (bPNTs)**: + * AA 账户使用 **bPNTs** 支付 Gas。 + * 通过 Bread Community 的 PaymasterV4 发起交易。 + * 验证:成功,扣除 AA 的 bPNTs。 + +### 3.4 SuperPaymasterV3 交易 (Demo Community - Credit System) +目标:测试信用 (Credit)、债务 (Debt) 和 偿还 (Repayment) 逻辑。 +配置:Demo Community Operator (Anni) 部署的 SuperPaymaster。 + +1. **Tx 1: cPNTs Payment (Normal)**: + * AA 账户使用 **cPNTs** 支付。 + * 发起 Gasless 交易。 + * 验证: + * AA 的 cPNTs 余额减少。 + * SuperPaymaster 内 Demo Community 的 **aPNTs** 余额减少 (底层支付)。 + +2. **Tx 2: Insufficient cPNTs (Credit & Debt Test)**: + * **场景**: AA 账户没有足够的 cPNTs。 + * **前提**: 账户拥有足够的 Reputation。 + * **执行**: 连续发起 3 次交易。 + * **预期**: + * 系统给予 3 次免费交易额度 (Credit)。 + * 交易全部成功。 + * **关键验证**: 每次交易都在 cPNTs 合约中记录了 AA 的 **债务 (Debt)**,因为使用了 Credit。 + +3. **Tx 3: Run out of Credit (Blacklist/Limit)**: + * **场景**: 用完 3 次免费额度,继续尝试第 4 次交易。 + * **预期**: 交易失败 (run out of credit),或者被列入黑名单。 + +4. **Tx 4: Repayment**: + * **场景**: AA 账户充值 cPNTs。 + * **预期**: 系统自动优先偿还债务 (Pay Debt First)。检查余额是否正确反映了 (充值金额 - 债务)。 + +## 4. 后续步骤 +* 编写 `scripts/l4-setup.ts` 自动化上述初始化。 +* 编写 `tests/regression/l4-gasless.ts` 执行上述测试用例。 +* + +补充: +xPNTsFactory合约初始化会设置SuperPaymaster内置为超级账户,可以直接从任意xPNTsFactory部署的xPNTs合约转账gas需要的xPNTs到自己的账户,不用approve。不过也提供了安全校验,只能用来转gas费用。 + + +## 规则补充 +以下规则在aastar-sdk 项目生效 +第一,禁止创建便利性的脚本或者临时性的脚本用来什么检查余额、部署token、资助账户,这些都禁止,如果需要便利性脚本,参考第二条 +第二,所有过程必须使用使用我们的API,我们API有L1L2L3级别的API,都封装了基础能力,你为什么不用API,需要便利性脚本了,在test,utils模块下新增工具api,转化为可重复使用的api,为全回归测试做准备 +第三个,禁止产生任何编译的过程文件(如 .js, .d.ts, .map)。如果运行 ts 脚本,**必须使用 `npx tsx` 直接运行**,**绝不执行 `tsc` 或其他会产生文件的编译命令**。如果不慎产生,必须随后立即清理。 +第四,所有的环境变量配置,在根目录的.env.sepolia(不同网络,不同配置名称,例如.env.anvil, .env.op-sepolia, .env.mainnet,目前我们重点是在sepolia跑通全回归测试)。 +第五,全回归测试必须包含三个阶段,必须一步步完成,禁止未完成第一阶段,进入第二阶段,以此类推。 +其中,第一阶段,定义为合约环境检查,第二阶段,定义为初始化账户(EOA和AA)、社区、token、paymaster和superpaymaster,第三阶段,准备forge script dry run测试useroperation是否合格,然后测试和fix,完成gasless测试。 +以上所有阶段的实现,都在L4 test脚本实现,通过组织和调用L1,L2,L3的sdk api,实现关键动作,禁止借助外部临时api完成,任何步骤没有api实现了,check后可以新增api,原则参考第二条规则, 最后无法完成的,抛出报错。 +------ +以上规则的详细版本,在docs/Verifier_L4_Gasless_Plan.md,此规则为实现gasless回归测试为目标。 + + +## 合约验证 +**目标** +验证所有合约地址是否是最新版本,合约名称,版本号,部署日期,合约地址,都要输出和明确展示,验证是否完成了相互之间的依赖初始化。 +以上需要统计合约数量(指的是由本项目开发的合约和依赖合约),目前有如下合约: + 1. Registry 60 functions,全局注册表合约 + 2. SuperPaymaster 58 functions,唯一实例的多租户Paymaster,由AAStar社区维护 + 3. MySBT 49 functions,全局唯一SBT合约,白板MySBT协议,只有你可以自由涂抹 + 4. PaymasterV4_2 48 functions ,模板合约,reg在PaymasterFactory合约一个具体实现 + 5. xPNTsToken 37 functions 模板合约,immutable方式固化在了xPNTsFactory合约 + 6. GToken 18 functions,基础GToken合约,未来要改进为销售合约 + 7. GTokenStaking 28 functions,GToken的质押管理合约 + 8. xPNTsFactory 28 functions xPNTs合约注册到工厂,然后通过工厂部署具体实现proxy + 9. PaymasterFactory 24 functions paymaster某版本实现reg到工厂,use工厂部署实现proxy + 10. ReputationSystem 20 functions,信用系统 + 11. BLSAggregator 18 functions,BLS聚合器 + 12. DVTValidator 15 functions,DVT验证器 + 13. BLSValidator 2 functions,BLS验证器合约 +----------------------------------------------------------------- +14. SimpleAccount 17 functions,默认0.7版,外部依赖,符合entrypoint 0.7的合约账户 +15. SimpleAccountV08 17 functions,外部依赖,符合entrypoint 0.8的合约账户 +16. EntryPoint 22 functions,外部依赖,官方entrypoint +17. Simple7702Account 10 functions,外部依赖,符合entrypoint 0.7的合约账户 +18. SimpleAccountFactory 4 functions,外部依赖,符合entrypoint 0.7的合约账户工厂 +19. SimpleAccountFactoryV08 4 functions,外部依赖,符合entrypoint 0.8的合约账户工厂 +20. SenderCreator 3 functions,外部依赖,部署AA账户的工具合约 +21. UserOperationLib 3 functions,外部依赖,用户操作的工具合约 + + + +基于工厂部署的实例: + 1. aPNTs,基于xpntsFactory部署的标准实现,提供xpnts接口的具体实例,归属于AAStar社区 + 2. bPNTs,基于xpntsFactory部署的标准实现,提供xpnts接口的具体实例,归属于Bread社区,以此类推 + 3. PaymasterV4_2-Bread,归属于Bread社区,基于paymasterFactory部署的标准实现,提供paymaster接口的具体实例,以此类推 + 4. SuperPaymaster,归属于AAStar社区,全局唯一实例,提供superpaymaster服务的多租户合约(这个是特殊实例,只有一个) + +### 角色和信用等级 + 预置角色配置表 (Registry v3.1.1) +以下是合约构造函数中初始化的核心参数(金额单位均为 GToken/ETH 对应的 18 位小数): + +角色 (Role ID) 最小质押 (minStake) 进入销毁 (entryBurn) 退出费率 (exitFeeBP) 最小退出费 说明 +ROLE_COMMUNITY 30 ETH 3 ETH 500 (5%) 1 ETH 社区运营者基础角色 +ROLE_ENDUSER 0.3 ETH 0.05 ETH 1000 (10%) 0.05 ETH 终端用户角色 +ROLE_PAYMASTER_SUPER 50 ETH 5 ETH 1000 (10%) 2 ETH 超级支付主角色 +ROLE_PAYMASTER_AOA 30 ETH 3 ETH 1000 (10%) 1 ETH 常规 AOA 支付主 +ROLE_DVT / ROLE_KMS 30~100 ETH 3~10 ETH 1000 (10%) 1~5 ETH 基础设施节点角色 +[!NOTE] bra fee (entryBurn): 注册时立即扣除并销毁的部分。 stakeExit fee (exitFeeBP): 退出角色时从质押余额中扣除的比例(BP 为万分之一)。 + +C. 信用分等级与额度 (Credit Tiers) +系统根据 Reputation 分数自动划分等级,对应不同的 SuperPaymaster 信用额度: + +等级 (Level) 信誉分阈值 (Reputation) 信用额度 (Credit Limit) +Level 1 < 13 0 +Level 2 13 - 33 100 aPNTs +Level 3 34 - 88 300 aPNTs +Level 4 89 - 232 600 aPNTs +Level 5 233 - 609 1000 aPNTs +Level 6 610+ 2000 aPNTs +这就解释了为什么在 L4 测试中,我们需要先提升 AA 账户的 Reputation,才能触发 SuperPaymaster 的信用支付逻辑。 + +### 验证 +相互之间的依赖是否初始化完成,包括: +1. GToken是否是immutable变量在GTokenStaking合约中 +(Wiring Matrix) +* MySBT -> Registry +*  GTokenStaking -> Registry +*  xPNTsFactory -> SuperPaymaster +* Registry -> ReputationSystem (as Source) +* Registry -> BLSAggregator +* Registry -> BLSValidator +* SuperPaymaster -> xPNTsFactory +* SuperPaymaster -> BLSAggregator +* 依赖的设置分为immutable变量设置和依赖合约地址设置,immutable变量设置在合约初始化时设置,依赖合约地址设置在合约初始化时设置(部署者/管理员调用setter函数) + +两个方式完成合约验证:到superpaymaster项目目录,运行 forge script scripts/VerifyV3_1_1.s.sol 来验证 +或者到aastar-sdk项目目录,添加checkContract函数(借鉴VerifyV3_1_1.s.sol逻辑,我们重新编写,这个还没做,需要新增checkContract函数),来验证 +------- +TX requirements + +L4 test for gasless tx, but you must check the test accounts (EOA account as operators to launch new community and deploy community xPNTs like aPNTs and bPNTs; and as a test receiver, and test AA account with entrpoint 0.7 adaptable) and and requirements(MySBT, bPNTs) and community registered() and + +Test Accounts: + +1. PRIVATE_KEY_SUPPLIER in .env.sepolia as a Test ETH supplier +2. 3 EOA as community launcher(operator) : Jason, Bob, Anni, private key in .env.sepolia +3. 6 AA(entrypoint 0.7) accounts for gasless test, produced by API + +Requirements +1. Mint GToken(100000, using supplier key, it is also the GToken contract owner) to 3 EOA accounts +2. Transfer test ETH(using supplier key) to 3 EOA accounts for deployment. +3. launch three communities and token for test + 1. AAStar Community and aPNTs (Jason) + 2. breadCommunity with bPNTs (Bob) + 3. DemoCommunity with cPNTs (Anni) +4. Launch two PaymasterV4, new deployment with GToken and test ETH in EOA +5. Launch two SuperPaymasterV3, just register in registry with with GToken and test ETH +6. Use Anni to register (launch) a SuperPaymaster with extra GToken and test ETH and 100000 aPNTs in EOA + 1. deposit aPNTs to Super +7. All above is one time job for our later test, we can make a individual test shell to prepare. +8. if done this, record all data, contracts, community data, accounts for next step. + +Test 4 kinds of gasless tx: + +1. Mint GToken to all test AA accounts(1000 is enough) ,use supplier key +2. Mint a,b,cPNTs to all test AA account(10000 is enough), use the community operator key(Jason, Bob, Anni) +3. use AA accounts to register different community(above all ) + 1. with test ETH + 2. without test ETH + 3. first time register a community + 4. second time + 5. third time +4. All test AA accounts get MySBT (registered in any community) and deposited xPNTs(a,b, cPNTs) 10000. +5. Launch a tx in a PaymasterV4 by breadCommunity(they accept bPNTs as gas token). + 1. AA account with apnts, launch gasless tx with aastar’s paymaster V4(deployed by aastar operator) + 2. AA account with bpnts , launch gasless tx with breadCommunity paymaster V4(deployed by breadCommunity operator) +6. Launch a tx in a SuperPaymasterV3 + 1. AA account with cpnts , launch gasless tx with DemoCommunity SuperPaymaster V3(deployed by DemoCommunity operator Anni) + 2. it should deduced aPNTs from DemoCommunity balance in SuperPaymaster + 3. it should + 1. deduce cPNTs from test AA account + 2. if AA account has no cPNTs balance + 3. improve the reputation of test account enough to get credit for 3 free tx + 1. try more tx, it should be put into blacklist (we put it manually for now) and can’t get gasless free tx anymore, it run out the credit. + 5. try again, should record a debt in cPNTs contract + 6. deposit cPNTs to test AA, it should pay debt first, then deposite + + +--- + +## 5. L4 实现计划 (Implementation Plan) + +### 5.1 脚本结构 + +```bash +# 1. 环境准备(幂等) +pnpm tsx scripts/l4-setup.ts --network=sepolia + +# 2. Gasless测试 +pnpm tsx tests/regression/l4-gasless.ts --network=sepolia + +# 3. 查看状态 +cat scripts/l4-state.json +``` + +### 5.2 l4-setup.ts 数据准备目标 + +| 阶段 | 对象 | 目标值 | 说明 | +|------|------|--------|------| +| **Funding** | Jason ETH | ≥0.1 ETH | 部署合约Gas | +| | Bob ETH | ≥0.1 ETH | 部署合约Gas | +| | Anni ETH | ≥0.1 ETH | 部署合约Gas | +| | Jason GToken | 100,000 | PaymasterV4 Stake | +| | Bob GToken | 100,000 | PaymasterV4 Stake | +| | Anni GToken | **200,000** | 100k社区质押+100k SuperPM质押 | +| **社区** | Jason | AAStar社区+aPNTs+PaymasterV4 | | +| | Bob | Bread社区+bPNTs+PaymasterV4 | | +| | Anni | Demo社区+cPNTs+SuperPM Operator | | +| **SuperPM** | Anni aPNTs余额 | **100,000** | Jason mint aPNTs给Anni | +| | Anni SuperPM内余额 | ≥50,000 aPNTs | Anni存入SuperPM的credit | +| **AA账户** | 6个AA | 每个≥0.02 ETH, 1000 GToken | | +| | AA xPNTs | 各10,000 a/b/cPNTs | 用于Gasless测试 | + +### 5.3 关键修复事项 + +1. **SuperPaymaster.deposit问题**: + - 合约`deposit(uint256 amount)`使用的是`APNTS_TOKEN`(全局aPNTs=`0xBdF389a6e402AF1C0d4A0A45396303dC0b1Cf8d2`) + - 不是Jason的社区aPNTs代币 + - SDK需添加`depositAPNTsToSuperPaymaster`语义化函数 + +2. **Token数量调整**: + - GToken: Jason/Bob 100,000, Anni 200,000 + - aPNTs from Jason to Anni: 100,000 + - SuperPM存入: 50,000 (保留50,000备用) + +3. **Anvil跳过评估**: + - Anvil本地没有真实Bundler,无法测试完整UserOp流程 + - **建议L4跳过Anvil**,仅在Sepolia/OP-Sepolia执行 + +### 5.3 构造UserOp +- 交易内容:从 Jason 的第一个 AA 账户 (Jason_AA1) 向 Bob 的 EOA 地址转移 2 个 bPNTs 代币。 +- 签名来源:使用 Jason 的私钥(即 AA 的 Owner)对 UserOp Hash 进行了标准的 signMessage 签名。 +- Nonce 处理:通过 SDK 实时获取了最新的 Nonce 值 (当前为 1)。 +“UserOperation 构造指南”,内容包括: + +Context: 明确演示背景为从 Jason (AA1) 向 Bob (EOA) 转移 2 个 bPNTs。 +5 种测试场景总结: +NATIVE: 标准 4337,AA 支付 ETH Gas。 +GASLESS_V4: PaymasterV4 免 Gas(社区赞助)。 +SUPER_BPNT: SuperPaymaster 内部结算 bPNT。 +SUPER_CPNT: SuperPaymaster 内部结算 cPNT。 +SUPER_CUSTOM: SuperPaymaster 自定义结算。 +API 使用范例: 展示了如何通过 UserOpScenarioBuilder 简单调用即可获得符合 Bundler JSON-RPC 规范(Hex 编码)的 UserOp。 +2. 验证结果 +脚本运行结果显示,所有场景的 UserOp Hash 均已成功计算,且签名已由 Jason 的 Owner 私钥完成。输出的 JSON 格式已完全兼容 Alchemy Bundler 等后端的集成 + +### 5.4 l4-gasless.ts 测试场景 + +| # | 场景 | Paymaster | 预期 | +|---|------|-----------|------| +| 1 | AA有ETH,直接交易 | 无 | 成功,扣ETH | +| 2 | AA使用aPNTs | PaymasterV4(AAStar) | 成功,扣aPNTs | +| 3 | AA使用bPNTs | PaymasterV4(Bread) | 成功,扣bPNTs | +| 4 | AA使用cPNTs | SuperPM(Demo) | 成功,扣cPNTs,Anni aPNTs余额减少 | +| 5 | AA无cPNTs有信用 | SuperPM(Demo) | 成功,记录债务 | +| 6 | 信用耗尽 | SuperPM(Demo) | 失败,黑名单 | +| 7 | 充值cPNTs | - | 优先还债 | + +### 5.5 状态输出 (l4-state.json) + +```json +{ + "network": "sepolia", + "timestamp": "2026-01-06T20:30:00Z", + "operators": { + "jason": { "address": "0x...", "community": true, "token": "0x...", "paymasterV4": "0x..." }, + "bob": { "address": "0x...", "community": true, "token": "0x...", "paymasterV4": "0x..." }, + "anni": { "address": "0x...", "community": true, "token": "0x...", "superPM": { "balance": "50000" } } + }, + "aaAccounts": [ + { "label": "Jason_AA1", "address": "0x...", "eth": "0.02", "gToken": "1000", "registered": true } + ], + "readyForGaslessTest": true +} +``` + +--- + +## 6. L4-Setup SDK API 使用清单 + +### 6.1 API 覆盖率审查 + +`l4-setup.ts` 脚本已完全基于 SDK API 实现,无直接合约调用(`writeContract`)。 + +| 步骤 | 操作 | 使用的 SDK API | 文件位置 | 状态 | +|------|------|---------------|---------|------| +| **1. Community 注册** | 注册 ROLE_COMMUNITY | `CommunityClient.registerAsCommunity()` | `packages/community` | ✅ 完整 | +| **2. Token 部署** | 部署 xPNTs 社区代币 | `xPNTsFactoryActions.createToken()` | `packages/core/actions` | ✅ 完整 | +| **3. Paymaster V4 部署** | 部署并注册 Paymaster V4 + Owner 验证 | `PaymasterOperatorClient.deployAndRegisterPaymasterV4()` | `packages/operator` | ✅ 已增强验证 | +| **4. AA 账户部署** | 部署 SimpleAccount v0.7 | `accountFactoryActions.createAccount()` | `packages/core/actions` | ✅ 完整 | +| **5. Token Mint** | Mint Token 到指定地址 | `tokenActions().mint()` | `packages/core/actions` | ✅ 完整 | +| **6. Token Approve** | Approve Token 给 Spender | `tokenActions().approve()` | `packages/core/actions` | ✅ 完整 | +| **7. SuperPaymaster 充值** | 向 SuperPaymaster 充值 aPNTs | `superPaymasterActions().depositAPNTs()` | `packages/core/actions` | ✅ 完整 | +| **8. Paymaster Owner 验证** | 验证 Paymaster 初始化状态 | `publicClient.readContract()` + PaymasterABI | `scripts/l4-setup.ts` | ✅ 新增防御 | + +### 6.2 关键增强 + +#### 6.2.1 Paymaster Owner 验证 + +在 `PaymasterOperatorClient.deployAndRegisterPaymasterV4()` 中增加了 SDK 级别的 owner 验证: + +```typescript +// 部署完成后立即验证 owner +const actualOwner = await publicClient.readContract({ + address: paymasterAddress, + abi: PaymasterABI, + functionName: 'owner' +}); + +if (actualOwner !== expectedOwner) { + throw new Error( + `Critical: Paymaster owner mismatch!\n` + + ` Expected: ${expectedOwner}\n` + + ` Actual: ${actualOwner}\n` + + ` DO NOT USE THIS PAYMASTER!` + ); +} +``` + +**防御效果**: +- ✅ 阻止使用未正确初始化的 Paymaster +- ✅ 及时发现部署问题 +- ✅ 防止 owner 被抢跑(虽然 Factory 是原子操作,理论上不会发生) + +#### 6.2.2 Charlie 测试验证 + +通过新增 Charlie(第 4 个 operator)验证修复效果: + +``` +📝 Registering Community for Charlie (Test)... +🏭 Deploying dPNTs for Charlie (Test)... +⛽ Deploying Paymaster V4 for Charlie (Test)... +Deploying Paymaster v4.2... +🔍 Verifying Paymaster initialization... + ✅ Owner verified: 0x4F0b7d0EaD970f6573FEBaCFD0Cd1FaB3b64870D +``` + +**结果**: +- ✅ 使用纯 SDK API 部署 +- ✅ Owner 正确设置(Charlie 地址) +- ✅ 证明修复后的 API 不会出现 0x000 owner 问题 + +### 6.3 API 设计原则 + +1. **封装性**:所有链上操作通过 SDK Actions 封装,脚本层不直接调用合约 +2. **验证性**:关键操作后自动验证状态(如 owner、balance) +3. **容错性**:自动检查前置条件,避免重复部署 +4. **可观察性**:清晰的日志输出,便于调试 + +### 6.4 后续优化方向 + +1. **合约层防御**(长期): + - 在 `PaymasterFactory.sol` 中添加 owner 强制验证 + - 在 `Paymaster.sol` 的 `initialize` 中添加调用者权限控制 + +2. **SDK 层增强**(已完成): + - ✅ 部署后自动验证 owner + - ✅ 提供详细错误信息 + +3. **测试覆盖**: + - ✅ l4-setup.ts 覆盖所有操作流程 + - ⏳ 添加单元测试(针对每个 SDK API) + diff --git a/0.16.23/guide/api_compliance_report.md b/0.16.23/guide/api_compliance_report.md new file mode 100644 index 000000000..81d4cf3f1 --- /dev/null +++ b/0.16.23/guide/api_compliance_report.md @@ -0,0 +1,65 @@ +# API Compliance Audit Report (v0.16.12) + +This report verifies 30 critical APIs across the 5 core packages of the AAStar SDK. + +## Summary +- **Verified Packages**: 5 +- **Verified APIs**: 30 +- **Status**: 🟢 100% Consistent + +--- + +## 1. @aastar/core (Primitives) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `registryActions` | Actions | 🟢 | Registry management & roles | +| `superPaymasterActions` | Actions | 🟢 | SuperPaymaster logic | +| `tokenActions` | Actions | 🟢 | ERC20 interactions | +| `validateAddress` | Validator | 🟢 | Input security | +| `CORE_ADDRESSES` | Constant | 🟢 | Canonical contract mapping | +| `EntryPointABI` | ABI | 🟢 | Standard EP encoding | + +## 2. @aastar/account (Identity) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `createSimpleAccount` | Factory | 🟢 | Quick smart account setup | +| `getAccountAddress` | Helper | 🟢 | Predicted address check | +| `signUserOperation` | Core | 🟢 | Secure message signing | +| `eoaToSmartAccount` | Bridge | 🟢 | Rainbow bridge transition | +| `getDummySignature` | Util | 🟢 | Gas simulation | +| `deployAccount` | Action | 🟢 | On-demand deployment | + +## 3. @aastar/paymaster (Sponsorship) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `PaymasterClient.getPMD` | Method | 🟢 | V4 paymasterAndData generation | +| `SuperPMClient.deposit` | Method | 🟢 | Sponsoring gas deposit | +| `Operator.deployPM` | Method | 🟢 | Delegated V4 deployment | +| `BundlerCompat` | Util | 🟢 | Standard RPC compatibility | +| `withdrawProtocolRevenue` | Admin | 🟢 | Earnings management | +| `encodePMD` | Helper | 🟢 | Bytecode payload formation | + +## 4. @aastar/tokens (Economics) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `deployxPNTsToken` | Action | 🟢 | Community token launch | +| `approveAndStake` | Client | 🟢 | One-step collateral setup | +| `getTokenomicsOverview` | Query | 🟢 | Protocol health stats | +| `predictDepositAmount` | Math | 🟢 | Stake projection | +| `getTokenAddress` | Query | 🟢 | Token registry lookup | +| `xPNTsTokenABI` | ABI | 🟢 | Token contract interaction | + +## 5. @aastar/sdk (Coordination) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `createOperatorClient` | Entry | 🟢 | **[REFINED]** Operator start point | +| `createEndUserClient` | Entry | 🟢 | End user entry point | +| `OperatorClient.stake` | Method | 🟢 | **[NEW]** Simplified staking | +| `OperatorClient.deposit` | Method | 🟢 | **[NEW]** Simplified deposit | +| `getOperatorStatus` | Report | 🟢 | Cross-package status view | +| `setup` | Automation | 🟢 | Dev environment bootstrap | + +--- +**Verification Date**: 2026-01-19 +**Tag**: v0.16.12 +**Engineer**: Antigravity diff --git a/0.16.23/guide/concepts/account-abstraction.md b/0.16.23/guide/concepts/account-abstraction.md new file mode 100644 index 000000000..612d8e7c2 --- /dev/null +++ b/0.16.23/guide/concepts/account-abstraction.md @@ -0,0 +1,95 @@ +# Account Abstraction + +Understanding Account Abstraction (ERC-4337) in AAStar SDK. + +## What is Account Abstraction? + +Account Abstraction (AA) allows users to use smart contract wallets instead of traditional Externally Owned Accounts (EOAs). This enables advanced features like: + +- **Gasless Transactions**: Users don't need ETH for gas +- **Social Recovery**: Recover accounts without seed phrases +- **Session Keys**: Temporary permissions for DApps +- **Batch Transactions**: Multiple operations in one transaction +- **Custom Validation**: Flexible signature schemes + +## ERC-4337 Overview + +ERC-4337 is the standard for Account Abstraction. Key components: + +### UserOperation + +A pseudo-transaction object that represents a user's intent: + +```typescript +interface UserOperation { + sender: Address; // Smart account address + nonce: bigint; // Anti-replay protection + callData: Hex; // Actual transaction data + paymasterAndData: Hex; // Paymaster info (for gasless tx) + signature: Hex; // User signature + // ... gas fields +} +``` + +### EntryPoint + +The singleton contract that processes UserOperations. + +### Bundler + +Off-chain service that bundles UserOperations and submits them to the EntryPoint. + +### Paymaster + +Contract that sponsors gas fees for users. + +## AAStar Implementation + +AAStar SDK provides a complete AA infrastructure: + +### Smart Accounts + +```typescript +import { createSmartAccount } from '@aastar/account'; + +const account = await createSmartAccount({ + owner: ownerAddress, + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); +``` + +### Gasless Transactions + +```typescript +import { createEndUserClient } from '@aastar/core'; + +const user = createEndUserClient({...}); + +// Check eligibility +const eligible = await user.checkEligibility(communityAddress); + +if (eligible) { + // Send gasless transaction + await sendGaslessTransaction(); +} +``` + +## Benefits + +1. **Better UX**: Users don't need to understand gas or hold ETH +2. **Security**: Smart contract wallets are more secure than EOAs +3. **Flexibility**: Custom validation logic and recovery mechanisms +4. **Programmability**: Wallets can have complex logic + +## Learn More + +- [ERC-4337 Specification](https://eips.ethereum.org/EIPS/eip-4337) +- [Account Module API](/0.16.23/api/modules/account) +- [End User API](/0.16.23/api/roles/enduser) + +## Next Steps + +- [SuperPaymaster (AOA+)](/0.16.23/guide/concepts/superpaymaster) +- [Quick Start](/0.16.23/guide/quick-start) +- [Examples](/0.16.23/examples/) diff --git a/0.16.23/guide/concepts/rainbow-bridge.md b/0.16.23/guide/concepts/rainbow-bridge.md new file mode 100644 index 000000000..b8665f50d --- /dev/null +++ b/0.16.23/guide/concepts/rainbow-bridge.md @@ -0,0 +1,68 @@ +# EOA Rainbow Bridge + +Seamlessly bridge between traditional EOA wallets and smart contract accounts. + +## Overview + +The EOA Rainbow Bridge enables users to: +- Use existing EOA wallets +- Upgrade to smart accounts +- Maintain backward compatibility +- Seamless transition + +## How It Works + +``` +EOA Wallet → Rainbow Bridge → Smart Account + ↓ ↓ ↓ + Private Key Ownership Advanced Features +``` + +## Implementation + +```typescript +import { createSmartAccount } from '@aastar/account'; +import { privateKeyToAccount } from 'viem/accounts'; + +// 1. Start with EOA +const eoaAccount = privateKeyToAccount(process.env.PRIVATE_KEY); + +// 2. Create smart account owned by EOA +const smartAccount = await createSmartAccount({ + owner: eoaAccount.address, + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); + +// 3. Use smart account for advanced features +const user = createEndUserClient({ + chain: sepolia, + transport: http(), + account: smartAccount, +}); + +// Now user has: +// - Gasless transactions +// - Social recovery +// - Session keys +// - Batch operations +``` + +## Benefits + +1. **No Learning Curve**: Users keep their familiar wallets +2. **Gradual Adoption**: Upgrade when needed +3. **Best of Both Worlds**: EOA simplicity + smart account features +4. **Backward Compatible**: Works with existing DApps + +## Use Cases + +- Onboarding new users +- Migrating existing users +- Multi-wallet support +- Progressive enhancement + +## Related + +- [Account Module](/0.16.23/api/modules/account) +- [Account Abstraction](/0.16.23/guide/concepts/account-abstraction) diff --git a/0.16.23/guide/concepts/reputation.md b/0.16.23/guide/concepts/reputation.md new file mode 100644 index 000000000..b1048ecbb --- /dev/null +++ b/0.16.23/guide/concepts/reputation.md @@ -0,0 +1,95 @@ +# Reputation System + +On-chain reputation tracking with customizable rules and scoring. + +## Overview + +The Reputation System enables: +- On-chain reputation tracking +- Customizable scoring rules +- Community-specific metrics +- Credit limit calculation + +## Architecture + +``` +User Actions → Metrics → Reputation Score → Credit Limit +``` + +## Components + +### 1. Metrics + +Measurable user activities: +- Code contributions +- Community engagement +- Governance participation +- Transaction history + +### 2. Scoring Rules + +Community-defined weights: + +```typescript +await community.setReputationRules({ + rules: [ + { metric: 'contributions', weight: 40 }, + { metric: 'engagement', weight: 30 }, + { metric: 'governance', weight: 30 }, + ], +}); +``` + +### 3. Reputation Score + +Calculated from metrics and weights: + +``` +score = (metric1 * weight1) + (metric2 * weight2) + ... +``` + +### 4. Credit Limit + +Based on reputation: + +``` +creditLimit = baseLimit * (reputationScore / 1000) +``` + +## Usage + +```typescript +import { getReputationScore } from '@aastar/identity'; + +// Get user's reputation +const score = await getReputationScore( + client, + userAddress, + communityAddress +); + +console.log('Reputation:', score.toString()); + +// Higher reputation = higher credit limit +const credit = await user.getCreditLimit(); +``` + +## Benefits + +1. **Trustless**: On-chain, verifiable +2. **Customizable**: Each community sets rules +3. **Fair**: Transparent scoring +4. **Dynamic**: Updates with user activity + +## Use Cases + +- Gas credit limits +- Governance voting power +- Access control +- Reward distribution + +## Related + +- [Identity Module](/0.16.23/api/modules/identity) +- [Community API](/0.16.23/api/roles/community) +- [End User API](/0.16.23/api/roles/enduser) diff --git a/0.16.23/guide/concepts/superpaymaster.md b/0.16.23/guide/concepts/superpaymaster.md new file mode 100644 index 000000000..af2ac4052 --- /dev/null +++ b/0.16.23/guide/concepts/superpaymaster.md @@ -0,0 +1,141 @@ +# SuperPaymaster (AOA+) + +Advanced On-chain Accounting Paymaster with credit system. + +## Overview + +SuperPaymaster is AAStar's innovative gas sponsorship solution that enables truly gasless transactions through an on-chain credit system. + +## Key Features + +### 1. Credit-Based System + +Users get gas credit based on: +- **SBT Ownership**: Community membership tokens +- **Reputation Score**: On-chain reputation +- **Historical Behavior**: Past transaction patterns +- **Community Rules**: Custom eligibility criteria + +### 2. Operator Network + +Decentralized network of Paymaster operators who: +- Stake GTokens to participate +- Deposit funds for gas sponsorship +- Earn fees from communities +- Get slashed for misbehavior + +### 3. Community Governance + +Communities can: +- Set their own eligibility rules +- Configure credit limits +- Manage operator selection +- Customize fee structures + +## How It Works + +```mermaid +sequenceDiagram + User->>SuperPaymaster: Request gasless tx + SuperPaymaster->>Registry: Check eligibility + Registry->>SuperPaymaster: Return credit limit + SuperPaymaster->>Operator: Sponsor gas + Operator->>EntryPoint: Pay gas + EntryPoint->>User: Execute transaction + User->>SuperPaymaster: Repay debt (later) +``` + +## Architecture + +### Components + +1. **SuperPaymaster Contract**: Core logic for gas sponsorship +2. **Registry**: Manages communities, operators, and users +3. **GTokenStaking**: Operator stake management +4. **ReputationSystem**: On-chain reputation tracking + +### Credit Calculation + +```typescript +credit = baseCreditLimit + * reputationMultiplier + * communityBonus + - outstandingDebt +``` + +## Usage Example + +```typescript +import { createEndUserClient } from '@aastar/core'; +import { getPaymasterAndData } from '@aastar/paymaster'; + +// 1. Check eligibility +const user = createEndUserClient({...}); +const eligible = await user.checkEligibility(communityAddress); + +if (!eligible) { + throw new Error('Not eligible for gasless transactions'); +} + +// 2. Get credit limit +const creditLimit = await user.getCreditLimit(); +console.log('Available credit:', formatEther(creditLimit)); + +// 3. Create UserOperation with paymaster data +const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, +}); + +// 4. Submit gasless transaction +const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, +}); +``` + +## Benefits + +### For Users +- ✅ No need to hold ETH for gas +- ✅ Seamless transaction experience +- ✅ Credit-based system (pay later) +- ✅ Community-specific benefits + +### For Communities +- ✅ Attract more users +- ✅ Customizable rules +- ✅ Better user retention +- ✅ Governance control + +### For Operators +- ✅ Earn fees from gas sponsorship +- ✅ Decentralized network +- ✅ Stake-based participation +- ✅ Performance incentives + +## Comparison with Traditional Paymasters + +| Feature | Traditional Paymaster | SuperPaymaster (AOA+) | +|---------|----------------------|----------------------| +| Gas Sponsorship | ✅ | ✅ | +| Credit System | ❌ | ✅ | +| Decentralized | ❌ | ✅ | +| Community Governance | ❌ | ✅ | +| Reputation-Based | ❌ | ✅ | +| Operator Network | ❌ | ✅ | + +## Learn More + +- [Operator API](/0.16.23/api/roles/operator) - Become an operator +- [Community API](/0.16.23/api/roles/community) - Set up gas sponsorship +- [End User API](/0.16.23/api/roles/enduser) - Use gasless transactions + +## Next Steps + +- [EOA Rainbow Bridge](/0.16.23/guide/concepts/rainbow-bridge) +- [Reputation System](/0.16.23/guide/concepts/reputation) +- [Quick Start](/0.16.23/guide/quick-start) diff --git a/0.16.23/guide/deployments/index.md b/0.16.23/guide/deployments/index.md new file mode 100644 index 000000000..e92efed56 --- /dev/null +++ b/0.16.23/guide/deployments/index.md @@ -0,0 +1,30 @@ +# Deployments + +This page tracks the latest verified deployments across networks. + +- **[Optimism (Default)](./verify.optimism.contracts)** +- **[OP-Sepolia](./verify.op-sepolia.contracts)** +- **[Sepolia](./verify.sepolia.contracts)** + +## Verified SuperPaymaster Contracts (Optimism) + +The following contracts have been successfully verified on Etherscan/Blockscout for the optimism network. + +| Contract Name | Address | Explorer Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0xA2c9A6e95f19f5D2a364CBCbB5f0b32B1B4d140E` | [View on Explorer](https://optimistic.etherscan.io/address/0xA2c9A6e95f19f5D2a364CBCbB5f0b32B1B4d140E#code) | +| **Registry** | `0x997686219F31405503D32728B1f094F115EF24e7` | [View on Explorer](https://optimistic.etherscan.io/address/0x997686219F31405503D32728B1f094F115EF24e7#code) | +| **GToken** | `0x8d6Fe002dDacCcFBD377F684EC1825f2E1ab7ef6` | [View on Explorer](https://optimistic.etherscan.io/address/0x8d6Fe002dDacCcFBD377F684EC1825f2E1ab7ef6#code) | +| **aPNTs** | `0x0B41C78081B5A141eb4C3C7E7FD8E58A7Bde553B` | [View on Explorer](https://optimistic.etherscan.io/address/0x0B41C78081B5A141eb4C3C7E7FD8E58A7Bde553B#code) | +| **xPNTsFactory** | `0x864971a26384d9DCC7115f0bBC428e2623F28b6e` | [View on Explorer](https://optimistic.etherscan.io/address/0x864971a26384d9DCC7115f0bBC428e2623F28b6e#code) | +| **GTokenStaking** | `0x7A1216C2d814D2389698C64eD23AA1aA9Eb6343E` | [View on Explorer](https://optimistic.etherscan.io/address/0x7A1216C2d814D2389698C64eD23AA1aA9Eb6343E#code) | +| **MySBT** | `0x28eBFc5fc03B1d7648254AbF1C7B39DbFdef1a94` | [View on Explorer](https://optimistic.etherscan.io/address/0x28eBFc5fc03B1d7648254AbF1C7B39DbFdef1a94#code) | +| **BLSValidator** | `0xA88ADec5A8dc422B57488272d5aD5913d728942A` | [View on Explorer](https://optimistic.etherscan.io/address/0xA88ADec5A8dc422B57488272d5aD5913d728942A#code) | +| **BLSAggregator** | `0x1C305372ecc5a36CBef1FA371392234bCD55eB19` | [View on Explorer](https://optimistic.etherscan.io/address/0x1C305372ecc5a36CBef1FA371392234bCD55eB19#code) | +| **ReputationSystem** | `0xA9560898dC0eE4F9Ed3F1db17dbf74dE65e925c2` | [View on Explorer](https://optimistic.etherscan.io/address/0xA9560898dC0eE4F9Ed3F1db17dbf74dE65e925c2#code) | +| **DVTValidator** | `0x31Ede6454a56293f7cf2323CA5d5F9a6230558Fb` | [View on Explorer](https://optimistic.etherscan.io/address/0x31Ede6454a56293f7cf2323CA5d5F9a6230558Fb#code) | +| **PaymasterFactory** | `0x58A7F6E44a57028A255794119F8b37124c9a7eB8` | [View on Explorer](https://optimistic.etherscan.io/address/0x58A7F6E44a57028A255794119F8b37124c9a7eB8#code) | +| **PaymasterV4Impl** | `0xc4dd13F7825409EEC13FBCBdD9D8f6d618207cca` | [View on Explorer](https://optimistic.etherscan.io/address/0xc4dd13F7825409EEC13FBCBdD9D8f6d618207cca#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/deployments/verify.op-sepolia.contracts.md b/0.16.23/guide/deployments/verify.op-sepolia.contracts.md new file mode 100644 index 000000000..e14584443 --- /dev/null +++ b/0.16.23/guide/deployments/verify.op-sepolia.contracts.md @@ -0,0 +1,26 @@ +# Verified SuperPaymaster Contracts (OP-Sepolia) + +The following contracts have been successfully verified on Etherscan/Blockscout for the Optimism Sepolia testnet. + +- **[Deployments (Default: Optimism)](./)** +- **[Optimism](./verify.optimism.contracts)** +- **[Sepolia](./verify.sepolia.contracts)** + +| Contract Name | Address | Explorer Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94#code) | +| **Registry** | `0xcf6860Ab57de8669756997e414D9c52B6e301972` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xcf6860Ab57de8669756997e414D9c52B6e301972#code) | +| **GToken** | `0xC341c88453372021d0221834307613c2e99fE718` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xC341c88453372021d0221834307613c2e99fE718#code) | +| **aPNTs** | `0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440#code) | +| **xPNTsFactory** | `0x7792a49C9E91e0E9B631B27D885d15e971B7482A` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x7792a49C9E91e0E9B631B27D885d15e971B7482A#code) | +| **GTokenStaking** | `0x5f57B931C849e8E255F22755506eB2255aB22a7C` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x5f57B931C849e8E255F22755506eB2255aB22a7C#code) | +| **MySBT** | `0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0#code) | +| **BLSValidator** | `0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5#code) | +| **BLSAggregator** | `0x6e06b17b1a4D2D973F7E3e026e24b4393315736c` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x6e06b17b1a4D2D973F7E3e026e24b4393315736c#code) | +| **ReputationSystem** | `0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9#code) | +| **DVTValidator** | `0x0087cA806109E150438116cAA414580BB5fa9195` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x0087cA806109E150438116cAA414580BB5fa9195#code) | +| **PaymasterFactory** | `0x1e3b9d12eAc27867a523d0537902441B0E7D98d8` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x1e3b9d12eAc27867a523d0537902441B0E7D98d8#code) | +| **PaymasterV4Impl** | `0x906123080207F250B1C9F299991512Cb31f35b2f` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x906123080207F250B1C9F299991512Cb31f35b2f#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/deployments/verify.optimism.contracts.md b/0.16.23/guide/deployments/verify.optimism.contracts.md new file mode 100644 index 000000000..0435d61ba --- /dev/null +++ b/0.16.23/guide/deployments/verify.optimism.contracts.md @@ -0,0 +1,22 @@ +# Verified SuperPaymaster Contracts (Optimism) + +The following contracts have been successfully verified on Etherscan/Blockscout for the optimism network. + +| Contract Name | Address | Explorer Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0xA2c9A6e95f19f5D2a364CBCbB5f0b32B1B4d140E` | [View on Explorer](https://optimistic.etherscan.io/address/0xA2c9A6e95f19f5D2a364CBCbB5f0b32B1B4d140E#code) | +| **Registry** | `0x997686219F31405503D32728B1f094F115EF24e7` | [View on Explorer](https://optimistic.etherscan.io/address/0x997686219F31405503D32728B1f094F115EF24e7#code) | +| **GToken** | `0x8d6Fe002dDacCcFBD377F684EC1825f2E1ab7ef6` | [View on Explorer](https://optimistic.etherscan.io/address/0x8d6Fe002dDacCcFBD377F684EC1825f2E1ab7ef6#code) | +| **aPNTs** | `0x0B41C78081B5A141eb4C3C7E7FD8E58A7Bde553B` | [View on Explorer](https://optimistic.etherscan.io/address/0x0B41C78081B5A141eb4C3C7E7FD8E58A7Bde553B#code) | +| **xPNTsFactory** | `0x864971a26384d9DCC7115f0bBC428e2623F28b6e` | [View on Explorer](https://optimistic.etherscan.io/address/0x864971a26384d9DCC7115f0bBC428e2623F28b6e#code) | +| **GTokenStaking** | `0x7A1216C2d814D2389698C64eD23AA1aA9Eb6343E` | [View on Explorer](https://optimistic.etherscan.io/address/0x7A1216C2d814D2389698C64eD23AA1aA9Eb6343E#code) | +| **MySBT** | `0x28eBFc5fc03B1d7648254AbF1C7B39DbFdef1a94` | [View on Explorer](https://optimistic.etherscan.io/address/0x28eBFc5fc03B1d7648254AbF1C7B39DbFdef1a94#code) | +| **BLSValidator** | `0xA88ADec5A8dc422B57488272d5aD5913d728942A` | [View on Explorer](https://optimistic.etherscan.io/address/0xA88ADec5A8dc422B57488272d5aD5913d728942A#code) | +| **BLSAggregator** | `0x1C305372ecc5a36CBef1FA371392234bCD55eB19` | [View on Explorer](https://optimistic.etherscan.io/address/0x1C305372ecc5a36CBef1FA371392234bCD55eB19#code) | +| **ReputationSystem** | `0xA9560898dC0eE4F9Ed3F1db17dbf74dE65e925c2` | [View on Explorer](https://optimistic.etherscan.io/address/0xA9560898dC0eE4F9Ed3F1db17dbf74dE65e925c2#code) | +| **DVTValidator** | `0x31Ede6454a56293f7cf2323CA5d5F9a6230558Fb` | [View on Explorer](https://optimistic.etherscan.io/address/0x31Ede6454a56293f7cf2323CA5d5F9a6230558Fb#code) | +| **PaymasterFactory** | `0x58A7F6E44a57028A255794119F8b37124c9a7eB8` | [View on Explorer](https://optimistic.etherscan.io/address/0x58A7F6E44a57028A255794119F8b37124c9a7eB8#code) | +| **PaymasterV4Impl** | `0xc4dd13F7825409EEC13FBCBdD9D8f6d618207cca` | [View on Explorer](https://optimistic.etherscan.io/address/0xc4dd13F7825409EEC13FBCBdD9D8f6d618207cca#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/deployments/verify.sepolia.contracts.md b/0.16.23/guide/deployments/verify.sepolia.contracts.md new file mode 100644 index 000000000..0e5a4be2c --- /dev/null +++ b/0.16.23/guide/deployments/verify.sepolia.contracts.md @@ -0,0 +1,26 @@ +# Verified SuperPaymaster Contracts (Sepolia) + +The following contracts have been successfully verified on Etherscan for the Sepolia testnet. + +- **[Deployments (Default: Optimism)](./)** +- **[Optimism](./verify.optimism.contracts)** +- **[OP-Sepolia](./verify.op-sepolia.contracts)** + +| Contract Name | Address | Etherscan Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A` | [View on Etherscan](https://sepolia.etherscan.io/address/0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A#code) | +| **Registry** | `0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788` | [View on Etherscan](https://sepolia.etherscan.io/address/0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788#code) | +| **GToken** | `0x9ceDeC089921652D050819ca5BE53765fc05aa9E` | [View on Etherscan](https://sepolia.etherscan.io/address/0x9ceDeC089921652D050819ca5BE53765fc05aa9E#code) | +| **aPNTs** | `0xDf669834F04988BcEE0E3B6013B6b867Bd38778d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xDf669834F04988BcEE0E3B6013B6b867Bd38778d#code) | +| **xPNTsFactory** | `0x6EafdA3477F3eec1F848505e1c06dFB5532395b6` | [View on Etherscan](https://sepolia.etherscan.io/address/0x6EafdA3477F3eec1F848505e1c06dFB5532395b6#code) | +| **GTokenStaking** | `0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC#code) | +| **MySBT** | `0x677423f5Dad98D19cAE8661c36F094289cb6171a` | [View on Etherscan](https://sepolia.etherscan.io/address/0x677423f5Dad98D19cAE8661c36F094289cb6171a#code) | +| **BLSValidator** | `0x04590731005d25d379A55b6c3136B5CD1eaC757F` | [View on Etherscan](https://sepolia.etherscan.io/address/0x04590731005d25d379A55b6c3136B5CD1eaC757F#code) | +| **BLSAggregator** | `0xe380d443842A8A37F691B9f3EF58e40073759edc` | [View on Etherscan](https://sepolia.etherscan.io/address/0xe380d443842A8A37F691B9f3EF58e40073759edc#code) | +| **ReputationSystem** | `0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC#code) | +| **DVTValidator** | `0xcB42417Cfb374e923BAF729040d9973FB7676537` | [View on Etherscan](https://sepolia.etherscan.io/address/0xcB42417Cfb374e923BAF729040d9973FB7676537#code) | +| **PaymasterFactory** | `0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d#code) | +| **PaymasterV4Impl** | `0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf` | [View on Etherscan](https://sepolia.etherscan.io/address/0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60482a2B343004dF29EB205C4F6916E864700` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/docs/ABI_MAINTENANCE_PLAN.md b/0.16.23/guide/docs/ABI_MAINTENANCE_PLAN.md new file mode 100644 index 000000000..6b6fe365c --- /dev/null +++ b/0.16.23/guide/docs/ABI_MAINTENANCE_PLAN.md @@ -0,0 +1,132 @@ +# SDK ABI 维护计划 + +## 命名策略(最终版) + +**统一无版本号命名**: +- 文件名:`BLSAggregator.json`(无 V3 后缀) +- 版本信息:通过 ABI 的 `version()` 函数获取 +- 同步时自动去除版本号后缀 + +## 最终 ABI 配置(20个) + +### 从 SuperPaymaster 同步(16个) + +#### 核心合约(13个) +来源:`SuperPaymaster/abis/*.json`(同步时去除版本号) + +- BLSAggregator.json ← BLSAggregatorV3.json +- BLSValidator.json +- DVTValidator.json ← DVTValidatorV3.json +- GToken.json +- GTokenStaking.json +- MySBT.json +- PaymasterFactory.json +- PaymasterV4_2.json +- Registry.json +- ReputationSystem.json ← ReputationSystemV3.json +- SuperPaymaster.json ← SuperPaymasterV3.json +- xPNTsFactory.json +- xPNTsToken.json + +#### AA 标准(3个) +来源:`SuperPaymaster/out/*.sol/*.json`(提取 `.abi` 字段) + +- EntryPoint.json +- SimpleAccount.json +- SimpleAccountFactory.json + +### SDK 自维护(4个) + +- SimpleAccountV08.json +- SimpleAccountFactoryV08.json +- Simple7702Account.json +- Eip7702Support.json +- SenderCreator.json +- LegacyAccount.json +- UserOperationLib.json + +## 自动同步流程 + +### 触发 +每次运行回归测试前自动同步: +```bash +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +### 同步步骤 + +**步骤1**:合约地址 +- `SuperPaymaster/deployments/sepolia.json` → SDK `.env.sepolia` + +**步骤2.1**:核心合约 ABI(13个) +- `SuperPaymaster/abis/*.json` → SDK `packages/core/src/abis/` +- **自动去除版本号**:`BLSAggregatorV3.json` → `BLSAggregator.json` + +**步骤2.2**:AA 标准 ABI(3个) +- 从 `SuperPaymaster/out/` 提取纯 ABI 数组 + +**步骤3**:环境配置(可选) +- 提示手动复制 `.env.sepolia` + +## 典型使用场景 + +### 场景1:更新核心合约(最常见) + +```bash +# 在 SuperPaymaster 修改合约 +cd SuperPaymaster +forge build +./extract_abis.sh + +# 切换到 SDK,运行测试(自动同步) +cd ../aastar-sdk +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +**自动执行**: +1. 同步合约地址 +2. 同步 ABI(自动去除版本号) +3. 验证合约环境 + +### 场景2:查看合约版本 + +```typescript +import { SuperPaymasterABI } from '@aastar/core'; +import { createPublicClient } from 'viem'; + +const version = await client.readContract({ + address: superPaymasterAddress, + abi: SuperPaymasterABI, + functionName: 'version' +}); +// 返回: "SuperPaymaster-3.2.0" +``` + +## 维护检查清单 + +### 每次合约更新后 +- [ ] SuperPaymaster 编译成功 +- [ ] `extract_abis.sh` 已运行 +- [ ] SDK 测试自动同步 ABI +- [ ] SDK 构建成功(`pnpm build`) + +### 定期检查 +- [ ] 确认无重复 ABI 文件 +- [ ] 确认 `index.ts` 导出完整 +- [ ] 确认命名统一(无版本号后缀) + +## 总结 + +**核心原则**: +1. **单一数据源**:SuperPaymaster 是唯一来源 +2. **自动同步**:每次测试前自动更新 +3. **统一命名**:文件名无版本号,版本信息在 ABI 内 +4. **无重复**:一个合约一个 ABI 文件 + +**日常使用**: +```bash +# 更新合约 → 编译 → 运行 SDK 测试 → 自动同步 ✅ +pnpm tsx scripts/phase1_verify_contracts.ts +``` + +大多数时候只更新13个核心 ABI,AA 标准和辅助 ABI 基本不变。 diff --git a/0.16.23/guide/docs/API_REFERENCE.md b/0.16.23/guide/docs/API_REFERENCE.md new file mode 100644 index 000000000..b48d08da5 --- /dev/null +++ b/0.16.23/guide/docs/API_REFERENCE.md @@ -0,0 +1,826 @@ +# AAStar SDK API Documentation + +## Overview + +AAStar SDK is a comprehensive TypeScript SDK for interacting with the AAStar Public Goods Infrastructure and create Your Own Protocol (YOP), providing Account Abstraction (ERC-4337) capabilities with advanced features like gasless SuperPaymaster(AOA+), EOA RainBow Bridge and community management, and reputation systems. + +**Version**: 0.16.23 +**License**: MIT +**Repository**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk) + +--- + +## SDK Architecture (L1-L4 Tiers) + +The SDK follows a layered abstraction model to balance control and ease of use: + +| Tier | Name | Target | Description | +| :--- | :--- | :--- | :--- | +| **L1** | **Base API** | Protocol Engineers | Raw contract wrappers (Registry, Paymaster, SBT). | +| **L2** | **Workflows** | Integrators | Atomic tasks (e.g., `onboardOperator`, `deployXPNTs`). | +| **L3** | **Scenarios** | dApp Developers | End-to-end journeys (e.g., `submitGaslessUserOperation`). | +| **L4** | **Regression** | QA / Researchers | Full system lifecycle verification. | + +--- + +## Table of Contents + +1. [Installation](#installation) +2. [SDK Architecture](#sdk-architecture-l1-l4-tiers) +3. [Quick Start](#quick-start) +4. [Core Module](#core-module) +5. [Account Module](#account-module) +6. [Paymaster Module](#paymaster-module) +7. [Tokens Module](#tokens-module) +8. [Identity Module](#identity-module) +9. [DApp Module](#dapp-module) +10. [Complete Examples](#complete-examples) +11. [Gas Strategy & Keeper](#gas-strategy--keeper) + +--- + +## Installation + +```bash +pnpm add @aastar/sdk +# or individual packages +pnpm add @aastar/core @aastar/account @aastar/paymaster +``` + +--- + +## Quick Start + +```typescript +import { createOperatorClient, createEndUserClient } from '@aastar/core'; +import { sepolia } from 'viem/chains'; + +// Create an Operator client +const operatorClient = createOperatorClient({ + chain: sepolia, + transport: http('https://rpc.sepolia.org'), + account: privateKeyToAccount('0x...'), +}); + +// Stake GTokens +const stakeTx = await operatorClient.stake({ + amount: parseEther('100'), +}); +``` + +--- + +## Core Module + +### `@aastar/core` + +Core configuration, contract addresses, and client creation utilities. + +#### Exports + +```typescript +export * from './branding'; +export * from './contract-addresses'; +export * from './contracts'; +export * from './contract-versions'; +export * from './networks'; +export * from './constants'; +export * from './communities'; +export * from './abis'; +export * from './clients'; +export * from './actions'; +``` + +--- + +### Networks + +#### `getNetwork(network)` + +Get network configuration for a supported network. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name ('sepolia' | 'optimism' | 'optimism-sepolia' | 'anvil') + +**Returns:** Network configuration object + +**Example:** +```typescript +import { getNetwork } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +console.log(network.rpcUrl); // 'https://rpc.sepolia.org' +``` + +--- + +#### `getTxUrl(network, txHash)` + +Get block explorer URL for a transaction. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name +- `txHash`: `string` - Transaction hash + +**Returns:** `string` - Full transaction URL + +**Example:** +```typescript +import { getTxUrl } from '@aastar/core'; + +const url = getTxUrl('sepolia', '0x123...'); +// 'https://sepolia.etherscan.io/tx/0x123...' +``` + +--- + +#### `getAddressUrl(network, address)` + +Get block explorer URL for an address. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name +- `address`: `string` - Contract or wallet address + +**Returns:** `string` - Full address URL + +**Example:** +```typescript +import { getAddressUrl } from '@aastar/core'; + +const url = getAddressUrl('sepolia', '0xabc...'); +// 'https://sepolia.etherscan.io/address/0xabc...' +``` + +--- + +#### `getChainId(network)` + +Get chain ID for a network. + +**Parameters:** +- `network`: `SupportedNetwork` - Network name + +**Returns:** `number` - Chain ID + +**Example:** +```typescript +import { getChainId } from '@aastar/core'; + +const chainId = getChainId('sepolia'); // 11155111 +``` + +--- + +### Contract Addresses + +#### `CONTRACTS` + +Object containing all contract addresses for supported networks. + +**Structure:** +```typescript +{ + sepolia: { + registry: Address, + superPaymaster: Address, + gToken: Address, + gTokenStaking: Address, + // ... more contracts + }, + // ... other networks +} +``` + +**Example:** +```typescript +import { CONTRACTS } from '@aastar/core'; + +const registryAddress = CONTRACTS.sepolia.registry; +console.log(registryAddress); // '0x...' +``` + +--- + +### Constants + +#### Protocol Constants + +```typescript +import { + SERVICE_FEE_RATE, // 200 (2%) + MAX_SERVICE_FEE, // 1000 (10%) + BPS_DENOMINATOR, // 10000 + ROLE_ENDUSER, // Keccak256 hash + ROLE_COMMUNITY, // Keccak256 hash + ROLE_PAYMASTER_SUPER, // Keccak256 hash +} from '@aastar/core'; +``` + +--- + +### Client Creation + +#### `createOperatorClient(config)` + +Create a client for Paymaster operators. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` - Viem chain object + - `transport`: `Transport` - Viem transport + - `account`: `Account` - Operator account + +**Returns:** `OperatorClient` with extended actions + +**Example:** +```typescript +import { createOperatorClient } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const client = createOperatorClient({ + chain: sepolia, + transport: http('https://rpc.sepolia.org'), + account: privateKeyToAccount(process.env.OPERATOR_KEY), +}); + +// Available actions: +await client.stake({ amount: parseEther('100') }); +await client.deposit({ amount: parseEther('10') }); +await client.withdraw({ amount: parseEther('5') }); +``` + +--- + +#### `createCommunityClient(config)` + +Create a client for community managers. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - Community admin account + +**Returns:** `CommunityClient` with extended actions + +**Example:** +```typescript +import { createCommunityClient } from '@aastar/core'; + +const client = createCommunityClient({ + chain: sepolia, + transport: http(), + account: communityAccount, +}); + +// Available actions: +await client.registerCommunity({ name: 'MyDAO' }); +await client.mintSBT({ to: userAddress, tokenId: 1n }); +await client.setReputationRules({ rules: [...] }); +``` + +--- + +#### `createEndUserClient(config)` + +Create a client for end users. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - User account + +**Returns:** `EndUserClient` with extended actions + +**Example:** +```typescript +import { createEndUserClient } from '@aastar/core'; + +const client = createEndUserClient({ + chain: sepolia, + transport: http(), + account: userAccount, +}); + +// Available actions: +const credit = await client.getCreditLimit(); +await client.repayDebt({ amount: parseEther('1') }); +``` + +--- + +#### `createAdminClient(config)` + +Create a client for protocol administrators. + +**Parameters:** +- `config`: `ClientConfig` + - `chain`: `Chain` + - `transport`: `Transport` + - `account`: `Account` - Admin account + +**Returns:** `AdminClient` with extended actions + +**Example:** +```typescript +import { createAdminClient } from '@aastar/core'; + +const client = createAdminClient({ + chain: sepolia, + transport: http(), + account: adminAccount, +}); + +// Available actions: +await client.slashOperator({ operator: address, amount: parseEther('10') }); +await client.setGlobalParameters({ exitFee: 100n }); +``` + +--- + +## Account Module + +### `@aastar/account` + +Account Abstraction utilities for creating and managing smart accounts. + +#### `createSmartAccount(config)` + +Create a new smart account (ERC-4337). + +**Parameters:** +- `config`: `SmartAccountConfig` + - `owner`: `Address` - EOA owner address + - `salt`: `bigint` - Salt for deterministic address + - `factoryAddress`: `Address` - Account factory address + +**Returns:** `SmartAccount` object + +**Example:** +```typescript +import { createSmartAccount } from '@aastar/account'; + +const account = await createSmartAccount({ + owner: '0x...', + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); + +console.log(account.address); // Predicted smart account address +``` + +--- + +#### `getAccountAddress(config)` + +Get the deterministic address for a smart account. + +**Parameters:** +- `config`: `SmartAccountConfig` + +**Returns:** `Promise
` - Smart account address + +**Example:** +```typescript +import { getAccountAddress } from '@aastar/account'; + +const address = await getAccountAddress({ + owner: ownerAddress, + salt: 0n, + factoryAddress: factoryAddress, +}); +``` + +--- + +## Paymaster Module + +### `@aastar/paymaster` + +Paymaster utilities for gas sponsorship. + +#### `getPaymasterAndData(userOp, paymasterConfig)` + +Generate paymaster data for a UserOperation. + +**Parameters:** +- `userOp`: `UserOperation` - User operation object +- `paymasterConfig`: `PaymasterConfig` + - `paymasterAddress`: `Address` + - `communityAddress`: `Address` + - `xPNTsAddress`: `Address` + - `verificationGasLimit`: `bigint` + - `postOpGasLimit`: `bigint` + +**Returns:** `Hex` - Encoded paymaster and data + +**Example:** +```typescript +import { getPaymasterAndData } from '@aastar/paymaster'; + +const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress: '0x...', + xPNTsAddress: '0x...', + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, +}); +``` + +--- + +#### `checkEligibility(user, community, rpcUrl)` + +Check if a user is eligible for gas sponsorship. + +**Parameters:** +- `user`: `Address` - User address +- `community`: `Address` - Community address +- `rpcUrl`: `string` - RPC endpoint + +**Returns:** `Promise` - Eligibility status + +**Example:** +```typescript +import { checkEligibility } from '@aastar/paymaster'; + +const isEligible = await checkEligibility( + userAddress, + communityAddress, + 'https://rpc.sepolia.org' +); + +if (isEligible) { + // Proceed with sponsored transaction +} +``` + +--- + +## Tokens Module + +### `@aastar/tokens` + +Token utilities for GToken, xPNTs, and SBTs. + +#### `mintGToken(client, to, amount)` + +Mint GTokens (test/development only). + +**Parameters:** +- `client`: `WalletClient` - Wallet client with minter role +- `to`: `Address` - Recipient address +- `amount`: `bigint` - Amount to mint (in wei) + +**Returns:** `Promise` - Transaction hash + +**Example:** +```typescript +import { mintGToken } from '@aastar/tokens'; + +const txHash = await mintGToken( + client, + recipientAddress, + parseEther('1000') +); +``` + +--- + +#### `approveGToken(client, spender, amount)` + +Approve GToken spending. + +**Parameters:** +- `client`: `WalletClient` +- `spender`: `Address` - Spender address (e.g., staking contract) +- `amount`: `bigint` - Approval amount + +**Returns:** `Promise` - Transaction hash + +**Example:** +```typescript +import { approveGToken } from '@aastar/tokens'; + +await approveGToken( + client, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') +); +``` + +--- + +#### `getGTokenBalance(client, address)` + +Get GToken balance for an address. + +**Parameters:** +- `client`: `PublicClient` +- `address`: `Address` + +**Returns:** `Promise` - Balance in wei + +**Example:** +```typescript +import { getGTokenBalance } from '@aastar/tokens'; + +const balance = await getGTokenBalance(client, userAddress); +console.log(formatEther(balance)); // "1000.0" +``` + +--- + +## Identity Module + +### `@aastar/identity` + +Identity and reputation management. + +#### `getSBTBalance(client, user, tokenId)` + +Get SBT (Soul-Bound Token) balance. + +**Parameters:** +- `client`: `PublicClient` +- `user`: `Address` +- `tokenId`: `bigint` + +**Returns:** `Promise` - SBT balance (0 or 1) + +**Example:** +```typescript +import { getSBTBalance } from '@aastar/identity'; + +const hasSBT = await getSBTBalance(client, userAddress, 1n); +console.log(hasSBT > 0n); // true if user has the SBT +``` + +--- + +#### `getReputationScore(client, user, community)` + +Get user's reputation score in a community. + +**Parameters:** +- `client`: `PublicClient` +- `user`: `Address` +- `community`: `Address` + +**Returns:** `Promise` - Reputation score + +**Example:** +```typescript +import { getReputationScore } from '@aastar/identity'; + +const score = await getReputationScore( + client, + userAddress, + communityAddress +); +console.log(score); // 850n +``` + +--- + +## DApp Module + +### `@aastar/dapp` + +React hooks and utilities for DApp integration. + +#### `useAAStar(config)` + +React hook for AAStar SDK integration. + +**Parameters:** +- `config`: `AAStarConfig` + - `network`: `SupportedNetwork` + - `rpcUrl`: `string` + +**Returns:** `AAStarContext` object + +**Example:** +```typescript +import { useAAStar } from '@aastar/dapp'; + +function MyComponent() { + const { client, account, connect, disconnect } = useAAStar({ + network: 'sepolia', + rpcUrl: 'https://rpc.sepolia.org', + }); + + return ( + + ); +} +``` + +--- + +## Complete Examples + +### Example 1: Operator Staking Flow + +```typescript +import { createOperatorClient, CONTRACTS } from '@aastar/core'; +import { mintGToken, approveGToken } from '@aastar/tokens'; +import { http, parseEther } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +async function operatorStakingFlow() { + // 1. Create operator client + const operator = createOperatorClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.OPERATOR_KEY), + }); + + // 2. Mint GTokens (testnet only) + await mintGToken( + operator, + operator.account.address, + parseEther('1000') + ); + + // 3. Approve staking contract + await approveGToken( + operator, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') + ); + + // 4. Stake tokens + const stakeTx = await operator.stake({ + amount: parseEther('100'), + }); + + console.log('Staked! TX:', stakeTx); + + // 5. Deposit to Paymaster + const depositTx = await operator.deposit({ + amount: parseEther('10'), + }); + + console.log('Deposited! TX:', depositTx); +} +``` + +--- + +### Example 2: Community Registration + +```typescript +import { createCommunityClient, CONTRACTS } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; + +async function registerCommunity() { + const community = createCommunityClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: communityAccount, + }); + + // Register community + await community.registerCommunity({ + name: 'MyAwesomeDAO', + metadata: 'ipfs://...', + }); + + // Mint SBT to member + await community.mintSBT({ + to: memberAddress, + tokenId: 1n, + }); + + // Set reputation rules + await community.setReputationRules({ + rules: [ + { metric: 'activity', weight: 30 }, + { metric: 'contribution', weight: 70 }, + ], + }); +} +``` + +--- + +### Example 3: End User Gasless Transaction + +```typescript +import { createEndUserClient, checkEligibility } from '@aastar/core'; +import { getPaymasterAndData } from '@aastar/paymaster'; + +async function sendGaslessTransaction() { + const user = createEndUserClient({ + chain: sepolia, + transport: http(), + account: userAccount, + }); + + // Check eligibility + const eligible = await checkEligibility( + user.account.address, + communityAddress, + process.env.RPC_URL + ); + + if (!eligible) { + throw new Error('Not eligible for gas sponsorship'); + } + + // Create UserOperation + const userOp = { + sender: user.account.address, + nonce: 0n, + // ... other fields + }; + + // Get paymaster data + const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, + }); + + // Submit to bundler + const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, + }); + + console.log('Gasless TX:', txHash); +} +``` + +--- + +## Error Handling + +All SDK functions may throw errors. Always wrap in try-catch: + +```typescript +try { + await client.stake({ amount: parseEther('100') }); +} catch (error) { + if (error.message.includes('insufficient balance')) { + console.error('Not enough GTokens'); + } else { + console.error('Staking failed:', error); + } +} +``` + +--- + +## TypeScript Support + +The SDK is fully typed. Use TypeScript for the best development experience: + +```typescript +import type { + OperatorClient, + CommunityClient, + EndUserClient, + AdminClient, + SupportedNetwork, +} from '@aastar/core'; +``` + +--- + +## Support + +- **Documentation**: [docs.aastar.io](https://docs.aastar.io) +- **GitHub**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk) +- **Discord**: [Join our community](https://discord.gg/aastar) + +--- + +## Gas Strategy & Keeper + +### Gas Pricing Strategy +The SDK implements a dynamic gas pricing strategy to balance cost and reliability: +- **Mainnet**: Uses a **1.2x boost** on base fees to ensure inclusion during volatility. +- **Testnets**: Enforces a minimum **0.5 Gwei** priority fee to prevent transaction hangs. + +### Service Maintenance (Keeper) +The `scripts/keeper.ts` utility maintains paymaster price freshness: +- **Hot Path**: Reads from local `cachedPrice` to minimize gas. +- **Auto-Refresh**: Triggers `updatePrice()` when staleness exceeds the threshold. +- **Resilience**: Features 90s internal timeouts and Telegram alerting. + +--- + +## License + +MIT © AAStar Community diff --git a/0.16.23/guide/docs/Account_Initialization_Guide_CN.md b/0.16.23/guide/docs/Account_Initialization_Guide_CN.md new file mode 100644 index 000000000..fcf67d27f --- /dev/null +++ b/0.16.23/guide/docs/Account_Initialization_Guide_CN.md @@ -0,0 +1,89 @@ +# 账户初始化指南 (Account Initialization Guide) + +本文档旨在帮助开发者和集成商理解如何在 AAStar SDK 中以全局一致的方式初始化和管理 ERC-4337 智能账户。 + +## 1. 核心原则:配置驱动与全局一致性 + +SDK 旨在提供一套**无感切换**的账户体系。无论你使用的是默认的 `SimpleAccount`,还是 `Kernel` 或 `Safe` 等高级账户体系,你只需要在 SDK 的 `Config` 中指定对应的 `factoryAddress` 以及相应的 `factoryType`(可选),SDK 内部会自动适配部署逻辑。 + +> [!IMPORTANT] +> **不要手动调用底层合约 API**。请始终使用 `UserClient.deployAccount` 作为统一入口。SDK 确保了不同账户合约之间的 API 一致性。 + +## 2. 初始化流程 + +初始化账户通常发生在用户首次通过您的应用进行交互时。流程如下: + +1. **生成/获取 Owner 密钥**: 通常是一个 EOA (MetaMask, Privy, etc.)。 +2. **预测账户地址**: 调用 `UserClient.deployAccount` (或单纯预测 API) 获取预计算地址。 +3. **部署账户 (Deploy)**: 调用 `UserClient.deployAccount` 触发链上部署。 +4. **初始化 Client (Initialize)**: 使用部署好的地址初始化 `UserClient`,开始链上业务逻辑。 + +> [!TIP] +> **地址预测的稳定性**:只要 `owner` 和 `salt` 不变,无论在哪个链(Anvil, Sepolia, OP),预测出的账户地址都是一致的。这保证了跨链身份的一致性(create2 确定性)。 + +## 3. 使用 SDK 部署账户 + +SDK 在 `UserClient` 中提供了静态辅助方法 `deployAccount`,它屏蔽了底层工厂合约的差异。 + +### 3.1 引入 SDK + +```typescript +import { UserClient } from '@aastar/sdk'; +import { createWalletClient, http } from 'viem'; +import { privateKeyToAccount } from 'viem/accounts'; +import { sepolia } from 'viem/chains'; + +const wallet = createWalletClient({ + account: privateKeyToAccount('YOUR_PRIVATE_KEY'), + chain: sepolia, + transport: http() +}); +``` + +### 3.2 预测与部署 (支持不同账户体系) + +您可以通过简单的配置切换账户体系。 + +```typescript +// 1. 默认 SimpleAccount +const result1 = await UserClient.deployAccount(wallet, { + owner: wallet.account.address, + salt: 0n +}); + +// 2. 切换到其他工厂 (例如自定义 Factory 地址) +const result2 = await UserClient.deployAccount(wallet, { + owner: wallet.account.address, + salt: 123n, + factoryAddress: '0xCustomFactoryAddress...', // 只需修改此处地址 + // factoryType: 'kernel' // 如果支持特定类型,可以提供类型以适配非标准接口 +}); + +console.log(`✅ Deployed Address: ${result1.accountAddress}`); +``` + +## 4. 初始化 UserClient + +账户部署后,您可以无缝初始化 `EndUserClient`。由于 SDK 屏蔽了底层实现,后续的 `executeGasless` 等业务逻辑对所有账户体系都是一致的。 + +```typescript +import { createEndUserClient } from '@aastar/sdk'; + +const userClient = createEndUserClient({ + accountAddress: result1.accountAddress, + account: wallet.account, + chainId: sepolia.id, + // ...其他配置 +}); +``` + +## 5. 常见问题 (FAQ) + +**Q: 我需要支持 Safe 或 Kernel,需要改代码吗?** +A: 不需要。只需要在部署时传入对应的 `factoryAddress` 并指定 `accountType`(可选)。SDK 的 `deployAccount` 会尝试调用标准的工厂接口(`createAccount/getAddress`)。如果该工厂是非标准的,可以通过 `customAbi` 进行适配。 + +**Q: 为什么推荐使用 SDK 统一入口?** +A: 因为 SDK 会自动处理公共客户端(PublicClient)与钱包客户端(WalletClient)的分离,确保地址预测的准确性和交易链上部署的原子性,避免手动拼接 `initCode` 的繁琐。 + +**Q: 账户未部署前可以接收代币吗?** +A: 可以。由于地址是确定性的,您可以向预测出的地址发送代币。但在账户合约部署前,该账户无法发起任何交易。 diff --git a/0.16.23/guide/docs/Configuration_Sync.md b/0.16.23/guide/docs/Configuration_Sync.md new file mode 100644 index 000000000..85611f8ab --- /dev/null +++ b/0.16.23/guide/docs/Configuration_Sync.md @@ -0,0 +1,73 @@ +# SDK & Contract Repository Configuration Sync + +This document outlines the synchronization mechanism between the `SuperPaymaster` (Contracts) repository and the `aastar-sdk`. + +## Overview + +The SDK relies on two artifacts from the contract repository: +1. **ABIs**: JSON files defining the contract interfaces. +2. **Configuration**: JSON files defining deployed contract addresses and source code verification hashes. + +## Sync Workflow + +The synchronization is automated via the `run_sdk_complete_regression.sh` script (and standalone `sync_to_sdk.sh` in SuperPaymaster). + +### 1. Artifact Generation (SuperPaymaster Side) +* **ABIs**: `forge build` generates artifacts. `extract_v3_abis.sh` extracts verified ABIs to `abis/*.json`. +* **Config**: Deployment scripts (e.g., `DeployAnvil.s.sol`) generate `deployments/config.{network}.json`. This file includes: + * Contract Addresses (Registry, SuperPaymaster, etc.) + * `srcHash`: SHA-256 hash of the `contracts/src` directory for integrity checks. + +### 2. Synchronization Bridge +Artifacts are copied to the SDK: +* `abis/*.json` -> `packages/core/src/abis/` +* `deployments/config.{network}.json` -> `config.{network}.json` (SDK Root) + +### 3. SDK Abstraction Layer (`constants.ts`) +The SDK avoids hardcoding addresses or reading JSON files directly in business logic. +* **File**: `packages/core/src/constants.ts` +* **Mechanism**: + * Reads `process.env.NETWORK` (default: 'anvil'). + * Dynamically loads `config.{network}.json`. + * Exports constants like `REGISTRY_ADDRESS`, `SUPER_PAYMASTER_ADDRESS`. +* **Legacy Support**: `contract-addresses.ts` has been refactored to consume `constants.ts`, ensuring backward compatibility. + +### 4. Canonical Address Solidification (V0.16.16+) +To support NPM distribution where root JSON files are unavailable, the SDK now includes a built-in address registry. +* **File**: `packages/core/src/addresses.ts` +* **Mechanism**: + * Hardcoded defaults for Sepolia (Chain ID 11155111) and OP Sepolia (Chain ID 11155420). + * `constants.ts` use these as a third-level fallback after ENV and Local JSON. +* **Benefit**: Users installing via `@aastar/sdk` get a "plug-and-play" experience on supported networks. + +## SDK Release Integrity Lifecycle +To ensure verifiable releases, the SDK uses an automated SHA-256 integrity hash system. + +### 1. Generation (`update-version.sh`) +When upgrading the version, the script automatically: +* Calculates a stable hash of all source files (excluding `.md`). +* Synchronizes this hash into `README.md`, `CHANGELOG.md`, and this document. +* The hash is also included in the Git Tag metadata. + +### 2. Guarding (`publish.sh`) +Before publishing to NPM, the script: +* Re-calculates the actual code hash. +* Compares it with the "Official" hash recorded in `README.md`. +* Blocks the release if any code was modified after the last version update. + +**Current Code Integrity Hash (v0.16.23)**: `9b02e91aaae2081b68b8ddfcf4c3dd52d450b4f368a8746b5896e0024e441db7` +*(Excludes metadata/markdown to ensure stability)* + +## Verification (`verify_onchain_milestone.ts`) + +A verification script (`scripts/verify_onchain_milestone.ts`) ensures the SDK is in sync with the chain: +1. Loads `config.{network}.json` via `constants.ts`. +2. Verifies `srcHash` existence. +3. Checks on-chain code presence for all critical contracts using `viem`. + +## Usage + +To run the full regression with sync and verification: +```bash +./run_sdk_complete_regression.sh --env anvil +``` diff --git a/0.16.23/guide/docs/DAO_Mining_Distribution_Plan.md b/0.16.23/guide/docs/DAO_Mining_Distribution_Plan.md new file mode 100644 index 000000000..6832e6070 --- /dev/null +++ b/0.16.23/guide/docs/DAO_Mining_Distribution_Plan.md @@ -0,0 +1,522 @@ +# GToken DAO 治理挖矿分配机制 + +## 概述 + +基于动态 CAP 管理的 GToken 挖矿分配系统,通过 DAO 委员会治理,实现对基础设施节点贡献的公平奖励。 + +--- + +## 一、核心机制 + +### 1.1 动态供应管理 + +```solidity +// GToken.sol 已实现 +uint256 public constant MAX_SUPPLY = 21_000_000 ether; + +function remainingMintableSupply() external view returns (uint256) { + return cap() - totalSupply(); +} +``` + +**关键特性**: +- ✅ 硬顶 2100万 GToken +- ✅ burn() 自动创造铸造空间 +- ✅ 无需额外存储变量 +- ✅ totalSupply() 是唯一真理源 + +### 1.2 授权铸造逻辑 + +```solidity +// 只要 remainingMintableSupply > 0, 即可 mint +function mint(address to, uint256 amount) external onlyOwner { + _mint(to, amount); // ERC20Capped 自动检查 cap +} +``` + +**无需新增接口**: +- ERC20Capped 已内置 cap 检查 +- 只需查询 `remainingMintableSupply()` + +--- + +## 二、基础设施节点贡献分类 + +### 2.1 计算类别 + +| 类别 | 描述 | 权重基数 | 示例 | +|------|------|----------|------| +| **Validator** | 出块验证节点 | 10 | 验证交易、生成区块 | +| **Indexer** | 数据索引节点 | 7 | 提供 GraphQL API、历史数据查询 | +| **RPC Provider** | RPC 服务节点 | 8 | eth_call, eth_sendTransaction | +| **Bundler** | UserOp 打包节点 | 9 | AA 交易打包、Gas 优化 | +| **Paymaster** | Gas 赞助节点 | 6 | SuperPaymaster Operator | +| **Storage** | 存储节点 | 5 | IPFS, Arweave 网关 | +| **Relay** | 中继节点 | 4 | MEV 保护、隐私交易 | + +### 2.2 贡献量化指标 + +#### Validator 节点 +``` +贡献分 = 出块数量 × 10 + + 验证成功率 × 5 + + 在线时长(小时) × 0.01 +``` + +#### RPC Provider 节点 +``` +贡献分 = 请求响应数量 / 1000 × 8 + + 平均响应时间(ms) × (-0.01) // 越快分数越高 + + 正常运行时间(%) × 2 +``` + +#### Bundler 节点 +``` +贡献分 = UserOp 打包数量 / 100 × 9 + + Gas 节省率(%) × 5 + + 提交成功率 × 3 +``` + +#### Paymaster 节点 +``` +贡献分 = 赞助交易数量 / 50 × 6 + + 赞助金额(ETH) × 10 + + xPNTs 销毁量 × 0.5 +``` + +### 2.3 贡献数据采集 + +**链上数据**: +- 区块链事件日志(Block Produced, UserOp Executed) +- 合约调用记录(Paymaster Deposits, Slash Events) + +**链下数据**(经 Oracle 验证): +- RPC 请求日志 → Chainlink Oracle +- 节点在线时长 → 多签验证者签名 +- 响应时间统计 → TEE 可信计算 + +--- + +## 三、DAO 委员会份额分配策略 + +### 3.1 分配周期 + +**建议**: 每季度(Epoch)进行一次分配 + +```solidity +uint256 public constant EPOCH_DURATION = 90 days; +uint256 public lastMintEpoch; + +modifier onlyNewEpoch() { + require(block.timestamp >= lastMintEpoch + EPOCH_DURATION, "Epoch not ready"); + _; +} +``` + +### 3.2 份额分配比例 + +**DAO 委员会投票决定**: 当前 Epoch 使用 `remainingMintableSupply` 的百分比 + +```solidity +struct EpochAllocation { + uint256 epochId; + uint256 totalAvailable; // remainingMintableSupply 快照 + uint256 allocationPercent; // DAO 投票决定 (basis points, 2000 = 20%) + uint256 actualMinted; + mapping(address => uint256) nodeRewards; +} +``` + +**示例场景**: +- Epoch 1: `remainingMintableSupply` = 5,000,000 +- DAO 投票: 使用 20% (1,000,000 GToken) +- 剩余: 4,000,000 继续留存 + +### 3.3 委员会决策流程 + +``` +1. Oracle 提交链下数据 → Merkle Root +2. DAO 委员会审核 → 投票 +3. 投票通过 → 执行链上分配 +4. 节点领取 → Merkle Proof 验证 +``` + +--- + +## 四、智能合约架构 + +### 4.1 核心合约: MiningDistributor + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.23; + +import "@openzeppelin/contracts/access/AccessControl.sol"; +import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; +import "./GToken.sol"; + +/** + * @title MiningDistributor + * @notice DAO-governed mining reward distribution for infrastructure nodes + * @dev Uses Merkle Tree for efficient reward claiming + */ +contract MiningDistributor is AccessControl { + + bytes32 public constant DAO_ROLE = keccak256("DAO_ROLE"); + bytes32 public constant ORACLE_ROLE = keccak256("ORACLE_ROLE"); + + GToken public immutable gToken; + + uint256 public currentEpoch; + uint256 public constant EPOCH_DURATION = 90 days; + uint256 public epochStartTime; + + struct Epoch { + bytes32 merkleRoot; // 节点奖励 Merkle 树根 + uint256 totalAllocated; // 本 Epoch 总分配量 + uint256 allocationPercent; // 使用百分比 (basis points) + uint256 mintedAmount; // 已铸造总量 + mapping(address => bool) claimed; // 领取记录 + } + + mapping(uint256 => Epoch) public epochs; + + event EpochProposed(uint256 indexed epochId, bytes32 merkleRoot, uint256 allocation); + event EpochApproved(uint256 indexed epochId, uint256 totalMinted); + event RewardClaimed(uint256 indexed epochId, address indexed node, uint256 amount); + + constructor(address _gToken, address _daoAdmin) { + gToken = GToken(_gToken); + _grantRole(DEFAULT_ADMIN_ROLE, _daoAdmin); + _grantRole(DAO_ROLE, _daoAdmin); + epochStartTime = block.timestamp; + } + + /** + * @notice DAO 提案新 Epoch 的分配方案 + * @param merkleRoot 节点奖励 Merkle 树根 + * @param allocationPercent 使用 remainingMintableSupply 的百分比 (basis points) + */ + function proposeEpoch( + bytes32 merkleRoot, + uint256 allocationPercent + ) external onlyRole(DAO_ROLE) { + require(block.timestamp >= epochStartTime + EPOCH_DURATION, "Epoch not ready"); + require(allocationPercent <= 5000, "Max 50% per epoch"); // 安全上限 + + uint256 newEpochId = currentEpoch + 1; + uint256 available = gToken.remainingMintableSupply(); + uint256 allocation = available * allocationPercent / 10000; + + epochs[newEpochId].merkleRoot = merkleRoot; + epochs[newEpochId].allocationPercent = allocationPercent; + epochs[newEpochId].totalAllocated = allocation; + + emit EpochProposed(newEpochId, merkleRoot, allocation); + } + + /** + * @notice DAO 批准并执行分配(进入新 Epoch) + */ + function approveEpoch() external onlyRole(DAO_ROLE) { + uint256 newEpochId = currentEpoch + 1; + require(epochs[newEpochId].merkleRoot != bytes32(0), "No proposal"); + + currentEpoch = newEpochId; + epochStartTime = block.timestamp; + + emit EpochApproved(newEpochId, epochs[newEpochId].totalAllocated); + } + + /** + * @notice 节点领取奖励 + * @param epochId Epoch ID + * @param amount 奖励数量 + * @param proof Merkle 证明 + */ + function claimReward( + uint256 epochId, + uint256 amount, + bytes32[] calldata proof + ) external { + require(epochId <= currentEpoch, "Future epoch"); + require(!epochs[epochId].claimed[msg.sender], "Already claimed"); + + // 验证 Merkle Proof + bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount)); + require( + MerkleProof.verify(proof, epochs[epochId].merkleRoot, leaf), + "Invalid proof" + ); + + epochs[epochId].claimed[msg.sender] = true; + epochs[epochId].mintedAmount += amount; + + // 铸造奖励(GToken owner 需授权此合约) + gToken.mint(msg.sender, amount); + + emit RewardClaimed(epochId, msg.sender, amount); + } + + /** + * @notice 查询节点在指定 Epoch 的奖励领取状态 + */ + function hasClaimed(uint256 epochId, address node) external view returns (bool) { + return epochs[epochId].claimed[node]; + } + + /** + * @notice 获取当前可分配总量 + */ + function getAvailableForMinting() external view returns (uint256) { + return gToken.remainingMintableSupply(); + } +} +``` + +--- + +## 五、DAO 治理流程 + +### 5.1 提案阶段 + +**输入**: +1. Oracle 提交链下数据汇总(Merkle Root) +2. 包含所有符合条件节点的贡献分及奖励金额 + +**DAO 审核**: +- 验证 Oracle 数据真实性 +- 检查分配比例合理性 +- 投票决定 `allocationPercent` + +### 5.2 投票标准 + +```solidity +// 简单多签 DAO (可升级为 Governor) +contract SimpleDAO { + uint256 public constant QUORUM = 3; // 最少投票数 + uint256 public constant THRESHOLD = 2; // 通过阈值 + + mapping(bytes32 => uint256) public proposalVotes; + mapping(bytes32 => mapping(address => bool)) public hasVoted; + + function vote(bytes32 proposalId) external onlyMember { + require(!hasVoted[proposalId][msg.sender], "Already voted"); + hasVoted[proposalId][msg.sender] = true; + proposalVotes[proposalId]++; + + if (proposalVotes[proposalId] >= THRESHOLD) { + // 执行提案 + distributor.approveEpoch(); + } + } +} +``` + +### 5.3 执行与领取 + +1. **批准执行**: DAO 调用 `approveEpoch()` +2. **节点领取**: 节点自行调用 `claimReward()` + Merkle Proof +3. **Gas 优化**: 只需链上存储 Merkle Root,节点数据存储在 IPFS + +--- + +## 六、Merkle Tree 生成(链下) + +### 6.1 数据结构 + +```typescript +interface NodeReward { + address: string; + contributionScore: number; + rewardAmount: bigint; + category: string; +} + +const nodeRewards: NodeReward[] = [ + { + address: "0xValidator1...", + contributionScore: 1250, + rewardAmount: parseEther("50000"), + category: "Validator" + }, + { + address: "0xRPC_Provider...", + contributionScore: 890, + rewardAmount: parseEther("35000"), + category: "RPC Provider" + }, + // ... +]; +``` + +### 6.2 Merkle Tree 构建 + +```typescript +import { MerkleTree } from 'merkletreejs'; +import { keccak256, solidityPacked } from 'ethers'; + +function generateMerkleTree(rewards: NodeReward[]): { root: string, tree: MerkleTree } { + const leaves = rewards.map(r => + keccak256(solidityPacked(['address', 'uint256'], [r.address, r.rewardAmount])) + ); + + const tree = new MerkleTree(leaves, keccak256, { sortPairs: true }); + const root = tree.getHexRoot(); + + return { root, tree }; +} + +function getProof(tree: MerkleTree, address: string, amount: bigint): string[] { + const leaf = keccak256(solidityPacked(['address', 'uint256'], [address, amount])); + return tree.getHexProof(leaf); +} +``` + +### 6.3 IPFS 发布 + +```typescript +// 将完整奖励数据发布到 IPFS +const ipfsHash = await ipfs.add(JSON.stringify({ + epochId: 5, + merkleRoot: root, + totalAllocated: parseEther("1000000"), + rewards: nodeRewards, + timestamp: Date.now() +})); + +// DAO 链上只需存储 +distributor.proposeEpoch(root, 2000); // 使用20% +``` + +--- + +## 七、实施路线图 + +### Phase 1: 合约部署 (Week 1-2) + +- [x] GToken v2.1.0 (已完成) +- [x] GTokenStaking v3.1.0 (已完成) +- [ ] MiningDistributor v1.0.0 +- [ ] SimpleDAO / Governor + +### Phase 2: Oracle 集成 (Week 3-4) + +- [ ] Chainlink Oracle 适配器 +- [ ] 链下数据聚合脚本 +- [ ] Merkle Tree 生成工具 + +### Phase 3: DAO 治理测试 (Week 5-6) + +- [ ] Testnet 部署 +- [ ] 首个 Epoch 模拟投票 +- [ ] 节点领取流程验证 + +### Phase 4: 主网上线 (Week 7-8) + +- [ ] 安全审计 +- [ ] 主网部署 +- [ ] 社区公告与教育 + +--- + +## 八、安全考量 + +### 8.1 防止滥用 + +**单 Epoch 上限**: +```solidity +require(allocationPercent <= 5000, "Max 50% per epoch"); +``` + +**时间锁**: +```solidity +uint256 public constant PROPOSAL_DELAY = 3 days; +``` + +**紧急暂停**: +```solidity +bool public paused; + +modifier whenNotPaused() { + require(!paused, "Paused"); + _; +} +``` + +### 8.2 Oracle 安全 + +**多 Oracle 验证**: +```solidity +mapping(bytes32 => uint256) public oracleConfirmations; +uint256 public constant REQUIRED_CONFIRMATIONS = 3; +``` + +**数据时效性**: +```solidity +require(block.timestamp - dataTimestamp < 1 days, "Stale data"); +``` + +--- + +## 九、常见问题 + +### Q1: remainingMintableSupply 如何实时追踪? + +**A**: 无需追踪!`totalSupply()` 已实时更新: + +```solidity +// 每次 burn 调用时 +function _burn(address account, uint256 amount) internal virtual { + _totalSupply -= amount; // 自动减少 + // ... +} + +// 查询时 +function remainingMintableSupply() external view returns (uint256) { + return cap() - totalSupply(); // 实时计算 +} +``` + +### Q2: DAO 可以无限 mint 吗? + +**A**: 不可以! `ERC20Capped._mint()` 强制检查: + +```solidity +function _mint(address account, uint256 amount) internal virtual { + require(totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded"); + super._mint(account, amount); +} +``` + +### Q3: 如何激励节点长期运行? + +**A**: 引入"质押乘数": + +```solidity +贡献分 = 基础分 × (1 + stakingDuration / 365 days × 0.5) +``` + +运行满1年的节点,贡献分增加50%。 + +--- + +## 十、总结 + +✅ **已实现**: +- GToken v2.1.0: Burnable + remainingMintableSupply +- GTokenStaking v3.1.0: True Burn + +🔄 **待实施**: +- MiningDistributor 合约 +- DAO 治理合约 +- Oracle 数据聚合 + +📊 **核心优势**: +- 透明: totalSupply = 唯一真理 +- 灵活: DAO 动态调整分配比例 +- 高效: Merkle Tree 节省 Gas +- 公平: 基于量化贡献的分配 + +> [!NOTE] +> 这是一个完全链上治理的分配系统,无需信任中心化实体,所有分配决策由 DAO 投票决定。 diff --git a/0.16.23/guide/docs/DEMO_REFACTOR_PLAN.md b/0.16.23/guide/docs/DEMO_REFACTOR_PLAN.md new file mode 100644 index 000000000..697d57aef --- /dev/null +++ b/0.16.23/guide/docs/DEMO_REFACTOR_PLAN.md @@ -0,0 +1,289 @@ +# Demo 重构计划 + +## 项目目标 +创建一个基于 SDK 高层 API (99%) 的交互式演示系统,提供清晰的左右分栏界面,展示 AAStar 生态系统的完整生命周期。 + +## UI/UX 架构设计 + +### 界面布局 +``` +┌─────────────────────────────────────────────────────────┐ +│ AAStar Demo │ +├──────────────┬──────────────────────────────────────────┤ +│ │ │ +│ 左侧导航栏 │ 右侧内容区域 │ +│ │ │ +│ ┌────────┐ │ ┌─────────────────────────────────────┐ │ +│ │ Step 1 │ │ │ │ │ +│ │Accounts│ │ │ 当前步骤的详细信息和操作界面 │ │ +│ └────────┘ │ │ │ │ +│ ┌────────┐ │ │ - 显示历史记录 │ │ +│ │ Step 2 │ │ │ - 显示当前状态 │ │ +│ │Community│ │ │ - 提供操作按钮 │ │ +│ └────────┘ │ │ - 实时反馈 │ │ +│ ┌────────┐ │ │ │ │ +│ │ Step 3 │ │ └─────────────────────────────────────┘ │ +│ │Operator│ │ │ +│ └────────┘ │ │ +│ ┌────────┐ │ │ +│ │ Step 4 │ │ │ +│ │End User│ │ │ +│ └────────┘ │ │ +│ │ │ +└──────────────┴──────────────────────────────────────────┘ +``` + +### 分步骤功能设计 + +#### Step 1: Account Management (账户管理) +**右侧显示内容** +- 账户列表表格 + +| 名称 | 地址 | ETH 余额 | GToken 余额 | 操作 | +|---------|-------------------|----------|-------------|---------| +| Alice | 0xB6D3... | 0.1000 | 200.00 | [选择] | +| Bob | 0x2944... | 0.1000 | 200.00 | [选择] | +| Charlie | 0xa74f... | 0.1000 | 100.00 | [选择] | + +**操作按钮** +- `+ 新建账户` - 生成新的 EOA 账户 +- `刷新余额` - 更新所有账户余额 +- `充值选中账户` - 为选中账户充值 ETH 和 GToken + +**SDK API 需求** +- ✅ `KeyManager.generateAccount()` - 生成账户 +- ✅ `FundingManager.fundWithETH()` - ETH 充值 +- ✅ `FundingManager.fundWithToken()` - Token 充值 +- 🆕 `StateValidator.getAccountBalances()` - 批量查询余额 + +#### Step 2: Launch Community (启动社区) +**右侧显示内容** +- 当前账户状态卡片 + ``` + 选中账户: Alice (0xB6D3...) + ┌─────────────────────────────────────┐ + │ 社区状态 │ + ├─────────────────────────────────────┤ + │ ✅ 已注册 COMMUNITY 角色 │ + │ ✅ 已部署社区 Token │ + │ │ + │ Token 地址: 0xb65D... │ + │ Token 名称: DemoDAO_xxx │ + │ 注册时间: 2024-12-29 11:37 │ + └─────────────────────────────────────┘ + ``` + +**操作流程** +- 如果未注册:显示 `[启动新社区]` 表单 + - 社区名称输入框 + - ENS 名称(可选) + - 描述(可选) + - `[确认启动]` 按钮 +- 如果已注册:显示社区详情 + `[查看 Token 详情]` + +**SDK API 需求** +- ✅ `CommunityClient.launch()` - 启动社区 +- 🆕 `CommunityClient.getCommunityInfo(account)` - 查询社区信息 + ```typescript + { + hasRole: boolean; + tokenAddress: Address | null; + communityData: { + name: string; + ensName: string; + createdAt: number; + } | null; + } + ``` + +#### Step 3: Setup Operator (运营商设置) +**右侧显示内容** +- 运营商类型选择 + ``` + 选中账户: Bob (0x2944...) + 请选择运营商类型: + ┌──────────────────────────────────────┐ + │ ⭕ SuperPaymaster (推荐) │ + │ - 跨社区共享流动性 │ + │ - 支持多 Token 支付 │ + │ - 需要质押 50 GToken + 存入 aPNTs │ + └──────────────────────────────────────┘ + ┌──────────────────────────────────────┐ + │ ⭕ Paymaster V4 (独立) │ + │ - 社区独立部署 │ + │ - 单一 Token 支付 │ + │ - 需要指定 Token 和 SBT │ + └──────────────────────────────────────┘ + ``` + +- 已注册状态显示 + ``` + ┌─────────────────────────────────────┐ + │ SuperPaymaster 运营商 │ + ├─────────────────────────────────────┤ + │ ✅ 已质押: 50 GToken │ + │ ✅ 已存入: 100 aPNTs │ + │ 📊 可用余额: 75 aPNTs │ + │ 🏦 Treasury: 0x2944... │ + │ 📈 Exchange Rate: 1:1 │ + └─────────────────────────────────────┘ + ``` + +**操作:** +- `[追加存款]` `[提取余额]` `[修改配置]` + +**SDK API 需求** +- ✅ `OperatorClient.onboardOperator()` - 注册运营商(SuperPaymaster) +- ✅ `OperatorClient.deployPaymasterV4()` - 部署 Paymaster V4 +- 🆕 `OperatorClient.getOperatorInfo(account)` - 查询运营商状态 + ```typescript + { + type: 'super' | 'v4' | null; + superPaymaster: { + isConfigured: boolean; + balance: bigint; + exchangeRate: bigint; + treasury: Address; + } | null; + paymasterV4: { + address: Address; + token: Address; + balance: bigint; + } | null; + } + ``` +- 🆕 `OperatorClient.depositFunds(amount)` - 追加存款 +- 🆕 `OperatorClient.withdrawFunds(amount)` - 提取余额 + +#### Step 4: Onboard End User (用户入驻) +**右侧显示内容** +- 用户账户来源选择 + ``` + 选择用户账户类型: + ┌──────────────────────────────────────┐ + │ ⭕ 从现有 EOA 创建 │ + │ 选择账户: [下拉列表] │ + │ [创建 AA 账户] │ + └──────────────────────────────────────┘ + ┌──────────────────────────────────────┐ + │ ⭕ 生成新的 Simple Account │ + │ 盐值: [自动生成] │ + │ [部署新账户] │ + └──────────────────────────────────────┘ + ``` + +- 用户状态显示 + ``` + ┌─────────────────────────────────────┐ + │ AA Account: 0x1234... │ + ├─────────────────────────────────────┤ + │ 📍 已部署 │ + │ 👤 Owner: Alice (0xB6D3...) │ + │ 💰 余额: │ + │ - 0.05 ETH │ + │ - 50 xPNTs (社区 Token) │ + │ - 100 aPNTs │ + │ │ + │ 🎫 SBT 持有: │ + │ - MySBT #1234 (已mint) │ + └─────────────────────────────────────┘ + ``` + +**操作:** +- `[充值 xPNTs]` `[Mint SBT]` `[发送 UserOp]` + +**SDK API 需求** +- 🆕 `EndUserClient.deployAccount(owner, salt?)` - 部署 AA 账户 +- 🆕 `EndUserClient.getAccountInfo(address)` - 查询 AA 账户信息 +- 🆕 `EndUserClient.mintSBT(account)` - 为用户 Mint SBT +- 🆕 `EndUserClient.fundWithXPNTs(account, amount)` - 充值社区 Token +- ✅ `EndUserClient.sendUserOp()` - 发送 UserOperation + +## SDK API 增强计划 + +### 优先级分类 +**P0 - 立即实现(状态查询类)** +- `CommunityClient.getCommunityInfo(account: Address)` +- `OperatorClient.getOperatorInfo(account: Address)` +- `StateValidator.getAccountBalances(addresses: Address[])` + +**P1 - 高优先级(核心功能)** +- `EndUserClient.deployAccount(owner: Address, salt?: bigint)` +- `EndUserClient.mintSBT(account: Address)` +- `OperatorClient.depositFunds(amount: bigint)` +- `OperatorClient.withdrawFunds(amount: bigint)` + +**P2 - 中优先级(增强功能)** +- `EndUserClient.getAccountInfo(address: Address)` +- `EndUserClient.fundWithXPNTs(account: Address, amount: bigint)` + +### 回归脚本分析 +需要从以下脚本中提取功能: + +**社区相关** +- ✅ `01_register_community_raw.ts` - 已提取为 `CommunityClient.launch()` +- 📋 `09_local_test_community_lifecycle.ts` - 社区生命周期完整流程 + +**运营商相关** +- 📋 `deploy_paymaster_v4.ts` - Paymaster V4 部署逻辑 +- 📋 `05_test_superpaymaster.ts` - SuperPaymaster 完整设置流程 + - Line 114-199: `setupOperator` 函数(包含配置和存款) + +**用户相关** +- 📋 `deploy_test_accounts.ts` - AA 账户部署逻辑 +- 📋 `03_test_standard_aa.ts` - AA 交互流程 + +## 实现路线图 + +### 阶段 1: 修复当前错误 ✅ +- [x] 修复 account undefined 错误 +- [x] 修复 gToken undefined 错误 +- [x] 确保 SDK 构建成功 + +### 阶段 2: SDK API 增强 (1-2天) +- [ ] 实现 P0 状态查询 API +- [ ] 从回归脚本提取 `setupOperator` 的配置逻辑 +- [ ] 从 `deploy_test_accounts.ts` 提取 AA 部署逻辑 +- [ ] 添加单元测试 + +### 阶段 3: UI 重构 (2-3天) +- [ ] 重构 index.html 为左右分栏布局 +- [ ] 实现 Step 1: Account Management +- [ ] 实现 Step 2: Launch Community(状态查询 + 操作) +- [ ] 实现 Step 3: Setup Operator(类型选择 + 状态查询) +- [ ] 实现 Step 4: Onboard End User + +### 阶段 4: 集成测试 (1天) +- [ ] 端到端流程测试 +- [ ] 性能优化 +- [ ] 错误处理完善 + +## 技术细节 + +### 前端状态管理 +```javascript +const demoState = { + selectedAccount: null, // 当前选中的账户 + currentStep: 1, // 当前步骤 + accounts: [], // 账户列表 + communityInfo: {}, // 社区信息缓存 + operatorInfo: {}, // 运营商信息缓存 + aaAccounts: [] // AA 账户列表 +}; +``` + +### API 响应格式规范 +所有 SDK API 应返回统一格式: +```typescript +interface SDKResponse { + success: boolean; + data?: T; + error?: string; + txHashes?: Hash[]; +} +``` + +## 下一步行动 +- ✅ 立即修复: 修复 operator 设置中的地址问题 +- 📝 规划审查: 用户审查本计划,提供反馈 +- 🔨 开始实施: 按阶段实施 diff --git a/0.16.23/guide/docs/DOCUMENTATION_PLAN.md b/0.16.23/guide/docs/DOCUMENTATION_PLAN.md new file mode 100644 index 000000000..c28a7aac0 --- /dev/null +++ b/0.16.23/guide/docs/DOCUMENTATION_PLAN.md @@ -0,0 +1,455 @@ +# AAStar SDK 文档生成和发布方案 + +## 概述 + +本文档定义了AAStar SDK的完整文档生成、维护和发布流程。 + +--- + +## 1. 技术栈选择 + +### 推荐方案: VitePress + +**优势**: +- ⚡ 基于Vite,构建速度极快 +- 📝 原生Markdown支持 +- 🎨 Vue组件集成 +- 🔍 内置全文搜索 +- 📱 响应式设计 +- 🚀 零配置部署到GitHub Pages/Vercel + +**替代方案**: Docusaurus (React生态) + +--- + +## 2. 仓库架构 + +### 2.1 SDK仓库 (`aastar-sdk`) + +``` +aastar-sdk/ +├── packages/ # SDK源码 +│ ├── core/ +│ ├── account/ +│ ├── paymaster/ +│ └── ... +├── docs/ # 文档源文件 +│ ├── guide/ # 手写指南 +│ │ ├── getting-started.md +│ │ ├── concepts.md +│ │ └── use-cases/ +│ │ ├── community-management.md +│ │ ├── gasless-transactions.md +│ │ └── operator-staking.md +│ ├── api/ # 自动生成的API文档 +│ │ ├── core.md +│ │ ├── account.md +│ │ └── ... +│ └── examples/ # 完整示例 +│ ├── operator-flow.md +│ ├── community-flow.md +│ └── enduser-flow.md +├── scripts/ +│ ├── generate-api-docs.ts # API文档生成脚本 +│ └── sync-to-docs-repo.sh # 同步到文档仓库 +└── package.json +``` + +### 2.2 文档仓库 (`aastar-docs`) + +``` +aastar-docs/ +├── .vitepress/ +│ ├── config.ts # VitePress配置 +│ ├── theme/ # 自定义主题 +│ └── components/ # Vue组件 +├── public/ # 静态资源 +│ ├── logo.svg +│ └── images/ +├── index.md # 首页 +├── guide/ # 从SDK repo同步 +├── api/ # 从SDK repo同步 +├── examples/ # 从SDK repo同步 +└── package.json +``` + +--- + +## 3. 自动化工作流 + +### 3.1 API文档自动生成 + +使用 **TypeDoc** 或 **API Extractor** 从TypeScript源码提取API文档。 + +**脚本**: `scripts/generate-api-docs.ts` + +```typescript +import { Application } from 'typedoc'; + +async function generateAPIDocs() { + const app = new Application(); + + app.options.addReader(new TypeDocReader()); + app.bootstrap({ + entryPoints: ['packages/*/src/index.ts'], + out: 'docs/api', + plugin: ['typedoc-plugin-markdown'], + }); + + const project = app.convert(); + await app.generateDocs(project, 'docs/api'); +} +``` + +### 3.2 文档同步流程 + +文档同步使用 `scripts/extract-docs.sh` 腳本,手動調用命令為 `pnpm run docs:sync`。 + +**流程**: +1. 在 `aastar-sdk` 運行 `pnpm run docs:generate` 生成最新 API 文檔。 +2. 運行 `pnpm run docs:sync` 將 `docs/` 文件夾內容同步到 `aastar-docs`。 +3. 同步過程會保持相同的目錄結構 (`guide/`, `api/`, `examples/`)。 + +**Shell 腳本核心邏輯**: +\`\`\`bash +# 同步 Guide +cp -r "$SDK_REPO/docs/guide/"* "$DOCS_REPO/guide/" +# 同步 API +cp -r "$SDK_REPO/docs/api/"* "$DOCS_REPO/api/" +# 同步 Examples +cp -r "$SDK_REPO/docs/examples/"* "$DOCS_REPO/examples/" +\`\`\` + + + +### 3.3 文档站点部署 + +Use docs repo shell to deploy. +--- + +## 4. 文档结构设计 + +### 4.1 首页 (index.md) + +```markdown +# AAStar SDK + +> Build Your Own Protocol (YOP) with Account Abstraction + +## Features +- 🚀 Gasless Transactions (SuperPaymaster AOA+) +- 🌈 EOA Rainbow Bridge +- 🏛️ Community Management +- 🎯 Reputation System + +## Quick Start +[Get Started →](/0.16.23/guide/getting-started) +``` + +### 4.2 指南结构 + +``` +guide/ +├── index.md # 指南概览 +├── getting-started.md # 快速开始 +├── concepts/ +│ ├── account-abstraction.md +│ ├── superpaymaster.md +│ └── reputation-system.md +├── use-cases/ +│ ├── community-management.md +│ ├── gasless-transactions.md +│ ├── operator-staking.md +│ └── rainbow-bridge.md +└── advanced/ + ├── custom-paymaster.md + └── multi-chain.md +``` + +### 4.3 API文档结构 (按角色组织) + +``` +api/ +├── index.md # API概览 +├── roles/ +│ ├── operator.md # Operator角色API +│ ├── community.md # Community角色API +│ ├── enduser.md # EndUser角色API +│ └── admin.md # Admin角色API +├── modules/ +│ ├── core.md # Core模块 +│ ├── account.md # Account模块 +│ ├── paymaster.md # Paymaster模块 +│ ├── tokens.md # Tokens模块 +│ └── identity.md # Identity模块 +└── types/ + ├── common.md # 通用类型 + └── errors.md # 错误类型 +``` + +--- + +## 5. API文档模板 + +### 5.1 模块文档模板 + +```markdown +# @aastar/core + +Core configuration and client creation utilities. + +## Installation + +\`\`\`bash +pnpm add @aastar/core +\`\`\` + +## Exports + +- [Networks](#networks) +- [Contracts](#contracts) +- [Clients](#clients) +- [Constants](#constants) + +--- + +## Networks + +### getNetwork() + +Get network configuration for a supported network. + +**Signature:** +\`\`\`typescript +function getNetwork(network: SupportedNetwork): NetworkConfig +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| network | `SupportedNetwork` | Network name ('sepolia' \| 'optimism' \| 'anvil') | + +**Returns:** +| Type | Description | +|------|-------------| +| `NetworkConfig` | Network configuration object | + +**Type Definitions:** +\`\`\`typescript +type SupportedNetwork = 'sepolia' | 'optimism' | 'optimism-sepolia' | 'anvil'; + +interface NetworkConfig { + chainId: number; + name: string; + rpcUrl: string; + blockExplorer: string; + nativeCurrency: { + name: string; + symbol: string; + decimals: number; + }; +} +\`\`\` + +**Example:** +\`\`\`typescript +import { getNetwork } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +console.log(network.rpcUrl); // 'https://rpc.sepolia.org' +\`\`\` + +**Errors:** +- Throws if network is not supported + +**See Also:** +- [getTxUrl()](#gettxurl) +- [getChainId()](#getchainid) +``` + +### 5.2 角色文档模板 + +```markdown +# Operator API + +API reference for Paymaster operators. + +## Overview + +Operators are responsible for: +- Staking GTokens +- Depositing to Paymaster +- Managing withdrawals +- Monitoring performance + +## Client Creation + +### createOperatorClient() + +Create a client for Paymaster operators. + +[详细文档...] + +## Actions + +### stake() + +Stake GTokens to become an operator. + +**Context:** Use this when you want to register as a Paymaster operator. + +**Prerequisites:** +- Must have GTokens +- Must approve GTokenStaking contract + +**Signature:** +\`\`\`typescript +stake(params: StakeParams): Promise +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| params.amount | `bigint` | Amount to stake (in wei) | + +**Returns:** +| Type | Description | +|------|-------------| +| `Promise` | Transaction hash | + +**Example:** +\`\`\`typescript +import { createOperatorClient } from '@aastar/core'; +import { parseEther } from 'viem'; + +const operator = createOperatorClient({...}); + +// Approve first +await operator.approveGToken({ + spender: CONTRACTS.sepolia.gTokenStaking, + amount: parseEther('100'), +}); + +// Then stake +const txHash = await operator.stake({ + amount: parseEther('100'), +}); +\`\`\` + +**Errors:** +- `InsufficientBalance` - Not enough GTokens +- `InsufficientAllowance` - Need to approve first +- `MinimumStakeNotMet` - Amount below minimum + +**Events Emitted:** +- `Staked(operator, amount)` + +**See Also:** +- [deposit()](#deposit) +- [withdraw()](#withdraw) +``` + +--- + +## 6. 实施步骤 + +### Phase 1: 基础设施搭建 (1-2天) + +- [ ] 创建`aastar-docs`仓库 +- [ ] 安装VitePress并配置 +- [ ] 设置GitHub Actions自动部署 +- [ ] 配置自定义域名`docs.aastar.io` + +### Phase 2: API文档生成 (2-3天) + +- [ ] 安装TypeDoc和相关插件 +- [ ] 编写`generate-api-docs.ts`脚本 +- [ ] 为每个模块生成API文档 +- [ ] 添加类型定义和错误说明 + +### Phase 3: 指南编写 (3-5天) + +- [ ] 编写快速开始指南 +- [ ] 编写核心概念文档 +- [ ] 编写用例文档(社区管理、无Gas交易等) +- [ ] 编写高级主题文档 + +### Phase 4: 角色文档 (2-3天) + +- [ ] 按角色组织API文档 +- [ ] 为每个角色编写完整工作流 +- [ ] 添加实际代码示例 +- [ ] 添加最佳实践 + +### Phase 5: 自动化和优化 (1-2天) + +- [ ] 设置自动同步workflow +- [ ] 添加文档搜索功能 +- [ ] 优化移动端显示 +- [ ] 添加代码playground (可选) + +--- + +## 7. 维护流程 + +### 日常维护 + +1. **代码变更时**: + - 开发者提交PR + - CI自动运行`pnpm run docs:generate` + - 检查API文档变更 + - 合并后自动同步到docs repo + +2. **手动文档更新**: + - 在SDK repo的`docs/`目录编辑 + - 提交后自动同步 + +3. **版本发布**: + - 打tag时自动生成版本化文档 + - 保留历史版本文档 + +### 质量保证 + +- [ ] 文档链接检查 +- [ ] 代码示例可运行性测试 +- [ ] TypeScript类型检查 +- [ ] Markdown格式检查 + +--- + +## 8. 工具和脚本 + +### package.json scripts + +```json +{ + "scripts": { + "docs:generate": "tsx scripts/generate-api-docs.ts", + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs", + "docs:sync": "bash scripts/sync-to-docs-repo.sh" + } +} +``` + +--- + +## 9. 参考资源 + +- [VitePress官方文档](https://vitepress.dev) +- [TypeDoc文档](https://typedoc.org) +- [Viem文档](https://viem.sh) (参考其文档结构) +- [Ethers.js文档](https://docs.ethers.org) (参考其API组织方式) + +--- + +## 11. 論文數據採集指南 (PhD Data collection) + +詳細指南請參見: [paper-data-collection.md](file:///Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/docs/paper-data-collection.md) + +**核心要點**: +- 所有實驗必須使用 `aastar-sdk` 實作。 +- 使用 `run_automated_experiment.sh` 進行自動化運行。 +- 數據採集涵蓋: Gas Usage, Latency, Throughput (TPS), Cost (USD)。 diff --git a/0.16.23/guide/docs/ENV_SEPOLIA_UPDATE.md b/0.16.23/guide/docs/ENV_SEPOLIA_UPDATE.md new file mode 100644 index 000000000..dea6b2338 --- /dev/null +++ b/0.16.23/guide/docs/ENV_SEPOLIA_UPDATE.md @@ -0,0 +1,68 @@ +# .env.sepolia Configuration Update + +## Summary +Cleaned and updated `.env.sepolia` with latest Sepolia deployment addresses from `SuperPaymaster/script/v3/config/deployed.json`. + +## Key Changes + +### Removed Duplicates +- Removed old/duplicate contract addresses (e.g., multiple GTOKEN_ADDRESS entries) +- Consolidated to single source of truth + +### Latest Contract Addresses + +#### Paymaster Contracts +- **PaymasterV4 Proxy**: `0x0F9019Dd30C7Cc5774d4883fba933aA0Caba9424` +- **PaymasterV4 Implementation**: `0x720472c8ce72c2A2D711333e064ABD3E6BbEAdd3` +- **SuperPaymaster**: `0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D` +- **Paymaster Factory**: `0x5c74c94173F05dA1720953407cbb920F3DF9f887` + +#### Core Contracts +- **GToken**: `0xfbC22278A96299D91d41C453234d97b4F5Eb9B2d` +- **Staking**: `0xC9a43158891282A2B1475592D5719c001986Aaec` +- **Registry**: `0x367761085BF3C12e5DA2Df99AC6E1a824612b8fb` +- **MySBT**: `0x1c85638e118b37167e9298c2268758e058DdfDA0` +- **ReputationSystem**: `0xCace1b78160AE76398F486c8a18044da0d66d86D` + +#### Token Contracts +- **aPNTs**: `0x49fd2BE640DB2910c2fAb69bB8531Ab6E76127ff` +- **xPNTs Factory**: `0xA4899D35897033b927acFCf422bc745916139776` + +#### EntryPoint & Validators +- **EntryPoint V0.7**: `0x2B0d36FACD61B71CC05ab8F3D2355ec3631C0dd5` +- **BLS Aggregator**: `0xF8e31cb472bc70500f08Cd84917E5A1912Ec8397` +- **DVT Validator**: `0xD5ac451B0c50B9476107823Af206eD814a2e2580` + +#### SimpleAccount Factory +- **Factory**: `0x4b6aB5F819A515382B0dEB6935D793817bB4af28` + +### Test Account Configuration +- **TEST_SIMPLE_ACCOUNT_A**: `0x11595E52131Ffd571ce5e00C44472FBf94c99937` + - ✅ Has PIM tokens deposited + - ✅ Ready for Pimlico paymaster tests +- **TEST_OWNER_EOA_A**: `0xda7f83CafAe1b76Bd4446a4aB2B8e88770CfA927` +- **TEST_OWNER_KEY_A**: (stored in .env.sepolia) + +### Bundler RPC Configuration +- **Primary RPC**: `SEPOLIA_RPC_URL` (Alchemy) +- **Bundler RPC**: `SEPOLIA_RPC_URL2` (Alchemy bundler endpoint) + - Used for AA UserOp submission + +## For Experiment Runner + +The experiment runner now uses: +1. **PAYMASTER_ADDRESS**: `0x0F9019Dd30C7Cc5774d4883fba933aA0Caba9424` (PaymasterV4 Proxy) +2. **SUPERPAYMASTER_ADDRESS**: `0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D` +3. **SEPOLIA_RPC_URL2**: Alchemy bundler RPC for Groups 3 & 4 + +## Next Steps +Run the experiment runner to test all 4 groups: +```bash +pnpm tsx scripts/19_sdk_experiment_runner.ts +``` + +Expected results: +- ✅ Group 1 (EOA): Should pass +- ✅ Group 2 (Pimlico): Should pass with PIM tokens +- ✅ Group 3 (AOA/PaymasterV4): Should pass with new address +- ✅ Group 4 (SuperPaymaster): Should pass with new address diff --git a/0.16.23/guide/docs/L2_BUSINESS_CLIENTS_PLAN.md b/0.16.23/guide/docs/L2_BUSINESS_CLIENTS_PLAN.md new file mode 100644 index 000000000..26152e339 --- /dev/null +++ b/0.16.23/guide/docs/L2_BUSINESS_CLIENTS_PLAN.md @@ -0,0 +1,394 @@ +# L2 Business Clients 开发计划 + +## 🎯 L2 层目标 + +基于完整的 L1 Core Actions,构建**角色导向**的高层业务客户端,封装端到端业务逻辑。 + +--- + +## 📋 L2 架构设计 + +### 核心原则 + +1. **角色导向** - 按用户角色划分 Client +2. **业务完整** - 封装完整业务流程 +3. **简化接口** - 隐藏底层复杂性 +4. **组合 L1** - 复用所有 L1 actions + +### 四大角色 Client + +``` +L2 Business Clients +├── CommunityClient - 社区管理者 +├── PaymasterOperatorClient - Paymaster 运营商 +├── UserClient - 终端用户 +└── DAOClient - DAO 治理者 +``` + +--- + +## 1️⃣ CommunityClient - 社区管理者 + +### 目标用户 +社区创建者和管理员 + +### 核心功能 + +#### 1.1 社区创建与配置 +- `createCommunity(name, ensName)` - 创建社区并注册 +- `deployCommunityToken(name, symbol)` - 部署社区代币(xPNTs) +- `configureCommunity(config)` - 配置社区参数 + +#### 1.2 成员管理 +- `getMemberships()` - 获取所有成员 +- `getActiveMemberships()` - 获取活跃成员 +- `verifyCommunityMembership(user)` - 验证成员资格 +- `airdropSBT(users, metadata)` - 批量空投 SBT + +#### 1.3 角色管理 +- `createRole(name, config)` - 创建自定义角色 +- `configureRole(roleId, config)` - 配置角色参数 +- `assignRole(user, roleId)` - 分配角色 +- `revokeRole(user, roleId)` - 撤销角色 + +#### 1.4 信誉系统 +- `setReputationRule(ruleId, rule)` - 设置信誉规则 +- `computeMemberScore(user)` - 计算成员积分 +- `getCommunityRanking()` - 获取排行榜 + +### 使用示例 + +```typescript +import { CommunityClient } from '@aastar/enduser'; + +const community = new CommunityClient({ + registryAddress: REGISTRY, + sbtAddress: MYSBT, + factoryAddress: XPNTS_FACTORY, + client: walletClient, +}); + +// 创建社区 +const { communityAddress, tokenAddress } = await community.createCommunity({ + name: 'Web3 Builders', + ensName: 'web3builders.eth', + tokenSymbol: 'W3B', +}); + +// 空投 SBT +await community.airdropSBT({ + users: ['0x...', '0x...'], + metadata: { tier: 'founder' }, +}); + +// 设置信誉规则 +await community.setReputationRule({ + ruleId: '0x01', + rule: { + activityWeight: 50, + contributionWeight: 50, + }, +}); +``` + +--- + +## 2️⃣ PaymasterOperatorClient - Paymaster 运营商 + +### 目标用户 +Paymaster 运营商(赞助交易的服务提供者) + +### 核心功能 + +#### 2.1 运营商注册与配置 +- `registerAsOperator()` - 注册为 Paymaster 运营商 +- `configureOperator(config)` - 配置运营参数 +- `deployPaymaster(owner)` - 部署自己的 Paymaster + +#### 2.2 资金管理 +- `deposit(amount)` - 充值到 SuperPaymaster +- `withdraw(amount)` - 提取资金 +- `getBalance()` - 查询余额 +- `getAvailableCredit(user)` - 查询用户额度 + +#### 2.3 赞助策略 +- `setSponsorshipPolicy(policy)` - 设置赞助策略 +- `updateExchangeRate(rate)` - 更新兑换率 +- `setPause(paused)` - 暂停/恢复服务 +- `setOperatorLimits(limits)` - 设置运营限制 + +#### 2.4 监控与审计 +- `getOperatorStats()` - 获取运营统计 +- `getSlashHistory()` - 查询 Slash 历史 +- `getReputationScore()` - 查询信誉评分 +- `getRevenueReport()` - 获取收益报告 + +### 使用示例 + +```typescript +import { PaymasterOperatorClient } from '@aastar/operator'; + +const operator = new PaymasterOperatorClient({ + superPaymasterAddress: SUPER_PAYMASTER, + registryAddress: REGISTRY, + client: walletClient, +}); + +// 注册并配置 +await operator.registerAsOperator(); + +await operator.configureOperator({ + xPNTsToken: TOKEN_ADDRESS, + treasury: TREASURY_ADDRESS, + exchangeRate: 100n, // 1 xPNTs = 100 wei +}); + +// 充值 +await operator.deposit({ amount: parseEther('10') }); + +// 设置赞助策略 +await operator.setSponsorshipPolicy({ + maxGasPerOp: 500000n, + dailyLimit: parseEther('1'), + whitelistedUsers: ['0x...'], +}); + +// 监控 +const stats = await operator.getOperatorStats(); +console.log('Today sponsored:', stats.sponsoredCount); +console.log('Revenue:', stats.revenue); +``` + +--- + +## 3️⃣ UserClient - 终端用户 + +### 目标用户 +普通终端用户(使用 AA 账户的用户) + +### 核心功能 + +#### 3.1 账户管理 +- `createAccount(owner, salt)` - 创建 AA 账户 +- `getAccountAddress(owner, salt)` - 预测账户地址 +- `getNonce()` - 获取 nonce + +#### 3.2 SBT 管理 +- `mintSBT(roleId)` - 铸造 SBT +- `getMySBTs()` - 获取我的 SBTs +- `getMemberships()` - 获取社区成员资格 +- `leaveCommunity(community)` - 退出社区 + +#### 3.3 积分操作 +- `getBalance(token)` - 查询代币余额 +- `transfer(to, amount, token)` - 转账 +- `claimRewards()` - 领取奖励 + +#### 3.4 赞助操作 +- `executeWithSponsorship(target, calldata)` - 使用赞助执行操作 +- `batchExecuteWithSponsorship(calls)` - 批量执行 +- `getAvailableCredit(operator)` - 查询可用额度 + +### 使用示例 + +```typescript +import { UserClient } from '@aastar/enduser'; + +const user = new UserClient({ + accountAddress: MY_ACCOUNT, + registryAddress: REGISTRY, + sbtAddress: MYSBT, + superPaymasterAddress: SUPER_PAYMASTER, + client: walletClient, +}); + +// 铸造 SBT +const tokenId = await user.mintSBT({ + roleId: ROLE_ENDUSER, +}); + +// 查看我的成员资格 +const memberships = await user.getMemberships(); +console.log('I am member of:', memberships.length, 'communities'); + +// 使用赞助执行操作 +const hash = await user.executeWithSponsorship({ + target: NFT_CONTRACT, + calldata: mintCalldata, + operator: OPERATOR_ADDRESS, +}); +``` + +--- + +## 4️⃣ DAOClient - DAO 治理者 + +### 目标用户 +DAO 成员、提案者、投票者 + +### 核心功能 + +#### 4.1 提案管理 +- `createProposal(target, calldata, description)` - 创建提案 +- `getProposal(proposalId)` - 查询提案 +- `getProposalState(proposalId)` - 获取提案状态 +- `cancelProposal(proposalId)` - 取消提案 + +#### 4.2 投票管理 +- `signProposal(proposalId)` - 签名支持提案 +- `hasVoted(proposalId, validator)` - 检查是否已投票 +- `getSignatureCount(proposalId)` - 获取签名数 + +#### 4.3 执行操作 +- `executeWithProof(proposalId, signatures)` - 执行提案(DVT) +- `executeWithBLS(proposalId, blsSignature)` - 执行提案(BLS) + +#### 4.4 验证器管理 +- `getValidators()` - 获取验证器列表 +- `addValidator(validator)` - 添加验证器 +- `removeValidator(validator)` - 移除验证器 +- `setThreshold(threshold)` - 设置阈值 + +### 使用示例 + +```typescript +import { DAOClient } from '@aastar/operator'; + +const dao = new DAOClient({ + dvtValidatorAddress: DVT_VALIDATOR, + blsAggregatorAddress: BLS_AGGREGATOR, + client: walletClient, +}); + +// 创建提案 +const proposalId = await dao.createProposal({ + target: TREASURY, + calldata: transferCalldata, + description: 'Transfer 10 ETH to community fund', +}); + +// 签名提案 +await dao.signProposal({ proposalId }); + +// 检查状态 +const state = await dao.getProposalState({ proposalId }); +if (state === ProposalState.Succeeded) { + // 执行 + await dao.executeWithProof({ + proposalId, + signatures: collectedSignatures, + }); +} +``` + +--- + +## 📦 实现计划 + +### Phase 1: 基础架构 (1-2天) + +1. 创建 L2 packages + - `packages/enduser/` - CommunityClient + UserClient + - `packages/operator/` - PaymasterOperatorClient + DAOClient + +2. 定义基础类型和接口 + - `ClientConfig` + - `TransactionOptions` + - `BusinessResult` + +3. 实现基类 `BaseClient` + - 统一的 client 管理 + - 通用的错误处理 + - 日志和监控 + +### Phase 2: CommunityClient (2-3天) + +1. 社区创建与配置 +2. 成员管理 +3. 角色管理 +4. 信誉系统 + +### Phase 3: PaymasterOperatorClient (2-3天) + +1. 运营商注册 +2. 资金管理 +3. 赞助策略 +4. 监控审计 + +### Phase 4: UserClient (1-2天) + +1. 账户管理 +2. SBT 管理 +3. 积分操作 +4. 赞助操作 + +### Phase 5: DAOClient (1-2天) + +1. 提案管理 +2. 投票管理 +3. 执行操作 +4. 验证器管理 + +### Phase 6: 测试与文档 (2-3天) + +1. 单元测试 +2. 集成测试 +3. E2E 示例 +4. API 文档 + +--- + +## 🎯 预期成果 + +### 代码交付 + +``` +packages/ +├── enduser/ +│ ├── src/ +│ │ ├── CommunityClient.ts +│ │ ├── UserClient.ts +│ │ └── types.ts +│ └── tests/ +└── operator/ + ├── src/ + │ ├── PaymasterOperatorClient.ts + │ ├── DAOClient.ts + │ └── types.ts + └── tests/ +``` + +### 使用体验 + +**L1 - 底层调用** (现在): +```typescript +// 需要多步操作 +const registry = registryActions(REGISTRY); +const factory = xPNTsFactoryActions(FACTORY); + +await registry(client).registerRole(...); +await factory(client).createToken(...); +await registry(client).setCommunityToken(...); +``` + +**L2 - 业务封装** (目标): +```typescript +// 一步完成 +const community = new CommunityClient({ ... }); +await community.createCommunity({ + name: 'My Community', + tokenSymbol: 'MYC', +}); +``` + +--- + +## 📝 下一步 + +1. ✅ 完成 L1 API Demo +2. 🔄 审核 L2 设计 +3. ⏭️ 开始 Phase 1: 基础架构 +4. ⏭️ 实现 CommunityClient +5. ⏭️ 完整 L2 测试 + +**准备开始 L2 开发!** 🚀 diff --git a/0.16.23/guide/docs/L3_Complete_Demo_Walkthrough.md b/0.16.23/guide/docs/L3_Complete_Demo_Walkthrough.md new file mode 100644 index 000000000..8a60bcac6 --- /dev/null +++ b/0.16.23/guide/docs/L3_Complete_Demo_Walkthrough.md @@ -0,0 +1,110 @@ +# L3 Complete Lifecycle Demo Walkthrough + +本教程将带你走完 AAstar 协议的完整生命周期,包括社区创建、运营商入驻、用户加入以及免 Gas 交易。 + +## 场景概述 + +在这个 Demo 中,我们模拟两个角色: +1. **Alice (社区领袖 & 运营商)**: 她创建一个名为 "AliceDAO" 的社区,并运行一个 SuperPaymaster 节点来为她的成员通过赞助。 +2. **Bob (终端用户)**: 他加入 Alice 的社区,获得 SBT 身份,并发送一笔由 Alice 赞助的免 Gas 交易。 + +## 源码位置 + +你可以从 SDK 仓库中找到该完整示例: +`examples/for-iri/ts/src/l3-lifecycle-demo.ts` + +--- + +## 核心步骤解析 + +### 1. 社区创建 (Community Launch) + +Alice 使用 `CommunityClient` 一键启动社区。这会自动完成角色注册、xPNTs 代币部署和信誉规则初始化。 + +```typescript +const aliceCommunity = new CommunityClient({ ... }); + +await aliceCommunity.setupCommunity({ + name: "AliceDAO", + tokenSymbol: "ALICE", + stakeAmount: parseEther('30') // 质押 30 GToken 启动社区 +}); +``` + +### 2. 运营商入驻 (Operator Onboarding) + +Alice 决定作为 SuperPaymaster 运营商,为社区提供 Gas 代付服务。 + +```typescript +const aliceOperator = new OperatorLifecycle({ ... }); + +// 一键完成:质押 GToken + 注册角色 + 存入 Gas 备用金 +await aliceOperator.setupNode({ + type: 'SUPER', + stakeAmount: parseEther('50'), + depositAmount: parseEther('100') +}); + +// 配置支持的代币和收益提现地址 +await aliceOperator.configureOperator(xPNTsToken, aliceAcc.address, parseEther('1')); +``` + +### 3. 用户加入 (User Onboarding) + +Bob 发现 Alice 的社区很棒,决定加入。 + +```typescript +const bobL3 = new UserLifecycle({ ... }); + +// 检查是否满足加入条件,然后执行一键 onboard +if (await bobL3.checkEligibility(aliceAddr)) { + await bobL3.onboard(aliceAddr, parseEther('0.4')); // 质押少量 GToken 并铸造 SBT +} +``` + +### 4. 免 Gas 交易 (Gasless Transaction) + +Bob 现在是社区成员了,他发送交易时无需支付 native ETH。 + +```typescript +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction( + publicClient, + bobClient, + bobAA, + entryPoint, + bundlerUrl, + { + token: GTOKEN_ADDRESS, + recipient: aliceAddr, + amount: parseEther('0.1'), + operator: aliceAddr, // 指定由 Alice 的节点赞助 + paymasterAddress: SUPER_PAYMASTER + } +); +``` + +### 5. 退出流程 (Exit Phase) + +最后,Bob 离开社区,Alice 撤出运营商资金。 + +```typescript +// Bob 离开 +await bobL3.leaveCommunity(aliceAddr); + +// Alice 撤资(受协议锁定期限制) +await aliceOperator.withdrawAllFunds(); +``` + +--- + +## 如何运行 + +1. 配置 `examples/for-iri/ts/.env` 文件,确保包含必要的合约地址和私钥。 +2. 安装依赖:`pnpm install` +3. 执行 Demo: + ```bash + npx tsx src/l3-lifecycle-demo.ts + ``` + +> [!IMPORTANT] +> 免 Gas 交易步骤需要配置有效的 Bundler URL (如 Pimlico 或 Alchemy)。如果仅在本地 Anvil 测试,该步骤可能会因为缺乏 Bundler 环境而跳过。 diff --git a/0.16.23/guide/docs/L3_Lifecycle_Developer_Guide.md b/0.16.23/guide/docs/L3_Lifecycle_Developer_Guide.md new file mode 100644 index 000000000..3a4e43514 --- /dev/null +++ b/0.16.23/guide/docs/L3_Lifecycle_Developer_Guide.md @@ -0,0 +1,111 @@ +# L3 Lifecycle API Developer Guide + +本文档旨在帮助开发者理解和使用 `@aastar/sdk` 提供的 L3 Lifecycle API。这些 API 封装了 L1/L2 的底层交互,提供了面向角色的全生命周期管理能力。 + +## 1. 核心类概览 + +| 角色 (Role) | 对应类 (Class) | 包 (Package) | 职责描述 | +| :--- | :--- | :--- | :--- | +| **Operator** | `OperatorLifecycle` | `@aastar/operator` | 管理 SuperPaymaster 节点运营者,包括质押、入驻、配置、资金管理和退出。 | +| **End User** | `UserLifecycle` | `@aastar/enduser` | 管理终端用户,包括加入社区 (Onboard)、发送 Gasless 交易、以及退出社区。 | +| **Admin** | `ProtocolGovernance` | `@aastar/admin` | (DAO/Admin) 管理协议全局参数、拥有权转移等治理操作。 | + +--- + +## 2. Operator Lifecycle (运营者) + +**类名**: `OperatorLifecycle` +**前提**: 账户需持有足够的 GToken,并已被授权基础社区身份 (`ROLE_COMMUNITY`, 通常由 DAO 投票决定)。 + +| 阶段 (Phase) | 动作 (Action API) |主要参数 | 进入前状态 (Pre-State) | 行动后状态 (Post-State) | 备注 (Notes) | +| :--- | :--- | :--- | :--- | :--- | :--- | +| **Setup** | `setupNode()` | `type: 'SUPER'`
`stakeAmount`
`depositAmount` | - 持有 GToken
- 有 `ROLE_COMMUNITY` | - 获得 `ROLE_PAYMASTER_SUPER`
- Registry: GToken 被质押
- Paymaster: 存入初始 Collateral | 一键完成 `Approve` + `RegisterRole` + `Deposit`。 | +| **Operate** | `depositCollateral()` | `amount` | - 节点运行中
- Collateral 余额不足 | - Paymaster: Collateral 增加 | 用于补充 Gas 代付备用金。 | +| **Operate** | `withdrawCollateral()` | `amount` | - Paymaster 有余额 | - Paymaster: Collateral 减少
- 钱包收到退回的 GToken | 随时可提,无锁定期 (除非涉及 ETH Stake)。 | +| **Query** | `checkReadiness()` | - | - | 返回 `{ isConfigured, isActive, balance }` | 检查节点是否配置完成及当前余额。 | +| **Exit** | `withdrawAllFunds()` | `to` (可选) | - 节点运行中
- 有质押和存款 | - Paymaster: Collateral 清零
- Registry: **触发退出锁定期** (如30天) | **注意**: 如果 Role 有锁定期 (如30天),此调用会触发 `exitRole` 并**Revert** (或进入冷却期),资金需等待期满后方可完全提取。 | + +### 开发者示例 +```typescript +import { OperatorLifecycle } from '@aastar/sdk'; + +// 初始化 +const operator = new OperatorLifecycle({ + client: walletClient, + ...contracts +}); + +// 1. 入驻 (需先获得 ROLE_COMMUNITY) +await operator.setupNode({ + type: 'SUPER', + stakeAmount: parseEther('50'), // 质押 50 GT 到 Registry + depositAmount: parseEther('10') // 存入 10 GT 到 Paymaster 用于付 Gas +}); + +// 2. 退出 +// 注意:如果 Registry 设置了 roleLockDuration,这步在锁定期内会失败 +try { + await operator.withdrawAllFunds(); +} catch(e) { + console.log("Exit initiated or locked:", e.message); +} +``` + +--- + +## 3. User Lifecycle (终端用户) + +**类名**: `UserLifecycle` +**前提**: 这是一个抽象层,既支持 EOA 也支持 AA 账户。 + +| 阶段 (Phase) | 动作 (Action API) | 主要参数 | 进入前状态 (Pre-State) | 行动后状态 (Post-State) | 备注 (Notes) | +| :--- | :--- | :--- | :--- | :--- | :--- | +| **Onboard** | `onboard()` | `community` (Address)
`stakeAmount` | - 持有 GToken (用于质押)
- **未**加入该社区 | - 获得 `ROLE_ENDUSER`
- Mint 该社区的 SBT
- Registry: GToken 被质押 | 类似于 "注册/会员" 流程。 | +| **Verify** | `checkEligibility()` | `community` | - | 返回 `boolean` | 检查是否满足加入条件 (如黑名单检查)。 | +| **Operate** | `enableGasless()` | `config: { policy }` | - | - 本地配置已更新 | 开启 Gasless 模式开关。 | +| **Operate** | `executeGaslessTx()` | `target`
`data`
`value` | - 已 Onboard
- 有足够 Reputation/Credit | - 交易成功上链
- 消耗 Credit 而非 ETH | 会自动路由到对应的 Paymaster (V4 或 Super)。 | +| **Query** | `getMyReputation()` | - | - | 返回 `{ score, creditLimit }` | 查询当前信誉分和可用额度。 | +| **Exit** | `leaveCommunity()` | `community` | - 已加入社区
- 持有 SBT | - SBT 被销毁
- 角色移除 | 退出社区,不再享受该社区的权益/Sponsorship。 | + +### 开发者示例 +```typescript +import { UserLifecycle } from '@aastar/sdk'; + +// 1. 加入社区 +const user = new UserLifecycle({ ... }); +const canJoin = await user.checkEligibility(communityAddr); +if (canJoin) { + await user.onboard(communityAddr, parseEther('0.4')); // 质押 0.4 GT +} + +// 2. 发送 Gasless 交易 +await user.enableGasless({ policy: 'CREDIT' }); +const txHash = await user.executeGaslessTx({ + target: targetContract, + data: encodeFunctionData(...) +}); +``` + +--- + +## 4. Admin (Protocol Governance) + +**类名**: `ProtocolGovernance` +**前提**: 调用者需是 Registry 或各个核心合约的 Owner。 + +| 动作 (Action API) | 描述 | 涉及合约 | +| :--- | :--- | :--- | +| `transferDAO(newDAO)` | 将所有核心合约的 Owner 权限转移给新的 DAO 地址。 | Registry, SuperPaymaster, etc. | +| `updateGlobalParams()` | 更新全局参数 (如 ProtocolFee, Treasury)。 | Registry | +| `upgradeContracts()` | 升级核心合约实现 (TBD)。 | Factory, Registry | + +--- + +## 5. 常见问题 (FAQ) + +### Q: 为什么 `withdrawAllFunds` 会失败? +**A**: 在 Aastar 协议设计中,为了防止恶意节点作恶后立即跑路,核心角色 (如 `ROLE_PAYMASTER_SUPER`) 通常设有 **退出锁定期 (Role Lock Duration)**,例如 30 天。 +在此期间,如果您尝试调用 `exitRole` (包含在 `withdrawAllFunds` 中),Registry 合约会拒绝该操作。您必须保持节点在线直到服务期满,或等待锁定期结束。 + +### Q: `UserLifecycle` 支持 AA 吗? +**A**: 是的。初始化 `UserLifecycle` 时传入 `accountAddress` (AA 地址) 和 `client` (具备签名能力的 Client)。如果是 Gasless 交易,SDK 会自动构建 UserOperation 并发送给 Bundler;如果是普通交易,则直接通过 Client 发送。 diff --git a/0.16.23/guide/docs/L3_Lifecycle_Patterns_Design.md b/0.16.23/guide/docs/L3_Lifecycle_Patterns_Design.md new file mode 100644 index 000000000..a8ba07eb8 --- /dev/null +++ b/0.16.23/guide/docs/L3_Lifecycle_Patterns_Design.md @@ -0,0 +1,518 @@ +L3 Complete Lifecycle Patterns Design (完整版) +Overview +基于 +USER_CASE_DESIGN.md + 和用户补充需求,实现所有角色完整生命周期 + 管理功能的 L3 Patterns。 + +🎯 核心原则 +完整生命周期: 注册 → 配置 → 运营 → 退出 +管理能力: 每个角色都有增删改查 (CRUD) 能力 +业务聚类: 按职责分组(治理、运营、用户) +Gasless原生: 所有Pattern支持Gasless配置 +角色完整映射 +📱 1. 终端用户 (End User) - UserLifecycle +职责: 参与社区、交易、积累信誉 + +完整生命周期: + +未注册 → 加入社区(质押+SBT) → Gasless交易 → 更新信誉 → 绑定NFT → 退出社区 +L3 Methods: + +```typescript +class UserLifecycle { + // 注册阶段 + checkEligibility(community): Promise + onboard(community, stakeAmount): Promise + enableGasless(config: GaslessConfig): Promise + + // 运营阶段 + executeGaslessTx(tx): Promise + claimSBT(roleId): Promise + bindNFT(nftAddress, tokenId): Promise + updateReputation(): Promise + + // 查询能力 + getMyReputation(): Promise + getMySBTs(): Promise + getMyNFTs(): Promise + getCreditLimit(): Promise + + // 退出阶段 + leaveCommunity(community): Promise + exitRole(roleId): Promise + unstakeAll(): Promise +} +``` +🏛️ 2. 社区管理员 (Community Admin) - CommunityManager +职责: 启动社区、治理规则、成员管理 + +完整生命周期: + +EOA → 注册社区 → 发行Token → 设置治理 → 管理成员 → 移交多签 +L3 Methods: + +```typescript +class CommunityManager { + // 启动阶段 (已有 CommunityLaunchpad) + launch(params): Promise + + // 成员管理 + airdropSBT(users: Address[], roleId: Hex): Promise + revokeSBT(tokenId: bigint): Promise + batchMintNFT(users: Address[]): Promise + + // Reputation规则管理 ⭐ (新增) + addReputationRule(rule: ReputationRule): Promise + updateReputationRule(ruleId: Hex, rule): Promise + removeReputationRule(ruleId: Hex): Promise + getActiveRules(): Promise + + // 治理配置 + setVotingPeriod(period: bigint): Promise + setQuorum(quorum: number): Promise + updateTreasury(newTreasury: Address): Promise + + // 移交阶段 ⭐ (新增) + transferToMultisig(multisig: Address): Promise + + // 查询能力 + getCommunityStats(): Promise + getMembers(): Promise + getTreasuryBalance(): Promise +} +``` +🚀 3. Paymaster 运营商 (PM Operator) - +PaymasterOperator +职责: 部署节点、配置Gas、管理流动性 + +完整生命周期: ⭐ (需补充退出) + +EOA → 资源检查 → 质押注册 → 部署节点 → 配置Token → 运营管理 → 退出/撤资 +L3 Methods: + +```typescript +class PaymasterOperator { + // 启动阶段 (已有 OperatorLifecycle) + checkReadiness(): Promise + setupNode(params): Promise + + // 配置管理 + addGasToken(token, priceFeed): Promise + removeGasToken(token): Promise + updateFeeStrategy(strategy): Promise + setExchangeRate(rate: bigint): Promise + + // 流动性管理 + depositCollateral(amount: bigint): Promise + withdrawCollateral(amount: bigint): Promise + + // 运营监控 + getOperatorStats(): Promise + getSponsoredTxCount(): Promise + getRevenue(): Promise + + // 退出阶段 ⭐ (新增) + initiateExit(): Promise + completeExit(): Promise + withdrawAllFunds(): Promise +} +``` +⚡ 4. SuperPaymaster 运营商 - SuperPaymasterOperator ⭐ (新增) +职责: 管理全局Gas池、设置协议参数 + +完整生命周期: + +协议批准 → 质押注册 → 配置国库 → 设置费率 → 管理流动性 → 退出 +L3 Methods: + +```typescript +class SuperPaymasterOperator { + // 注册阶段 ⭐ (新增) + registerAsOperator(collateral: bigint): Promise + stakeForRole(amount: bigint): Promise + + // 配置阶段 ⭐ (新增) + configureTreasury(treasury: Address): Promise + setProtocolFee(feeBps: bigint): Promise + setExchangeRate(token: Address, rate: bigint): Promise + + // 流动性管理 + addLiquidity(amount: bigint): Promise + removeLiquidity(amount: bigint): Promise + + // 运营监控 + getPoolStats(): Promise + getTotalSponsored(): Promise + getOperatorRevenue(): Promise + + // 退出阶段 ⭐ (新增) + initiateOperatorExit(): Promise + unstakeOperator(): Promise + withdrawAllRewards(): Promise +} +``` +🏛️ 5. 协议管理员 (Protocol Admin) - ProtocolGovernance ⭐ (增强) +职责: 全局参数治理、合约升级 + +完整生命周期: + +部署EOA → 初始配置 → 日常治理 → 移交DAO多签 +L3 Methods: + +```typescript +class ProtocolGovernance { + // 全局参数管理 ⭐ (增强) + setGlobalMinStake(amount: bigint): Promise + setProtocolFee(recipient: Address, bps: bigint): Promise + setTreasury(treasury: Address): Promise + updateEntryPoint(entryPoint: Address): Promise + + // SuperPaymaster管理 ⭐ (新增) + approveSuperPaymasterOperator(operator: Address): Promise + revokeSuperPaymasterOperator(operator: Address): Promise + updateSPTreasury(treasury: Address): Promise + setSPFeeRate(feeBps: bigint): Promise + + // 提案治理 + createProposal(proposal: Proposal): Promise + voteOnProposal(proposalId: Hex, support: boolean): Promise + executeProposal(proposalId: Hex): Promise + + // 紧急控制 + pauseProtocol(): Promise + unpauseProtocol(): Promise + + // 移交阶段 + transferToDAO(daoMultisig: Address): Promise + + // 查询能力 + getProtocolParams(): Promise + getAllOperators(): Promise + getProposals(): Promise +} +``` +🔐 6. DVT 验证器 (DVT Operator) - DVTNodeManager ⭐ (新增) +职责: 分布式验证、BLS签名、治理投票 + +完整生命周期: + +生成BLS密钥 → 注册验证器 → 加入验证集 → 签名验证 → 退出验证集 +L3 Methods: + +```typescript +class DVTNodeManager { + // 注册阶段 + generateBLSKeyPair(): Promise + registerBLSKey(pubkey: Hex): Promise + joinValidatorSet(stake: bigint): Promise + + // 验证运营 + signMessage(message: Hex): Promise + aggregateSignatures(sigs: Signature[]): Promise + submitValidation(data: ValidationData): Promise + + // 治理参与 + proposeSlash(target: Address, reason: string): Promise + voteOnSlash(proposalId: Hex, support: boolean): Promise + + // 查询能力 + getValidatorStatus(): Promise + getSigningHistory(): Promise + getRewards(): Promise + + // 退出阶段 + leaveValidatorSet(): Promise + withdrawStake(): Promise +} +``` +🔑 7. KMS 节点 (KMS Node) - KMSNodeManager ⭐ (新增) +职责: 密钥管理、签名服务 + +完整生命周期: + +初始化节点 → 注册到Registry → 提供签名服务 → 密钥轮换 → 退出 +L3 Methods: + +```typescript +class KMSNodeManager { + // 初始化 + initializeNode(config: KMSConfig): Promise + registerNode(nodeId: Hex): Promise + + // 密钥管理 + generateKey(keyType: string): Promise + rotateKey(oldKeyId: Hex): Promise + revokeKey(keyId: Hex): Promise + + // 签名服务 + signRequest(request: SignRequest): Promise + batchSign(requests: SignRequest[]): Promise + + // 监控 + getNodeHealth(): Promise + getSigningStats(): Promise + + // 退出 + deactivateNode(): Promise + exportKeys(backup: boolean): Promise +} +``` +🎨 Reputation 管理增强 ⭐ +ReputationManager (新增) +```typescript +class ReputationManager { + // 规则管理 + addRule(community: Address, rule: ReputationRule): Promise + updateRule(ruleId: Hex, newParams): Promise + removeRule(ruleId: Hex): Promise + activateRule(ruleId: Hex): Promise + deactivateRule(ruleId: Hex): Promise + + // 积分更新 + recordActivity(user: Address, activityType: string): Promise + batchUpdateScores(users: Address[]): Promise + + // 查询 + getUserReputation(user: Address): Promise + getCommunityRules(community: Address): Promise + getTopUsers(limit: number): Promise +} +``` +🎯 NFT 绑定增强 ⭐ +NFTManager (新增) +```typescript +class NFTManager { + // NFT绑定 + bindNFTToSBT(sbtId: bigint, nftAddr: Address, nftId: bigint): Promise + unbindNFT(sbtId: bigint, nftAddr: Address): Promise + + // 查询 + getBoundNFTs(sbtId: bigint): Promise + verifiyNFTOwnership(user: Address, nftAddr: Address): Promise + + // 批量操作 + batchBindNFTs(bindings: NFTBinding[]): Promise +} +``` +📋 实现优先级 (修订) +P0 - 核心生命周期 (立即实现) +✅ +CommunityLaunchpad + (已完成) +✅ +StakingManager + (已完成) +✅ +OperatorLifecycle + (已完成,需补充退出) +🔄 UserLifecycle (完整版,含Gasless) +🔄 SuperPaymasterOperator (新增) +🔄 ProtocolGovernance (增强版) +P1 - 管理增强 (下一阶段) +ReputationManager +NFTManager +DVTNodeManager +KMSNodeManager +P2 - 工具函数 +GaslessHelper - Paymaster配置工具 +RoleHelper - 角色权限检查工具 +🧪 验证计划 +Scenario完整测试 +// examples/l3-complete-lifecycle-demo.ts +async function fullEcosystemDemo() { + // 1. 协议启动 + const protocol = new ProtocolGovernance(config); + await protocol.setGlobalMinStake(...); + + // 2. 社区启动 + const community = new CommunityManager(config); + await community.launch({ name: "TestDAO", ... }); + await community.addReputationRule(...); + + // 3. 运营商部署 + const spOperator = new SuperPaymasterOperator(config); + await spOperator.registerAsOperator(1000n); + await spOperator.configureTreasury(...); + + const pmOperator = new PaymasterOperator(config); + await pmOperator.setupNode({ collateral: 500n, ... }); + + // 4. 用户Gasless入驻 + const user = new UserLifecycle({ + ...config, + gasless: { paymasterUrl: "..." } + }); + await user.onboard("TestDAO", 100n); + await user.executeGaslessTx(...); + await user.updateReputation(); + + // 5. DVT验证器 + const dvt = new DVTNodeManager(config); + await dvt.registerBLSKey(...); + await dvt.joinValidatorSet(200n); + + // 6. 生命周期退出 + await user.leaveCommunity("TestDAO"); + await pmOperator.initiateExit(); + await spOperator.unstakeOperator(); +} +Next Steps (执行计划) +Phase 1: 核心Pattern实现 (本次) +补充 +OperatorLifecycle + 的退出机制 +实现 UserLifecycle (完整版 + Gasless) +实现 SuperPaymasterOperator +增强 ProtocolGovernance +Phase 2: 管理Pattern (后续) +实现 ReputationManager +实现 NFTManager +实现 DVTNodeManager +实现 KMSNodeManager +Phase 3: 集成测试 +创建 l3-complete-lifecycle-demo.ts +回归测试所有Use Cases +更新文档和使用指南 +角色与生命周期映射 +1. 终端用户 (End User) - 🎫 UserOnboarding +Use Cases: 3 (SBT & Reputation) + 4 (Gasless UX) + +Lifecycle: + +未注册 → 选择社区 → 质押GToken → 铸造SBT → 激活Gasless → 开始交易 +L3 Methods: + +checkEligibility(community): 检查是否可以加入社区 +onboard(community, params) +: 一键入驻 +自动质押 0.4 GT (if required) +铸造 MySBT +配置 Gasless (if paymasterUrl provided) +getReputation(): 查询信誉分 +enableGasless(paymasterConfig): 启用Gasless交易 +Value: + +消除"Approve → Stake → Mint"的多步骤摩擦 +Gasless配置透明化 +2. 社区管理员 (Community Admin) - 🏛️ +CommunityLaunchpad + (已实现) +Use Case: 1 (DAO Launchpad) + +Lifecycle: + +EOA → 质押注册 → 部署Token → 设置治理 → 移交多签 +L3 Methods (已实现): + +launch(params) +: 一键启动社区 +Register Community Role +Deploy xPNTs Token +Setup Reputation Rules +Enhancement (待补充): + +transferToMultisig(multisig): 移交控制权给Safe多签 +3. Paymaster 运营商 (PM Operator) - 🚀 +OperatorLifecycle + (已实现) +Use Case: 2 (Operator Wizard) + +Lifecycle: + +EOA → 资源检查 → 质押充值 → 配置节点 → 启动服务 +L3 Methods (已实现): + +checkReadiness() +: 资源自检 +setupNode(params) +: 一键部署 +Deposit Collateral +Add Gas Tokens +Configure Operator +Enhancement (待补充): + +updateFeeStrategy(strategy): 动态费率调整 +withdrawRewards(): 提取收益 +4. SuperPaymaster 运营商 - ⚡ SuperPaymasterManager (新增) +Scope: 全局Gas代付池管理 + +Lifecycle: + +协议批准 → 质押注册 → 配置国库 → 管理流动性 +L3 Methods: + +registerAsOperator(collateral): 注册为SP运营商 +configureTreasury(treasury, exchangeRate): 配置国库 +managePoolLiquidity(): 管理流动性池 +5. 协议管理员 (Protocol Admin) - 🏛️ ProtocolGovernance (新增) +Scope: 全局参数治理 + +Lifecycle: + +部署期EOA → 配置参数 → 移交多签 → 提案投票治理 +L3 Methods: + +setGlobalParameters(params): 设置全局参数 +Protocol Fee +Treasury Address +Min Stake Amount +createProposal(proposal) +: 创建治理提案 +transferToDAO(multisig): 移交给DAO +6. DVT 验证器 (DVT Operator) - 🔐 DVTNodeManager (新增) +Scope: 分布式验证节点管理 + +Lifecycle: + +注册BLS密钥 → 加入验证集 → 签名验证 → 治理投票 +L3 Methods: + +registerBLSKey(pubkey) +: 注册BLS公钥 +joinValidatorSet(): 加入验证集 +proposeSlash(target): 提出惩罚提案 +🎯 Gasless 集成策略 +方案: Gasless作为L3的"配置选项" +所有需要Gasless的Pattern都接受 GaslessConfig: + +interface GaslessConfig { + paymasterUrl: string; // e.g. Pimlico/Alchemy URL + policy?: 'CREDIT' | 'TOKEN' | 'SPONSORED'; +} +实现方式: + +L3 Pattern 接受 gaslessConfig?: GaslessConfig +内部逻辑: 如果提供,则使用 createSmartAccountClient with Paymaster middleware +透明化: 用户无需手动构建 paymasterAndData +📋 实现优先级 +P0 - 核心生命周期 (本次实现) +✅ CommunityLaunchpad +✅ StakingManager +✅ OperatorLifecycle +🔄 UserOnboarding (含Gasless) +🔄 ProtocolGovernance +P1 - 运营增强 (后续迭代) +SuperPaymasterManager +DVTNodeManager +ReputationManager +🧪 验证计划 +Scenario Tests (对应 USER_CASE_DESIGN.md) +✅ Scenario 1: Community Launch → CommunityLaunchpad.launch() +✅ Scenario 2: Operator Setup → OperatorLifecycle.setupNode() +🔄 Scenario 3: User SBT Mint → UserOnboarding.onboard() +🔄 Scenario 4: Gasless TX → UserOnboarding.enableGasless() + any tx +Integration Demo +创建 examples/l3-complete-demo.ts: + +启动社区 +部署运营商 +用户Gasless入驻 +发送Gasless交易 +Next Steps +实现 UserOnboarding.ts (含Gasless配置) +实现 ProtocolGovernance.ts +创建 GaslessHelper.ts (工具函数) +编写集成测试 examples/l3-complete-demo.ts +更新 +task.md + 和用户文档 diff --git a/0.16.23/guide/docs/L3_Use_Case_Analysis.md b/0.16.23/guide/docs/L3_Use_Case_Analysis.md new file mode 100644 index 000000000..814de9b1d --- /dev/null +++ b/0.16.23/guide/docs/L3_Use_Case_Analysis.md @@ -0,0 +1,68 @@ +# L3 SDK Refinement & Gap Analysis + +## Overview +This document analyzes the current state of the L3 SDK against the "Complete Lifecycle Patterns Design" requirements. It identifies gaps, proposes architectural refinements, and outlines a prioritized implementation roadmap. + +## 1. Gap Analysis: Current vs. Target + +| Role / Pattern | Current State (`USER_CASE_DESIGN.md`) | Target State ("Complete Lifecycle") | Status | Priority | +| :--- | :--- | :--- | :--- | :--- | +| **End User** | Focus on Mint SBT & Gasless TX. Basic client. | **Complete Lifecycle**: Register -> Gasless -> Reputation -> Exit. Query capabilities. | 🔄 Partial | **P0** | +| **Community Admin** | `CommunityLaunchpad` exists. | **Governance & Exit**: Transfer to Multisig, Reputation Rules management. | 🔄 Partial | **P0** | +| **Paymaster Operator** | `OperatorLifecycle` covers setup. | **Exit Strategy**: Withdraw funds, initiate exit. Dynamic config. | 🔄 Partial | **P0** | +| **SuperPaymaster Operator** | Basic client exists (V4). | **Dedicated Manager**: Register, Treasury config, liquidity management. | ❌ Missing | **P1** | +| **Protocol Admin** | Basic scripts. | **Governance**: Global param updates, DAO transfer. | ❌ Missing | **P1** | +| **DVT Operator** | Placeholder in scripts. | **Node Manager**: BLS Key gen, validator set management. | ❌ Missing | **P2** | +| **Reputation Manager** | Basic scoreboard. | **Rule Engine**: Dynamic rule configuration & scoring. | ❌ Missing | **P2** | + +## 2. Architectural Refinements + +### 2.1 Unified Lifecycle Pattern +Move from ad-hoc "Client" classes to structured "Lifecycle" patterns. +* **Old**: `UserClient` mixed basic wallet ops with business logic. +* **New**: `UserLifecycle` extends `UserClient` patterns but strictly follows `onboard` -> `operate` -> `exit` flow. + +### 2.2 Gasless-First Design +Gasless should be a configuration option, not a separate class. +```typescript +interface GaslessConfig { + paymasterUrl: string; + policy: 'CREDIT' | 'TOKEN' | 'SPONSORED'; +} +``` +* **Implementation**: All Lifecycle classes (User, Operator) accept `GaslessConfig` in constructor. +* **Middlestream**: Use `PaymasterClient` middleware automatically if config is present. + +### 2.3 Strict Typing +Enforce return types (e.g., `Promise`, `Promise`) to standardize API responses for frontend consumers. + +## 3. Detailed Refinement Plan (P0 Priorities) + +### 3.1 UserLifecycle (The "All-in-One" User) +* **Goal**: Consolidate `EndUserClient` and disjoint scripts into one clean class. +* **Key Methods**: + * `onboard(community, stakeAmount)`: Wraps Approve GToken -> Stake -> Mint SBT. + * `enableGasless(config)`: Activates smart account features. + * `leaveCommunity()`: Handles unstaking and SBT burning. + +### 3.2 OperatorLifecycle (Enhanced) +* **Goal**: Add missing "Exit" capabilities to existing logic. +* **Updates**: + * Add `withdrawAllFunds()`: Sweeps ETH and GTokens. + * Add `initiateExit()`: Formal unstake process from Registry. + +### 3.3 ProtocolGovernance (New Core) +* **Goal**: Centralize admin functions currently scattered in scripts. +* **Key Methods**: + * `setGlobalParameters()` + * `transferToDAO()` + +## 4. Documentation Strategy +* **One Doc Per Pattern**: Create dedicated `.md` files for each Lifecycle pattern in `docs/l3-patterns/`. +* **Scenario-Driven**: Docs should lead with "How to [Scenario]" rather than method lists. + +## 5. Next Steps +1. **Refactor**: Create `UserLifecycle.ts` implementing the new design. +2. **Enhance**: Update `OperatorLifecycle.ts` with exit methods. +3. **Create**: Implement `ProtocolGovernance.ts`. +4. **Verify**: Build `examples/l3-complete-demo.ts` to test the full flow. diff --git a/0.16.23/guide/docs/L4_Manual_Test_CheatSheet.md b/0.16.23/guide/docs/L4_Manual_Test_CheatSheet.md new file mode 100644 index 000000000..d3556d3c5 --- /dev/null +++ b/0.16.23/guide/docs/L4_Manual_Test_CheatSheet.md @@ -0,0 +1,172 @@ +# L4 Gasless 调试备忘录 (L4 Debug Cheat Sheet) + +这份文档旨在协助进行 L4 Gasless 场景的人工调试和验证。适用于 Sepolia, Anvil 或其他 EVM 网络。 + +> **注意**: 部分地址 (Token, Paymaster) 是在运行 `l4-setup.ts` 脚本时动态生成的,请参照 `scripts/l4-state.json` 文件获取最新值。 + +## 1. 核心账户配置 (Keys & Accounts) + +请确保你的 ENV 文件 (`.env.sepolia` 或 `.env.anvil`) 中包含以下私钥配置。 + +| 角色 (Role) | 变量名 (ENV Variable) | 说明 (Description) | +| :--- | :--- | :--- | +| **资金提供方** | `PRIVATE_KEY_SUPPLIER` | Used for Minting GToken, Initial ETH funding. | +| **Operator A** | `PRIVATE_KEY_JASON` | Jason (AAStar Operator). Paymaster V4 + aPNTs. | +| **Operator B** | `PRIVATE_KEY_BOB` | Bob (Bread Operator). Paymaster V4 + bPNTs. | +| **Operator C** | `PRIVATE_KEY_ANNI` | Anni (Demo Operator). SuperPaymaster + cPNTs. | + +## 2. 全局合约 (Global Contracts) + +### 2.1 说明 (Concepts) + +PaymasterFactory是有注册实例(PaymasterV4Impl)的工厂合约,任何社区可以无许可的发行自己的Gas Token,然后从工厂clone 实例proxy来完成低gas部署和绑定自己的Gas Token(例如bPNTs,cPNTs),从而为自己的社区提供Gasless服务(需要自行充值到EntryPoint和维护运营)。 + +而SuperPaymaster是多租户的公共基础设施,它是一个全局唯一Paymaster,同时也是一个多租户的合约,社区在注册和发行自己的gas token后,需要购买此合约的唯一服务方AAStar社区发行的aPNTs并deposite到SuperPaymaster,然后自己的社区成员可以获得该社区的bPNTs,cPNTs等,作为gas token无感支付(AAStar社区会维护运营)。 + +无论是Paymaster V4还是SuperPaymaster,都是标准的ERC4337 Paymaster,本测试会为几个测试账户分别部署两个不同的Paymaster V4,注册一个SuperPaymaster(全局唯一,无需部署,注册即可)。 + +GToken是Mycelium的治理代币,2100万硬顶,除了社区投票和治理外,核心作用是公共物品花园的门票。所有协议的参与者(例如节点运营商、Paymaster服务商和SuperPaymaster注册服务商等)和使用者(普通的用户等),都需要stake & locky一定数量的GToken来获得入场资格,永久一次性门票,可退票。Mycelium协议致力于维护和提供一套不断产生数字公共物品的流程和基建,包括Infrastucture, Protocol, DApp三个层级的协作和支持。GTokenStaking是对应的管理合约,在注册和质押GToken时使用,需要一次性approve一定的额度范围(例如普通用户大约需要0.45,注册社区需要33, 启动Paymaster大约需要33, 注册启动SuperPaymaster大约需要55等等,此配置可由协议治理多签进行调整)。 + +MySBT是Mycelium的灵魂绑定的一个数字白板,归属于第一次mint的用户,当你注册为Mycelium协议成员或者任意协议社区时自动mint。白板秉持隐私保护策略,owner全权控制显示哪些信息,自动绑定了Gasless加油卡,接受所有协议内的社区自己发行的Gas Token,自动绑定了数字公共物品花园的门票,同时被动接受社区自定义的reputation规则的更新和全局reputation的更新。Reputation越高,获得Mycelium内部DApp启动的早期邀请和airdrop的概率越大。同时也是一个可以设置头像的NFT,可配置profile等。 + +xPNTsFactory和xPNTs,是工厂合约和泛指任意社区发行的ERC20Gas Token,只要拥有加油卡(MySBT+充值xPNTs)即可无感支付Gas,自由交易。 + +### 2.2 合约地址 (Addresses) + +这些是部署在网络上的核心系统合约 (请检查 `config..json`)。 + +| 合约名称 (Contract) | 说明 | +| :--- | :--- | +| **Registry** | 核心注册表,管理权限与角色 | +| **EntryPoint** | ERC-4337 官方入口点 (v0.7) | +| **GToken** | 系统 Gas Token (ERC-20) | +| **GTokenStaking** | Paymaster 质押合约 (Locking) | +| **SBT** | 灵魂绑定代币合约 (Identity) | +| **ReputationSystem**| 信誉系统合约 | +| **PaymasterFactory**| 部署 Paymaster V4 的工厂 | +| **SuperPaymaster** | 超级 Paymaster (代理合约) | + +## 3. 动态环境配置 (Dynamic Setup) + +运行 `pnpm tsx scripts/l4-setup.ts --network=` 后,以下信息会更新到 `scripts/l4-state.json`。 + +| 社区名称 | Operator | Token Symbol | Paymaster 类型 | 获取地址方式 (l4-state.json) | +| :--- | :--- | :--- | :--- | :--- | +| **AAStar** | Jason | **aPNTs** | **V4** | `jason.tokenAddress` / `jason.paymasterAddress` | +| **Bread** | Bob | **bPNTs** | **V4** | `bob.tokenAddress` / `bob.paymasterAddress` | +| **Demo** | Anni | **cPNTs** | **Super** | `anni.tokenAddress` / `anni.superPaymasterAddress` | + +## 4. 自动化初始化检查清单 (Setup Checklist) + +`scripts/l4-setup.ts` 会自动执行以下检查与修复动作 (Idempotent)。此脚本适配不同网络,基于 `config..json` 加载配置。 + +| # | 检查项 (Item) | 逻辑 (Logic) | 预期 (Expectation) | +| :--- | :--- | :--- | :--- | +| **1** | **Check/Deploy AA** | 使用 0.7 Factory 计算并部署 AA 账户 | Jason, Bob, Anni 的 AA 账户已部署 | +| **2** | **Operator Funding** | 检查 AA & EOA 的 ETH/GToken 余额 | ETH > 0.05, GToken > 1000 | +| **3** | **Community Role** | `registry.hasRole(COMMUNITY)` | Operator 均注册为 Community | +| **4** | **Token Deployment** | `factory.getTokenAddress(owner)` | aPNTs, bPNTs, cPNTs 已部署 | +| **5** | **Paymaster V4** | `pmFactory.getPaymaster(owner)` | Jason & Bob 拥有 Paymaster V4 实例 | +| **6** | **SuperPaymaster**| Operator Client Registration | Anni 注册为 SuperPaymaster Operator | +| **7** | **Deposits** | `entryPoint.balanceOf(pm)` | Paymaster 在 EntryPoint 存款 > 0.1 ETH | + +## 5. 常用调试命令 + +```bash +# 1. 运行环境配置 (幂等,推荐每次测试前运行) +pnpm tsx scripts/l4-setup.ts --network=sepolia + +# 2. 运行 Gasless 回归测试 +pnpm tsx tests/regression/l4-gasless.ts --network=sepolia + +# 3. 查看状态文件 +cat scripts/l4-state.json +``` + +## 6. 新建 AA 账户 & Gasless 开发指南 (Developer Workflow) + +如果你需要测试一个新的 AA 账户 (SimpleAccount),请遵循以下标准流程: + +### Step 1: 账户生成与初始化 (Client SDK) + +无需手动部署 Factory,使用 `UserClient` 即可。 + +```typescript +import { UserClient } from '@aastar/enduser'; +import { createWalletClient, http } from 'viem'; +import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; + +// 1. 本地生成/读取私钥 +const pKey = generatePrivateKey(); +const account = privateKeyToAccount(pKey); + +// 2. 初始化 Client (自动关联 EntryPoint v0.7) +// 注意:configs 应从 network config 加载,不应 hardcode +const client = new UserClient({ + client: createWalletClient({ + account, + chain: chainConfig, + transport: http(rpcUrl) + }), + entryPointAddress: CONFIG.entryPoint, + registryAddress: CONFIG.registry + // ... 其他地址 +}); +console.log(`New AA Address: ${client.accountAddress}`); +``` + +### Step 2: 资金准备 (Admin Actions) + +新账户需要 Gas Token 来通过 Paymaster 验证。 + +* **Operator (Admin)** 调用 SDK 发放代币: + ```typescript + await tokenActions(operatorClient).mint({ + token: aPNTsAddress, + to: client.accountAddress, // AA 地址 + amount: parseEther('100') + }); + ``` +* **Supplier** 发放少量 ETH (可选,如果 Token 不支持 Permit 或是首次 Approve 需要): + ```typescript + await supplier.sendTransaction({ to: client.accountAddress, value: parseEther('0.05') }); + ``` + +### Step 3: Approve Paymaster (User Actions) + +在发起 Gasless 交易前,必须授权 Paymaster 扣款。 + +```typescript +// 普通 ERC20 Approve +const tx = await tokenActions(client.client).approve({ + token: aPNTsAddress, + spender: paymasterAddress, + amount: parseEther('1000') +}); +// 等待 Approve 上链 (Approve 本身需要 ETH Gas) +``` + +### Step 4: 发送 Gasless 交易 (User Actions) + +使用 `executeGasless` 自动构建 UserOp。 + +```typescript +import { encodeFunctionData } from 'viem'; + +// 1. 业务逻辑 (如: 注册自己) +const callData = encodeFunctionData({ + abi: RegistryABI, + functionName: 'registerRoleSelf', + args: [ROLE_COMMUNITY, '0x'] +}); + +// 2. 提交 +const hash = await client.executeGasless({ + target: registryAddress, + value: 0n, + data: callData, + paymaster: paymasterAddress, + paymasterType: 'V4' // 或 'Super' +}); +console.log(`UserOp Hash: ${hash}`); +``` diff --git a/0.16.23/guide/docs/Plan.md b/0.16.23/guide/docs/Plan.md new file mode 100644 index 000000000..a886088d8 --- /dev/null +++ b/0.16.23/guide/docs/Plan.md @@ -0,0 +1,266 @@ +# AAStar计划 + + +## V2 + +好的,完全理解你的思路!MVP阶段聚焦核心功能,快速验证,是非常明智的选择。 + +根据你的优先级分析: + +* **最高优先级 (High Priority - H)**: + 1. 核心账户功能 (二次签名验证 + 整体集成,包括Relay) + 2. Demo 应用 (页面JS版本 + 简单后端配合,为后续集成COS72做准备) +* **中等优先级 (Medium Priority - M)**: + 1. 基础的Gasless功能对接 (SuperPaymaster的初步集成) +* **低优先级 (Low Priority - L)**: + 1. SDSS的完全去中心化 (先采用中心化或简化版) + 2. 完整的SDK化 + 3. 其他高级功能和研究性课题 + +现在,我们基于这个思路,从你之前的详细任务列表中筛选和重组,形成一个更聚焦的MVP计划表格。 + +--- + +## AirAccount MVP 开发计划 (V2) + +### 一、最高优先级 (High Priority - H) + +#### H1. 核心账户功能与集成 (Core Account Functionality & Integration) + - [ ] **H1.1 账户基础与二次签名验证 (Account Primitives & Dual-Signature Verification)** + - [ ] H1.1.1 最小版二次签名验证账户的合约实现 (BLS with DVT or simplified approach for MVP, plan EIP-7212 for future) + - [ ] H1.1.2 账户的注册、生成流程实现 + - [ ] H1.1.3 指纹 (Passkey) 绑定与账户管理 (添加、查询) 的基本API和逻辑 + - [ ] **H1.2 TEE 集成与核心钱包逻辑 (TEE Integration & Core Wallet Logic)** + - [ ] H1.2.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) 的核心功能 (私钥安全存储与签名) + - [ ] H1.2.2 不可信应用 (CA) 与 TEE API 的基础交互逻辑 (用于Demo调用) + - [ ] H1.2.3 CA 与 TA 的核心交互流程联调 (签名请求与响应) + - [ ] **H1.3 Relay 与 Bundler 核心功能 (Relay & Bundler Core Functionality)** + - [ ] H1.3.1 内部 Bundler 的核心实现 (打包UserOperation) + - [ ] H1.3.2 Relay 的核心实现 (接收CA请求,与TEE交互,与Bundler交互,提交交易) + - [ ] **H1.4 整体核心流程联调 (Overall Core Flow Integration & Testing)** + - [ ] H1.4.1 从用户发起操作 (CA) -> Relay -> TEE签名 -> Bundler打包 -> 交易上链 的核心流程联调 + - [ ] H1.4.2 部署与测试环境搭建 (例如,本地测试网,目标硬件初步验证 NXP iMX93) + +#### H2. Demo 应用与初步用户体验 (Demo Application & Initial UX) + - [ ] **H2.1 Demo 前端页面 (JS 版本) (Demo Frontend - JS Version)** + - [ ] H2.1.1 核心账户操作的用户界面 (账户创建、指纹绑定、发起简单交易) + - [ ] H2.1.2 与后端/Relay交互的API调用实现 + - [ ] H2.1.3 基本的用户反馈和状态显示 + - [ ] **H2.2 Demo 简易后端/模拟服务 (Demo Simplified Backend/Mock Service)** + - [ ] H2.2.1 (如果需要) 提供必要的后端API支持Demo前端 (例如,用户管理、状态查询的简化版) + - [ ] H2.2.2 (如果需要) 模拟部分链上交互或TEE行为,以便前端独立开发和测试 + - [ ] **H2.3 Demo 流程验证与用户体验初步打磨 (Demo Flow Validation & Initial UX Refinement)** + - [ ] H2.3.1 完整演示核心账户创建、绑定、使用流程 + - [ ] H2.3.2 收集初步用户体验反馈,进行界面和流程优化 + +### 二、中等优先级 (Medium Priority - M) + +#### M1. 基础 Gasless 功能对接 (Basic Gasless Functionality Integration) + - [ ] **M1.1 SuperPaymaster 初步集成 (Initial SuperPaymaster Integration)** + - [ ] M1.1.1 部署或对接一个基础功能的 Paymaster 合约 + - [ ] M1.1.2 实现 AirAccount 账户与该 Paymaster 的交互逻辑 (例如,允许特定ERC20代付) + - [ ] M1.1.3 在 Demo 应用中集成基础的 Gasless 交易体验 (例如,特定操作免Gas) + - [ ] **M1.2 Gasless 流程测试与验证 (Gasless Flow Testing & Validation)** + - [ ] M1.2.1 测试通过 Paymaster 完成 ERC20 代付的流程 + - [ ] M1.2.2 验证 Gasless 交易的正确性和稳定性 + +--- + +**计划V2说明与思考:** + +1. **聚焦核心**: 这个版本严格筛选了任务,确保所有高优先级任务都直接服务于“可用的核心账户”和“能展示核心价值的Demo”。 +2. **二次签名验证的简化**: 在H1.1.1中提到 "BLS with DVT or simplified approach for MVP",意味着MVP阶段可以考虑一个更易于快速实现的二次签名方案,后续再升级到更复杂的链上验证方案。 +3. **TEE的核心价值**: H1.2 强调了TEE在私钥安全存储和签名方面的核心作用,这是AirAccount安全性的基石。 +4. **Relay是枢纽**: H1.3 将Relay和Bundler作为核心集成部分,它们是连接用户、TEE和区块链的关键。 +5. **Demo驱动**: H2 的目标是快速构建一个能跑通核心流程的Demo,用于验证、展示和收集早期反馈。先有JS版本,后续再考虑集成到COS72。 +6. **Gasless作为重要加分项**: M1 将基础的Gasless功能作为中等优先级,因为它能显著提升用户体验,是账户抽象的一个重要特性。MVP阶段实现基础对接即可。 +7. **隐含的任务**: + * **合约部署与管理**: 部署账户合约、Paymaster合约等。 + * **测试用例编写**: 对核心功能进行单元测试和集成测试。 + * **文档**: 核心API和流程的初步文档。 +8. **后续迭代**: + * **低优先级任务**: SDSS的去中心化、完整的SDK、社交恢复、ERC-7702、更多应用协议、AI集成等都放在MVP成功验证之后。 + * **COS72集成**: 在Demo JS版本稳定后,再考虑将其能力集成到更成熟的COS72框架中。 + +这个V2计划更加精炼,目标更明确,希望能帮助你的团队高效推进MVP的开发。记住,MVP的关键在于“最小”和“可行”,快速迭代,持续优化。 + +-------- +下面是V1的 + +------ + +好的,这是一个非常详细和全面的开发计划!我将根据你提供的架构思考、Research重点和明细开发任务,帮你整理成一个包含checkbox的计划表格。 + +**重要说明:** + +* **层级与拆解**: 你提到了“表格罗列两层任务足够”,但你提供的明细任务非常细致,很多可以看作是第三层甚至第四层的任务。为了保持表格的可读性,我会尽量将相关的细致任务组织在更大的特性或模块下。 +* **负责人与时间**: 这个表格**不包含**负责人和预计完成时间,这些需要你和你的团队根据实际情况来分配。 +* **依赖关系**: 很多任务之间存在依赖关系,这个表格主要关注任务列表,具体的依赖管理需要在项目管理工具中体现。 +* **动态调整**: 这是一个初步的计划,实际开发过程中肯定会遇到变化,需要灵活调整。 +* **N0-N3**: 我理解这是指不同的部署阶段或节点类型,在相关任务中会体现。 + +**开发计划表格 (Markdown格式)** + +--- + +## AirAccount 开发计划 + +### 一、基础设施 (Infrastructure) + +#### 1. 核心账户与签名 (Core Account & Signature) + - [ ] **1.1 账户基础 (Account Primitives)** + - [ ] 1.1.1 最小版二次签名验证账户的注册、生成 (BLS with DVT, plan EIP-7212) + - [ ] 1.1.2 指纹 (Passkey) 绑定与账户管理 (添加、查询) + - [ ] **1.2 Paymaster 与 Gas 管理 (Paymaster & Gas Management)** + - [ ] 1.2.1 使用 Paymaster 完成 ERC20 代付 + - [ ] 1.2.2 Gas Card 设计:查询、绑定、ERC20 代扣 + - [ ] **1.3 Bundler 与 Relay (Bundler & Relay)** + - [ ] 1.3.1 Bundler 实现:从外部依赖过渡到内部 Bundler + - [ ] 1.3.2 优化:内部 Bundler 与 Paymaster Relay 合并,实现一步提交 + - [ ] **1.4 TEE 集成与硬件钱包交互 (TEE Integration & HW Wallet Interaction)** + - [ ] 1.4.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) + - [ ] 1.4.2 不可信应用 (CA) 开发 + - [ ] 1.4.3 CA 通过 TEE API 调用可信应用 TA (硬件钱包) 的联合调试 + - [ ] **1.5 社交恢复与账户升级 (Social Recovery & Account Upgrade)** + - [ ] 1.5.1 AirAccount 社交恢复的多签账户设计与实现 + - [ ] 1.5.2 AirAccount 账户升级到社交恢复多签账户的流程 + - [ ] 1.5.3 (可选) ERC-7702 账户集成与多签恢复嵌入 + - [ ] **1.6 整体联调与测试 (Overall Integration & Testing)** + - [ ] 1.6.1 整体 AirAccount 基础设施联调 (目标平台: NXP iMX93 或更低配置) + +#### 2. SDSS (Standardized Decentralized Service System) - V0.1 + - [ ] **2.1 核心服务与API (Core Services & API)** + - [ ] 2.1.1 SDSS ENS (或类似域名服务) 实现 + - [ ] 2.1.2 SDSS API 服务基础框架搭建 + - [ ] 2.1.3 路由注册、发现机制 + - [ ] 2.1.4 API 标准数据提交、更新、缓存、错误处理机制 + - [ ] **2.2 核心提交服务 (Core Submission Service)** + - [ ] 2.2.1 SDSS Submit 服务基础:一次提交 (Gas Sponsor + Bundler 上链) + +#### 3. 客户端与工具 (Client & Tools) + - [ ] **3.1 Tauri 客户端 (Tauri Client)** + - [ ] 3.1.1 Tauri 客户端多端发布与测试 + - [ ] 3.1.2 Tauri 集成测试:COS72 基础 Web 版本开发与集成 + - [ ] **3.2 SSO 与 SDK (SSO & SDK)** + - [ ] 3.2.1 SSO (单点登录) 插件/JS/SDK 开发与测试 + +### 二、框架层 (Framework) + +#### 4. AAStar SDK 与集成 + - [ ] **4.1 AAStar SDK 开发 (AAStar SDK Development)** + - [ ] 4.1.1 AAStar SDK Web 版本开发与测试 + - [ ] **4.2 COS72 与 AAStar SDK 集成 (COS72 & AAStar SDK Integration)** + - [ ] 4.2.1 COS72 与 AAStar SDK 集成测试 + +#### 5. Relay 技术栈演进与集成 (Relay Stack Evolution & Integration) + - [ ] **5.1 Relay 版本统一 (Relay Version Unification)** + - [ ] 5.1.1 Go 版本 Relay 与 Rust 版本 Relay 的尝试合并/搬迁 + - [ ] **5.2 Rust Relay 集成 (Rust Relay Integration)** + - [ ] 5.2.1 Rust 版本 Relay 集成到 COS72 (N0-N3 部署) + +#### 6. SDSS 服务集成到 COS72 (SDSS Service Integration into COS72) + - [ ] **6.1 文件服务 SDSS (File Service SDSS)** + - [ ] 6.1.1 文件服务 SDSS 集成到 COS72 + - [ ] **6.2 Supabase SDSS (Supabase SDSS)** + - [ ] 6.2.1 Supabase (或类似 BaaS) SDSS 集成到 COS72 + - [ ] **6.3 硬件钱包 SDSS (Hardware Wallet SDSS)** + - [ ] 6.3.1 硬件钱包 SDSS 集成到 COS72 + +#### 7. COS72 可定制化与发布 (COS72 Customization & Release) + - [ ] **7.1 可定制化 COS72 (Customizable COS72)** + - [ ] 7.1.1 COS72 配置化方案设计与实现 + - [ ] 7.1.2 COS72 构建 (Build) 流程优化 + - [ ] 7.1.3 COS72 发布流程建立 + +### 三、应用层 (Application) + +#### 8. 核心协议与应用 (Core Protocols & Applications) + - [ ] **8.1 OpenPNTs (Programmable Non-fungible Tokens)** + - [ ] 8.1.1 OpenPNTs 协议设计与基础应用开发 + - [ ] 8.1.2 OpenPNTs 集成到 COS72 + - [ ] **8.2 OpenCards** + - [ ] 8.2.1 OpenCards 协议设计与基础应用开发 + - [ ] 8.2.2 OpenCards 集成到 COS72 + - [ ] **8.3 Uniswap V4 Launchpad (可选/探索)** + - [ ] 8.3.1 Uniswap V4 Launchpad 功能开发 + +#### 9. PNTs 发行与演示 (PNTs Issuance & Demo) + - [ ] **9.1 PNTs 发行流程设计 (PNTs Issuance Flow Design)** + - [ ] 9.1.1 PNTs 发行流程 (线上线下、链上) Demo 设计 + - [ ] **9.2 PNTs 发行流程开发 (PNTs Issuance Flow Development)** + - [ ] 9.2.1 PNTs 发行流程功能开发 + +#### 10. COS72 版本发布 (COS72 Release) + - [ ] **10.1 COS72 V0.14 发布** + - [ ] 10.1.1 实现无侵入使用特性 + - [ ] 10.1.2 实现随时解绑账户特性 + - [ ] 10.1.3 支持用户发行自己的积分和 GasCard + +#### 11. AAStar 生态应用 (AAStar Ecosystem Applications) + - [ ] **11.1 AAStar 积分 (aPNTs)** + - [ ] 11.1.1 AAStar 发行自己的积分 aPNTs (基于 OpenPNTs) + - [ ] 11.1.2 aPNTs 引入 SDSS,管理积分发行 + +#### 12. Arcadia (探索性项目) + - [ ] **12.1 Arcadia 设计与 Demo 开发** + - [ ] 12.1.1 Arcadia 概念讨论与哲学 AI 基础研究 + - [ ] 12.1.2 Arcadia Demo2 开发 + +#### 13. 插件生态 (Plugin Ecosystem) + - [ ] **13.1 插件规划** + - [ ] 13.1.1 ~20+ 插件的思考、规划与优先级排序 + +### 四、AI 集成 (AI Integration) - (探索与研究阶段为主) + +#### 14. AI 辅助决策与知识库 (AI-Assisted Decision Making & Knowledge Base) + - [ ] **14.1 人生路径与未来知识库** + - [ ] 14.1.1 知识库构建与使用场景探索 + - [ ] **14.2 常规选择与决策 AI 辅助** + - [ ] 14.2.1 AI 辅助模型研究与原型 + - [ ] **14.3 消费决策 AI** + - [ ] 14.3.1 消费决策 AI 模型研究与原型 + +#### 15. Crypto + AI (Asset3) + - [ ] **15.1 Asset3 概念与实现探索** + - [ ] 15.1.1 Crypto 资产与 AI 结合的创新应用探索 + +### 五、Research 重点 (与开发并行或指导开发) + +*(这些是研究方向,可能不会直接转化为开发任务,但会影响设计和实现)* + - [ ] **R1. 签名方案研究** + - [ ] R1.1 当前签名方案优化与安全性分析 (BLS, EIP-7212 等) + - [ ] R1.2 后量子密码 (PQC) 签名方案调研与集成可行性分析 + - [ ] **R2. TEE 可信方案研究** + - [ ] R2.1 TEE 技术栈选择与安全性评估 (e.g., Intel SGX, ARM TrustZone) + - [ ] R2.2 TEE 证明与远程认证机制研究 + - [ ] **R3. 漏洞与作恶防范研究** + - [ ] R3.1 硬件层面漏洞分析与防范 (TEE, Secure Element) + - [ ] R3.2 应用层面安全设计与代码审计方法研究 + - [ ] R3.3 智能合约安全审计与形式化验证方法研究 + - [ ] **R4. 隐私保护技术研究** + - [ ] R4.1 ZKP (零知识证明) 在账户抽象和 SDSS 中的应用研究 + - [ ] R4.2 匿名地址与隐私交易方案研究 + - [ ] **R5. SDSS V0.1 性能评估** + - [ ] R5.1 SDSS V0.1 效率、吞吐量、延迟等性能指标测试与分析 + - [ ] **R6. SDSS V0.2 (P2P) 演进研究** + - [ ] R6.1 SDSS 引入 P2P 网络后的架构变化、性能影响、去中心化程度分析 + +--- + +**使用建议:** + +1. **优先级排序**: 你的任务列表非常庞大。强烈建议根据 MVP (最小可行产品) 原则,对这些任务进行优先级排序。哪些是核心功能,哪些是后续迭代? +2. **分配负责人和时间**: 将每个 `- [ ]` 任务分配给具体的负责人,并估算完成时间。 +3. **工具**: 使用专业的项目管理工具 (如 Jira, Trello, Asana, Notion, ClickUp 等) 来跟踪这些任务、依赖关系和进度。这个 Markdown 表格可以作为初始导入或高级概览。 +4. **迭代**: 将开发过程划分为多个 Sprint 或迭代,每个迭代有明确的目标。 +5. **定期同步**: 团队内部需要定期开会同步进度、讨论问题和调整计划。 + +这个计划表非常宏大,预祝你的项目顺利推进! + +分析和思考: +当务之急是MVP,因此 +1. 低优先级:SDSS是去中心化的,可以独立和分离,因此降低优先级,先中心化,再去中心,迁移难度不大 +2. 低优先级:相对独立的Superpaymaster,Gasless是独立的,可选的,因此中等优先级,完成基础的对接和基础的gasless即可 +3. 最高优先级:账户是串联所有的基础,目前核心是二次签名验证+整体集成(relay等),非SDK(后面再整合为sdk) +4. 考虑demo也是高优先级,因此需要页面和服务器配合,先有页面js版本,再集成到cos72 +5. 所以计划的第二个版本,只设计高优先级(两个)和中等优先级(1个),请按这个思路筛选,不必那么严苛任务数量 diff --git a/0.16.23/guide/docs/Regression_Testing_Guide.md b/0.16.23/guide/docs/Regression_Testing_Guide.md new file mode 100644 index 000000000..43be4bfb1 --- /dev/null +++ b/0.16.23/guide/docs/Regression_Testing_Guide.md @@ -0,0 +1,70 @@ +# 回归测试脚本使用说明 + +## 仅使用两个回归脚本 + +### 1. `run_full_regression.sh` - 完整回归测试 + +**用途**: Anvil本地完整测试套件 + +**包含内容**: +- Anvil启动与清理 +- 合约部署(DeployV3FullLocal.s.sol) +- 配置同步 +- 24个测试脚本: + - ✅ V2回归测试 (6个): 00-05 + - ✅ V3核心测试 (6个): 06-11 + - ✅ 高级功能测试 (12个): 12-23, 98-99 + +**运行方式**: +```bash +# Anvil模式(默认) +./run_full_regression.sh + +# Sepolia模式(跳过部署) +./run_full_regression.sh --env sepolia +``` + +--- + +### 2. `run_sdk_regression.sh` - SDK独立测试 + +**用途**: SDK API层面的独立功能测试 + +**包含内容**: +- BLS签名测试 +- Middleware测试 +- 不依赖Anvil的纯SDK功能 + +**运行方式**: +```bash +./run_sdk_regression.sh +``` + +--- + +## ⚠️ 已删除脚本 + +- ❌ `scripts/run_regression.sh` (冗余,已合并到run_full_regression.sh) + +--- + +## 快速使用指南 + +### 本地开发验证 +```bash +./run_full_regression.sh +``` + +### Sepolia测试网验证 +```bash +./run_full_regression.sh --env sepolia +``` + +### SDK功能测试 +```bash +./run_sdk_regression.sh +``` + +--- + +**结论**: 只需要这两个脚本即可完成所有回归测试! ✅ diff --git a/0.16.23/guide/docs/Reputation-to-Credit_Mapping_Whitepaper.md b/0.16.23/guide/docs/Reputation-to-Credit_Mapping_Whitepaper.md new file mode 100644 index 000000000..7f6c0586e --- /dev/null +++ b/0.16.23/guide/docs/Reputation-to-Credit_Mapping_Whitepaper.md @@ -0,0 +1,242 @@ +# Reputation-to-Credit 技术映射白皮书 + +## 1. 设计初衷与哲学 (Design Philosophy) + +AAStar 协议的核心愿景是构建一个“赋能社区、简化开发”的账户抽象基础设施。在这个体系中,**Reputation (声誉)** 和 **Credit (信用/授信)** 是连接链上资产与社交共识的桥梁。 + +### 核心理念: +- **Reputation 是主观度量**:它代表了社区成员之间的共识。声誉不是单纯的数字,而是基于用户活动(Entropic Factor)和社交关系(Social Graph)的综合评分。 +- **Credit 是经济表现**:信用是将主观声誉转化为客观支付能力的机制。通过信用系统,用户可以“预支”Gas 费用,实现真正的无感交互。 +- **去中心化的安全底线**:通过 DVT (Distributed Validator Technology) 和 BLS 聚合签名,确保声誉的更新不依赖于任何单一中心化实体。 + +--- + +## 2. 技术架构与映射逻辑 + +### 2.1 声誉增长路径 (The Three Tiers) + +系统设计了三种平行的声誉更新路径,以适应不同的信任级别: + +| 级别 | 名称 | 触发逻辑 | 验证机制 | 适用场景 | +| :--- | :--- | :--- | :--- | :--- | +| **Tier 1** | **Manual Inject** | 管理员手动设定 | 合约 Owner 权限 | 测试、紧急干预、初始数据导入 | +| **Tier 2** | **Rule-based Sync** | 链上规则自动累加 | 预定义智能合约算法 | 质押奖励、固定活动积分 | +| **Tier 3** | **DVT Batch Sync** | 离线计算批量同步 | **BLS256 聚合签名证明** | 生产环境、综合行为建模、跨链声誉 | + +### 2.2 映射模型:从分数到额度 + +声誉分数的转换遵循以下三级映射: + +1. **Reputation Score (25分)**: 用户在特定社区或全局的活动积分。 +2. **Credit Level (Level 2)**: 在 `Registry` 中注册的等级阈值。 + - *配置示例*:Level 1 (>10分), Level 2 (>20分), Level 3 (>50分)。 +3. **Credit Limit (100 aPNTs)**: 每个等级对应一个全局的基础信用额度。 +4. **Community Limits (xPNTs)**: 各社区可基于全局额度进行微调或设置黑名单。 + +--- + +## 3. 用户场景与活动路径 + +### 场景 A:终端用户 Gasless 体验 (End-user Flow) +1. **活动产生**:用户在 App 内完成每日签到。 +2. **声誉增长**:`ReputationSystem` 根据 Tier 2 规则自动计算分数增长。 +3. **信用变现**:用户发起交易,`SuperPaymaster` 发现该用户 `Credit Level` 已达标。 +4. **代付执行**:`SuperPaymaster` 为用户垫付 Gas,并在 `xPNTsToken` 中记录债务(Debt)。 +5. **自动偿还**:当用户获得新的社区激励(Mint)时,债务先于余额自动扣除。 + +### 场景 B:社区管理员配置 (Admin Flow) +1. **启动社区**:通过 `createCommunityClient` 启动并部署社区专属 `xPNTsToken`。 +2. **定义规则**:调用 `ReputationSystem.setRule` 设置“质押 100 GT 每日增 1 分”的规则。 +3. **设置阈值**:在 `Registry` 中定义不同信用等级对应的 Airdrop 权限。 + +### 场景 C:生产级去中心化同步 (DVT Consensus Flow) +1. **离线分析**:DVT 节点群分析用户的跨链及链上行为。 +2. **共识签名**:多个 DVT 节点对更新后的声誉列表进行 BLS 签名。 +3. **批量注入**:调用 `Registry.batchUpdateGlobalReputation`。合约在毫秒内验证 BLS 证明。 +4. **权限锁死**:Owner 权限收缩,确保非 DVT 签名的声誉更新会被拒绝。 + +--- + +## 4. 关键初始化配置 (Default Setup) + +为了确保系统的“开箱即用”且安全,我们预设了以下基准配置: + +- **基础信用阈值 (Level Thresholds)**: + - Level 1: 13 points (入门级,支持基础转账代付)。 + - Level 2: 50 points (高级用户,支持复杂合约交互)。 +- **信用额度配额 (Credit Tiers)**: + - Level 1 Limit: 等值 $10 USD 的 aPNTs。 + - Level 2 Limit: 等值 $50 USD 的 aPNTs。 +- **安全拦截器 (Safety Interceptor)**: + - `SuperPaymaster` 采用**被动黑名单机制**。即使额度足够,若 DVT 标记 `isBlocked=true`,交易仍会被拒绝。 + +--- + +## 5. 结论 + +Reputation-to-Credit 映射不仅是一套算法,它是 AAStar 网络治理的核心。它通过将“社交声誉”转化为“链上信用”,解决了 Web3 用户进入门槛高的痛点,同时利用 DVT 技术确保了这套信用体系的公正与去中心化。 + +--- + +## 6. 核心数据结构与关系映射 (Core Data Structures & Relationships) + +为了深入理解系统如何从底层数据层面支撑声誉到信用的转换,本节整理了三大核心合约的关键数据对象及其交互关系。 + +### 6.1 对象关系图 (Object Relationship Diagram) + +```mermaid +classDiagram + class Registry { + +mapping(address => uint256) globalReputation + +mapping(uint256 => uint256) creditTierConfig + +uint256[] levelThresholds + +RoleConfig[] roleConfigs + +getCreditLimit(user) + } + + class ReputationSystem { + +mapping(community => Rule) communityRules + +mapping(user => score) communityReputations + +computeScore() + +syncToRegistry() + } + + class SuperPaymaster { + +mapping(operator => OperatorConfig) operators + +mapping(operator => user => UserOpState) userOpState + +validatePaymasterUserOp() + } + + class User { + +address account + +uint256 reputationScore + +uint256 creditLimit + } + + %% Relationships + ReputationSystem ..> Registry : 1. Sync Score (Write) + User --> Registry : 2. Check Level (Read) + Registry --> SuperPaymaster : 3. Credit Limit (Read) + SuperPaymaster ..> User : 4. Enforce Blocking (Read State) +``` + +### 6.2 核心数据对象 (Key Data Objects) + +#### A. Registry (Single Source of Truth) +Registry 是整个系统的状态中心,存储了用户的全局声誉和信用配置。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **Global Reputation** | `mapping` | 所有用户的全局声誉分 | `globalReputation[user] => uint256 score` | +| **Credit Tiers** | `mapping` | 等级与信用额度的映射 | `creditTierConfig[level] => uint256 limit (aPNTs)` | +| **Level Thresholds** | `array` | 晋升等级所需的分数线 | `levelThresholds[] = [13, 34, 89...]` | +| **Role Config** | `struct` | 角色行为定义 | `minStake`, `exitFeePercent`, `roleLockDuration` | + +#### B. ReputationSystem (Calculation Engine) +负责计算分数的逻辑层,支持规则定义和即时计算。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **Rule** | `struct` | 社区定义的声誉获取规则 | `baseScore`, `activityBonus`, `maxBonus` | +| **Community Rules** | `mapping` | 社区特有规则集 | `communityRules[community][ruleId] => Rule` | +| **Score Cache** | `mapping` | 社区内局部声誉缓存 | `communityReputations[community][user] => uint256` | + +#### C. SuperPaymaster (Execution Layer) +根据 Registry 的数据执行支付逻辑,并维护自身的风险控制状态。 + +| 数据结构 | 类型 | 描述 | 关键字段 (Struct/Field) | +| :--- | :--- | :--- | :--- | +| **OperatorConfig** | `struct` | Paymaster 运营商配置 | `aPNTsBalance`, `exchangeRate`, `isPaused` | +| **UserOpState** | `struct` | 压缩的用户状态(省Gas) | `uint48 lastTimestamp`, `bool isBlocked` | +| **PriceCache** | `struct` | 代币价格预言机缓存 | `int256 price`, `uint256 updatedAt` | + +### 6.3 数据流转逻辑 (Data Flow) + +整个信用体系的数据流转遵循 **"计算 -> 存储 -> 消费"** 的闭环: + +1. **计算 (Compute)**: `ReputationSystem` 根据 `Rule` 和用户活动(Activities)计算出 `communityScore`。 +2. **同步 (Sync)**: 通过 `syncToRegistry` 或 DVT 共识,将计算结果写入 `Registry.globalReputation`。 +3. **映射 (Map)**: `Registry` 内部通过 `levelThresholds` 将分数动态映射为 `Credit Level`。 +4. **消费 (Consume)**: 用户发起交易时,`SuperPaymaster` 调用 `Registry.getCreditLimit(user)` 获取最新的信用额度。 +5. **校验 (Validate)**: `SuperPaymaster` 结合自身的 `UserOpState` (是否被屏蔽、频率限制) 和额度,决定是否为该 UserOperation 支付 Gas。 + +--- + +## 7. 深度解析:多社区协同与算法聚合 (Deep Dive: Multi-Community Aggregation) + +本节通过具体的用户案例(Alice)和运营视角,解析声誉系统如何在去中心化的环境下处理多源数据。 + +### 7.1 用户视角:Alice 的多重身份 (The User Journey) + +假设用户 **Alice** 加入了三个不同的 DAO 社区,并在每个社区通过不同的行为积累声誉。 + +#### A. 行为记录 +| 社区 | 角色/身份 | 参与活动 (Activity) | 原始积分 | +| :--- | :--- | :--- | :--- | +| **Panda DAO** | 治理成员 | **投票 (Vote)**: 参与了 15 次治理投票 | 150 pts | +| **Dev Guild** | 开发者 | **代码贡献 (PR)**: 合并了 3 个 PR | 300 pts | +| **Charity Fund**| 捐赠者 | **捐款 (Donate)**: 捐赠了 0.5 ETH | 500 pts | + +#### B. 数据展示与查询 +Alice 不需要去三个不同的应用查看积分。通过 Aggregator(聚合器)前端或 SDK,她可以调用统一的 ABI 获取全视图: +- **查询单社区分**:`ReputationSystem.calculateReputation(Alice, PandaDAO, 0)` -> 返回 `150`。 +- **查询全局分**:`Registry.globalReputation(Alice)` -> 返回聚合后的总分(如 `950`)。 +- **查询明细**:`ReputationSystem.getReputationBreakdown(Alice, DevGuild, ...)` -> 返回 `baseScore`, `activityBonus` 等。 + +### 7.2 运营视角:规则配置 (Operator Configuration) + +三个社区的 Operator (运营者账户) 可以在不修改合约代码的情况下,通过 ABI 设置各自的激励规则。 + +#### A. 规则定义 (Rule Definition) +通过调用 `ReputationSystem.setRule(bytes32 ruleId, uint base, uint bonus, uint max, string desc)`: + +1. **Panda DAO (投票)**: + - `ruleId`: `keccak256("VOTE_ACTION")` + - `base`: 10 (每次参与的基础分) + - `bonus`: 0 + - `max`: 1000 +2. **Dev Guild (PR)**: + - `ruleId`: `keccak256("PR_MERGED")` + - `base`: 50 + - `bonus`: 10 (代码量额外奖励) + - `max`: 500 + +#### B. 规则生效逻辑 +规则配置立即存储在链上 `communityRules[communityAddr][ruleId]` 中。只要 Alice 在该社区产生交互(触发 SDK 的 `l4-reputation-tiers.ts` 脚本或后端触发),积分计算逻辑会自动拉取最新的配置进行计算。 + +### 7.3 算法核心:熵增因子与聚合 (The Aggregation Algorithm) + +系统如何避免“积分通胀”?如何平衡不同社区的权重?核心在于 **内置的加权聚合算法**。 + +#### A. 当前算法逻辑 (Current Logic) +`ReputationSystem.computeScore` 采用线性加权求和模型: + +```solidity +// 伪代码逻辑 +function computeScore(user, communities, activities) { + totalScore = 0; + for (comm in communities) { + rawScore = rules[comm].base + (activity * rules[comm].bonus); + // 关键:熵增因子 (Entropy Factor) + // 1e18 = 1.0 (标准权重) + // 0.5e18 = 0.5 (低质量社区降权) + weight = entropyFactors[comm]; + totalScore += (rawScore * weight) / 1e18; + } + return totalScore; +} +``` + +- **Panda DAO** (权重 1.0): 150 * 1.0 = 150 +- **Dev Guild** (权重 1.5 - 技术公会): 300 * 1.5 = 450 +- **Charity Fund** (权重 0.8): 500 * 0.8 = 400 +- **Global Score**: 150 + 450 + 400 = **1000** + +这种设计允许 Registry 管理员(或 DAO 治理)通过调整 `entropyFactors` 来宏观调控不同社区对全局信用的贡献度,防止恶意刷分社区破坏系统平衡。 + +#### B. 未来演进:可插拔算法模块 (Pluggable Algorithm) +`ReputationSystem` 目前实现了 `IReputationCalculator` 接口。由于 `Registry` 与计算逻辑是**解耦**的(Registry 只存结果,不存过程),未来可以轻松升级: + +1. **外置模块化**: 可以部署 `ReputationSystemV2`(例如引入 PageRank 算法或通过 AI 模型分析链上行为)。 +2. **多源喂价**: `Registry.isReputationSource` 允许白名单机制。未来可以授权给 Chainlink Oracle 或 ZK-Verifier 合约,它们可以使用完全不同的链下算法计算分数,只需将最终结果 "Feed" 给 Registry。 +3. **无缝迁移**: 由于 Alice 的 Global Reputation 是累积的,新的算法可以基于旧分进行增量更新,或者通过 Epoch 版本号完全重置,实现平滑过渡。 diff --git a/0.16.23/guide/docs/SDK_ABI_COVERAGE.md b/0.16.23/guide/docs/SDK_ABI_COVERAGE.md new file mode 100644 index 000000000..b0103fe65 --- /dev/null +++ b/0.16.23/guide/docs/SDK_ABI_COVERAGE.md @@ -0,0 +1,839 @@ +# SDK 合约 ABI Total + +完整覆盖率分析 + +## 1. 合约清单 + +我们有 **27 个合约** ABIs: + +### 核心合约 (Core Contracts) +1. **Registry** - 角色和社区管理 +2. **GTokenStaking** - 治理代币质押 +3. **GToken** - 治理代币 +4. **SuperPaymaster** - 超级支付主管 +5. **MySBT** - 灵魂绑定代币 +6. **ReputationSystem** - 信誉系统 + +### Paymaster 相关 +7. **PaymasterV4_2** - V4 支付主管 +8. **Paymaster** - 基础支付主管 +9. **PaymasterFactory** - 支付主管工厂 + +### 代币相关 +10. **aPNTs** - 全局积分代币 +11. **xPNTs** - 社区积分代币 +12. **xPNTsFactory** - 社区积分工厂 +13. **xPNTsToken** - 社区积分代币(别名) + +### AA 账户相关 +14. **EntryPoint** - ERC-4337 入口点 +15. **SimpleAccount** - 简单账户 v0.7 +16. **SimpleAccountV08** - 简单账户 v0.8 +17. **SimpleAccountFactory** - 账户工厂 v0.7 +18. **SimpleAccountFactoryV08** - 账户工厂 v0.8 +19. **LegacyAccount** - 遗留账户 +20. **Simple7702Account** - EIP-7702 账户 +21. **Eip7702Support** - EIP-7702 支持 +22. **SenderCreator** - 发送者创建器 + +### 验证器相关 +23. **DVTValidator** - DVT 验证器 +24. **BLSValidator** - BLS 验证器 +25. **BLSAggregator** - BLS 聚合器 + +### 工具 +26. **UserOperationLib** - 用户操作库 +27. **StateValidator** - 状态验证器 + +--- + +## 2. SDK Actions 映射 + +### packages/core/src/actions/ + +| Action 文件 | 目标合约 | 状态 | +|------------|---------|------| +| `registry.ts` | Registry | ✅ | +| `staking.ts` | GTokenStaking | ✅ | +| `tokens.ts` | GToken, aPNTs, xPNTs | ✅ | +| `superPaymaster.ts` | SuperPaymaster | ✅ | +| `sbt.ts` | MySBT | ✅ | +| `reputation.ts` | ReputationSystem | ✅ | +| `paymasterV4.ts` | PaymasterV4_2 | ✅ | +| `factory.ts` | PaymasterFactory, xPNTsFactory | ✅ | +| `dvt.ts` | DVTValidator | ✅ | +| `aggregator.ts` | BLSAggregator, BLSValidator | ✅ | +| `StateValidator.ts` | StateValidator | ✅ | + +### packages/sdk/src/clients/ + +| Client 文件 | 组合的 Actions | 状态 | +|------------|---------------|------| +| `community.ts` | registry + tokens + factory | ✅ | +| `operator.ts` | registry + staking + superPaymaster | ✅ | +| `endUser.ts` | registry + sbt + AA账户 | ✅ | +| `admin.ts` | registry + reputation + dvt | ✅ | +| `ExperimentClient.ts` | 性能测试包装器 | ✅ | + +--- + +## 3. 详细 ABI 覆盖率分析 + +### ✅ Registry (100% 覆盖) + +**核心函数**: +- `registerRole()` ✅ registry.ts +- `hasRole()` ✅ registry.ts +- `getCommunityInfo()` ✅ registry.ts +- `exitRole()` ✅ registry.ts +- `getRoleConfig()` ✅ registry.ts + +**SDK 层**: +- CommunityClient.launch() ✅ +- OperatorClient.onboardOperator() ✅ + +--- + +### ✅ GTokenStaking (100% 覆盖) + +**核心函数**: +- `stake()` ✅ staking.ts +- `unstake()` ✅ staking.ts +- `getStakedAmount()` ✅ staking.ts + +**SDK 层**: +- OperatorClient.onboardOperator() ✅ + +--- + +### ✅ SuperPaymaster (90% 覆盖) + +**已覆盖函数**: +- `depositFor()` ✅ superPaymaster.ts +- `configureOperator()` ✅ superPaymaster.ts +- `validatePaymasterUserOp()` ✅ superPaymaster.ts +- `operators()` ✅ superPaymaster.ts (查询) + +**未覆盖函数**: +- `withdrawTo()` ⏭️ (Admin 操作,低优先级) +- `setOperatorPaused()` ⏭️ (Admin 操作) +- `updateReputation()` ⏭️ (Admin 操作) + +**SDK 层**: +- OperatorClient.configureOperator() ✅ +- EndUserClient.executeGasless() ✅ (构建 paymasterAndData) + +--- + +### ✅ MySBT (80% 覆盖) + +**已覆盖函数**: +- `safeMint()` ✅ sbt.ts +- `balanceOf()` ✅ sbt.ts +- `tokenOfOwnerByIndex()` ✅ sbt.ts + +**未覆盖函数**: +- `burn()` ⏭️ (低频操作) +- `transferOwnership()` ⏭️ (Admin 操作) + +**SDK 层**: +- EndUserClient.joinAndActivate() ✅ + +--- + +### ✅ GToken / aPNTs / xPNTs (100% 覆盖) + +**核心 ERC20 函数**: +- `balanceOf()` ✅ tokens.ts +- `transfer()` ✅ tokens.ts +- `approve()` ✅ tokens.ts +- `mint()` ✅ tokens.ts (测试环境) + +**SDK 层**: +- CommunityClient (xPNTs 管理) ✅ +- OperatorClient (aPNTs 存款) ✅ + +--- + +### ✅ PaymasterFactory & xPNTsFactory (100% 覆盖) + +**核心函数**: +- `deployPaymaster()` / `createXPNTs()` ✅ factory.ts +- `calculateAddress()` ✅ factory.ts + +**SDK 层**: +- CommunityClient.deployXPNTs() ✅ +- OperatorClient.setupNode() ✅ + +--- + +### ⚠️ EntryPoint (50% 覆盖) + +**已覆盖函数**: +- `handleOps()` ✅ endUser.ts (executeGasless) +- `getNonce()` ✅ endUser.ts + +**未覆盖函数**: +- `simulateValidation()` ⏭️ (Bundler 层操作) +- `handleAggregatedOps()` ⏭️ (聚合器操作) +- `depositTo()` ⏭️ (低频操作) + +**说明**: EntryPoint 的大部分函数是 Bundler 层调用,SDK 只需要覆盖业务相关的函数。 + +--- + +### ⏭️ SimpleAccount / SimpleAccountFactory (基础覆盖) + +**已覆盖函数**: +- `createAccount()` ✅ endUser.ts (通过 factory) +- `execute()` ✅ endUser.ts (构建 callData) + +**未覆盖函数**: +- `validateUserOp()` ⏭️ (EntryPoint 调用) +- `addDeposit()` / `withdrawDepositTo()` ⏭️ (低频操作) + +**说明**: SimpleAccount 的验证逻辑由 EntryPoint 调用,SDK 不需要直接调用。 + +--- + +### ⏭️ DVT / BLS 验证器 (基础覆盖) + +**已覆盖函数**: +- `validateSignature()` ✅ aggregator.ts +- `aggregateSignatures()` ✅ aggregator.ts + +**说明**: 这些是高级功能,当前版本主要用于未来的去中心化验证。 + +--- + +## 4. 覆盖率统计 + +### 按合约类型 + +| 类别 | 合约数 | 核心函数覆盖率 | 说明 | +|------|-------|--------------|------| +| **核心业务** | 6 | **95%** | Registry, GTokenStaking, SuperPaymaster, MySBT, ReputationSystem, GToken | +| **代币系统** | 4 | **100%** | aPNTs, xPNTs, xPNTsFactory全覆盖 | +| **Paymaster** | 3 | **90%** | V4, Factory 完整,SuperPaymaster 少数 Admin 函数未覆盖 | +| **AA 账户** | 6 | **60%** | 业务函数全覆盖,验证函数由 EntryPoint 调用 | +| **验证器** | 3 | **70%** | 核心验证函数已覆盖 | +| **工具** | 2 | **100%** | UserOperationLib, StateValidator | + +### 按优先级 + +| 优先级 | 函数类型 | 覆盖率 | 状态 | +|--------|---------|--------|------| +| **P0** | 业务核心函数 | **98%** | ✅ | +| **P1** | 常用管理函数 | **85%** | ✅ | +| **P2** | 低频 Admin 函数 | **40%** | ⏭️ 按需添加 | +| **P3** | 内部/验证函数 | **20%** | ⏭️ 由合约调用 | + +--- + +## 5. 未覆盖函数清单 + +### 5.1 低优先级 Admin 函数 (P2) + +| 合约 | 函数 | 说明 | 是否需要 SDK | +|------|------|------|------------| +| SuperPaymaster | `withdrawTo()` | Admin 提现 | ⏭️ 低频 | +| SuperPaymaster | `setOperatorPaused()` | 暂停运营商 | ⏭️ 低频 | +| Registry | `setRoleOwner()` | 转移角色所有权 | ⏭️ 低频 | +| MySBT | `burn()` | 销毁 SBT | ⏭️ 低频 | + +### 5.2 内部/验证函数 (P3) + +| 合约 | 函数 | 说明 | 是否需要 SDK | +|------|------|------|------------| +| SimpleAccount | `validateUserOp()` | EntryPoint 调用 | ❌ 不需要 | +| EntryPoint | `simulateValidation()` | Bundler 调用 | ❌ 不需要 | +| PaymasterV4 | `validatePaymasterUserOp()` | EntryPoint 调用 | ❌ 不需要 | + +--- + +## 6. 测试覆盖验证 + +### Anvil 环境已测试的 API + +✅ **CommunityClient** (10/10): +- launch(), getCommunityInfo(), deployXPNTs(), registerCommunity(), exitCommunity() +- approve(), stake(), getRoleConfig(), hasRole(), getCommunityToken() + +✅ **OperatorClient** (12/12): +- onboardOperator(), configureOperator(), getOperatorStatus(), depositCollateral() +- stake(), approve(), deployPaymaster(), calculateAddress() +- hasRole(), registerRole(), getStakedAmount(), getBalance() + +✅ **EndUserClient** (8/8): +- createSmartAccount(), deploySmartAccount(), joinAndActivate() +- safeMint(), balanceOf(), tokenOfOwnerByIndex() +- ⏭️ executeGasless() (Nonce ✅, handleOps 留待 Sepolia) + +✅ **AdminClient** (5/5): +- updateReputation(), setOperatorPaused(), configureRole() +- validateSignature(), aggregateSignatures() + +--- + +## 7. 总结 + +### ✅ 核心成就 + +1. **业务函数 98% 覆盖**: 所有核心业务场景的合约函数都已封装为 SDK API +2. **结构化组织**: 通过 Actions (基础层) + Clients (业务层) 清晰分层 +3. **场景完整性**: 社区启动、运营商入驻、用户注册、Gasless 交易全流程覆盖 + +### ⏭️ 未覆盖部分 + +**有意不覆盖**: +- Admin 低频操作 (withdrawTo, setOperatorPaused 等) +- 内部验证函数 (由 EntryPoint/Bundler 调用) +- 遗留合约 (LegacyAccount, SimpleAccountV08 等) + +**原因**: 这些函数要么是低频操作,要么是合约内部调用,不是 SDK 的核心职责。 + +### 📊 最终覆盖率 + +- **业务核心函数**: 98% ✅ +- **全部合约函数**: 76% (包含低频和内部函数) +- **测试验证覆盖**: 85% (Anvil 环境) + +**结论**: SDK 已有组织、有结构地覆盖了所有核心业务合约的关键 ABI,未覆盖的都是低优先级或内部函数。 +-------- + +# SDK 合约与 API 覆盖情况完整总结 + +## � L2 Client Capability Matrix (New) + +| Client | Role | Coverage | Key Features Added | +| :--- | :--- | :--- | :--- | +| **`UserClient`** | End User | ✅ **95%** | Staking (`stakeForRole`), Lifecycle (`exitRole`, `leaveCommunity`) | +| **`CommunityClient`** | Community Manager | ✅ **90%** | SBT Revocation (`revokeMembership`), Token Transfer | +| **`PaymasterOperatorClient`** | Paymaster Operator | ✅ **95%** | Gas Tokens (`addGasToken`), Config (`configureOperator`) | +| **`ProtocolClient`** | Protocol Admin | ✅ **90%** | Global Params (`setProtocolFee`, `setTreasury`) | + +## �📋 完整的 25 个合约清单 + +### 核心业务合约 (6个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 1 | **Registry** | 60 | 42 | 70% | P0 ✅ | +| 2 | **SuperPaymaster** | 58 | 39 | 67% | P0 ✅ | +| 3 | **GTokenStaking** | 28 | 29 | 100% | P0 ✅ | +| 4 | **MySBT** | 49 | 29 | 59% | P0 ✅ | +| 5 | **ReputationSystem** | 20 | 1 | 5% | P1 ⚠️ | +| 6 | **GToken** | 18 | ~8 (tokens.ts) | 44% | P0 ✅ | + +### 代币系统 (4个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 7 | **aPNTs** | 37 | ~24 (tokens.ts通用) | 65% | P0 ✅ | +| 8 | **xPNTs** | 37 | ~24 (tokens.ts通用) | 65% | P0 ✅ | +| 9 | **xPNTsToken** | 37 | (同xPNTs) | 65% | - | +| 10 | **xPNTsFactory** | 28 | 6 | 21% | P1 ✅ | + +### Paymaster 系统 (3个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 11 | **PaymasterV4_2** | 48 | 20 | 42% | P1 ✅ 主要使用 | +| 12 | **Paymaster** | 48 | (废弃) | 0% | ⏭️ 旧版本,不需要 | +| 13 | **PaymasterFactory** | 24 | 6 | 25% | P2 ✅ | + +### AA 账户相关 (7个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 14 | **EntryPoint** | 22 | 5 (account.ts) | 23% | P1 ✅ 核心已覆盖 | +| 15 | **SimpleAccount** | 17 | 8 (account.ts) | 47% | P1 ✅ v0.7 主用 | +| 16 | **SimpleAccountV08** | 17 | - | 0% | ⏭️ v0.8 暂不用 | +| 17 | **LegacyAccount** | 17 | - | 0% | ⏭️ 遗留版本 | +| 18 | **Simple7702Account** | 10 | - | 0% | ⏭️ EIP-7702 未来 | +| 19 | **SimpleAccountFactory** | 4 | 2 (account.ts) | 50% | P1 ✅ | +| 20 | **SimpleAccountFactoryV08** | 4 | - | 0% | ⏭️ v0.8 暂不用 | + +### 验证器系统 (3个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 优先级 | +|---|------|--------|------------|--------|--------| +| 21 | **DVTValidator** | 15 | 4 | 27% | P2 ✅ | +| 22 | **BLSAggregator** | 18 | 3 | 17% | P2 ✅ | +| 23 | **BLSValidator** | 2 | - | 0% | P3 ⏭️ | + +### 工具合约 (2个) +| # | 合约 | 函数数 | SDK Actions | 覆盖率 | 说明 | +|---|------|--------|------------|--------|------| +| 24 | **SenderCreator** | 3 | - | 0% | ⏭️ 内部工具 | +| 25 | **UserOperationLib** | 3 | - | 0% | ⏭️ 库函数 | + +--- + +## 📊 总体统计 + +### 原始数据 +- **总合约数**: 25 +- **总函数数**: 624 +- **已实现 Actions**: 211 +- **原始覆盖率**: 33.8% + +### 实际业务覆盖率(去除无关合约) + +**应该覆盖的合约** (19个核心+业务合约): +- 核心业务: 6个 (Registry, SuperPaymaster, GTokenStaking, MySBT, ReputationSystem, GToken) +- 代币系统: 3个 (aPNTs, xPNTs, xPNTsFactory) - xPNTsToken 和 xPNTs 重复 +- Paymaster: 2个 (PaymasterV4_2, PaymasterFactory) - 去掉旧 Paymaster +- AA账户: 3个 (EntryPoint, SimpleAccount, SimpleAccountFactory) - 去掉 V08 和 Legacy +- 验证器: 2个 (DVTValidator, BLSAggregator) - BLSValidator 基础够用 +- 工具: 0个 (内部使用) + +**应该覆盖的函数总数**: +- 去掉重复和废弃: ~450 functions + +**实际业务覆盖率**: 211/450 = **46.9%** + +**核心功能覆盖率**: +- P0 核心合约 (6个): ~85% ✅ +- P1 重要合约 (8个): ~45% ✅ +- P2 扩展功能 (5个): ~20% ⏭️ + +--- + +## 🎯 Actual Usage Scenario Coverage (Updated) + +### ✅ User Scenarios (95%) +- **Basic:** Transfer, Account Info ✅ +- **Identity:** Check SBT, Join Community (via Airdrop) ✅ +- **Staking:** Stake to Operator, Unstake, Check Rewards ✅ **(Added in v0.14.3)** +- **Lifecycle:** Leave Community, Exit Role ✅ **(Added in v0.14.3)** + +### ✅ Community Scenarios (90%) +- **Setup:** Create Token, Register ✅ +- **Growth:** Airdrop SBT ✅ +- **Governance:** Set Reputation Rules ✅ +- **Management:** Revoke Membership, Transfer Token Ownership ✅ **(Added in v0.14.3)** + +### ✅ Operator Scenarios (95%) +- **Funds:** Deposit, Withdraw ✅ +- **Staking:** Stake (Register), Unstake ✅ +- **Configuration:** Set Gas Tokens, Configure Global Params ✅ **(Added in v0.14.3)** + +### ✅ Protocol Scenarios (90%) +- **Governance:** Create Proposal, Vote ✅ +- **Infra:** Register BLS Key ✅ +- **Admin:** Set Protocol Fee, Set Treasury ✅ **(Added in v0.14.3)** + +### ⚠️ Remaining Gaps +- **Advanced:** BLS multi-signature aggregation (low priority) +- **Edge Cases:** Force-exit of stuck roles (handled by Protocol Admin via slash) + +--- + +## 💡 建议 + +### 当前状态:✅ 可用 +**核心业务场景 95% 覆盖**,足以支持: +1. 社区启动和管理 +2. 用户注册和 Gasless 交易 +3. 运营商配置和管理 + +### 可选提升(按需) +1. **ReputationSystem**: 补充直接查询接口(当前通过 Registry) +2. **PaymasterV4**: 补充 ERC20 Gas Token 完整支持 +3. **BLS**: 补充完整的聚合签名验证 + +**结论**: 211 个 Actions 已足够支持所有核心业务流程。剩余函数大多是: +- 标准接口的完整性补充(如 ERC20/ERC721 的所有函数) +- 低频管理操作 +- 内部调用函数 +- 未来功能(EIP-7702) + +---------- + +# AAStar SDK API 分层架构设计 + +## 架构概览 + +``` +┌─────────────────────────────────────────────────────────────┐ +│ L3: Scenario Patterns │ +│ (面向业务开发者 - Business Developers) │ +│ DAO Launchpad | Operator Lifecycle | User Onboarding │ +└─────────────────────────────────────────────────────────────┘ + ↓ 编排组合 +┌─────────────────────────────────────────────────────────────┐ +│ L2: Business Clients │ +│ (面向集成开发者 - Integration Developers) │ +│ CommunityClient | OperatorClient | EndUserClient │ +└─────────────────────────────────────────────────────────────┘ + ↓ 函数组合 +┌─────────────────────────────────────────────────────────────┐ +│ L1: Core Actions │ +│ (面向资深开发者 - Advanced Developers) │ +│ registryActions | stakingActions | superPaymasterActions │ +└─────────────────────────────────────────────────────────────┘ + ↓ 直接映射 +┌─────────────────────────────────────────────────────────────┐ +│ Smart Contracts ABIs │ +│ Registry.sol | GTokenStaking.sol | SuperPaymaster.sol │ +└─────────────────────────────────────────────────────────────┘ +``` + +--- + +## L1: Core Actions (底层 ABI API) + +### 定位 +**1:1 映射智能合约 ABI 的纯函数接口** + +### 目标用户 +1. **SDK 内部开发者** (Primary) - 构建 L2/L3 的基础 +2. **资深区块链开发者** (Secondary) - 需要精细控制的自定义场景 + +### 特点 +- ✅ 完整覆盖所有合约函数(100% ABI Coverage) +- ✅ 无业务逻辑封装,纯粹的合约调用 +- ✅ 参数直接对应 Solidity 函数签名 +- ✅ 返回原始的交易哈希或链上数据 + +### 包结构 +``` +packages/core/src/actions/ +├── registry.ts # Registry 合约 60 个函数 +├── staking.ts # GTokenStaking 28 个函数 +├── superPaymaster.ts # SuperPaymaster 58 个函数 +├── sbt.ts # MySBT 49 个函数 +├── tokens.ts # GToken/aPNTs/xPNTs 所有 ERC20 +├── paymasterV4.ts # PaymasterV4 48 个函数 +├── factory.ts # Factories +├── reputation.ts # ReputationSystem +├── dvt.ts # DVT Validator +├── aggregator.ts # BLS Aggregator/Validator +└── account.ts # AA 账户相关 +``` + +### 使用示例 +```typescript +import { registryActions } from '@aastar/core'; + +// 底层 API - 直接调用合约 +const registry = registryActions(REGISTRY_ADDRESS)(client); +await registry.registerRole({ + roleId: ROLE_ID, + user: USER_ADDRESS, + data: encodedData, + account +}); +``` + +**适用场景**: +- 自定义复杂的多步骤流程 +- 调试和测试特定合约函数 +- 构建非标准的业务逻辑 + +--- + +## L2: Business Clients (业务组合 API) + +### 定位 +**面向特定角色的高层业务封装** + +### 目标用户 +1. **DApp 集成开发者** (Primary) - 快速集成 AAStar 功能 +2. **后端服务开发者** - 构建 API 服务 +3. **智能合约开发者** - 链下交互 + +### 特点 +- ✅ 角色导向:Community、Operator、EndUser、Admin +- ✅ 业务逻辑封装:自动处理前置条件、批量操作 +- ✅ 错误处理和重试机制 +- ✅ 参数验证和智能默认值 +- ✅ 返回结构化的业务对象 + +### 包结构 +``` +packages/sdk/src/clients/ +├── community.ts # 社区管理 +├── operator.ts # 运营商管理 +├── endUser.ts # 终端用户 +└── admin.ts # 管理员 + +每个 Client 内部调用 L1 Actions +``` + +### 使用示例 +```typescript +import { createCommunityClient } from '@aastar/sdk'; + +// 业务 API - 自动处理复杂流程 +const communityClient = createCommunityClient({ chain, transport, account }); + +// 一键启动社区(内部组合多个 L1 actions) +const result = await communityClient.launch({ + name: "My DAO", + tokenName: "DAO Token", + tokenSymbol: "DAO", + description: "A community DAO", + website: "https://mydao.com" +}); + +// 自动完成: +// 1. 生成唯一名称 +// 2. 编码 roleData +// 3. Approve GToken +// 4. 注册 COMMUNITY 角色 +// 5. 部署 xPNTs 代币 +// 6. 返回结构化结果 +``` + +**适用场景**: +- DApp 前端集成 +- 后端 API 服务 +- 标准业务流程快速实现 + +--- + +## L3: Scenario Patterns (场景化模式) + +### 定位 +**端到端业务场景的最佳实践模板** + +### 目标用户 +1. **产品开发者** (Primary) - 快速构建应用原型 +2. **业务分析师** - 理解业务流程 +3. **新手开发者** - 学习参考 + +### 特点 +- ✅ 完整的端到端流程 +- ✅ 最佳实践和安全模式 +- ✅ 包含前端 UI 示例 +- ✅ 可复制的代码模板 + +### 包结构 +``` +examples/scenarios/ +├── 01_dao_launchpad.ts # DAO 启动模式 +├── 02_operator_lifecycle.ts # 运营商全生命周期 +├── 03_user_onboarding.ts # 用户注册激活 +├── 04_gasless_transaction.ts # 免 gas 交易 +├── 05_credit_system.ts # 信用体系 +└── 06_reputation_staking.ts # 信誉质押 +``` + +### 使用示例 +```typescript +// Scenario Pattern - 完整的 DAO 启动流程 +import { DAOLaunchpadPattern } from '@aastar/patterns'; + +const pattern = new DAOLaunchpadPattern({ + chain, + transport, + adminAccount +}); + +// 一键完成 DAO 从 0 到 1 +const dao = await pattern.launch({ + community: { + name: "Research DAO", + description: "...", + initialStake: parseEther('100') + }, + governance: { + votingPeriod: 7 * 24 * 3600, + quorum: 0.2 + }, + treasury: { + initialFunds: parseEther('1000') + } +}); + +// 自动完成: +// 1. 社区注册 +// 2. 代币发行 +// 3. 多签设置 +// 4. 治理合约部署 +// 5. 初始资金注入 +// 6. 返回完整的 DAO 对象 +``` + +**适用场景**: +- 快速原型开发 +- 教学和演示 +- 标准化业务模板 + +--- + +## 分层对比表 + +| 层级 | 目标用户 | 抽象程度 | 易用性 | 灵活性 | 使用场景 | +|------|---------|---------|--------|--------|---------| +| **L3 Patterns** | 产品开发 | 最高 | ⭐⭐⭐⭐⭐ | ⭐⭐ | 标准业务快速实现 | +| **L2 Clients** | DApp 集成 | 中 | ⭐⭐⭐⭐ | ⭐⭐⭐ | 90% 业务需求 | +| **L1 Actions** | 资深开发 | 低 | ⭐⭐ | ⭐⭐⭐⭐⭐ | 自定义复杂逻辑 | + +--- + +## 当前实施状态 + +### ✅ L1: Core Actions (100% 目标) +- ✅ Registry (60 functions) - 已完成 +- ✅ GTokenStaking (28 functions) - 已完成 +- ⏳ SuperPaymaster (58 functions) - 进行中 +- ⏳ MySBT (49 functions) - 待补充 +- ⏳ Tokens (100+ functions) - 待补充 +- ⏳ 其他合约 (200+ functions) - 待补充 + +### ✅ L2: Business Clients (90% 完成) +- ✅ CommunityClient - 完整 +- ✅ OperatorClient - 完整 +- ✅ EndUserClient - 完整 +- ✅ AdminClient - 完整 + +### ✅ L3: Scenario Patterns (75% 完成) +- ✅ DAO Launchpad - 已实现 (Scenario 1) +- ✅ Operator Lifecycle - 已实现 (Scenario 2) +- ✅ User Onboarding - 已实现 (Scenario 3) +- ⏳ Gasless Transaction - 部分实现 (Scenario 4) +- ⏳ Credit System - 待实现 +- ⏳ Reputation Staking - 待实现 + +--- + +## 文档策略 + +### L1 文档 (API Reference) +**目标**:完整的技术参考手册 + +``` +docs/api-reference/ +├── L1-Core-Actions/ +│ ├── registry.md # 60 个函数详细说明 +│ ├── staking.md # 28 个函数详细说明 +│ └── ... +``` + +**内容**: +- 函数签名 +- 参数说明 +- 返回值类型 +- 使用示例 +- 对应的 Solidity 合约 + +### L2 文档 (Integration Guide) +**目标**:快速集成指南 + +``` +docs/integration/ +├── community-client.md # 社区管理集成 +├── operator-client.md # 运营商集成 +└── enduser-client.md # 用户集成 +``` + +**内容**: +- 业务流程图 +- 快速开始 +- 常见用例 +- 错误处理 +- 最佳实践 + +### L3 文档 (Tutorials) +**目标**:端到端教程 + +``` +docs/tutorials/ +├── launch-your-dao.md # 启动 DAO 教程 +├── become-an-operator.md # 成为运营商 +└── build-gasless-app.md # 构建免 gas 应用 +``` + +**内容**: +- 业务背景 +- 步骤详解 +- 完整代码 +- 视频演示 +- 故障排查 + +--- + +## 测试策略 + +### L1 测试:单元测试 +```typescript +// packages/core/tests/actions/registry.test.ts +describe('Registry Actions', () => { + it('should register role', async () => { + const result = await registry.registerRole({...}); + expect(result).toBeDefined(); + }); + + // 测试所有 60 个函数 +}); +``` + +### L2 测试:集成测试 +```typescript +// packages/sdk/tests/clients/community.test.ts +describe('Community Client', () => { + it('should launch community end-to-end', async () => { + const result = await communityClient.launch({...}); + expect(result.tokenAddress).toMatch(/^0x/); + }); +}); +``` + +### L3 测试:场景测试(已有) +```bash +./run_sdk_regression.sh --env anvil --scenarios-only +``` + +--- + +## 建议的 Package 暴露策略 + +### @aastar/core (L1) +```typescript +// 暴露所有底层 actions +export * from './actions/registry'; +export * from './actions/staking'; +// ... 所有 actions +``` + +### @aastar/sdk (L2 + L3) +```typescript +// 默认暴露 L2 Clients +export * from './clients/community'; +export * from './clients/operator'; +export * from './clients/endUser'; +export * from './clients/admin'; + +// 可选暴露 L1(给资深开发者) +export * as CoreActions from '@aastar/core/actions'; + +// 可选暴露 L3 Patterns +export * from './patterns'; +``` + +### 使用示例 +```typescript +// 一般开发者 - 使用 L2 +import { createCommunityClient } from '@aastar/sdk'; + +// 资深开发者 - 直接使用 L1 +import { CoreActions } from '@aastar/sdk'; +const { registryActions } = CoreActions; + +// 产品开发者 - 使用 L3 +import { DAOLaunchpadPattern } from '@aastar/sdk/patterns'; +``` + +--- + +## 总结 + +这个三层架构设计: +1. **L1 Actions** - 100% ABI 覆盖,服务资深开发者和 SDK 内部 +2. **L2 Clients** - 角色导向的业务封装,服务 90% 开发者 +3. **L3 Patterns** - 场景化模板,服务快速原型和学习 + +**当前任务**: +1. ✅ 继续完成 L1 的 100% ABI 覆盖 +2. ⏭️ 完成后统一测试 +3. ⏭️ 补充文档 + +继续执行 L1 补充工作! diff --git a/0.16.23/guide/docs/SDK_COVERAGE_STRATEGY.md b/0.16.23/guide/docs/SDK_COVERAGE_STRATEGY.md new file mode 100644 index 000000000..1e5d6c2f5 --- /dev/null +++ b/0.16.23/guide/docs/SDK_COVERAGE_STRATEGY.md @@ -0,0 +1,397 @@ +# SDK 合约分类与覆盖策略 + +## 📋 合约分类体系 + +### ✅ 第一类:自研业务合约(已完成 93%+ 覆盖) + +**核心系统** (11个合约,355 functions) + +| # | 合约 | 函数数 | 说明 | 最终覆盖 | 状态 | +|---|------|--------|------|---------|------| +| 1 | **Registry** | 60 | 角色和社区注册中心 | 73/60 (121%) | ✅ 完成 | +| 2 | **SuperPaymaster** | 58 | 超级支付主管 | 61/58 (105%) | ✅ 完成 | +| 3 | **MySBT** | 49 | 灵魂绑定代币 | 58/49 (118%) | ✅ 完成 | +| 4 | **GTokenStaking** | 28 | 治理代币质押 | 29/28 (104%) | ✅ 完成 | +| 5 | **xPNTsFactory** | 28 | 社区代币工厂 | 22/28 (79%) | ✅ 完成 | +| 6 | **PaymasterFactory** | 24 | Paymaster 工厂 | 16/24 (67%) | ✅ 完成 | +| 7 | **ReputationSystem** | 20 | 信誉系统 | 20/20 (100%) | ✅ 完成 | +| 8 | **GToken** | 18 | 治理代币 (ERC20) | 20/18 (111%) | ✅ 完成 | +| 9 | **BLSAggregator** | 18 | BLS 签名聚合 | 18/18 (100%) | ✅ 完成 | +| 10 | **DVTValidator** | 15 | DVT 验证器 | 20/15 (133%) | ✅ 完成 | +| 11 | **aPNTs** | 37 | 全局积分代币 | 34/37 (92%) | ✅ 完成 | + +**小计**: 355 functions, **331/355 = 93.2% 覆盖** ✅ + +**成果**: **所有自研合约达到 90%+ 覆盖目标!** + +--- + +### ✅ 第二类:第三方标准合约(关键功能覆盖) + +**ERC-4337 基础设施** (仅覆盖业务必需) + +| # | 合约 | 函数数 | 需要覆盖 | 当前覆盖 | 说明 | +|---|------|--------|---------|---------|------| +| 12 | **EntryPoint** | 22 | 5 | 5/5 ✅ | handleOps, getNonce, getUserOpHash, getDepositInfo | +| 17 | **SimpleAccount** | 17 | 8 | 8/8 ✅ | execute, executeBatch, owner, entryPoint, getNonce | +| 21 | **SimpleAccountFactory** | 4 | 4 | 2/4 | createAccount, getAddress | + +**小计**: 17 functions 需要覆盖, **15/17 = 88% 覆盖** ✅ + +--- + +### ⚠️ 第三类:模板/实例合约(按需覆盖) + +| # | 合约 | 函数数 | 覆盖策略 | 当前覆盖 | +|---|------|--------|---------|---------| +| 4 | **Paymaster** (模板) | 48 | ❌ 不需要 SDK | 0 | +| 5 | **PaymasterV4_2** (实例) | 48 | ✅ 基础 API (20个) | 20/48 ✅ | + +**说明**: +- Paymaster 是抽象模板,供合约开发者参考 +- PaymasterV4_2 是具体实例,SDK 提供基础 API 即可 +- 社区可以基于 Paymaster 模板创建自定义 Paymaster + +--- + +### ❌ 第四类:重复/遗留合约(不覆盖) + +| # | 合约 | 函数数 | 说明 | 决策 | +|---|------|--------|------|------| +| 7 | ~~xPNTs~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 8 | ~~xPNTsToken~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 16 | ~~LegacyAccount~~ | 17 | **旧版 AA 账户** | ❌ 已废弃 | +| 18 | ~~SimpleAccountV08~~ | 17 | v0.8 版本 | ❌ 暂不支持 | +| 20 | ~~Simple7702Account~~ | 10 | EIP-7702 (未来) | ❌ 预留 | +| 22 | ~~SimpleAccountFactoryV08~~ | 4 | v0.8 工厂 | ❌ 暂不支持 | +| 23 | ~~SenderCreator~~ | 3 | 内部工具 | ❌ 不需要 | +| 24 | ~~UserOperationLib~~ | 3 | 库函数 | ❌ 不需要 | +| 25 | ~~BLSValidator~~ | 2 | 基础验证器 | ❌ BLSAggregator 已够用 | + +**说明**: +- **LegacyAccount**: 早期版本的 SimpleAccount,已被 v0.7 SimpleAccount 替代 +- **xPNTs/xPNTsToken**: 都是使用 `xPNTsToken` ABI,通过 `tokens.ts` 的通用接口调用不同地址即可 + +--- + +## 🎯 最终覆盖率统计 + +### 实际完成情况 + +| 类别 | 合约数 | 总函数数 | 目标覆盖 | 实际覆盖 | 达成率 | +|------|-------|---------|---------|---------|--------| +| **自研业务** | 11 | 355 | 320 (90%) | 331 (93.2%) | ✅ 103% | +| **第三方标准** | 3 | 43 | 17 (40%) | 15 (88%) | ✅ 88% | +| **模板实例** | 1 | 48 | 20 (42%) | 20 (100%) | ✅ 100% | +| **合计** | **15** | **446** | **357 (80%)** | **366 (82%)** | ✅ **102%** | + +**起始覆盖率**: 186/446 = **41.7%** +**最终覆盖率**: 366/446 = **82.0%** ✅ +**新增函数**: **180 functions** + +--- + +## 💡 核心设计原则 + +### 1. **通用性优先** - 基于地址调用 + +所有 actions 都支持传入任意合约地址,确保通用性: + +```typescript +// ✅ 正确:通用接口,支持任何部署实例 +const factory = xPNTsFactoryActions(FACTORY_ADDRESS)(client); +const tokenA = await factory.getTokenAddress({ community: COMMUNITY_A }); +const tokenB = await factory.getTokenAddress({ community: COMMUNITY_B }); + +// aPNTs, bPNTs, cPNTs... 都能用同一套 tokenActions +const apnts = tokenActions(APNTS_ADDRESS)(client); +const bpnts = tokenActions(BPNTS_ADDRESS)(client); +``` + +### 2. **自研合约全覆盖** + +所有 11 个自研合约均达到 90%+ 覆盖: +- Registry: 121% (73/60) +- SuperPaymaster: 105% (61/58) +- MySBT: 118% (58/49) +- GTokenStaking: 104% (29/28) +- ReputationSystem: 100% (20/20) +- BLSAggregator: 100% (18/18) +- DVTValidator: 133% (20/15) +- GToken: 111% (20/18) +- aPNTs: 92% (34/37) +- xPNTsFactory: 79% (22/28) +- PaymasterFactory: 67% (16/24) + +**平均覆盖率**: 93.2% ✅ + +### 3. **不重复** + +- xPNTs, xPNTsToken, aPNTs 使用同一套通用 `tokenActions` 接口 +- 不同地址实例调用同一套 API,避免代码重复 +- Paymaster template vs instance: 只实现 instance API + +### 4. **关联合约按需覆盖** + +- EntryPoint: 23% (5/22) - 只覆盖 handleOps, getNonce 等业务必需 +- SimpleAccount: 47% (8/17) - 只覆盖 execute, owner 等常用函数 +- 其他标准函数按实际业务需求补充 + +--- + +## 📝 合约说明补充 + +### LegacyAccount vs SimpleAccount + +- **LegacyAccount** (17 functions): + - SuperPaymaster v3.0 之前使用的账户实现 + - 基于早期的 ERC-4337 草案 + - **已废弃**,被 SimpleAccount v0.7 替代 + +- **SimpleAccount** (17 functions): + - 当前主要使用的 v0.7 账户实现 + - 符合最新的 ERC-4337 规范 + - ✅ **SDK 主要支持** + +### xPNTs 系列说明 + +- **xPNTs.json**: 社区积分代币 ABI(通用模板) +- **xPNTsToken.json**: 同上(别名) +- **aPNTs.json**: 全局积分代币 ABI + +**SDK 策略**: +- 使用 `tokens.ts` 中的通用接口 +- 通过传入不同的 token 地址来操作不同的代币 +- 不需要为每个代币类型创建单独的 actions + +--- + +## ✅ 完成总结 + +### 🎉 目标达成 + +- ✅ **自研合约覆盖**: 93.2% (超额完成 90% 目标) +- ✅ **总体覆盖率**: 82.0% (超额完成 80% 目标) +- ✅ **新增函数**: 180 functions +- ✅ **编译状态**: 全部通过 +- ✅ **代码质量**: 遵循通用性原则,类型安全 + +### 📦 交付物 + +**Actions 文件**: +- `registry.ts` - 73 actions (827 lines) +- `superPaymaster.ts` - 61 actions (720 lines) +- `sbt.ts` - 58 actions (671 lines) +- `staking.ts` - 29 actions (已有) +- `tokens.ts` - 通用 ERC20/xPNTs (已有) +- `gtokenExtended.ts` - 12 actions (144 lines) +- `factory.ts` - 38 actions (468 lines) +- `reputation.ts` - 20 actions (237 lines) +- `validators.ts` - 38 actions (441 lines) +- `account.ts` - 13 actions (已有) +- `paymasterV4.ts` - 20 actions (已有) + +**总代码量**: ~4,900 lines + +### 🚀 下一步 + +L1 Core Actions 已完整,可以开始: + +1. **L1 全回归测试** - 验证所有 API 与区块链交互 +2. **L2 Business Clients** - 角色导向的高层 API +3. **L3 Scenario Patterns** - 端到端业务场景模板 +4. **文档完善** - API 文档 + 使用示例 + +**核心价值**: L1 提供完整的底层 ABI 封装,为上层抽象打下坚实基础。 + + +## 📋 合约分类体系 + +### ✅ 第一类:自研业务合约(100% 覆盖) + +**核心系统** (11个合约,~350 functions) + +| # | 合约 | 函数数 | 说明 | 当前覆盖 | +|---|------|--------|------|---------| +| 1 | **Registry** | 60 | 角色和社区注册中心 | 42/60 (70%) | +| 2 | **SuperPaymaster** | 58 | 超级支付主管 | 39/58 (67%) | +| 3 | **MySBT** | 49 | 灵魂绑定代币 | 29/49 (59%) | +| 4 | **GTokenStaking** | 28 | 治理代币质押 | 29/28 (100%) ✅ | +| 5 | **xPNTsFactory** | 28 | 社区代币工厂 | 6/28 (21%) | +| 6 | **PaymasterFactory** | 24 | Paymaster 工厂 | 6/24 (25%) | +| 7 | **ReputationSystem** | 20 | 信誉系统 | 1/20 (5%) | +| 8 | **GToken** | 18 | 治理代币 (ERC20) | 8/18 (44%) | +| 9 | **BLSAggregator** | 18 | BLS 签名聚合 | 3/18 (17%) | +| 10 | **DVTValidator** | 15 | DVT 验证器 | 4/15 (27%) | +| 11 | **aPNTs** | 37 | 全局积分代币 | 24/37 (65%) | + +**小计**: 355 functions, **151/355 = 42.5% 覆盖** + +**目标**: 提升到 **90%+** (约 320 functions) + +--- + +### ✅ 第二类:第三方标准合约(关键功能覆盖) + +**ERC-4337 基础设施** (仅覆盖业务必需) + +| # | 合约 | 函数数 | 需要覆盖 | 当前覆盖 | 说明 | +|---|------|--------|---------|---------|------| +| 12 | **EntryPoint** | 22 | 5 | 5/5 ✅ | handleOps, getNonce, getUserOpHash, getDepositInfo | +| 17 | **SimpleAccount** | 17 | 8 | 8/8 ✅ | execute, executeBatch, owner, entryPoint, getNonce | +| 21 | **SimpleAccountFactory** | 4 | 4 | 2/4 | createAccount, getAddress | + +**小计**: 17 functions 需要覆盖, **15/17 = 88% 覆盖** ✅ + +--- + +### ⚠️ 第三类:模板/实例合约(按需覆盖) + +| # | 合约 | 函数数 | 覆盖策略 | 当前覆盖 | +|---|------|--------|---------|---------| +| 4 | **Paymaster** (模板) | 48 | ❌ 不需要 SDK | 0 | +| 5 | **PaymasterV4_2** (实例) | 48 | ✅ 基础 API (20个) | 20/48 ✅ | + +**说明**: +- Paymaster 是抽象模板,供合约开发者参考 +- PaymasterV4_2 是具体实例,SDK 提供基础 API 即可 +- 社区可以基于 Paymaster 模板创建自定义 Paymaster + +--- + +### ❌ 第四类:重复/遗留合约(不覆盖) + +| # | 合约 | 函数数 | 说明 | 决策 | +|---|------|--------|------|------| +| 7 | ~~xPNTs~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 8 | ~~xPNTsToken~~ | 37 | 与 aPNTs 同接口 | ❌ 不单独实现 | +| 16 | ~~LegacyAccount~~ | 17 | **旧版 AA 账户** | ❌ 已废弃 | +| 18 | ~~SimpleAccountV08~~ | 17 | v0.8 版本 | ❌ 暂不支持 | +| 20 | ~~Simple7702Account~~ | 10 | EIP-7702 (未来) | ❌ 预留 | +| 22 | ~~SimpleAccountFactoryV08~~ | 4 | v0.8 工厂 | ❌ 暂不支持 | +| 23 | ~~SenderCreator~~ | 3 | 内部工具 | ❌ 不需要 | +| 24 | ~~UserOperationLib~~ | 3 | 库函数 | ❌ 不需要 | +| 25 | ~~BLSValidator~~ | 2 | 基础验证器 | ❌ BLSAggregator 已够用 | + +**说明**: +- **LegacyAccount**: 早期版本的 SimpleAccount,已被 v0.7 SimpleAccount 替代 +- **xPNTs/xPNTsToken**: 都是使用 `xPNTsToken` ABI,通过 `tokens.ts` 的通用接口调用不同地址即可 + +--- + +## 🎯 修正后的覆盖目标 + +### 第一优先级:自研合约 100% 覆盖 + +**需要补充** (~170 functions): + +1. **Registry** (18 functions): + - 补充社区管理函数 (communityByENS, createNewRole) + - 补充角色锁定函数 (roleLockDurations, setRoleLockDuration) + +2. **SuperPaymaster** (19 functions): + - 补充完整的 Operator 管理 + - 补充 Credit 系统查询 + +3. **MySBT** (20 functions): + - 补充完整的 ERC721 Enumerable + - 补充批量铸造功能 + +4. **xPNTsFactory** (22 functions): + - 补充完整的创建和查询接口 + +5. **ReputationSystem** (19 functions): + - 补充信誉规则配置 + - 补充积分计算接口 + +6. **GToken** (10 functions): + - 补充完整的 ERC20 标准接口 + +7. **BLSAggregator** (15 functions): + - 补充签名验证接口 + - 补充密钥管理 + +8. **DVTValidator** (11 functions): + - 补充提案管理 + - 补充验证器管理 + +9. **aPNTs** (13 functions): + - 补充债务管理 + - 补充自动授权功能 + +### 第二优先级:标准合约关键功能 + +**SimpleAccountFactory** (2 functions): +- 补充 createAccount 的其他变体 + +--- + +## 📊 最终覆盖率目标 + +| 类别 | 合约数 | 总函数数 | 目标覆盖 | 当前覆盖 | 差距 | +|------|-------|---------|---------|---------|------| +| **自研业务** | 11 | 355 | 320 (90%) | 151 (42.5%) | +169 | +| **第三方标准** | 3 | 43 | 17 (40%) | 15 (88%) | +2 | +| **模板实例** | 1 | 48 | 20 (42%) | 20 (100%) | 0 ✅ | +| **合计** | **15** | **446** | **357** | **186** | **+171** | + +**当前实际覆盖率**: 186/446 = **41.7%** +**目标覆盖率**: 357/446 = **80%** + +--- + +## 💡 执行建议 + +### ✅ 立即执行 + +1. **补充自研合约剩余 70% 函数** (~170 functions) + - 按优先级:Registry → SuperPaymaster → MySBT → Factories → Reputation → Validators + +2. **测试验证** + - 每完成一个合约,立即编译测试 + - 确保所有自研合约 API 可用 + +### ⏭️ 未来扩展 + +- EIP-7702 支持 (Simple7702Account) +- v0.8 兼容性 (SimpleAccountV08) +- 自定义 Paymaster 模板指南 + +--- + +## 📝 合约说明补充 + +### LegacyAccount vs SimpleAccount + +- **LegacyAccount** (17 functions): + - SuperPaymaster v3.0 之前使用的账户实现 + - 基于早期的 ERC-4337 草案 + - **已废弃**,被 SimpleAccount v0.7 替代 + +- **SimpleAccount** (17 functions): + - 当前主要使用的 v0.7 账户实现 + - 符合最新的 ERC-4337 规范 + - ✅ **SDK 主要支持** + +### xPNTs 系列说明 + +- **xPNTs.json**: 社区积分代币 ABI(通用模板) +- **xPNTsToken.json**: 同上(别名) +- **aPNTs.json**: 全局积分代币 ABI + +**SDK 策略**: +- 使用 `tokens.ts` 中的通用接口 +- 通过传入不同的 token 地址来操作不同的代币 +- 不需要为每个代币类型创建单独的 actions + +--- + +## ✅ 结论 + +**精简后需要覆盖的合约**: 15 个 +**精简后需要覆盖的函数**: 446 个 +**当前已实现**: 186 个 (41.7%) +**目标**: 357 个 (80%) +**还需补充**: 171 个函数 + +**核心价值**: 专注自研业务合约 100% 覆盖,确保完整的业务能力。 diff --git a/0.16.23/guide/docs/SDK_Optimization_Evaluation_Plan.md b/0.16.23/guide/docs/SDK_Optimization_Evaluation_Plan.md new file mode 100644 index 000000000..df05ce7f5 --- /dev/null +++ b/0.16.23/guide/docs/SDK_Optimization_Evaluation_Plan.md @@ -0,0 +1,51 @@ +# SDK & Contract Optimization Evaluation Plan (GBT5.2 Recommendations) + +## 概述 +本方案针对 GBT5.2 对 `aastar-sdk` 及相关合约 ABI 扫描后给出的建议进行评估,并制定后续优化计划。我们将建议分为 **SDK 优化**、**合约安全加固** 以及 **架构对齐** 三个维度,并根据优先级划定动作:**优化 (Optimize)**、**置之不理 (Ignore)** 或 **更好的方案 (Better Solution)**。 + +--- + +## 评估与动作列表 + +### 1. SDK 侧建议评估 (packages/superpaymaster & core) + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`getPaymasterAndData` 输入上界校验** | 高 | **优化 (Optimize)** | `uint128` 溢出或格式错误会导致 Bundler 端不可预测的失败。应在 SDK 侧拦截并抛出清晰错误。 | +| **`checkEligibility` 移除硬编码 Sepolia** | 中 | **优化 (Optimize)** | 支持多链是 SDK 的基本要求。应允许用户传入 `chainId` 或从 `provider` 自动获取。 | +| **`formatUserOpToBundlerV07` 字段长度严格断言** | 高 | **优化 (Optimize)** | V0.7 格式对字节长度(如 `0x...` 字符串长度)有严格要求,由于 JS 没有原生固定长度字节类型,SDK 必须代劳检查。 | + +### 2. 合约侧(基于 ABI 反推)建议评估 + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`PaymasterV4` 价格预言机新鲜度与权限校验** | 极高 | **优化 (Optimize)** | 关键安全路径。需确认合约源码中是否有 `updatedAt` 和 `roundId` 校验。SDK 侧无法修正,需同步到合约端。 | +| **`SuperPaymasterV3` 债务隔离与 Slash 路径** | 高 | **优化 (Optimize)** | 多运营方模式下,用户债务必须隔离。Slash 逻辑需严格绑定 BLS 证明,防止误伤或攻击。 | +| **`BLS/DVT` 聚合签名实操验证** | 极高 | **更好的方案 (Better Solution)** | 若目前仅为逻辑占位,主网前必须实现完整的 BLS 配对验证,或先行降级为多签治理方案以保安全。 | +| **`Registry` 重放攻击防御 (Epoch/Nonce)** | 中 | **优化 (Optimize)** | Reputation 同步必须单调递增或带 Nonce,防止过期状态覆盖新状态。 | +| **`ReputationSystemV3` 数组上限与 NFT 真实性** | 中 | **优化 (Optimize)** | 防止 Gas DoS 攻击。NFT Boost 必须做 `balanceOf` 校验而非仅仅依赖输入数组。 | + +--- + +## 执行计划与优先级 + +### 第一阶段:SDK 鲁棒性增强 (Priority: P0) +**目标**:确保 SDK 生成的 Payload 100% 符合规范,并能拦截低级输入错误。 +- [ ] 在 `getPaymasterAndData` 中增加 `uint128` 范围检查与地址合法性检查。 +- [ ] 重构 `checkEligibility`,支持从配置或环境中读取 `chainId`。 +- [ ] 为 `formatUserOpToBundlerV07` 增加对 `Hex` 长度的显式断言。 + +### 第二阶段:合约安全与逻辑核对 (Priority: P1) +**目标**:将 ABI 发现的高风险点在合约源码中进行逐一核对与修复。 +- [ ] 对接 `SuperPaymaster` 仓库,核对 `PaymasterV4` 和 `SuperPaymasterV3` 的关键权限代码。 +- [ ] 评估 `BLS/DVT` 的实现深度,并给出迁移/补全方案。 + +### 第三阶段:文档与标准对齐 (Priority: P2) +**目标**:更新技术文档,确保 SDK 行为与合约逻辑完全一致。 +- [ ] 更新 `projects/aastar-sdk/docs` 下的各组件文档。 + +--- + +## 备注 +> [!IMPORTANT] +> 由于本仓库仅包含 ABI 且当前处于 SDK 开发模式,上述合约侧建议需在切换至合约仓库时强制执行。SDK 的优化可即刻开始。 diff --git a/0.16.23/guide/docs/SDK_REGRESSION_AND_API_PLAN.md b/0.16.23/guide/docs/SDK_REGRESSION_AND_API_PLAN.md new file mode 100644 index 000000000..4da782d9c --- /dev/null +++ b/0.16.23/guide/docs/SDK_REGRESSION_AND_API_PLAN.md @@ -0,0 +1,98 @@ +# SDK 重构与回归测试计划 (SDK Regression & API Plan) + +## 1. 项目目标与原则 +**核心目标**: 验证 SDK 构建完整性,基于分层架构完善 API(满足 Phase 3 场景),并执行全量回归测试。 + +**开发原则**: +1. **API 分层原则 (Layering)**: + * 优先使用 **基础层 API (Base/Core SDK)** 构建 **业务层 API (Business API)**。 + * 如果基础层缺失,**先补充基础层**,再构建业务层。 + * *例外情况*: 仅在性能瓶颈或极特殊逻辑下直接调用合约 ABI,且必须在代码中注释说明原因。 +2. **数据收集优先 (Data First)**: + * 集成博士论文所需的数据收集模块 (`TestCountManager`)。 + * 提供独立的 API 套件用于实验数据采集(Gas 消耗、TPS、成功率等)。 +3. **合约稳定性**: + * 基于 `SuperPaymaster` 项目提供的稳定 Sepolia 合约地址 (`.env.sepolia`)。 + * 仅在发现合约初始化缺陷时才回溯修改合约。 + +## 2. API 架构与差距分析 (Gap Analysis) + +### 2.1 基础层 API (Base Layer) - `packages/core`, `packages/contracts` +*封装底层合约交互、类型定义、基础工具。* + +* **P0 (缺失/需增强)**: + * [ ] `StateValidator.getAccountBalances(addresses[])`: 批量获取 ETH/GToken/aPNTs 余额。 + * [ ] `ContractConfigManager`: 适配 V3.1.1 配置读取(从 `.env` 或 Config 合约)。 + * [ ] `TestCountManager`: 封装实验计数器与数据打点基础方法。 + +### 2.2 业务层 API (Business Layer) - `packages/sdk` +*基于基础层构建,面向最终开发者场景。* + +* **P0 (状态查询 - Read)**: + * [ ] `CommunityClient.getCommunityInfo(account)`: 返回角色、Token 地址、元数据。 + * [ ] `OperatorClient.getOperatorInfo(account)`: 返回 Operator 类型 (Super/V4)、国库状态、质押额。 + * [ ] `ExperimentClient.collectMetrics(txHash)`: **(新增)** 收集单笔交易的实验数据(Gas, Cost, Status)。 + +* **P1 (核心写操作 - Write)**: + * [ ] `EndUserClient.deployAccount(owner, salt?)`: 封装 `SimpleAccountFactory` 部署逻辑。 + * [ ] `EndUserClient.mintSBT(account)`: 封装 "自动质押 + Mint" 的组合逻辑。 + * [ ] `OperatorClient.depositFunds(amount)` & `withdrawFunds()`: 简化质押金管理。 + * [ ] `ExperimentClient.recordBenchmark(scenarioId)`: **(新增)** 记录场景基准数据。 + +* **P2 (增强功能)**: + * [ ] `EndUserClient.fundWithXPNTs()`: 社区 Token 分发辅助方法。 + +## 3. 回归测试策略 (Scenarios) +我们将现有的散乱脚本重构为 **标准化场景测试 (Scenarios)**,位于 `tests/scenarios/`。 + +### 场景 1: 社区生命周期 (DAO Launchpad) +* **目标**: 注册社区 -> 发行 xPNTs -> 初始配置。 +* **原脚本**: `09_local_test_community_lifecycle.ts` +* **新测试**: `01_community_launch.test.ts` +* **API 验证**: `CommunityClient`, `RegistryClient` (Base)。 + +### 场景 2: 运营商入驻向导 (Operator Wizard) +* **目标**: 注册 SuperPaymaster Operator -> 质押 GToken -> 存入 aPNTs。 +* **原脚本**: `05_test_superpaymaster.ts` +* **新测试**: `02_operator_setup.test.ts` +* **API 验证**: `OperatorClient`, `FundingManager` (Base)。 + +### 场景 3: 终端用户体验 (Gasless UX) +* **目标**: 新 EOA -> 部署 AA 账户 -> 领取 SBT -> 发送 Gasless 交易。 +* **原脚本**: `03_test_standard_aa.ts` +* **新测试**: `03_end_user_gasless.test.ts` +* **API 验证**: `EndUserClient`, `PaymasterClient` (Base). + +### 场景 4: 实验数据收集 (PhD Data Collection) +* **目标**: 运行基准测试 (Baseline) vs 实验组,自动记录数据。 +* **原脚本**: `collect_industry_baseline.ts` +* **新测试**: `04_data_collection.test.ts` +* **API 验证**: `ExperimentClient`, `TestCountManager`. + +## 4. 执行计划 (Work Plan) + +### 阶段 1: 基础层与实验工具建设 (1-2天) +1. 完善 `packages/core` 中的基础读取方法。 +2. **重点**: 实现 `ExperimentClient` 和 `TestCountManager`,确保数据收集通道畅通。 + +### 阶段 2: 业务 API 实现 (2-3天) +1. 按 P0 -> P1 顺序实现 `packages/sdk` 中的业务方法。 +2. 严格遵守“基础层优先”原则,代码 Review 重点检查是否绕过 SDK 直接调用合约。 + +### 阶段 3: 场景回归与数据验证 (2天) +1. 迁移脚本至 `tests/scenarios/`。 +2. 运行全量回归:`pnpm test:scenarios`。 +3. 验证产生的实验数据格式是否符合论文要求。 + +### 阶段 4: Demo 重构 (P2 优先级) +* 在 `projects/aastar-sdk-demo` 仓库中进行。 +* 基于已验证的 SDK API 改造前端逻辑。 + +## 5. 启动指令 +```bash +# 1. 检查构建 +pnpm build + +# 2. 运行特定场景 (开发中) +pnpm test:scenarios --filter=01_community +``` diff --git a/0.16.23/guide/docs/SDK_STAGE3_ANALYSIS.md b/0.16.23/guide/docs/SDK_STAGE3_ANALYSIS.md new file mode 100644 index 000000000..595056e21 --- /dev/null +++ b/0.16.23/guide/docs/SDK_STAGE3_ANALYSIS.md @@ -0,0 +1,60 @@ +# SDK Stage 3 API Implementation Analysis + +**Date:** 2026-02-05 +**Reference Plan:** [SDK_STAGE3_PLAN.md](./SDK_STAGE3_PLAN.md) + +## 1. Executive Summary + +Based on the inspection of the SDK codebase (`packages/enduser`, `packages/operator`, `packages/core`), the current SDK implementation achieves **High Alignment** with the Stage 3 Plan from functionality and business scenario dimensions. + +All Critical Paths (Community Creation, Operator Onboarding, User Registration, Gasless Execution) are implemented. Some method names differ from the plan but fulfill the required business logic. + +## 2. Detailed Comparison + +### 2.1 Core Actions (Layer 1) + +| Plan Item | Implementation Status | SDK Method / Location | Notes | +| :--- | :--- | :--- | :--- | +| **RegistryActions** | ✅ Implemented | `packages/core/src/actions/registry.ts` | Complete coverage of Role/Config/Access logic. | +| `registerCommunity` | ✅ Implemented | `registerRoleSelf` (Generic) | Handled via `CommunityClient.setupCommunity`. | +| `joinCommunity` | ✅ Implemented | `registerRoleSelf` (Generic) | Handled via `UserClient.registerAsEndUser`. | +| `getCommunityInfo` | ✅ Implemented | `getRoleConfig` / `roleConfigs` | Returns detailed config struct. | +| **SuperPaymasterActions** | ✅ Implemented | `packages/core/src/actions/superPaymaster.ts` | Referenced by OperatorClient. | +| **GTokenStakingActions** | ✅ Implemented | `packages/core/src/actions/staking.ts` | `lockStake`, `unlockAndTransfer` confirmed. | +| **PaymasterFactoryActions**| ✅ Implemented | `packages/core/src/actions/factory.ts` | Used in `PaymasterOperatorClient`. | + +### 2.2 Business Clients (Layer 2) + +#### CommunityClient +| Plan Item | Implementation | Status | +| :--- | :--- | :--- | +| `onboardCommunity()` | `setupCommunity({...})` | ✅ Matches (Renamed) | +| `getCommunityInfo()` | `getRoleConfig` (via Actions) | ⚠️ Partial (Client helper missing, uses Action) | +| `deployXPNTs()` | `createCommunityToken({...})` | ✅ Matches | + +#### OperatorClient +| Plan Item | Implementation | Status | +| :--- | :--- | :--- | +| `setupNode()` | `registerAsSuperPaymasterOperator` | ✅ Specific Implementation | +| `depositCollateral()`| `depositCollateral` | ✅ Matches | +| `getOperatorStatus()`| `getOperatorDetails` | ✅ Matches | + +#### EndUserClient +| Plan Item | Implementation | Status | +| :--- | :--- | :--- | +| `joinAndActivate()` | `registerAsEndUser({...})` | ✅ Matches | +| `deploySmartAccount()`| **Missing** in `UserClient` | ⚠️ Gap: Logic exists in Factory Actions, not wrapped in UserClient. | +| `executeGasless()` | `executeGasless({...})` | ✅ Matches (Logic for V4 & SuperPaymaster) | + +## 3. Gap Analysis & Recommendations + +1. **Smart Account Deployment**: The `UserClient` assumes an existing account address. For a complete "Onboarding" flow, a static helper or a `UserFactoryClient` might be needed to deploy the abstract account *before* the `UserClient` can be fully instantiated (or `UserClient` should support a "deploy on first tx" mode). + - **Recommendation**: Add a static `deployAccount` helper or ensure documentation covers using `SimpleAccountFactory` before `UserClient`. + +2. **Naming Consistency**: + - `setupCommunity` vs `onboardCommunity`. The current `setup` naming is clearer as it implies multiple steps (Register + Token). + - `registerAsEndUser` is precise. + +## 4. Conclusion + +The SDK API is **Stage 3 Ready** for detailed regression testing. The business logic coverage allows for the execution of all 4 key scenarios defined in the plan. The identified gaps (Account Deployment wrapper) are minor convenience issues rather than blocking functional missing defects. diff --git a/0.16.23/guide/docs/SDK_STAGE3_PLAN.md b/0.16.23/guide/docs/SDK_STAGE3_PLAN.md new file mode 100644 index 000000000..b83e519e2 --- /dev/null +++ b/0.16.23/guide/docs/SDK_STAGE3_PLAN.md @@ -0,0 +1,151 @@ +# SDK Stage 3: 全面回归测试与场景验证计划 + +## 当前状态总结 (Current Status) + +### ✅ 已完成的工作 +1. **工作区清理与配置修复**: + - 清理了所有外部参考仓库的编译产物 + - 恢复了 `.eslintrc.js`,加固了 `tsconfig.json` 和 `.gitignore` + - 配置了 `paths` 支持 IDE 代码跳转 + +2. **Anvil 环境回归测试**: + - ✅ Scenario 1: 社区注册(Onboard Community) + - ✅ Scenario 2: 运营商入驻(Onboard Operator) + - ✅ Scenario 3: 用户注册(Onboard User) + - ⚠️ Scenario 4: Gasless 交易流(getNonce 已修复,但 handleOps 仍失败) + +3. **SDK 基础层优化**: + - 修复了 `EndUserClient.executeGasless` 的 nonce 获取逻辑 + - 实现了 `ExperimentClient` 用于性能数据采集 + - 同步了最新的 SuperPaymasterV3 ABIs + +### ⚠️ 待解决的问题 +1. **Scenario 4 handleOps 回滚**: + - 问题:EntryPoint.handleOps 执行失败 + - 可能原因:Paymaster 验证失败、签名不正确或 Gas 参数问题 + - 影响:无法完成 Anvil 环境的完整 Gasless 流程验证 + +2. **Sepolia 环境测试**: + - 需要验证 Sepolia 环境的完整流程 + - 需要确认所有合约地址已正确同步到SDK + +--- + +## Stage 3 执行计划 (Implementation Roadmap) + +基于 `STAGE3.md` 文档,我们将分三个阶段完成SDK的全面验证: + +### 阶段 1: 基础层回归测试 (Base Layer Regression) + +#### 1.1 SDK 构建验证 +- [ ] 验证 `pnpm build` 正常完成 +- [ ] 检查所有 packages 的依赖关系 +- [ ] 确认类型声明文件正确生成 + +#### 1.2 核心 API 验证 +- [ ] **RegistryActions**: + - `registerCommunity`, `joinCommunity`, `getCommunityInfo` +- [ ] **SuperPaymasterActions**: + - `validatePaymasterUserOp`, `postOp` payment logic +- [ ] **GTokenStakingActions**: + - `stake`, `unstake`, `getStakedAmount` +- [ ] **PaymasterFactoryActions**: + - `deployPaymaster`, `calculateAddress` + +#### 1.3 ABI 同步验证 +- [ ] 确认所有 V3.1.1 合约的 ABI 已同步 +- [ ] 验证自定义错误解码器正常工作 +- [ ] 测试事件监听和解析 + +--- + +### 阶段 2: 业务层回归测试 (Business Layer Regression) + +#### 2.1 CommunityClient 验证 +- [ ] `onboardCommunity()` 组合操作 +- [ ] `getCommunityInfo()` 状态查询 +- [ ] `deployXPNTs()` 代币发行 + +#### 2.2 OperatorClient 验证 +- [ ] `setupNode()` 节点配置 +- [ ] `depositCollateral()` 质押充值 +- [ ] `getOperatorStatus()` 状态查询 + +#### 2.3 EndUserClient 验证 +- [ ] `joinAndActivate()` 用户注册 +- [ ] `deploySmartAccount()` AA 账户部署 +- [ ] `executeGasless()` 无 Gas 交易(**需修复**) + +--- + +### 阶段 3: 场景化测试 (Scenario Verification) + +#### 3.1 Anvil 环境场景测试 +- [x] Scenario 1: DAO Launchpad Pattern +- [x] Scenario 2: Operator Lifecycle +- [x] Scenario 3: User Onboarding & Credit +- [/] Scenario 4: High-Frequency Gasless UX (**handleOps 待修复**) + +#### 3.2 Sepolia 环境场景测试 +- [ ] 部署完整的 V3.1.1 合约栈 +- [ ] 验证 4 个核心场景在 Sepolia 上的执行 +- [ ] 采集性能数据(Gas 消耗、延迟等) + +#### 3.3 对比实验数据采集 +- [ ] Group A: EOA Baseline +- [ ] Group B: Pimlico/Alchemy Paymaster +- [ ] Group C1: Paymaster V4 +- [ ] Group C2: SuperPaymaster V3 + +--- + +## 优先级排序 (Priority Queue) + +### P0 - 紧急修复 +1. **修复 Scenario 4 的 handleOps 问题** + - 调试 EntryPoint 验证逻辑 + - 检查 paymasterAndData 格式 + - 验证 UserOp 签名 + +### P1 - 核心功能验证 +2. **完成 Anvil 环境的 4 个场景测试** +3. **验证 SDK 构建流程** +4. **确认所有核心 API 正常工作** + +### P2 - Sepolia 环境部署 +5. **部署 V3.1.1 合约至 Sepolia** +6. **运行 Sepolia 场景测试** + +### P3 - 数据采集与文档 +7. **采集对比实验数据** +8. **编写开发者指南** +9. **完成 Stage 3 报告** + +--- + +## 立即行动项 (Immediate Actions) + +1. ✅ 创建本计划文档 +2. ⏭️ 修复 Scenario 4 的 handleOps 问题 +3. ⏭️ 验证 SDK 构建流程 +4. ⏭️ 运行基础层 API 回归测试 + +--- + +## 预期交付物 (Deliverables) + +1. **测试报告**: + - `docs/STAGE_3_REGRESSION_REPORT.md` + - 包含所有测试用例的执行结果 + +2. **性能数据**: + - `docs/STAGE_3_BENCHMARK_DATA.json` + - 包含 4 组对比实验的详细数据 + +3. **开发者指南**: + - `docs/guide/patterns.md` + - 沉淀的 SDK Orchestration Patterns + +4. **修复记录**: + - `walkthrough.md` + - 记录所有发现和修复的问题 diff --git a/0.16.23/guide/docs/SEPOLIA_ENV_REFERENCE.md b/0.16.23/guide/docs/SEPOLIA_ENV_REFERENCE.md new file mode 100644 index 000000000..c87db82d4 --- /dev/null +++ b/0.16.23/guide/docs/SEPOLIA_ENV_REFERENCE.md @@ -0,0 +1,51 @@ +# Sepolia Environment Configuration Reference + +Copy this configuration to your `.env.sepolia` file in `aastar-sdk/scripts/experiment/stage3/`: + +```bash +# Sepolia Testnet Configuration +SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/Bx4QRW1-vnwJUePSAAD7N +ETHERSCAN_API_KEY= + +# EntryPoint & Bundler +ENTRYPOINT_ADDRESS=0x0000000071727De22E5E9d8BAf0edAc6f37da032 +BUNDLER_URL=https://sepolia.g.alchemy.com/v2/Bx4QRW1-vnwJUePSAAD7N + +# V3 Core Components +GTOKEN_ADDRESS=0xbf0DD4c529cA321bCa8FBE23644a64eFA1BeaeB6 +GTOKENSTAKING_ADDRESS=0x5D5d930C295630e8f4130fef037E23105BE17B84 +MYSBT_ADDRESS=0x44088fE0Fc39FEE323aFc8a760E79C45D3c2fcF6 +REGISTRY_ADDRESS=0x0b72441C61D97D6c48F080E29F8Cd507A62Ce674 + +# V3 Factory & SuperPaymaster +XPNTS_FACTORY_ADDRESS=0xD127976771547966e1a86d5DdFA10756ae682c34 +APNTS_ADDRESS=0x7e4ACE9e0DACf6e1Bb86A53B1b12a825568273c7 +SUPERPAYMASTER_V3_ADDRESS=0x2D8Bb69A570c96E86F6A0F774975A90C30534d44 + +# Auxiliary Modules +REPUTATION_SYSTEM_ADDRESS=0xddF0b0283E88D809E711AA5CFcab1D5fA835c2Ca +BLS_AGGREGATOR_ADDRESS=0x77D381AE02C12cD826e14BC7642D43a85F9aB035 +DVT_VALIDATOR_ADDRESS=0xCD6d236D638a9991b423433BFF0C737112A0D4fB +BLS_VALIDATOR_ADDRESS=0xD6932C92d75be024a90002feDaFD4EE8768298e5 + +# V4 Paymaster Suite +PAYMASTER_FACTORY_V4_ADDRESS=0x81178D2CB3f4BB8b4020923b082a8bddbb27aFf0 +PAYMASTER_V4_IMPL_ADDRESS=0x8400209ADC02125747cfF360b7E4ABA83941DcA3 +PAYMASTER_V4_INSTANCE_ADDRESS=0xfBDAac70E9e1e978651A2dd40469C221096b7533 + +# Stage 3 Experiment Keys (NEVER COMMIT TO GIT) +ADMIN_PRIVATE_KEY= +EOA_PRIVATE_KEY= +AA_OWNER_PRIVATE_KEY= + +# Pimlico (for Group B - Standard AA) +PIMLICO_API_KEY= +``` + +## Quick Setup + +```bash +cd /Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/scripts/experiment/stage3 +cp .env.sepolia.example .env.sepolia +# Then fill in the private keys and API keys +``` diff --git a/0.16.23/guide/docs/STAGE3.md b/0.16.23/guide/docs/STAGE3.md new file mode 100644 index 000000000..8a25a7f39 --- /dev/null +++ b/0.16.23/guide/docs/STAGE3.md @@ -0,0 +1,191 @@ +# Stage 3 Sepolia Experiment & Orchestration Pattern Design + +## 1. 背景与目标 (Context & Objectives) + +在 Phase 2 (Local Anvil) 阶段,我们验证了所有 17 个基础回归用例。进入 Phase 3 (Sepolia),我们的重点将从“功能验证”转向“**场景化业务流验证**”和“**基准性能评估**”。 + +本计划旨在通过四个核心业务场景,沉淀出 SDK 的**高阶抽象模式 (Orchestration Patterns)**,并为 SuperPaymaster 论文提供可信的实验数据。 + +--- +## 2. 实验分组与基准 (Experiment 呃,那个spoliia的回归已经完成了。那我们现在转入另外一个话题,就是SDK。首先呢我们要check一下SDK当前是不是能够正常的build。呃,然后呢包括我们规划的这个API是不是都正常实现了,进行一次全回归的测试和检查,包括它的设计目标是不是都实现了。嗯,这个需要啊两个维度,一个是基础的这种AABI的或者是reite contract的封装。呃,另外一个就是业务层面。业务层面的高维度,业务原语的封装。这个角度呢就是我们已经在进行带测试和这个整体的设计可能需要不断的迭代。嗯它的带。底层可能是SDK呃本身的一些API或者我们调用其他合约的ABI对,那这是我的一个背景信息。我希望你去查看我们这三个相关的文档。然后呢梳理一下之后给出一个完整的规划来,然后从基础的AAPI的回归到业务原API的完善和回归测试啊,包括啊这几个文档的整体规划的目标的实现。Groups & Baselines) + +为了评估 SuperPaymaster 的竞争力,我们将对比三组账户: + +| 分组 | 身份标识 | 支付机制 | 核心组件 | 预期优势 | +| :--- | :--- | :--- | :--- | :--- | +| Group A: EOA | Standard EOA | Self-pay (ETH) | WalletClient | Baseline (Min Overhead) | +| **Group B: Standard AA** | SimpleAccount v0.7 | 3rd Party Sponsor | Alchemy/Pimlico | Industry Standard | +| **Group C1: Paymaster V4** | SimpleAccount v0.7 | Token-based (v4) | PaymasterV4 Contract | Basic Token Sponsorship | +| **Group C2: SuperPaymaster** | SimpleAccount v0.7 | Asset-based Gasless | SuperPaymaster V3 | Fully Decoupled & Credit Flow | + +--- + +## 3. 场景化测试用例 (Scenario-driven Test Cases) + +我们不仅测试单个 API,而是测试完整的“业务链路”。 + +### 3.1 场景一:社区启动 (DAO Launchpad Pattern) +- **业务逻辑**: 协议管理员批准 -> 社区管理员注册项目 -> 初始质押 GToken -> 部署专属 xPNTs 代币。 +- **SDK 沉淀**: `CommunityClient.onboardCommunity()` 组合操作。 +- **验证点**: 注册事件监听、xPNTs 部署地址验证、质押状态同步。 + +### 3.2 场景二:运营商运维 (Operator Lifecycle) +- **业务逻辑**: 运营商质押 -> 获取节点经营权 -> 通过 Factory 部署私有 Paymaster -> 激活 SuperPaymaster 路由。 +- **SDK 沉淀**: `OperatorClient.setupNode()` 模式。 +- **验证点**: 合约确定性部署 (CREATE2)、SuperPaymaster 权限映射、国库充值流转。 + +### 3.3 场景三:终端用户旅程 (User Onboarding & Credit) +- **业务逻辑**: 用户加入社区 -> 铸造 SBT (Auto-stake) -> 信用额度激活 -> 查看实时 Reputation。 +- **SDK 沉淀**: `EndUserClient.joinAndActivate()`。 +- **验证点**: SBT 余额、信用上限计算逻辑、信用恢复速度。 + +### 3.4 场景四:极致 Gasless 体验 (High-Frequency UX) +- **业务逻辑**: 用户在无 ETH 状态下,连续发送 10 笔跨协议交互。 +- **SDK 沉淀**: `EndUserClient.sendGaslessTransaction()`。 +- **数据采集**: Gas消耗明细、UserOp 处理耗时、Paymaster 扣费准确性。 + +--- + +## 4. 实施规划 (Implementation Roadmap) + +### 4.1 目录结构 +在 `aastar-sdk` 下建立独立目录: +```text +scripts/experiment/stage3/ +├── .env.sepolia # Sepolia 环境专用私钥与地址 +├── 01_dao_launch.ts # 场景一脚本 +├── 02_operator_setup.ts # 场景二脚本 +├── 03_user_onboarding.ts # 场景三脚本 +├── 04_benchmarking.ts # 场景四 (数据采集) +└── setup.ts # 分组账号初始化与资金分发 +``` + +### 4.2 开发与执行顺序 +1. **环境初始化**: 部署 V3.3.0 核心合约至 Sepolia -> 填充 `.env.sepolia`。 +2. **场景脚本编写**: 按照 3.1-3.4 逐步实现,优先关注“组合 API”的开发。 +3. **数据采集**: 运行 `04_benchmarking.ts` 至少 30 组数据,生成 JSON 报告。 +4. **模式沉淀**: 将脚本中重复的 Orchestration 逻辑提取到 `packages/sdk` 的高阶函数中。 + +--- + +## 5. 预期交付物 + +1. **`docs/STAGE_3_SCENARIO_EXP_PLAN.md`**: 详细的业务用例设计方案(即本文件)。 +2. **`scripts/experiment/stage3/`**: 完整的可运行测试代码库。 +3. **`docs/STAGE_3_REPORT.json`**: 包含三组对比数据的实验报告。 +4. **SDK Patterns**: 在 `docs/guide/patterns.md` 中更新高阶业务开发模式。 + + +------- + + +# SDK 场景化案例设计 (User Case Design) + +本文档借鉴 `registry` 前端项目的用户交互逻辑,提取核心业务链路,设计了 SDK 在 Phase 3 (Sepolia) 阶段的场景化测试用例。我们的目标是**参考前端体验、沉淀 SDK 模式 (Orchestration Patterns)**,而非简单的接口复用。 + +## 场景角色定义 + +1. **Protocol Admin (协议管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,进行后续的全局配置、DVT 验证器管理、治理代币发行等。 +2. **Community Admin (社区管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,负责社区注册、xPNTs 发行、SBT 会员规则设定。 +3. **PM Operator (Paymaster 操作员)**: 部署时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 Paymaster 节点运维、质押充值、费用管理等。多数时候,早期社区管理员和Operator是一个EOA。 +4. **SuperPaymaster Operator**: 注册时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 SuperPaymaster参数配置和国库管理。多数时候,早期社区管理员和Operator是一个EOA。 +5. **DVT(Node) Operator**: 部署时期是一个EOA,完成部署后,**可选**交接给其他EOA或者自动Rotate 账户,负责 DVT 参数配置和治理代币管理。 +6. **EndUser (终端用户)**: 参与社区、获取 SBT 身份、使用社区信用进行 Gasless 交易。 + +--- + +## 核心测试用例 (Business Scenarios) +背景信息: +- GToken在测试阶段,来自于协议Admin直接铸造空投。 +- 未来GToken来自于独立的阶梯价格销售(Mint)合约/应用。 +- xPNTs在测试阶段,来自于社区Admin铸造空投。 +- 未来xPNTs来自于社区发行+Reputation机制+任务广场。 +- SBT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来SBT来自于社区Shops+Reputation机制+任务广场。 +- NFT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来NFT来自于社区Shops+Reputation机制+任务广场。 + +### 用例 1:社区“全流程”自动化 (DAO Launchpad Pattern) +**参考自**: `RegisterCommunity.tsx` +- **设计思路**: 前端是分步引导,SDK 应提供“原子组合”能力。模拟社区从 0 到 1 的全过程:授权 -> 质押 -> 基准配置 -> 关联 SBT。 +- **SDK 验证重点**: + - 组合调用:`GTokenClient` 与 `RegistryClient` 的无缝状态桥接。 + - `RegistryClient.registerCommunityWithAutoStake` + - 验证 `ContractConfigManager` 是否正确识别新注册的社区配置。 + - 社区发行自己的xPNTs,NFT。 + +### 用例 2:Paymaster 节点部署向导 (Operator Wizard) +**原型参考**: `DeployWizard.tsx` (3-Step Flow) +- **业务流程**: 操作员选择模式(AOA/AOA+)-> 资源自检(GToken 余额、质押状态)-> 部署合约并充值。 +- **SDK 验证重点**: + - `OperatorClient.checkResources` (模拟前端资源自检逻辑) + - `PaymasterFactory.deployPaymaster` + - `OperatorClient.depositCollateral` +- **预期结果**: 完成后,Operator拥有独立的`Paymaster`节点和 Gas Token(xPNTs),或者在 `SuperPaymaster` 的 aPNTs 余额可见且可用于支持自己社区成员使用xPNTs代付。 + +### 用例 3:用户身份获取与信誉激活 (SBT & Reputation) +**原型参考**: `GetSBT.tsx`, `MySBT.tsx` +- **业务流程**: 用户选择社区 -> 自动质押 0.4 GT -> 铸造 MySBT -> 查看全局信誉分。 +- **SDK 验证重点**: + - `EndUserClient.mintSBT` (包含 auto-stake 逻辑) + - `ReputationClient.getGlobalReputation` + - `RegistryClient.getCreditLimit` (验证信誉分是否正确转化为信用额度) + +### 用例 4:纯净 Gasless 交易体验 (Ultimate Gasless UX) +这也是我们PhD paper获取实验数据的阶段,包括baseline(EOA和Pimlico Paymaster,以及业界平均统计成本)和两个对比实验(Paymaster V4和SuperPaymaster)。 +**原型参考**: `DeveloperPortal.tsx` (集成示例) +- **业务流程**: 一个没有任何 ETH 的新账户,使用社区发放的 SBT 凭证,通过 SDK 发送一笔交易。 +- **SDK 验证重点**: + - `createEndUserClient` 初始化(无私钥签名模式或智能账户模式) + - `getSuperPaymasterMiddleware` 后台自动构建 `userOp.paymasterAndData` + - 验证 `SuperPaymaster` 的 `postOp` 阶段是否正确扣除用户信用或 xPNTs 代币。 + + +### 基础用例整合(后续TODO) +我们期望能够整合基础用例,给用户(社区)提供自主自助的launchpad以及管理平台。 +🎫 +Get GToken +Get protocol access permission GToken, become protocol member, join permissionless, quit anytime freely + +Get → +🏛️ +Register Community +Create and register your community on the AAstar Network + +Register → +💎 +Deploy xPNTs +Create your community gas token for payment abstraction + +Deploy → +🚀 +Launch Paymaster +Deploy your Paymaster contract and start serving gasless transactions to your community + +Launch Paymaster → → + +### 用例 X:更多用例,持续加入(后续TODO,不加入开发) + 用例 5:危机管理与 DVT 治理 (Governance & Slashing) +**原型参考**: `AdminBatchMint.tsx` (管理入口) +- **业务流程**: 管理员发现恶意行为 -> DVT 节点投票 -> 执行对社区质押额的 Slash。 +- **SDK 验证重点**: + - `DVTClient.proposeSlash` + - `DVTClient.signSlash` (模拟多节点聚合签名) + - `AdminClient.executeSlash` +--- + +## 开发计划 (Implementation Plan - 阶段 3) + +### 第一步:Sepolia 环境就绪 +- 部署全套合约 (V3.3.0+) 至 Sepolia。 +- 使用 `forge verify-contract` 完成 Etherscan 验证。 +- 更新 SDK `constants.ts` 中的 Sepolia 合约地址。 + +### 第二步:场景化示例开发 +- 在 `examples/` 目录下按上述 4 个用例创建独立的 目录和TS 脚本。 +- 编写配套的中文文档注释,确保其作为“开发者指南”的使用价值。 +- 结合SuperPaymaster Readme中的数据收集计划,完成PhD paper的数据收集。这部分可以独立目录。 + +### 第三步:全流程冒烟测试 +- 运行 `pnpm run test:sepolia` (新增脚本)。 +- 输出场景执行记录,作为 Phase 3 的交付证明。 diff --git a/0.16.23/guide/docs/Script_Comparison_Report.md b/0.16.23/guide/docs/Script_Comparison_Report.md new file mode 100644 index 000000000..4f6705e7b --- /dev/null +++ b/0.16.23/guide/docs/Script_Comparison_Report.md @@ -0,0 +1,91 @@ +# 回归测试脚本对比验证 + +## 对比结果 + +### scripts/run_regression.sh (旧脚本) +**测试内容**: +``` +scripts/v2_regression/00_validate_env.ts +scripts/v2_regression/01_setup_and_fund.ts +scripts/v2_regression/02_operator_onboarding.ts +scripts/v2_regression/03_community_registry.ts +scripts/v2_regression/04_enduser_flow.ts +scripts/v2_regression/05_admin_audit.ts +``` +**特点**: 简单、仅运行V2回归测试、不处理Anvil启动 + +--- + +### run_full_regression.sh (新主脚本) +**测试内容** (包含上述所有6个 + 更多): +``` +✅ scripts/v2_regression/00_validate_env.ts +✅ scripts/v2_regression/01_setup_and_fund.ts +✅ scripts/v2_regression/02_operator_onboarding.ts +✅ scripts/v2_regression/03_community_registry.ts +✅ scripts/v2_regression/04_enduser_flow.ts +✅ scripts/v2_regression/05_admin_audit.ts + scripts/06_local_test_v3_admin.ts + scripts/06_local_test_v3_funding.ts + ...共24个测试 +``` +**特点**: +- ✅ 包含所有v2_regression测试 +- ✅ 自动启动Anvil +- ✅ 自动部署合约 +- ✅ 支持Sepolia模式 + +--- + +### run_sdk_regression.sh (SDK独立测试) +**测试内容**: +``` +22_test_bls_signing.ts +23_test_middleware.ts +20_sdk_full_capability.ts +18_sdk_e2e_verification.ts +19_sdk_experiment_runner.ts +``` +**特点**: +- SDK层面测试 +- 不依赖Anvil +- 不与scripts/run_regression.sh重复 + +--- + +## ✅ 验证结论 + +**scripts/run_regression.sh** 的所有功能已100%包含在: +- ✅ `run_full_regression.sh` (包含全部6个v2_regression测试) + +**无遗漏内容**: +- run_full_regression.sh 是 scripts/run_regression.sh 的**超集** +- 包含完全相同的测试 + 额外18个高级测试 + +**可以安全删除**: +- ✅ scripts/run_regression.sh (冗余) + +--- + +## 推荐使用 + +**V2回归测试** (仅6个基础测试): +```bash +# 直接在Sepolia运行 +REVISION_ENV=sepolia SDK_ENV_PATH=.env.sepolia \ + ./run_full_regression.sh --env sepolia --skip-deploy +``` + +**完整回归测试** (24个测试): +```bash +# Anvil本地 +./run_full_regression.sh + +# Sepolia +./run_full_regression.sh --env sepolia +``` + +**SDK独立测试**: +```bash +./run_sdk_regression.sh +``` diff --git a/0.16.23/guide/docs/Sepolia_Latest_Deployment.md b/0.16.23/guide/docs/Sepolia_Latest_Deployment.md new file mode 100644 index 000000000..28a451c21 --- /dev/null +++ b/0.16.23/guide/docs/Sepolia_Latest_Deployment.md @@ -0,0 +1,117 @@ +# Sepolia最新合约部署总结 + +**部署时间**: 2025-12-31 +**部署者**: Admin (0xb5600060e6de5E11D3636731964218E53caadf0E) + +--- + +## 已部署合约 ✅ + +| 合约 | 地址 | 版本 | 状态 | +|------|------|------|------| +| **GToken** | `0x8c76a083B38093dC690bcEa422Ec560a81fFA59b` | **v2.1.0** | ✅ Burn升级 | +| **GTokenStaking** | `0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8` | **v3.1.0** | ✅ Burn升级 | +| **Registry** | `0xd8168f6e9410fc0A1e727B271991709ae484d1dc` | v3.1.1 | ✅ | +| **MySBT** | `0x08f65A2Eebb28342990d41094c278990fFBC6BF7` | - | ✅ | +| **ReputationSystem** | `0x7b617Bad6fa7A7f9Bd34640170586F8C12c88278` | - | ✅ | +| **aPNTs** | `0x1a93Bb78e7DF973d2A0f6aba3c40A81aAddA8A70` | - | ✅ | +| **SuperPaymaster** | `0x62Eb2A9693CEF22d07Ea311E0d44d5A617EEDde3` | v3.1.1 | ✅ | +| **BLSAggregator** | `0xcC93E8dac22e6C63C1A0a6D47D8da87901b44ab1` | - | ✅ | +| **DVTValidator** | `0x6C1233Dd301459B5DD5653c5059669f5bf666889` | - | ✅ | +| **BLSValidator** | `0xD455A42de3b8d49a64A7329ce4782D6e9632aAd8` | - | ✅ | +| **xPNTsFactory** | `0x9f831C6B825f4Eef04F92050B1B43A6446abAE78` | - | ✅ | +| **PaymasterV4** | `0x90E793Aa46d11239cdC10625d59252F311338a12` | - | ✅ | +| **PaymasterFactory** | `0xD63C1305223Cc505f0c2D9b70cCC623870DEbdcf` | - | ✅ | + +--- + +## 🔥 核心升级: GToken Burn机制 + +### GToken v2.1.0 +**新增功能**: +- ✅ `ERC20Burnable` 继承(真实销毁) +- ✅ `remainingMintableSupply()` 查询函数 +- ✅ `_update()` 多重继承覆盖 + +**链上验证**: +```bash +cast call 0x8c76a083B38093dC690bcEa422Ec560a81fFA59b "VERSION()(string)" \ + --rpc-url https://ethereum-sepolia-rpc.publicnode.com +# 输出: "2.1.0" ✅ +``` + +### GTokenStaking v3.1.0 +**升级内容**: +- ✅ Entry burn使用真实销毁(替代黑洞转账) +- ✅ totalSupply自动减少 +- ✅ Gas优化76% (8,180 vs 34,900) + +**链上验证**: +```bash +cast call 0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8 "VERSION()(string)" \ + --rpc-url https://ethereum-sepolia-rpc.publicnode.com +# 输出: "3.1.0" ✅ +``` + +--- + +## 测试验证 ✅ + +### V2回归测试: 6/6通过 +``` +✅ 00_validate_env +✅ 01_setup_and_fund +✅ 02_operator_onboarding +✅ 03_community_registry +✅ 04_enduser_flow +✅ 05_admin_audit +``` + +### 运行命令 +```bash +REVISION_ENV=sepolia SDK_ENV_PATH=.env.sepolia \ + ./run_full_regression.sh --env sepolia +``` + +--- + +## 初始化状态 + +### 测试账户aPNTs余额 +| 账户 | 地址 | aPNTs余额 | +|------|------|-----------| +| Operator | `0x0376a69C8128190734cCbEa038F47e59e9dEc49F` | 100 aPNTs | +| Community | `0x060b0A80557069B72D8A16bcEf5F8ba9716bFFF5` | 100 aPNTs | +| User | `0x3E3b5CA4C41Ab87c8043960e3c7eB89267740198` | 100 aPNTs | + +--- + +## 浏览器验证 + +**Sepolia Etherscan**: +- GToken: https://sepolia.etherscan.io/address/0x8c76a083B38093dC690bcEa422Ec560a81fFA59b +- GTokenStaking: https://sepolia.etherscan.io/address/0x3aB9151B57D05c8c98F55e5729E25057ecF6CEE8 +- Registry: https://sepolia.etherscan.io/address/0xd8168f6e9410fc0A1e727B271991709ae484d1dc + +--- + +## 配置文件 + +所有地址已更新到: +- ✅ `.env.sepolia` (SDK配置) +- ✅ 部署日志: `broadcast/DeployV3FullSepolia.s.sol/11155111/run-latest.json` + +--- + +## 总结 + +✅ **全新部署完成** +✅ **Burn机制升级已上链** +✅ **所有测试通过** +✅ **环境已初始化** + +Sepolia测试网环境已完全就绪,可用于: +- 前端集成测试 +- 用户验收测试 +- 合约交互验证 +- Burn机制展示 diff --git a/0.16.23/guide/docs/TESTER_GUIDE_GASLESS.md b/0.16.23/guide/docs/TESTER_GUIDE_GASLESS.md new file mode 100644 index 000000000..bfdcdf9c8 --- /dev/null +++ b/0.16.23/guide/docs/TESTER_GUIDE_GASLESS.md @@ -0,0 +1,411 @@ +# Paymaster V4 Gasless Test Guide + +> For external testers to run a gasless UserOperation on Sepolia. + +--- + +## Pre-configured Test Accounts + +Test accounts are dynamically configured via `l4-setup.ts` and stored in `scripts/l4-state.json`. + +Key test personas: +- **Jason**: Uses PaymasterV4, Token: aPNTs +- **Bob**: Uses PaymasterV4, Token: bPNTs +- **Anni**: Uses SuperPaymaster, Token: dPNTs +- **Charlie**: Uses PaymasterV4, Token: cPNTs + +Run `pnpm tsx scripts/l4-setup.ts` to view current addresses and status. + +--- + +## SDK Readiness & Preparation (NEW) + +The SDK now provides a "One-Click" readiness check to avoid common Bundler rejections. + +### 1. Check Readiness (Diagnostic) +Check if the Paymaster is staked, price is set, and user has deposit. + +```typescript +import { PaymasterOperator } from '@aastar/paymaster'; + +const report = await PaymasterOperator.checkGaslessReadiness( + publicClient, + entryPoint, + paymasterAddress, + userAA, + tokenAddress +); + +if (!report.isReady) { + console.error("Issues found:", report.issues); +} +``` + +### 2. Auto-Prepare (Operator Only) +Automatically fix missing stake, deposit, or prices. + +```typescript +const steps = await PaymasterOperator.prepareGaslessEnvironment( + operatorWallet, + publicClient, + entryPoint, + paymasterAddress, + tokenAddress, + { + tokenPriceUSD: 100000000n, // $1.00 (8 decimals) + minStake: parseEther('0.05'), // Reduced from 0.2 ETH + minDeposit: parseEther('0.1') // Minimum deposit required + } +); +console.log("Steps taken:", steps); +``` + +--- + +## Price Management APIs (For Operators) + +The SDK provides these APIs in `PaymasterV4Client`: + +On mainnet you should run a keeper to keep `cachedPrice` fresh. If `cachedPrice.updatedAt + priceStalenessThreshold < now`, Bundlers may reject the UserOp as expired. + +```typescript +import { PaymasterOperator } from '@aastar/paymaster'; + +// Write APIs (owner/operator only) +await PaymasterOperator.updatePrice(walletClient, paymasterAddress); +await PaymasterOperator.setTokenPrice(walletClient, paymasterAddress, tokenAddress, priceUSD); + +// Read APIs (anyone) - also available in PaymasterOperator for convenience +const { price, updatedAt } = await PaymasterOperator.getCachedPrice(publicClient, paymasterAddress); +const tokenPrice = await PaymasterOperator.getTokenPrice(publicClient, paymasterAddress, tokenAddress); + +// 4. Instant Bill (via TxHash) - No scanning required +const fee = await PaymasterClient.getTransactionFee(publicClient, txHash, paymasterAddress); +console.log(`Cost: ${fee.tokenCost} dPNTs`); +``` + +--- + +## Zero-Friction Workflow (Simplified) + +For a streamlined experience, we provide ready-to-use scripts for both **Admin** (Environment Setup) and **Developer** (Transaction Submission). + +### 1. Admin / DevOps: One-Click Preparation +Ensure the Paymaster environment is fully ready (Staked, Funded, Priced). + +```bash +# Checks 7+ readiness criteria and fixes them automatically +npx tsx examples/prepare-gasless.ts +``` + +**What it does:** +- Checks EntryPoint Stake & Deposit +- verifying Oracle ETH/USD price +- Checks Token Support & Price +- Auto-seeds user deposit if low + +### 2. App Developer: One-Liner Submission (Code Walkthrough) + +To understand how to integrate Gasless features into your app, look at `examples/simple-gasless-demo.ts`. This script demonstrates the "Zero-Friction" Developer Experience (DX). + +**Reference Script**: [`examples/simple-gasless-demo.ts`](../examples/simple-gasless-demo.ts) + +#### Step 1: Setup Client & Wallet +Standard `viem` setup. You need a `WalletClient` (to sign the UserOp) and a `PublicClient` (to read data). + +```typescript +// 1. Setup Clients +const wallet = createWalletClient({ account, chain: sepolia, transport: http(rpcUrl) }); +const client = createPublicClient({ chain: sepolia, transport: http(rpcUrl) }); +``` + +#### Step 2: Define "User Intent" (CallData) +Instead of dealing with raw ABI encoding, use the SDK's semantic builders. + +```typescript +// 2A. Inner Action: Transfer 0.01 dPNTs +const innerCall = PaymasterClient.encodeTokenTransfer(recipient, parseEther('0.01')); + +// 2B. Outer Action: Execute via AA +const callData = PaymasterClient.encodeExecution( + tokenAddress, + 0n, + innerCall +); +``` + +#### Step 3: ✨ The Magic Line (Submission) ✨ +This is the core of the SDK. The `submitGaslessUserOperation` function handles all the complexity of Account Abstraction: +1. **Gas Estimation**: Automatically calls the Bundler to estimate usage. +2. **Dynamic Gas Pricing**: Fetches current network gas prices and applies 1.5x buffer for volatility (no hardcoded values). +3. **Efficiency Guard**: Applies optimized gas limits (no buffer for verification, 1.1x for execution) to pass strict Bundler rules. +4. **Data Encoding**: Packs the Paymaster data (time validity, deposit info). +5. **Signing**: Signs the UserOp with the user's private key (v0.7 compliant). +6. **Submission**: Sends the packet to the Bundler. + +```typescript +// 3. Submit Gasless UserOp (One-Liner) +// No need to specify gas prices - SDK auto-fetches from network! +const userOpHash = await PaymasterClient.submitGaslessUserOperation( + client, // Public Client for reads + wallet, // Wallet Client for signing + aaAccountAddress, // The User's AA Wallet Address + entryPointAddress, // Global EntryPoint + paymasterAddress, // The Paymaster paying the fees + tokenAddress, // The Token the user is "spending" (conceptually) + bundlerUrl, // Where to send the UserOp + callData // The action from Step 2 + // Optional: Pass custom gas prices via options if needed +); +``` + +#### Step 4: Wait for Receipt +The `userOpHash` is just a tracking ID. You must wait for the Bundler to bundle it into a real Ethereum Transaction. + +```typescript +// 4. Wait for Execution +const receipt = await bundlerClient.waitForUserOperationReceipt({ + hash: userOpHash +}); +console.log(`mined in tx: ${receipt.receipt.transactionHash}`); +``` + +#### Step 5: Instant Bill (Get Cost) +Since the fee is deducted from an internal Paymaster balance (not an external ERC-20 transfer), users might wonder "How much did I pay?". +The `getTransactionFee` helper instantly decodes the `PostOpProcessed` log from the receipt to give you the exact cost. + +```typescript +// 5. Instant Bill (No scanning required) +const feeInfo = PaymasterClient.getFeeFromReceipt(receipt.receipt, paymasterAddress); +console.log(`[Instant Bill] Cost: ${formatEther(feeInfo.tokenCost)} dPNTs`); +``` + +--- + +--- + +## Advanced: Remote Signing (KMS / MPC) + +If your AA Account's private key is stored in a KMS (AWS, Google) or MPC Node, you cannot export it. **Good news**: The SDK is compatible with any signer. + +**How to integrate:** +1. Create a custom `viem` Account that calls your KMS. +2. Pass this account to `createWalletClient`. +3. The SDK uses `wallet.account.signMessage(...)` internally. + +```typescript +// Example: Custom KMS Account +import { toAccount } from 'viem/accounts'; + +const kmsAccount = toAccount({ + address: '0xYourAAAddress', + async signMessage({ message }) { + // 1. Send 'message.raw' (the UserOpHash) to your KMS API + const signature = await myKmsClient.sign(message.raw); + // 2. Return the signature + return signature; + }, + // Implement other required methods (signTransaction, etc.) if needed +}); + +const wallet = createWalletClient({ account: kmsAccount, ... }); + +// Now just call the SDK as normal! +await PaymasterClient.submitGaslessUserOperation(..., wallet, ...); +``` + +--- + +--- + +## SuperPaymaster Integration (Credit-Based Gasless) + +SuperPaymaster allows users to pay gas using credits provided by an **Operator**. This model is ideal for ecosystem projects where a central entity (the Operator) sponsors transactions for its users. + +### 1. The SuperPaymaster Flow +1. **Operator Config**: An Operator (e.g., Anni) configures a credit line in the SuperPaymaster contract. +2. **User Action**: A user (UserOp Sender) initiates a transaction. +3. **Submission**: The app submits the UserOp specifying the `operator` address. +4. **Execution**: SuperPaymaster verifies the Operator's credit and sponsors the gas. + +### 2. Developer Workflow + +We provide a dedicated `SuperPaymasterClient` that abstracts gas estimation and operator data packing. + +**Reference Script**: [`examples/simple-superpaymaster-demo.ts`](../examples/simple-superpaymaster-demo.ts) + +#### Step 1: Configure App & Operator +You need the **User's** account (Signer) and the **Operator's** address. + +```typescript +import { SuperPaymasterClient } from '@aastar/paymaster'; + +const APP_CONFIG = { + superPaymaster: '0x...', // Contract Address + operator: '0x...', // Operator Address (Provider) + token: '0x...' // Logic Token (optional context) +}; +``` + +#### Step 2: Submit with Dynamic Gas Tuning +The `SuperPaymasterClient.submitGaslessTransaction` method automatically: +- **Estimates Gas**: Queries the Bundler. +- **Tunes Limits**: Adjusts `verificationGasLimit` to satisfy Bundler efficiency rules (> 0.4 ratio) while ensuring safe execution for Paymaster logic. +- **Packs Data**: Encodes the Operator address into the `paymasterAndData` field. + +```typescript +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction( + client, // Public Client + wallet, // Wallet (Signer - Local or KMS) + userAA, // User's AA Address + entryPoint, // EntryPoint Address + bundlerUrl, // Bundler RPC + { + token: APP_CONFIG.token, + recipient: recipientAddress, + amount: parseEther('1'), + operator: APP_CONFIG.operator, + paymasterAddress: APP_CONFIG.superPaymaster + } +); +``` + +### 3. Using KMS / MPC Signers +Just like the standard Paymaster usage, `SuperPaymasterClient` supports any `viem` Wallet Client. + +If your User keys are in a KMS (AWS, Google, Fireblocks): +1. Create a custom `viem` Account that forwards `signMessage` calls to your KMS. +2. Pass this account to `createWalletClient`. +3. Pass the `wallet` to `SuperPaymasterClient`. + +*(See "Advanced: Remote Signing" section above for code example).* + +--- + + +--- + +--- + +## Automated Faucet & Verification Script (New) + +We have implemented a **SepoliaFaucetAPI** that automates the tedious setup process for new test accounts (Funding ETH, Registering EndUser, Minting Tokens, Depositing to Paymaster). + +### Verification Script +Run the following script to create a fresh AA account, fund it, and execute a gasless transaction immediately: + +```bash +npx tsx scripts/test-faucet-and-gasless.ts +``` + +**What it does:** +1. **Identity**: Generates a random private key (Brand new user). +2. **Faucet**: Uses `SepoliaFaucetAPI.prepareTestAccount` to: + - Fund 0.02 ETH (if needed). + - Register `ENDUSER` role (attempts via Admin key; logs warning if no permission). + - Mint `cPNTs` tokens (for SuperPaymaster). + - Deposit tokens to Paymaster V4 (if needed). +3. **Action**: Calculates the AA address (undeployed). +4. **Submission**: Uses `SuperPaymasterClient` (with factory support) to deploy and execute a gasless transaction in one step. + +> **Note**: Requires `PRIVATE_KEY` (Deployer) or `PRIVATE_KEY_ANNI` in `.env.sepolia` to have Admin/Minter privileges. If specific permissions fail (like GrantRole), the script attempts to proceed. + +### 4. Code Sample: Using Faucet & KMS +For a complete example of how to combine the Faucet (for setup) and a Mock KMS (for signing), refer to `scripts/test-kms-gasless.ts`. + +#### Faucet Setup (One-Time) +```typescript +import { SepoliaFaucetAPI } from '@aastar/core'; + +await SepoliaFaucetAPI.prepareTestAccount( + adminWallet, // WalletClient with Admin Key + publicClient, + { + targetAA: '0x...', + token: '0x...', // GToken Address + registry: '0x...', // Registry Address + // Optional: + tokenAmount: parseEther('1000') + } +); +``` + +#### KMS / Remote Signer Integration +To use a remote signer (AWS KMS, Fireblocks, MPC), creates a custom `viem` account. + +```typescript +import { toAccount } from 'viem/accounts'; + +const remoteSigner = toAccount({ + address: '0xYourWalletAddress', + async signMessage({ message }) { + // message.raw is the UserOpHash + const sig = await myKmsClient.sign(message.raw); + // Ensure signature is valid 65-byte hex (r, s, v) + return sig; + }, + async signTransaction(tx) { + throw new Error("Not supported for Gasless"); + } +}); + +const wallet = createWalletClient({ account: remoteSigner, ... }); + +// Pass this wallet to SuperPaymasterClient +const userOpHash = await SuperPaymasterClient.submitGaslessTransaction(..., wallet, ...); +``` + + +--- + +## Appendix: Real Transaction Analysis + +Below is an analysis of a fulfilled Gasless Transaction (executed via `l4-test-jason1-gasless.ts` on Sepolia). + +**Transaction Hash**: `0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb` +**Etherscan Link**: [View on Sepolia Etherscan](https://sepolia.etherscan.io/tx/0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb) + +### Data Breakdown + +| Field | Value / Description | Interpretation | +| :--- | :--- | :--- | +| **Status** | `Success` | The transaction was mined and executed successfully. | +| **From** | `0x4a1627CACf9bFb16ed955738b9932d511644e489` (Bundler EOA) | The Bundler/Relayer that submitted the batch. This is NOT the user. | +| **To** | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` (EntryPoint v0.7) | The central EntryPoint contract that constructs and executes the AA call. | +| **Transaction Action** | Transfer 0.1 dPNTs | The verified "User Intent". The AA account successfully called the Token contract. | +| **ERC-20 Tokens** | `0xECD9C07f648B09CFb78906302822Ec52Ab87dd70` (Jason AA1) → `0xEcAACb915f7D92e9916f449F7ad42BD0408733c9` (Anni) | **The Core Action**: Jason AA1 transferred 0.1 dPNTs to Anni. | +| **Gas Usage** | `165,824` / `409,844` (40.46%) | The Paymaster sponsored the gas. The Bundler overestimated (Limit), but actual usage was fair. | +| **Internal Txns** | Transfer 0.0000189 ETH (Refund) | The **Paymaster** (via EntryPoint) refunding the Bundler for the ETH gas cost. | +| **Burnt Fees** | `0.00000000047...` ETH | The portion of the gas fee burnt by the network (EIP-1559). | + +### Key Takeaways +1. **User Pays Zero ETH**: The `From` address (Bundler) paid the ETH gas. The Internal Transaction shows the Bundler getting reimbursed. +2. **User Spent dPNTs**: The `ERC-20 Token Transfer` shows the user moving `dPNTs`. This likely covers the service fee (gas + premium) in a real "Pay with Token" model, though in this "Gasless" mode, the dPNTs might just be the payload or a separate fee payment. +### Frequently Asked Questions (Analysis) + +#### 1. Why is "From" the Bundler, not the User? +In Account Abstraction (ERC-4337), the User does not send the transaction directly. +- **The Envelope**: The Bundler (`0x4a16...`) sends the Ethereum Transaction to the `EntryPoint`. They pay the ETH gas. +- **The Letter**: The `EntryPoint` opens the envelope and executes your **UserOperation**. +- **The Result**: Etherscan shows the "Envelope" (Bundler -> EntryPoint) as the top-level transaction. Your action (Token Transfer) is an *Internal Transaction* or *Log Event* triggered inside. + +#### 2. Where is the Gas Fee? "Value: 0 ETH"? +- The `Transaction Fee` shown on Etherscan (e.g., 0.000016 ETH) is paid by the **Bundler**. +- The **Paymaster** refunds the Bundler (visible in "Internal Transactions" as a transfer from Paymaster to Bundler). +- **Your Cost (in Tokens)**: Since this Paymaster uses a "Deposit Model", the fee is deducted from your internal balance within the Paymaster contract. + - **Visibility**: This deduction does NOT show up as an ERC-20 Transfer (because tokens didn't move wallets, only internal counters changed). + - **Verification**: Look at the **Logs** tab for the `PostOpProcessed` event. It explicitly lists `tokenCost` (the amount of dPNTs deducted). + +#### 3. Why is there only one ERC-20 Transfer? +- The transfer you see (`0.1 dPNTs` from Jason to Anni) is your **Actual execution payload**. +- If the Paymaster used "Token Paymaster Mode 1" (pulling tokens from your wallet), you would see a second transfer for the fee. +#### 4. "I can't see the Deducted Amount!" (How to Read Logs) +You mentioned you couldn't find the deduction. It is in **Log Index 2** (on Etherscan Logs tab). +- **Event Signature (Topic 0)**: `0x62544d7f...` (`PostOpProcessed`). +- **Data Field**: Contains 3 values (32 bytes each). + 1. **ActualGasCost (ETH)**: `0xc5ba77775be` -> `0.00001358 ETH` (The actual reimbursed amount). + 2. **TokenCost (dPNTs)**: `0x99ffeb21efcb3b` -> `43346900000000000` (Raw Units). + - Assuming 18 decimals: **0.0433469 dPNTs**. + 3. **ProtocolRevenue**: Same as above (no markup in this test). + +**Summary**: Your deposit was deducted by **0.0433 dPNTs**. diff --git a/0.16.23/guide/docs/TEST_COVERAGE_MATRIX.md b/0.16.23/guide/docs/TEST_COVERAGE_MATRIX.md new file mode 100644 index 000000000..4abb12241 --- /dev/null +++ b/0.16.23/guide/docs/TEST_COVERAGE_MATRIX.md @@ -0,0 +1,72 @@ +# SDK测试覆盖率矩阵 + +## 当前覆盖状态 (scripts/99_final_v2_regression.ts) + +### 角色覆盖率: 100% (4/4) + +| 角色 | 客户端 | 已覆盖场景 | 缺失场景 | 覆盖率 | +|------|--------|-----------|---------|--------| +| **运营商** | OperatorClient | Staking, Deposit (Push) | Withdraw, Pull Deposit, Treasury管理 | 40% | +| **社区** | CommunityClient | Registration, SBT Minting | xPNTs部署, 声誉规则配置, SBT空投 | 33% | +| **终端用户** | EndUserClient | Credit Query | Gasless Transaction, 债务还款 | 20% | +| **管理员** | AdminClient | Slashing | 全局参数, DVT配置, 费用调整 | 25% | + +### 用户场景覆盖率: 100% (17/17) ✅ **Phase 2 完成** + +#### ✅ 已覆盖场景 (6个) + +1. **Operator Staking** - 运营商质押GToken +2. **Paymaster Deposit (Push)** - 运营商存款(Push模式) +3. **Community Registration** - 社区注册 +4. **SBT Minting** - SBT铸造(通过registerRoleSelf) +5. **Admin Slashing** - 管理员惩罚 +6. **Credit Query** - 信用额度查询 + +#### ❌ 缺失场景 (5个 - Phase 2) + +**运营商场景** (2个): +13. Operator Pull Deposit - Pull模式存款 +14. Treasury Management - 国库地址管理 + +**社区场景** (1个): +15. Community Pause - 暂停/恢复社区 + +**管理员场景** (2个): +16. Global Parameters - 全局参数调整(完整实现) +17. Fee Configuration - 费用配置 + +--- + +## 扩展计划 + +### Phase 1: 核心场景补充 (优先级: P0) + +添加以下6个高优先级场景到 `99_final_v2_regression.ts`: + +1. **Operator Withdraw** - 验证提款逻辑 +2. **xPNTs Deployment** - 社区代币部署 +3. **Gasless Transaction** - 终端用户无Gas交易 +4. **Reputation Rules** - 声誉规则配置 +5. **SBT Airdrop** - 批量空投 +6. **Global Parameters** - 全局参数调整 + +### Phase 2: 完整覆盖 (优先级: P1) + +添加剩余5个场景,达到95%覆盖率 (16/17)。 + +--- + +## 目标 + +- **角色覆盖**: 100% (已达成) +- **场景覆盖**: 95% (16/17) - 当前35% (6/17) +- **分支覆盖**: 90%+ (核心逻辑) + +--- + +## 实施状态 + +- [x] 创建覆盖率矩阵文档 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 1) - 70%覆盖率达成 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 2) - **100%覆盖率达成** 🎉 +- [x] 验证100%覆盖率达成 diff --git a/0.16.23/guide/docs/TODO_SDK_COVERAGE.md b/0.16.23/guide/docs/TODO_SDK_COVERAGE.md new file mode 100644 index 000000000..15ce10739 --- /dev/null +++ b/0.16.23/guide/docs/TODO_SDK_COVERAGE.md @@ -0,0 +1,60 @@ +# SDK Testing Coverage TODO + +This document tracks the test cases and scenarios that were skipped or identified for future coverage during the SDK regression enhancement phase (v2.1.0). + +## 1. Skipped Scenarios: Test 5 (V2 Regression) + +Test 5 in `run_sdk_regression.sh` was skipped due to persistent `RoleAlreadyGranted` errors arising from local blockchain state conflicts. + +### Tracked Interfaces +- `Registry.registerRoleSelf(bytes32 roleId, bytes roleData)` +- `SuperPaymaster.notifyDeposit(address community, uint256 amount)` + +### Background Context +The test attempts to register the `ROLE_COMMUNITY` and `ROLE_PAYMASTER_SUPER` roles. Even with `hasRole` guards, the transaction reverts if the address is already registered in a previous run with different metadata or state. + +### Action Plan +- **Status Update (2025-12-26)**: Even after synchronizing `ROLE_COMMUNITY` and `ROLE_PAYMASTER_SUPER` hashes across the SDK and contracts, the `RoleAlreadyGranted` error persists. This confirms a deep-seated blockchain state conflict where the test address is already registered in a way that bypasses simple hash-existence checks. +- [ ] Reset local Anvil state (`forge script scripts/SetupV3...` with fresh accounts). +- [ ] Re-enable Test 5 in `run_sdk_regression.sh`. +- [ ] Verify `notifyDeposit` balance updates on-chain. + +## 2. Technical Debt: Core Constants Synchronization + +- **Role Hash Discrepancy**: Standardize the generation of hashes across `core/constants.ts` and `Registry.sol`. +- **Wallet Client Export**: `createAAStarWalletClient` is currently omitted from `core` in favor of SDK-level role clients (`createAdminClient`). Evaluate if a generic public wallet constructor belongs in `core`. + +--- + +## 3. SDK 完备性核实与进阶优化 (2025-12-26 源码审计更正) + +经过对 SDK 源码的深度检索,核实多项安全审计报告(`12-26-2sdk-audit.md`)中提到的“缺失项”**实际上已经实现**。以下是修正后的技术现状与优化计划: + +### 3.1 Paymaster V4 管理端 (🔴 已实现,待集成验证) +- **现状核实**: 源码中已存在 `addGasToken`、`addSBT`、`withdrawPNT` 等接口(见 `packages/core/src/actions/paymasterV4.ts`)。 +- **后续行动**: + - [ ] **场景集成**: 在 Phase 3 的场景测试中,正式调用这些接口执行“管理员配置 Paymaster”的流程,确保 Sepolia 集成无误。 + - [ ] **文档补全**: 确保这些接口在开发者指南中清晰可见。 + +### 3.2 SuperPaymaster V3 动态定价 (🟠 已实现,待开启测试) +- **现状核实**: `setXPNTsFactory` 接口已在 `SuperPaymasterClient` 和 `core` action 中定义。 +- **后续行动**: + - [ ] **全链路验证**: 在 Sepolia 环境下开启该功能,验证 SDK 能否正确配合 Factory 进行 Gas 定价。 + +### 3.3 BLS 签名与 DVT 工具链 (🟠 已实现核心,待易用性增强) +- **现状核实**: `core/src/crypto/blsSigner.ts` 已包含 `BLSSigner` 工具类。 +- **后续行动**: + - [ ] **DVT 助手封装**: 在 `packages/dvt`(如后续拆分)中提供更高层的业务助手,进一步简化 `executeSlashWithProof` 的参数构造。 + +### 3.4 API 安全性与权限限制 (🟡 已标记,待物理隔离) +- **现状核实**: `StakingActions.lockStake` 已经添加了 `@internal` 注解和明确的警告。 +- **后续行动**: + - [ ] **物理隔离**: 考虑在未来的重构中将管理员相关的 Actions 从公共 Client 中完全剥离,实行物理上的权限解耦。 + +--- + +## 4. Keeper 无人值守运行的安全增强 (2026-02-11) + +- [ ] 如果你希望进一步提高安全性(比如完全不在 env 里放密码),比较“工程化”的做法是用 macOS Keychain / 进程启动时注入一次密码(launchd + Secure input / secret manager),但这就超出 keeper 脚本本身的范围了;脚本侧目前已经满足“启动一次输入,后续无人职守自动跑”的目标。 +*上次更新: 2025-12-26 (基于 SDK 源码深度审计结果)* +*上次更新: 2025-12-26 (基于 SDK 源码深度审计结果)* diff --git a/0.16.23/guide/docs/USER_CASE_DESIGN.md b/0.16.23/guide/docs/USER_CASE_DESIGN.md new file mode 100644 index 000000000..b8f100494 --- /dev/null +++ b/0.16.23/guide/docs/USER_CASE_DESIGN.md @@ -0,0 +1,110 @@ +# SDK 场景化案例设计 (User Case Design) + +本文档借鉴 `registry` 前端项目的用户交互逻辑,提取核心业务链路,设计了 SDK 在 Phase 3 (Sepolia) 阶段的场景化测试用例。我们的目标是**参考前端体验、沉淀 SDK 模式 (Orchestration Patterns)**,而非简单的接口复用。 + +## 场景角色定义 + +1. **Protocol Admin (协议管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,进行后续的全局配置、DVT 验证器管理、治理代币发行等。 +2. **Community Admin (社区管理员)**: 部署时期是一个EOA,完成部署后交接给多签Safe账户,负责社区注册、xPNTs 发行、SBT 会员规则设定。 +3. **PM Operator (Paymaster 操作员)**: 部署时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 Paymaster 节点运维、质押充值、费用管理等。多数时候,早期社区管理员和Operator是一个EOA。 +4. **SuperPaymaster Operator**: 注册时期是一个EOA,完成部署后,**可选**交接给多签Safe账户,负责 SuperPaymaster参数配置和国库管理。多数时候,早期社区管理员和Operator是一个EOA。 +5. **DVT(Node) Operator**: 部署时期是一个EOA,完成部署后,**可选**交接给其他EOA或者自动Rotate 账户,负责 DVT 参数配置和治理代币管理。 +6. **EndUser (终端用户)**: 参与社区、获取 SBT 身份、使用社区信用进行 Gasless 交易。 + +--- + +## 核心测试用例 (Business Scenarios) +背景信息: +- GToken在测试阶段,来自于协议Admin直接铸造空投。 +- 未来GToken来自于独立的阶梯价格销售(Mint)合约/应用。 +- xPNTs在测试阶段,来自于社区Admin铸造空投。 +- 未来xPNTs来自于社区发行+Reputation机制+任务广场。 +- SBT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来SBT来自于社区Shops+Reputation机制+任务广场。 +- NFT在测试阶段,来自于社区Admin铸造空投或者自行Mint。 +- 未来NFT来自于社区Shops+Reputation机制+任务广场。 + +### 用例 1:社区“全流程”自动化 (DAO Launchpad Pattern) +**参考自**: `RegisterCommunity.tsx` +- **设计思路**: 前端是分步引导,SDK 应提供“原子组合”能力。模拟社区从 0 到 1 的全过程:授权 -> 质押 -> 基准配置 -> 关联 SBT。 +- **SDK 验证重点**: + - 组合调用:`GTokenClient` 与 `RegistryClient` 的无缝状态桥接。 + - `RegistryClient.registerCommunityWithAutoStake` + - 验证 `ContractConfigManager` 是否正确识别新注册的社区配置。 + - 社区发行自己的xPNTs,NFT。 + +### 用例 2:Paymaster 节点部署向导 (Operator Wizard) +**原型参考**: `DeployWizard.tsx` (3-Step Flow) +- **业务流程**: 操作员选择模式(AOA/AOA+)-> 资源自检(GToken 余额、质押状态)-> 部署合约并充值。 +- **SDK 验证重点**: + - `OperatorClient.checkResources` (模拟前端资源自检逻辑) + - `PaymasterFactory.deployPaymaster` + - `OperatorClient.depositCollateral` +- **预期结果**: 完成后,Operator拥有独立的`Paymaster`节点和 Gas Token(xPNTs),或者在 `SuperPaymaster` 的 aPNTs 余额可见且可用于支持自己社区成员使用xPNTs代付。 + +### 用例 3:用户身份获取与信誉激活 (SBT & Reputation) +**原型参考**: `GetSBT.tsx`, `MySBT.tsx` +- **业务流程**: 用户选择社区 -> 自动质押 0.4 GT -> 铸造 MySBT -> 查看全局信誉分。 +- **SDK 验证重点**: + - `EndUserClient.mintSBT` (包含 auto-stake 逻辑) + - `ReputationClient.getGlobalReputation` + - `RegistryClient.getCreditLimit` (验证信誉分是否正确转化为信用额度) + +### 用例 4:纯净 Gasless 交易体验 (Ultimate Gasless UX) +这也是我们PhD paper获取实验数据的阶段,包括baseline(EOA和Pimlico Paymaster,以及业界平均统计成本)和两个对比实验(Paymaster V4和SuperPaymaster)。 +**原型参考**: `DeveloperPortal.tsx` (集成示例) +- **业务流程**: 一个没有任何 ETH 的新账户,使用社区发放的 SBT 凭证,通过 SDK 发送一笔交易。 +- **SDK 验证重点**: + - `createEndUserClient` 初始化(无私钥签名模式或智能账户模式) + - `getSuperPaymasterMiddleware` 后台自动构建 `userOp.paymasterAndData` + - 验证 `SuperPaymaster` 的 `postOp` 阶段是否正确扣除用户信用或 xPNTs 代币。 + + +### 基础用例整合(后续TODO) +我们期望能够整合基础用例,给用户(社区)提供自主自助的launchpad以及管理平台。 +🎫 +Get GToken +Get protocol access permission GToken, become protocol member, join permissionless, quit anytime freely + +Get → +🏛️ +Register Community +Create and register your community on the AAstar Network + +Register → +💎 +Deploy xPNTs +Create your community gas token for payment abstraction + +Deploy → +🚀 +Launch Paymaster +Deploy your Paymaster contract and start serving gasless transactions to your community + +Launch Paymaster → → + +### 用例 X:更多用例,持续加入(后续TODO,不加入开发) + 用例 5:危机管理与 DVT 治理 (Governance & Slashing) +**原型参考**: `AdminBatchMint.tsx` (管理入口) +- **业务流程**: 管理员发现恶意行为 -> DVT 节点投票 -> 执行对社区质押额的 Slash。 +- **SDK 验证重点**: + - `DVTClient.proposeSlash` + - `DVTClient.signSlash` (模拟多节点聚合签名) + - `AdminClient.executeSlash` +--- + +## 开发计划 (Implementation Plan - 阶段 3) + +### 第一步:Sepolia 环境就绪 +- 部署全套合约 (V3.3.0+) 至 Sepolia。 +- 使用 `forge verify-contract` 完成 Etherscan 验证。 +- 更新 SDK `constants.ts` 中的 Sepolia 合约地址。 + +### 第二步:场景化示例开发 +- 在 `examples/` 目录下按上述 4 个用例创建独立的 目录和TS 脚本。 +- 编写配套的中文文档注释,确保其作为“开发者指南”的使用价值。 +- 结合SuperPaymaster Readme中的数据收集计划,完成PhD paper的数据收集。这部分可以独立目录。 + +### 第三步:全流程冒烟测试 +- 运行 `pnpm run test:sepolia` (新增脚本)。 +- 输出场景执行记录,作为 Phase 3 的交付证明。 diff --git a/0.16.23/guide/docs/Verifier_L4_Gasless_Plan.md b/0.16.23/guide/docs/Verifier_L4_Gasless_Plan.md new file mode 100644 index 000000000..0b4e5d03d --- /dev/null +++ b/0.16.23/guide/docs/Verifier_L4_Gasless_Plan.md @@ -0,0 +1,454 @@ +# L4 无 Gas 交易验证测试计划 (L4 Gasless Transaction Verification Plan) + +本文档详细描述了在 Sepolia和其他网络参数的验证无 Gas 交易(Gasless Transactions)的详细步骤和要求。 +一些信息和要求: +1. L4是run_sdk_regression.sh 整体回归脚本的一部分,完成gasless的账户数据check和准备和交易测试。 +2. 所有私钥、RPC等私密信息,来自于根目录的.env.sepolia(或者对应的网络,例如.env.op-sepolia, .env.mainnet, .env.anvil) +3. 使用SDK 提供的合约ABI(来源是根目录的abis) +4. 所有合约地址来自于根目录的config.sepolia.json(或者对应的config.network.json),包括唯一hash。 +5. 所有L4的数据准备、检查、初始化和交易测试,要求是幂等的,即可以重复执行,不会对系统和要进行的测试计划造成影响。 +6. L4 测试的目标,是使用L1,L2,L3积累和验证过的API(就是根目录的 run_sdk_regression.sh),来完成可重复的gasless交易全过程。 +7. 兼容不同网络参数:sepolia, mainnet, op-sepolia, anvil等等,但是对于anvil,L4模拟entrypoint和useroperation有一定限制,我建议L4跳过anvil的测试,你来评估是否合理。 +8. 检查、生成和初始化,然后记录log或者config并输出测试准备结果 +9. 如果API没有需要的能力,则添加API,全部使用API能力完成数据准备校验初始化和gasless交易全过程。 +10. 如果API报错,则修复,全部使用API能力 +11. 可以参考SDK的ABI和合约代码来调试 +12. 语义化函数名,避免类似getBalance, deposit, withdraw, mint, burn等太通用的函数名,使用反映业务场景的名字,例depositAPNTsToSuperPaymaster,当然不一定这个名字,但要语义化,场景匹配。 +## 1. 测试账户准备 (Test Accounts) + +需要在 `.env.sepolia` 中配置以下账户私钥: + +1. **供应商账户 (Supplier)** + * **Env Var**: `PRIVATE_KEY_SUPPLIER` + * **用途**: 提供测试 ETH (ETH Supplier),同时也是 GToken 合约的所有者 (Owner)。 + +2. **社区运营者 (Operators - EOAs)** + * 需在 `.env.sepolia` 中添加以下私钥 (如果不存在则生成): + * `PRIVATE_KEY_JASON` (Admin for AAStar Community) -> 负责部署 aPNTs + * `PRIVATE_KEY_BOB` (Admin for Bread Community) -> 负责部署 bPNTs + * `PRIVATE_KEY_ANNI` (Admin for Demo Community) -> 负责部署 cPNTs & SuperPaymaster 操作 + +3. **测试 AA 账户 (AA Users)** + * **生成方式**: 使用 Jason, Bob, Anni 的私钥作为 Signer 生成 EntryPoint v0.7 兼容的 Smart Accounts。 + * **数量**: 6 个 (每个 Operator 对应 2 个,或者混合使用)。 + +## 2. 环境初始化要求 (Initialization Requirements) + +这些步骤作为“一次性准备工作”运行(One-time Setup),将通过 `scripts/l4-setup.ts` 完成。 + +### 2.1 资金分发 (Funding) +1. **GToken 分发**: 使用 Supplier Key (Owner) 铸造 (Mint) GToken: + * 给 **Jason**: 100,000 GToken (Stake for PaymasterV4) + * 给 **Bob**: 100,000 GToken (Stake for PaymasterV4) + * 给 **Anni**: **200,000 GToken** (100k for Community Stake + Extra for SuperPaymaster Stake/Deposit) +2. **ETH 分发**: 使用 Supplier Key 发送测试 ETH 给 3 个 Operator (确保足够 Gas 用于部署合约)。 + +### 2.2 社区与代币启动 (Community & Token Launch) +1. **AAStar Community (Jason)** + * 注册社区。 + * 部署社区代币 **aPNTs**。 + * 部署 **PaymasterV4** (常规 Paymaster)。 + * **Action**: Mint 100,000 aPNTs 给 Anni (用于 Anni 的 SuperPaymaster 存款)。 +2. **Bread Community (Bob)** + * 注册社区。 + * 部署社区代币 **bPNTs**。 + * 部署 **PaymasterV4** (常规 Paymaster,接受 bPNTs)。 +3. **Demo Community (Anni)** + * 注册社区。 + * 部署社区代币 **cPNTs**。 + +### 2.3 Paymaster 启动 +1. **Launch PaymasterV4s**: 确保 Jason 和 Bob 的 PaymasterV4 已部署并存入 ETH (Gas) 和 GToken (Stake)。 +2. **Launch SuperPaymasterV3**: 确保系统中有两个 SuperPaymasterV3 实例(只需在 Registry 注册)。 +3. **Anni's SuperPaymaster Setup**: + * Anni 使用额外 GToken 和 ETH 注册/启动一个 SuperPaymaster。 + * Anni 将 **aPNTs** (来自 Jason) 存入 SuperPaymaster 作为 Credit (Deposit)。这是 SuperPaymaster 在全局账本中的抵押品。 + +## 3. L4 无 Gas 交易测试场景 (Test Scenarios) + +### 3.1 预备步骤 (Preparation for AA) +1. **GToken Mint**: 给所有 测试 AA 账户 Mint 1,000 GToken (Source: Supplier)。 +2. **xPNTs Mint**: 使用对应的 Operator 给相关 AA 账户 Mint 10,000 个 aPNTs, bPNTs, cPNTs。 +3. **SBT & Deposit**: + * 确保所有 AA 账户拥有 MySBT (通过注册任意社区获取)。 + * 确保所有 AA 账户已存入 10,000 xPNTs 到对应的代币合约/社区 (Deposit)。 + +### 3.2 社区注册测试 (Community Registration via AA) +使用生成的 AA 账户测试注册流程: +1. **Case 1 (With ETH)**: 账户有测试 ETH -> 注册成功。 +2. **Case 2 (Gasless)**: 账户无测试 ETH -> 注册成功 (使用 Paymaster)。 +3. **Case 3 (First Time)**: 首次注册。 +4. **Case 4 (Re-register)**: 二次注册 (Re-register)。 +5. **Case 5 (Idempotency)**: 三次注册 (检查幂等性)。 + +### 3.3 PaymasterV4 交易 (常规代币 Gas) +1. **AAStar Paymaster (aPNTs)**: + * AA 账户 (Signer: Jason/Anni) 使用 **aPNTs** 支付 Gas。 + * 通过 AAStar 的 PaymasterV4 发起交易。 + * 验证:成功,扣除 AA 的 aPNTs。 +2. **Bread Paymaster (bPNTs)**: + * AA 账户使用 **bPNTs** 支付 Gas。 + * 通过 Bread Community 的 PaymasterV4 发起交易。 + * 验证:成功,扣除 AA 的 bPNTs。 + +### 3.4 SuperPaymasterV3 交易 (Demo Community - Credit System) +目标:测试信用 (Credit)、债务 (Debt) 和 偿还 (Repayment) 逻辑。 +配置:Demo Community Operator (Anni) 部署的 SuperPaymaster。 + +1. **Tx 1: cPNTs Payment (Normal)**: + * AA 账户使用 **cPNTs** 支付。 + * 发起 Gasless 交易。 + * 验证: + * AA 的 cPNTs 余额减少。 + * SuperPaymaster 内 Demo Community 的 **aPNTs** 余额减少 (底层支付)。 + +2. **Tx 2: Insufficient cPNTs (Credit & Debt Test)**: + * **场景**: AA 账户没有足够的 cPNTs。 + * **前提**: 账户拥有足够的 Reputation。 + * **执行**: 连续发起 3 次交易。 + * **预期**: + * 系统给予 3 次免费交易额度 (Credit)。 + * 交易全部成功。 + * **关键验证**: 每次交易都在 cPNTs 合约中记录了 AA 的 **债务 (Debt)**,因为使用了 Credit。 + +3. **Tx 3: Run out of Credit (Blacklist/Limit)**: + * **场景**: 用完 3 次免费额度,继续尝试第 4 次交易。 + * **预期**: 交易失败 (run out of credit),或者被列入黑名单。 + +4. **Tx 4: Repayment**: + * **场景**: AA 账户充值 cPNTs。 + * **预期**: 系统自动优先偿还债务 (Pay Debt First)。检查余额是否正确反映了 (充值金额 - 债务)。 + +## 4. 后续步骤 +* 编写 `scripts/l4-setup.ts` 自动化上述初始化。 +* 编写 `tests/regression/l4-gasless.ts` 执行上述测试用例。 +* + +补充: +xPNTsFactory合约初始化会设置SuperPaymaster内置为超级账户,可以直接从任意xPNTsFactory部署的xPNTs合约转账gas需要的xPNTs到自己的账户,不用approve。不过也提供了安全校验,只能用来转gas费用。 + + +## 规则补充 +以下规则在aastar-sdk 项目生效 +第一,禁止创建便利性的脚本或者临时性的脚本用来什么检查余额、部署token、资助账户,这些都禁止,如果需要便利性脚本,参考第二条 +第二,所有过程必须使用使用我们的API,我们API有L1L2L3级别的API,都封装了基础能力,你为什么不用API,需要便利性脚本了,在test,utils模块下新增工具api,转化为可重复使用的api,为全回归测试做准备 +第三个,禁止产生任何编译的过程文件(如 .js, .d.ts, .map)。如果运行 ts 脚本,**必须使用 `npx tsx` 直接运行**,**绝不执行 `tsc` 或其他会产生文件的编译命令**。如果不慎产生,必须随后立即清理。 +第四,所有的环境变量配置,在根目录的.env.sepolia(不同网络,不同配置名称,例如.env.anvil, .env.op-sepolia, .env.mainnet,目前我们重点是在sepolia跑通全回归测试)。 +第五,全回归测试必须包含三个阶段,必须一步步完成,禁止未完成第一阶段,进入第二阶段,以此类推。 +其中,第一阶段,定义为合约环境检查,第二阶段,定义为初始化账户(EOA和AA)、社区、token、paymaster和superpaymaster,第三阶段,准备forge script dry run测试useroperation是否合格,然后测试和fix,完成gasless测试。 +以上所有阶段的实现,都在L4 test脚本实现,通过组织和调用L1,L2,L3的sdk api,实现关键动作,禁止借助外部临时api完成,任何步骤没有api实现了,check后可以新增api,原则参考第二条规则, 最后无法完成的,抛出报错。 +------ +以上规则的详细版本,在docs/Verifier_L4_Gasless_Plan.md,此规则为实现gasless回归测试为目标。 + + +## 合约验证 +**目标** +验证所有合约地址是否是最新版本,合约名称,版本号,部署日期,合约地址,都要输出和明确展示,验证是否完成了相互之间的依赖初始化。 +以上需要统计合约数量(指的是由本项目开发的合约和依赖合约),目前有如下合约: + 1. Registry 60 functions,全局注册表合约 + 2. SuperPaymaster 58 functions,唯一实例的多租户Paymaster,由AAStar社区维护 + 3. MySBT 49 functions,全局唯一SBT合约,白板MySBT协议,只有你可以自由涂抹 + 4. PaymasterV4_2 48 functions ,模板合约,reg在PaymasterFactory合约一个具体实现 + 5. xPNTsToken 37 functions 模板合约,immutable方式固化在了xPNTsFactory合约 + 6. GToken 18 functions,基础GToken合约,未来要改进为销售合约 + 7. GTokenStaking 28 functions,GToken的质押管理合约 + 8. xPNTsFactory 28 functions xPNTs合约注册到工厂,然后通过工厂部署具体实现proxy + 9. PaymasterFactory 24 functions paymaster某版本实现reg到工厂,use工厂部署实现proxy + 10. ReputationSystem 20 functions,信用系统 + 11. BLSAggregator 18 functions,BLS聚合器 + 12. DVTValidator 15 functions,DVT验证器 + 13. BLSValidator 2 functions,BLS验证器合约 +----------------------------------------------------------------- +14. SimpleAccount 17 functions,默认0.7版,外部依赖,符合entrypoint 0.7的合约账户 +15. SimpleAccountV08 17 functions,外部依赖,符合entrypoint 0.8的合约账户 +16. EntryPoint 22 functions,外部依赖,官方entrypoint +17. Simple7702Account 10 functions,外部依赖,符合entrypoint 0.7的合约账户 +18. SimpleAccountFactory 4 functions,外部依赖,符合entrypoint 0.7的合约账户工厂 +19. SimpleAccountFactoryV08 4 functions,外部依赖,符合entrypoint 0.8的合约账户工厂 +20. SenderCreator 3 functions,外部依赖,部署AA账户的工具合约 +21. UserOperationLib 3 functions,外部依赖,用户操作的工具合约 + + + +基于工厂部署的实例: + 1. aPNTs,基于xpntsFactory部署的标准实现,提供xpnts接口的具体实例,归属于AAStar社区 + 2. bPNTs,基于xpntsFactory部署的标准实现,提供xpnts接口的具体实例,归属于Bread社区,以此类推 + 3. PaymasterV4_2-Bread,归属于Bread社区,基于paymasterFactory部署的标准实现,提供paymaster接口的具体实例,以此类推 + 4. SuperPaymaster,归属于AAStar社区,全局唯一实例,提供superpaymaster服务的多租户合约(这个是特殊实例,只有一个) + +### 角色和信用等级 + 预置角色配置表 (Registry v3.1.1) +以下是合约构造函数中初始化的核心参数(金额单位均为 GToken/ETH 对应的 18 位小数): + +角色 (Role ID) 最小质押 (minStake) 进入销毁 (entryBurn) 退出费率 (exitFeeBP) 最小退出费 说明 +ROLE_COMMUNITY 30 ETH 3 ETH 500 (5%) 1 ETH 社区运营者基础角色 +ROLE_ENDUSER 0.3 ETH 0.05 ETH 1000 (10%) 0.05 ETH 终端用户角色 +ROLE_PAYMASTER_SUPER 50 ETH 5 ETH 1000 (10%) 2 ETH 超级支付主角色 +ROLE_PAYMASTER_AOA 30 ETH 3 ETH 1000 (10%) 1 ETH 常规 AOA 支付主 +ROLE_DVT / ROLE_KMS 30~100 ETH 3~10 ETH 1000 (10%) 1~5 ETH 基础设施节点角色 +[!NOTE] bra fee (entryBurn): 注册时立即扣除并销毁的部分。 stakeExit fee (exitFeeBP): 退出角色时从质押余额中扣除的比例(BP 为万分之一)。 + +C. 信用分等级与额度 (Credit Tiers) +系统根据 Reputation 分数自动划分等级,对应不同的 SuperPaymaster 信用额度: + +等级 (Level) 信誉分阈值 (Reputation) 信用额度 (Credit Limit) +Level 1 < 13 0 +Level 2 13 - 33 100 aPNTs +Level 3 34 - 88 300 aPNTs +Level 4 89 - 232 600 aPNTs +Level 5 233 - 609 1000 aPNTs +Level 6 610+ 2000 aPNTs +这就解释了为什么在 L4 测试中,我们需要先提升 AA 账户的 Reputation,才能触发 SuperPaymaster 的信用支付逻辑。 + +### 验证 +相互之间的依赖是否初始化完成,包括: +1. GToken是否是immutable变量在GTokenStaking合约中 +(Wiring Matrix) +* MySBT -> Registry +*  GTokenStaking -> Registry +*  xPNTsFactory -> SuperPaymaster +* Registry -> ReputationSystem (as Source) +* Registry -> BLSAggregator +* Registry -> BLSValidator +* SuperPaymaster -> xPNTsFactory +* SuperPaymaster -> BLSAggregator +* 依赖的设置分为immutable变量设置和依赖合约地址设置,immutable变量设置在合约初始化时设置,依赖合约地址设置在合约初始化时设置(部署者/管理员调用setter函数) + +两个方式完成合约验证:到superpaymaster项目目录,运行 forge script scripts/VerifyV3_1_1.s.sol 来验证 +或者到aastar-sdk项目目录,添加checkContract函数(借鉴VerifyV3_1_1.s.sol逻辑,我们重新编写,这个还没做,需要新增checkContract函数),来验证 +------- +TX requirements + +L4 test for gasless tx, but you must check the test accounts (EOA account as operators to launch new community and deploy community xPNTs like aPNTs and bPNTs; and as a test receiver, and test AA account with entrpoint 0.7 adaptable) and and requirements(MySBT, bPNTs) and community registered() and + +Test Accounts: + +1. PRIVATE_KEY_SUPPLIER in .env.sepolia as a Test ETH supplier +2. 3 EOA as community launcher(operator) : Jason, Bob, Anni, private key in .env.sepolia +3. 6 AA(entrypoint 0.7) accounts for gasless test, produced by API + +Requirements +1. Mint GToken(100000, using supplier key, it is also the GToken contract owner) to 3 EOA accounts +2. Transfer test ETH(using supplier key) to 3 EOA accounts for deployment. +3. launch three communities and token for test + 1. AAStar Community and aPNTs (Jason) + 2. breadCommunity with bPNTs (Bob) + 3. DemoCommunity with cPNTs (Anni) +4. Launch two PaymasterV4, new deployment with GToken and test ETH in EOA +5. Launch two SuperPaymasterV3, just register in registry with with GToken and test ETH +6. Use Anni to register (launch) a SuperPaymaster with extra GToken and test ETH and 100000 aPNTs in EOA + 1. deposit aPNTs to Super +7. All above is one time job for our later test, we can make a individual test shell to prepare. +8. if done this, record all data, contracts, community data, accounts for next step. + +Test 4 kinds of gasless tx: + +1. Mint GToken to all test AA accounts(1000 is enough) ,use supplier key +2. Mint a,b,cPNTs to all test AA account(10000 is enough), use the community operator key(Jason, Bob, Anni) +3. use AA accounts to register different community(above all ) + 1. with test ETH + 2. without test ETH + 3. first time register a community + 4. second time + 5. third time +4. All test AA accounts get MySBT (registered in any community) and deposited xPNTs(a,b, cPNTs) 10000. +5. Launch a tx in a PaymasterV4 by breadCommunity(they accept bPNTs as gas token). + 1. AA account with apnts, launch gasless tx with aastar’s paymaster V4(deployed by aastar operator) + 2. AA account with bpnts , launch gasless tx with breadCommunity paymaster V4(deployed by breadCommunity operator) +6. Launch a tx in a SuperPaymasterV3 + 1. AA account with cpnts , launch gasless tx with DemoCommunity SuperPaymaster V3(deployed by DemoCommunity operator Anni) + 2. it should deduced aPNTs from DemoCommunity balance in SuperPaymaster + 3. it should + 1. deduce cPNTs from test AA account + 2. if AA account has no cPNTs balance + 3. improve the reputation of test account enough to get credit for 3 free tx + 1. try more tx, it should be put into blacklist (we put it manually for now) and can’t get gasless free tx anymore, it run out the credit. + 5. try again, should record a debt in cPNTs contract + 6. deposit cPNTs to test AA, it should pay debt first, then deposite + + +--- + +## 5. L4 实现计划 (Implementation Plan) + +### 5.1 脚本结构 + +```bash +# 1. 环境准备(幂等) +pnpm tsx scripts/l4-setup.ts --network=sepolia + +# 2. Gasless测试 +pnpm tsx tests/regression/l4-gasless.ts --network=sepolia + +# 3. 查看状态 +cat scripts/l4-state.json +``` + +### 5.2 l4-setup.ts 数据准备目标 + +| 阶段 | 对象 | 目标值 | 说明 | +|------|------|--------|------| +| **Funding** | Jason ETH | ≥0.1 ETH | 部署合约Gas | +| | Bob ETH | ≥0.1 ETH | 部署合约Gas | +| | Anni ETH | ≥0.1 ETH | 部署合约Gas | +| | Jason GToken | 100,000 | PaymasterV4 Stake | +| | Bob GToken | 100,000 | PaymasterV4 Stake | +| | Anni GToken | **200,000** | 100k社区质押+100k SuperPM质押 | +| **社区** | Jason | AAStar社区+aPNTs+PaymasterV4 | | +| | Bob | Bread社区+bPNTs+PaymasterV4 | | +| | Anni | Demo社区+cPNTs+SuperPM Operator | | +| **SuperPM** | Anni aPNTs余额 | **100,000** | Jason mint aPNTs给Anni | +| | Anni SuperPM内余额 | ≥50,000 aPNTs | Anni存入SuperPM的credit | +| **AA账户** | 6个AA | 每个≥0.02 ETH, 1000 GToken | | +| | AA xPNTs | 各10,000 a/b/cPNTs | 用于Gasless测试 | + +### 5.3 关键修复事项 + +1. **SuperPaymaster.deposit问题**: + - 合约`deposit(uint256 amount)`使用的是`APNTS_TOKEN`(全局aPNTs=`0xBdF389a6e402AF1C0d4A0A45396303dC0b1Cf8d2`) + - 不是Jason的社区aPNTs代币 + - SDK需添加`depositAPNTsToSuperPaymaster`语义化函数 + +2. **Token数量调整**: + - GToken: Jason/Bob 100,000, Anni 200,000 + - aPNTs from Jason to Anni: 100,000 + - SuperPM存入: 50,000 (保留50,000备用) + +3. **Anvil跳过评估**: + - Anvil本地没有真实Bundler,无法测试完整UserOp流程 + - **建议L4跳过Anvil**,仅在Sepolia/OP-Sepolia执行 + +### 5.3 构造UserOp +- 交易内容:从 Jason 的第一个 AA 账户 (Jason_AA1) 向 Bob 的 EOA 地址转移 2 个 bPNTs 代币。 +- 签名来源:使用 Jason 的私钥(即 AA 的 Owner)对 UserOp Hash 进行了标准的 signMessage 签名。 +- Nonce 处理:通过 SDK 实时获取了最新的 Nonce 值 (当前为 1)。 +“UserOperation 构造指南”,内容包括: + +Context: 明确演示背景为从 Jason (AA1) 向 Bob (EOA) 转移 2 个 bPNTs。 +5 种测试场景总结: +NATIVE: 标准 4337,AA 支付 ETH Gas。 +GASLESS_V4: PaymasterV4 免 Gas(社区赞助)。 +SUPER_BPNT: SuperPaymaster 内部结算 bPNT。 +SUPER_CPNT: SuperPaymaster 内部结算 cPNT。 +SUPER_CUSTOM: SuperPaymaster 自定义结算。 +API 使用范例: 展示了如何通过 UserOpScenarioBuilder 简单调用即可获得符合 Bundler JSON-RPC 规范(Hex 编码)的 UserOp。 +2. 验证结果 +脚本运行结果显示,所有场景的 UserOp Hash 均已成功计算,且签名已由 Jason 的 Owner 私钥完成。输出的 JSON 格式已完全兼容 Alchemy Bundler 等后端的集成 + +### 5.4 l4-gasless.ts 测试场景 + +| # | 场景 | Paymaster | 预期 | +|---|------|-----------|------| +| 1 | AA有ETH,直接交易 | 无 | 成功,扣ETH | +| 2 | AA使用aPNTs | PaymasterV4(AAStar) | 成功,扣aPNTs | +| 3 | AA使用bPNTs | PaymasterV4(Bread) | 成功,扣bPNTs | +| 4 | AA使用cPNTs | SuperPM(Demo) | 成功,扣cPNTs,Anni aPNTs余额减少 | +| 5 | AA无cPNTs有信用 | SuperPM(Demo) | 成功,记录债务 | +| 6 | 信用耗尽 | SuperPM(Demo) | 失败,黑名单 | +| 7 | 充值cPNTs | - | 优先还债 | + +### 5.5 状态输出 (l4-state.json) + +```json +{ + "network": "sepolia", + "timestamp": "2026-01-06T20:30:00Z", + "operators": { + "jason": { "address": "0x...", "community": true, "token": "0x...", "paymasterV4": "0x..." }, + "bob": { "address": "0x...", "community": true, "token": "0x...", "paymasterV4": "0x..." }, + "anni": { "address": "0x...", "community": true, "token": "0x...", "superPM": { "balance": "50000" } } + }, + "aaAccounts": [ + { "label": "Jason_AA1", "address": "0x...", "eth": "0.02", "gToken": "1000", "registered": true } + ], + "readyForGaslessTest": true +} +``` + +--- + +## 6. L4-Setup SDK API 使用清单 + +### 6.1 API 覆盖率审查 + +`l4-setup.ts` 脚本已完全基于 SDK API 实现,无直接合约调用(`writeContract`)。 + +| 步骤 | 操作 | 使用的 SDK API | 文件位置 | 状态 | +|------|------|---------------|---------|------| +| **1. Community 注册** | 注册 ROLE_COMMUNITY | `CommunityClient.registerAsCommunity()` | `packages/community` | ✅ 完整 | +| **2. Token 部署** | 部署 xPNTs 社区代币 | `xPNTsFactoryActions.createToken()` | `packages/core/actions` | ✅ 完整 | +| **3. Paymaster V4 部署** | 部署并注册 Paymaster V4 + Owner 验证 | `PaymasterOperatorClient.deployAndRegisterPaymasterV4()` | `packages/operator` | ✅ 已增强验证 | +| **4. AA 账户部署** | 部署 SimpleAccount v0.7 | `accountFactoryActions.createAccount()` | `packages/core/actions` | ✅ 完整 | +| **5. Token Mint** | Mint Token 到指定地址 | `tokenActions().mint()` | `packages/core/actions` | ✅ 完整 | +| **6. Token Approve** | Approve Token 给 Spender | `tokenActions().approve()` | `packages/core/actions` | ✅ 完整 | +| **7. SuperPaymaster 充值** | 向 SuperPaymaster 充值 aPNTs | `superPaymasterActions().depositAPNTs()` | `packages/core/actions` | ✅ 完整 | +| **8. Paymaster Owner 验证** | 验证 Paymaster 初始化状态 | `publicClient.readContract()` + PaymasterABI | `scripts/l4-setup.ts` | ✅ 新增防御 | + +### 6.2 关键增强 + +#### 6.2.1 Paymaster Owner 验证 + +在 `PaymasterOperatorClient.deployAndRegisterPaymasterV4()` 中增加了 SDK 级别的 owner 验证: + +```typescript +// 部署完成后立即验证 owner +const actualOwner = await publicClient.readContract({ + address: paymasterAddress, + abi: PaymasterABI, + functionName: 'owner' +}); + +if (actualOwner !== expectedOwner) { + throw new Error( + `Critical: Paymaster owner mismatch!\n` + + ` Expected: ${expectedOwner}\n` + + ` Actual: ${actualOwner}\n` + + ` DO NOT USE THIS PAYMASTER!` + ); +} +``` + +**防御效果**: +- ✅ 阻止使用未正确初始化的 Paymaster +- ✅ 及时发现部署问题 +- ✅ 防止 owner 被抢跑(虽然 Factory 是原子操作,理论上不会发生) + +#### 6.2.2 Charlie 测试验证 + +通过新增 Charlie(第 4 个 operator)验证修复效果: + +``` +📝 Registering Community for Charlie (Test)... +🏭 Deploying dPNTs for Charlie (Test)... +⛽ Deploying Paymaster V4 for Charlie (Test)... +Deploying Paymaster v4.2... +🔍 Verifying Paymaster initialization... + ✅ Owner verified: 0x4F0b7d0EaD970f6573FEBaCFD0Cd1FaB3b64870D +``` + +**结果**: +- ✅ 使用纯 SDK API 部署 +- ✅ Owner 正确设置(Charlie 地址) +- ✅ 证明修复后的 API 不会出现 0x000 owner 问题 + +### 6.3 API 设计原则 + +1. **封装性**:所有链上操作通过 SDK Actions 封装,脚本层不直接调用合约 +2. **验证性**:关键操作后自动验证状态(如 owner、balance) +3. **容错性**:自动检查前置条件,避免重复部署 +4. **可观察性**:清晰的日志输出,便于调试 + +### 6.4 后续优化方向 + +1. **合约层防御**(长期): + - 在 `PaymasterFactory.sol` 中添加 owner 强制验证 + - 在 `Paymaster.sol` 的 `initialize` 中添加调用者权限控制 + +2. **SDK 层增强**(已完成): + - ✅ 部署后自动验证 owner + - ✅ 提供详细错误信息 + +3. **测试覆盖**: + - ✅ l4-setup.ts 覆盖所有操作流程 + - ⏳ 添加单元测试(针对每个 SDK API) + diff --git a/0.16.23/guide/docs/api_compliance_report.md b/0.16.23/guide/docs/api_compliance_report.md new file mode 100644 index 000000000..81d4cf3f1 --- /dev/null +++ b/0.16.23/guide/docs/api_compliance_report.md @@ -0,0 +1,65 @@ +# API Compliance Audit Report (v0.16.12) + +This report verifies 30 critical APIs across the 5 core packages of the AAStar SDK. + +## Summary +- **Verified Packages**: 5 +- **Verified APIs**: 30 +- **Status**: 🟢 100% Consistent + +--- + +## 1. @aastar/core (Primitives) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `registryActions` | Actions | 🟢 | Registry management & roles | +| `superPaymasterActions` | Actions | 🟢 | SuperPaymaster logic | +| `tokenActions` | Actions | 🟢 | ERC20 interactions | +| `validateAddress` | Validator | 🟢 | Input security | +| `CORE_ADDRESSES` | Constant | 🟢 | Canonical contract mapping | +| `EntryPointABI` | ABI | 🟢 | Standard EP encoding | + +## 2. @aastar/account (Identity) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `createSimpleAccount` | Factory | 🟢 | Quick smart account setup | +| `getAccountAddress` | Helper | 🟢 | Predicted address check | +| `signUserOperation` | Core | 🟢 | Secure message signing | +| `eoaToSmartAccount` | Bridge | 🟢 | Rainbow bridge transition | +| `getDummySignature` | Util | 🟢 | Gas simulation | +| `deployAccount` | Action | 🟢 | On-demand deployment | + +## 3. @aastar/paymaster (Sponsorship) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `PaymasterClient.getPMD` | Method | 🟢 | V4 paymasterAndData generation | +| `SuperPMClient.deposit` | Method | 🟢 | Sponsoring gas deposit | +| `Operator.deployPM` | Method | 🟢 | Delegated V4 deployment | +| `BundlerCompat` | Util | 🟢 | Standard RPC compatibility | +| `withdrawProtocolRevenue` | Admin | 🟢 | Earnings management | +| `encodePMD` | Helper | 🟢 | Bytecode payload formation | + +## 4. @aastar/tokens (Economics) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `deployxPNTsToken` | Action | 🟢 | Community token launch | +| `approveAndStake` | Client | 🟢 | One-step collateral setup | +| `getTokenomicsOverview` | Query | 🟢 | Protocol health stats | +| `predictDepositAmount` | Math | 🟢 | Stake projection | +| `getTokenAddress` | Query | 🟢 | Token registry lookup | +| `xPNTsTokenABI` | ABI | 🟢 | Token contract interaction | + +## 5. @aastar/sdk (Coordination) +| API | Type | Status | Use Case | +| :--- | :--- | :--- | :--- | +| `createOperatorClient` | Entry | 🟢 | **[REFINED]** Operator start point | +| `createEndUserClient` | Entry | 🟢 | End user entry point | +| `OperatorClient.stake` | Method | 🟢 | **[NEW]** Simplified staking | +| `OperatorClient.deposit` | Method | 🟢 | **[NEW]** Simplified deposit | +| `getOperatorStatus` | Report | 🟢 | Cross-package status view | +| `setup` | Automation | 🟢 | Dev environment bootstrap | + +--- +**Verification Date**: 2026-01-19 +**Tag**: v0.16.12 +**Engineer**: Antigravity diff --git a/0.16.23/guide/docs/old-solution.md b/0.16.23/guide/docs/old-solution.md new file mode 100644 index 000000000..a05e97a78 --- /dev/null +++ b/0.16.23/guide/docs/old-solution.md @@ -0,0 +1,1078 @@ + +A nodejs sdk for all developers to integrate AAStar's power abilities. + +AAStar npm packages collection: +You can use +``` +pnpm install @aastar/airaccount +@aastar/superpaymaster +@aastar/cometens +@aastar/openpnts +@aastar/opencards +@aastar/arcadia +@aastar/cos72 +``` +or +``` +pnpm install aastar +``` + +## For developers +Why do you install this package? +### airaccount +Provide a moveable\self-custody\crypto account with life cycle service. +Permissionless. +Trustless. +Decentralized. +In 3 steps: bind, send, claim, move(recover) + +### superpaymaster +Embbeded into AirAccount, but provide ERC20 gas token ability for any community individually. + +### cometens +Embbeded into AirAccount, but provide set your own ENS name for your community individually. + + +# 从零开始开发和发布 npm 包:完整指南 + +## 目录 + +1. [前期准备](#前期准备) +2. [初始化项目](#初始化项目) +3. [配置开发环境](#配置开发环境) +4. [开发 SDK](#开发-sdk) +5. [测试](#测试) +6. [构建和打包](#构建和打包) +7. [发布到 npm](#发布到-npm) +8. [文档和示例](#文档和示例) +9. [版本管理和更新](#版本管理和更新) +10. [持续集成和自动发布](#持续集成和自动发布) +11. [SDK 开发最佳实践](#sdk-开发最佳实践) +12. [问题排查](#问题排查) + +## 前期准备 + +### 1. 安装必要工具 + +```bash +# 安装 Node.js (推荐使用 nvm 管理 Node.js 版本) +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash +nvm install node # 安装最新版 +nvm install --lts # 或安装长期支持版 + +# 确认安装 +node --version +npm --version + +# 安装一些全局工具 +npm install -g typescript ts-node np +``` + +### 2. 创建 npm 账号 + +1. 访问 [npm 官网](https://www.npmjs.com/) 并注册 +2. 在命令行登录 npm (后续发布时需要) + +```bash +npm login +``` + +### 3. 规划你的 SDK + +在开始编码前,确定以下内容: + +- SDK 的目标和用途 +- 核心功能和 API 设计 +- 依赖关系 +- 支持的平台 (浏览器、Node.js、React Native 等) +- 命名规范 (包名必须唯一) +- 核心 API 结构 + +## 初始化项目 + +### 1. 创建项目目录 + +```bash +# 创建项目目录 (使用你希望的包名) +mkdir my-awesome-sdk +cd my-awesome-sdk +``` + +### 2. 初始化 npm 项目 + +```bash +npm init +``` + +按照提示填写信息: + +- `name`: 包名 (可以使用 `@组织名/包名` 格式) +- `version`: 版本号 (推荐从 0.1.0 开始) +- `description`: 简短描述 +- `main`: 入口文件 (通常是 `dist/index.js`) +- `scripts`: 构建脚本 +- `repository`: 代码仓库地址 +- `keywords`: 关键词,帮助用户发现你的包 +- `author`: 作者信息 +- `license`: 许可证 (如 MIT) + +### 3. 初始化 Git 仓库 + +```bash +git init +echo "node_modules\ndist\n.env\n*.log" > .gitignore +``` + +### 4. 创建基本目录结构 + +```bash +mkdir src tests examples docs +touch src/index.ts README.md LICENSE +``` + +## 配置开发环境 + +### 1. 配置 TypeScript + +```bash +# 安装 TypeScript +npm install typescript --save-dev + +# 初始化 TypeScript 配置 +npx tsc --init +``` + +编辑 `tsconfig.json`: + +```json +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["node_modules", "tests", "examples", "dist"] +} +``` + +### 2. 配置代码格式化和 Lint + +```bash +# 安装 ESLint 和 Prettier +npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier --save-dev + +# 创建 ESLint 配置 +``` + +创建 `.eslintrc.js`: + +```javascript +module.exports = { + parser: "@typescript-eslint/parser", + extends: [ + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + parserOptions: { + ecmaVersion: 2018, + sourceType: "module", + }, + rules: { + // 自定义规则 + }, +}; +``` + +创建 `.prettierrc`: + +```json +{ + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100, + "tabWidth": 2, + "semi": true +} +``` + +### 3. 配置测试环境 + +```bash +# 安装 Jest +npm install jest ts-jest @types/jest --save-dev +``` + +创建 `jest.config.js`: + +```javascript +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + testMatch: ["**/tests/**/*.test.ts"], + collectCoverage: true, + coverageDirectory: "coverage", + collectCoverageFrom: ["src/**/*.ts"], +}; +``` + +### 4. 更新 package.json 脚本 + +编辑 `package.json` 添加以下脚本: + +```json +"scripts": { + "build": "tsc", + "test": "jest", + "lint": "eslint 'src/**/*.ts'", + "format": "prettier --write 'src/**/*.ts'", + "prepare": "npm run build", + "prepublishOnly": "npm test && npm run lint", + "preversion": "npm run lint", + "version": "npm run format && git add -A src", + "postversion": "git push && git push --tags" +} +``` + +## 开发 SDK + +### 1. 创建基本结构 + +在 `src/index.ts` 创建 SDK 的入口点: + +```typescript +// 导出所有公共 API +export * from "./client"; +export * from "./types"; +// ... 其他导出 + +// 导出默认客户端 +import { Client } from "./client"; +export default Client; +``` + +### 2. 创建核心模块 + +例如,创建 `src/client.ts` 实现主要客户端类: + +```typescript +import { ApiResponse, ClientOptions } from "./types"; + +export class Client { + private apiKey: string; + private baseUrl: string; + + constructor(options: ClientOptions) { + this.apiKey = options.apiKey; + this.baseUrl = options.baseUrl || "https://api.example.com/v1"; + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + const url = `${this.baseUrl}/${endpoint}`; + + try { + const response = await fetch(url, { + method, + headers: { + "Content-Type": "application/json", + "Authorization": `Bearer ${this.apiKey}`, + }, + body: data ? JSON.stringify(data) : undefined, + }); + + const responseData = await response.json(); + + if (!response.ok) { + throw new Error(responseData.message || "API request failed"); + } + + return { + data: responseData, + status: response.status, + headers: response.headers, + }; + } catch (error) { + throw error; + } + } + + // 公共 API 方法 + async getUser(userId: string) { + return this.makeRequest(`users/${userId}`); + } + + // 更多 API 方法... +} +``` + +### 3. 定义类型 + +创建 `src/types.ts` 定义类型: + +```typescript +export interface ClientOptions { + apiKey: string; + baseUrl?: string; +} + +export interface ApiResponse { + data: T; + status: number; + headers: Headers; +} + +// 更多类型定义... +``` + +### 4. 使用模块化设计 + +将 SDK 拆分为多个模块,例如: + +``` +src/ + index.ts # 主入口 + client.ts # 核心客户端类 + types.ts # 类型定义 + modules/ + auth.ts # 认证相关功能 + users.ts # 用户相关功能 + products.ts # 产品相关功能 + utils/ + request.ts # 请求工具 + validation.ts # 验证工具 +``` + +## 测试 + +### 1. 编写单元测试 + +在 `tests` 目录中创建测试文件,例如 `tests/client.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 模拟 fetch API +global.fetch = jest.fn(); + +describe("Client", () => { + let client: Client; + + beforeEach(() => { + client = new Client({ apiKey: "test-api-key" }); + (global.fetch as jest.Mock).mockClear(); + }); + + test("makeRequest should call fetch with correct parameters", async () => { + (global.fetch as jest.Mock).mockResolvedValueOnce({ + ok: true, + status: 200, + json: async () => ({ id: "123", name: "Test User" }), + headers: new Headers(), + }); + + const result = await client.makeRequest("users/123"); + + expect(global.fetch).toHaveBeenCalledWith( + "https://api.example.com/v1/users/123", + expect.objectContaining({ + method: "GET", + headers: expect.objectContaining({ + "Authorization": "Bearer test-api-key", + }), + }), + ); + + expect(result.data).toEqual({ id: "123", name: "Test User" }); + }); + + // 更多测试... +}); +``` + +### 2. 运行测试 + +```bash +npm test +``` + +### 3. 编写集成测试 + +创建与真实 API 交互的集成测试,例如 `tests/integration.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 这些测试需要一个有效的 API 密钥 +// 通常通过环境变量提供 +const apiKey = process.env.API_KEY; + +// 只在提供 API 密钥时运行集成测试 +(apiKey ? describe : describe.skip)("Integration tests", () => { + let client: Client; + + beforeAll(() => { + client = new Client({ apiKey }); + }); + + test("can get a user", async () => { + const result = await client.getUser("test-user-id"); + expect(result.status).toBe(200); + expect(result.data).toHaveProperty("id"); + }); + + // 更多集成测试... +}); +``` + +## 构建和打包 + +### 1. 配置 npm 包文件 + +编辑 `package.json` 指定要包含的文件: + +```json +{ + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "LICENSE", + "README.md" + ] +} +``` + +### 2. 支持不同的模块格式 (可选) + +如果你想同时支持 CommonJS 和 ES 模块,可以使用 `rollup` 或 `tsup` 等工具。 + +使用 `tsup` 示例: + +```bash +# 安装 tsup +npm install tsup --save-dev +``` + +更新 `package.json`: + +```json +{ + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } + }, + "scripts": { + "build": "tsup src/index.ts --format cjs,esm --dts --clean" + } +} +``` + +## 发布到 npm + +### 1. 准备发布 + +确保你的包名是唯一的,并已登录 npm。如果使用组织名称,确保已创建组织。 + +```bash +# 检查是否登录 +npm whoami + +# 如果未登录 +npm login +``` + +### 2. 测试包 + +在发布前,使用 `npm pack` 创建一个本地包进行测试: + +```bash +npm pack +``` + +这将创建一个 `.tgz` 文件,可以在另一个项目中使用它进行测试: + +```bash +# 在测试项目中 +npm install ../path/to/your-package-1.0.0.tgz +``` + +### 3. 发布包 + +```bash +# 首次发布 +npm publish + +# 如果是组织包并想设为公共 +npm publish --access public +``` + +### 4. 更新包 + +修改 `package.json` 中的版本号或使用 `npm version` 命令: + +```bash +# 更新补丁版本 (1.0.0 -> 1.0.1) +npm version patch + +# 更新小版本 (1.0.0 -> 1.1.0) +npm version minor + +# 更新大版本 (1.0.0 -> 2.0.0) +npm version major +``` + +然后发布更新: + +```bash +npm publish +``` + +## 文档和示例 + +### 1. 编写 README + +一个好的 README 应包含: + +- 项目描述 +- 安装指南 +- 基本用法示例 +- API 文档链接 +- 配置选项 +- 常见问题 + +示例 README 结构: + +````markdown +# My Awesome SDK + +A JavaScript/TypeScript SDK for interacting with the Example API. + +## Installation + +```bash +npm install my-awesome-sdk +``` +```` + +## Quick Start + +```javascript +import Client from "my-awesome-sdk"; + +const client = new Client({ apiKey: "your-api-key" }); + +// Get a user +client.getUser("user123") + .then((response) => console.log(response.data)) + .catch((error) => console.error(error)); +``` + +## Documentation + +For full documentation, visit [docs.example.com](https://docs.example.com). + +## Configuration + +The client accepts the following options: + +| Option | Type | Required | Default | Description | +| ------- | ------ | -------- | -------------------------- | ---------------- | +| apiKey | string | Yes | - | Your API key | +| baseUrl | string | No | https://api.example.com/v1 | The API base URL | + +## License + +MIT + +```` +### 2. 示例代码 + +在 `examples` 目录中创建示例代码: + +```typescript +// examples/basic-usage.ts +import Client from '../src'; + +async function main() { + const client = new Client({ apiKey: 'your-api-key' }); + + try { + const user = await client.getUser('user123'); + console.log('User:', user.data); + + // More examples... + } catch (error) { + console.error('Error:', error); + } +} + +main(); +```` + +### 3. 生成 API 文档 + +可以使用 TypeDoc 生成 API 文档: + +```bash +npm install typedoc --save-dev +``` + +添加 `package.json` 脚本: + +```json +"scripts": { + "docs": "typedoc --out docs src/index.ts" +} +``` + +## 版本管理和更新 + +### 1. 遵循语义化版本规范 + +- **补丁版本**(1.0.x):修复 bug,小改进 +- **小版本**(1.x.0):添加向后兼容的新功能 +- **大版本**(x.0.0):不向后兼容的变更 + +### 2. 维护更新日志 + +创建 `CHANGELOG.md` 并记录每个版本的变更: + +```markdown +# Changelog + +## [1.1.0] - 2023-05-01 + +### Added + +- New feature X +- Support for Y + +### Changed + +- Improved error handling +- Better performance for Z + +### Fixed + +- Bug in getUser method + +## [1.0.0] - 2023-04-01 + +Initial release +``` + +## 持续集成和自动发布 + +### 1. 设置 GitHub Actions + +创建 `.github/workflows/ci.yml`: + +```yaml +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: npm test + - run: npm run lint +``` + +### 2. 设置自动发布 + +创建 `.github/workflows/publish.yml`: + +```yaml +name: Publish + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run build + - run: npm test + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +在 GitHub 仓库设置中,添加 `NPM_TOKEN` 秘密。 + +## SDK 开发最佳实践 + +### 1. API 设计原则 + +- **简单直观**:API 应该易于理解和使用 +- **一致性**:保持命名和模式一致 +- **错误处理**:提供清晰的错误信息和类型 +- **文档完善**:每个公共方法都应有文档 +- **链式调用**:考虑支持方法链接 + +### 2. 错误处理 + +创建自定义错误类: + +```typescript +// src/errors.ts +export class ApiError extends Error { + statusCode: number; + data: any; + + constructor(message: string, statusCode: number, data?: any) { + super(message); + this.name = "ApiError"; + this.statusCode = statusCode; + this.data = data; + Object.setPrototypeOf(this, ApiError.prototype); + } +} + +export class ValidationError extends Error { + errors: any[]; + + constructor(message: string, errors: any[]) { + super(message); + this.name = "ValidationError"; + this.errors = errors; + Object.setPrototypeOf(this, ValidationError.prototype); + } +} +``` + +### 3. 浏览器兼容性 + +如果 SDK 需要在浏览器中运行,考虑: + +- 使用 `fetch` 时提供兼容性封装 +- 考虑使用 `axios` 等库处理请求 +- 使用 polyfills 确保兼容性 + +### 4. 安全性 + +- 不要在客户端代码中存储敏感信息 +- 使用 HTTPS +- 避免将敏感信息记录到控制台 +- 提供 API 令牌轮换机制 + +## 问题排查 + +### 1. 常见问题 + +- **包名冲突**:在 npm 上查找是否已存在同名包 +- **构建错误**:检查 TypeScript 配置和依赖 +- **发布失败**:确保已登录 npm 并有权限发布 + +### 2. 调试技巧 + +```typescript +// 添加调试配置 +export class Client { + private debug: boolean; + + constructor(options: ClientOptions) { + this.debug = options.debug || false; + // ... + } + + private log(...args: any[]) { + if (this.debug) { + console.log("[SDK]", ...args); + } + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + this.log("Request:", method, endpoint, data); + + // ...请求逻辑... + + this.log("Response:", responseData); + return response; + } +} +``` + +### 3. 提供用户支持 + +- 在 GitHub 上设置 Issues 模板 +- 提供常见问题和解决方案 +- 考虑设置讨论区或社区渠道 + +# NPM包组织 + +您想要建立一个名为"aastar"的NPM组织,其中包含多个子包,既可以单独安装也可以整体安装。这是一个非常好的组织方式,类似于许多流行的库如Next.js、Ant +Design等采用的结构。 + +要实现这样的结构,您需要采用"Monorepo"(单体仓库)架构,以下是详细的规划和实现步骤: + +## 1. 创建Monorepo项目结构 + +首先,建立基本的项目结构: + +``` +aastar/ +├── packages/ +│ ├── airaccount/ # 子包1 +│ ├── superpaymaster/ # 子包2 +│ └── ... # 其他子包 +├── package.json # 根项目配置 +├── pnpm-workspace.yaml # 工作区配置 +├── lerna.json # (可选)Lerna配置 +└── tsconfig.json # 基础TypeScript配置 +``` + +## 2. 配置工作区 + +在根目录创建`pnpm-workspace.yaml`文件: + +```yaml +packages: + - 'packages/*' +``` + +## 3. 配置每个子包 + +在每个子包目录中创建`package.json`,例如`packages/airaccount/package.json`: + +```json +{ + "name": "@aastar/airaccount", + "version": "0.1.0", + "description": "AIR账户管理模块", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "jest" + }, + "dependencies": { + // 此包的依赖 + }, + "peerDependencies": { + // 可选的同级依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +## 4. 创建主包作为入口点 + +在`packages`目录下创建一个集合包,例如`packages/aastar/package.json`: + +```json +{ + "name": "aastar", + "version": "0.1.0", + "description": "AASTAR SDK全集合", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "dependencies": { + "@aastar/airaccount": "workspace:*", + "@aastar/superpaymaster": "workspace:*" + // 添加其他所有子包作为依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +然后创建相应的入口文件`packages/aastar/src/index.ts`,导出所有子包: + +```typescript +export * from "@aastar/airaccount"; +export * from "@aastar/superpaymaster"; +// 导出其他所有子包 +``` + +## 5. 使用工具管理版本和发布 + +您可以使用以下工具之一来管理版本和发布: + +### 选项1: 使用pnpm + changesets + +1. 安装changesets: + +```bash +pnpm add -D -w @changesets/cli +pnpm changeset init +``` + +2. 配置发布脚本:在根目录的`package.json`中添加: + +```json +{ + "scripts": { + "build": "pnpm -r build", + "version": "changeset version", + "publish": "pnpm build && changeset publish" + } +} +``` + +### 选项2: 使用Lerna + +1. 安装Lerna: + +```bash +pnpm add -D -w lerna +``` + +2. 创建`lerna.json`: + +```json +{ + "version": "independent", + "npmClient": "pnpm", + "useWorkspaces": true, + "command": { + "publish": { + "ignoreChanges": ["*.md"], + "message": "chore(release): publish" + } + } +} +``` + +## 6. 处理包之间的依赖关系 + +如果子包之间有依赖关系,在依赖包的`package.json`中添加: + +```json +{ + "dependencies": { + "@aastar/some-dependency": "workspace:*" + } +} +``` + +## 7. 统一配置和构建 + +创建一个根目录的`tsconfig.json`作为基础配置: + +```json +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "node", + "declaration": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + } +} +``` + +然后,每个子包可以扩展此配置: + +```json +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"] +} +``` + +## 8. 发布流程 + +1. 创建npm组织: + - 在npm网站上注册`aastar`组织 + +2. 发布所有包: + +```bash +# 使用changesets +pnpm changeset +pnpm version +pnpm publish + +# 或使用Lerna +pnpm lerna publish +``` + +## 使用示例 + +用户可以按您希望的方式安装和使用SDK: + +```bash +# 安装单个包 +pnpm install @aastar/airaccount @aastar/superpaymaster + +# 或安装全部功能 +pnpm install aastar +``` + +使用示例: + +```javascript +// 单个包使用方式 +import { someFunction } from "@aastar/airaccount"; + +// 全部功能使用方式 +import { airaccount, superpaymaster } from "aastar"; +``` + +这种结构的主要优点是: + +1. 用户可以根据需求选择安装单个包或全部功能 +2. 包之间可以共享代码,但又保持独立发布 +3. 可以统一管理版本,简化发布流程 +4. 便于维护和扩展 + +您对这种结构有什么特别的需求或问题吗? diff --git a/0.16.23/guide/docs/paper-data-collection.md b/0.16.23/guide/docs/paper-data-collection.md new file mode 100644 index 000000000..d9c29a8ad --- /dev/null +++ b/0.16.23/guide/docs/paper-data-collection.md @@ -0,0 +1,69 @@ +# 論文數據採集指南 (PhD Data Collection Guide) + +本文檔為 AAStar 系統論文中的數據採集提供標準化指南。所有實驗數據必須通過 `aastar-sdk` 獲取,以確保真實性與可重複性。 + +## 1. 實驗設置 (Environmental Setup) + +### 網絡環境 +- **Local**: 使用 `anvil` 進行基準測試(無網絡延遲)。 +- **Testnet**: 使用 `Sepolia` 進行公鏈環境驗證。 +- **L2**: 使用 `Optimism` (或 OP Sepolia) 進行低 Gas 性能測試。 + +### 賬戶準備 +確保 `.env.v3` 中配置了以下地址: +- `TEST_SIMPLE_ACCOUNT_A`: 標準 AA 賬戶。 +- `TEST_SIMPLE_ACCOUNT_B`: AOA (V4) 實驗賬戶。 +- `TEST_SIMPLE_ACCOUNT_C`: SuperPaymaster 實驗賬戶。 + +--- + +## 2. 核心指標 (Key Metrics) + +實驗腳本會自動採集以下維度: + +| 指標 | 英文名稱 | 採集方式 | +| :--- | :--- | :--- | +| **Gas 消耗** | Gas Usage | `receipt.gasUsed` | +| **延遲** | Latency | `Date.now() - start` (毫秒) | +| **交易成本** | Tx Cost | `gasUsed * effectiveGasPrice` | +| **吞吐量** | Throughput | 批量運行時的 `count / total_time` | + +--- + +## 3. 自動化運行 (Automation) + +直接使用統一腳本運行: + +```bash +# 運行所有配置的網絡(推薦) +./scripts/run_automated_experiment.sh all + +# 僅運行本地測試 +./scripts/run_automated_experiment.sh local + +# 僅運行 Sepolia 測試 +./scripts/run_automated_experiment.sh sepolia +``` + +## 4. 數據導出與處理 + +數據會自動保存至 `sdk_experiment_data.csv`。 + +**建議流程**: +1. 每個場景運行 30 次 (`EXPERIMENT_RUNS=30`) 以獲取統計顯著性。 +2. 使用 `pandas` 或 `Excel` 計算均值 (Mean) 與標準差 (Std Dev)。 +3. 使用 `scripts/collect_industry_baseline.ts` 獲取對比組(EOA, Pimlico)數據。 + +--- + +## 5. 常規檢查清單 + +- [ ] RPC 節點是否連通。 +- [ ] 實驗賬戶是否有足夠的 Gas 餘額 (或代幣)。 +- [ ] `PRIVATE_KEY_JASON` 是否已在本地導出。 +- [ ] 是否已清理舊的 CSV 數據。 + +--- + +> [!IMPORTANT] +> **嚴禁**手動修改 CSV 數據。所有偏差應在論文的 "Limitations" 或 "Discussion" 章節中說明。 diff --git a/0.16.23/guide/docs/release_plan_v0.16.12.md b/0.16.23/guide/docs/release_plan_v0.16.12.md new file mode 100644 index 000000000..d5530194d --- /dev/null +++ b/0.16.23/guide/docs/release_plan_v0.16.12.md @@ -0,0 +1,49 @@ +# Release Plan v0.16.12: NPM Publishing Fixes + +## 1. Overview +This plan addresses the issues encountered during the v0.16.11 release, specifically the accidental publishing of the root repository files and the inclusion of unnecessary development files (tests, `node_modules`) in certain packages. + +## 2. Package Structure & Strategy + +We follow a **Monorepo** structure where: +1. **Root (`@aastar/monorepo`)**: The development workspace. **PRIVATE**. Never published. +2. **Umbrella (`@aastar/sdk`)**: The main entry point for users. Installs all other packages as dependencies. +3. **Modules (`@aastar/core`, etc.)**: Individual functional units. Can be installed separately if needed. + +### Why this strategy? +- **Developer Experience**: Users only need to install `@aastar/sdk` to get everything. +- **Modularity**: Advanced users can pick and choose (e.g., only `@aastar/paymaster`). +- **Efficiency**: Shared logic (like `@aastar/core`) is reused without duplication. + +## 3. Current Issues & Proposed Fixes + +| Package | Status | Issue | Proposed Fix | +| :--- | :--- | :--- | :--- | +| **ROOT** | ❌ **CRITICAL** | Named `@aastar/sdk`, `private: false`. Publishes entire repo! | Rename to `@aastar/monorepo`, set `private: true`. | +| `@aastar/sdk` | ✅ OK | Correctly configured as public umbrella. | No change (ensure `files: ["dist"]`). | +| `@aastar/core` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/tokens` | ✅ OK | Correctly whitelist `dist`. | Fix `tsconfig` to prevent deep nesting (optional polish). | +| `@aastar/community` | ❌ Bloated | Missing `files` whitelist. Publishes src/tests. | Add `"files": ["dist"]`. | +| `@aastar/operator` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/analytics` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/enduser` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/paymaster` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/account` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/dapp` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/identity` | ✅ OK | Correctly whitelist `dist`. | No change. | + +## 4. Execution Plan + +1. **Root Fix**: Rename `package.json` -> `@aastar/monorepo`, `private: true`. +2. **Cleanup**: Add `"files": ["dist"]` to `community`, `operator`, `analytics`, `enduser` package.jsons. +3. **Version Bump**: Update all packages to `0.16.12` using `update-version.sh`. +4. **Verify**: Dry-run publish or inspect tarball content. +5. **Publish**: execute `pnpm publish -r --no-git-checks --access public`. + +## 5. Benefits +- **Fixes "Root Publish"**: Prevents the root folder (with all scripts and config) from overwriting `@aastar/sdk` on NPM. +- **Small Install Size**: Users only download compiled JS/DTS files, not your tests or source code. +- **Professional**: Clean packages without `node_modules` or `.test.ts` garbage. + +## 6. User Action +Please review and confirm this plan. Upon approval, I will apply the fixes and perform the formatting. diff --git a/0.16.23/guide/docs/technical_plan.md b/0.16.23/guide/docs/technical_plan.md new file mode 100644 index 000000000..96a0104c9 --- /dev/null +++ b/0.16.23/guide/docs/technical_plan.md @@ -0,0 +1,510 @@ +# Technical Plan: SuperPaymaster & AAStar SDK Experiment + +Based on the analysis of `projects/SuperPaymaster/scripts/gasless-test/test-gasless-viem-v2-final.js`, here is the detailed technical plan for implementing the SDK and the 3-category account experiment. + +## 1. Paymaster Data Structure (SuperPaymaster V3/V4) +Unlike generic Paymasters, SuperPaymaster V3 uses a specific packed format for `paymasterAndData` to optimize for gas and community attribution. + +**Format (72 bytes):** +1. **Paymaster Address** (20 bytes) +2. **Verification Gas Limit** (16 bytes, uint128) - Default 160k (Safe buffer over 120k actual) +3. **PostOp Gas Limit** (16 bytes, uint128) - Default 10k +4. **Operator Address** (20 bytes) - *The Community Node sponsoring the tx* + +**Verification Logic:** +* **On-chain**: Checks if `sender` holds `MySBT` (Soulbound Token) and has sufficient `xPNTs` (Gas Token) balance. +* **Off-chain**: No HTTP signature required. Purely asset-based validation. + +## 2. Experiment Groups & Setup + +### Group A: Traditional EOA (Baseline) +* **Identity**: `PRIVATE_KEY` (Account A) from `.env`. +* **Mechanism**: Standard `eth_sendTransaction`. +* **Setup**: Needs ETH for gas. + +### Group B: Standard AA (Control) +* **Identity**: `OWNER_PRIVATE_KEY` (Account B) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp. +* **Paymaster**: Third-party Provider (e.g., Alchemy Gas Manager) or Bundler's native paymaster. +* **Setup**: Needs a Policy ID or Paymaster RPC URL. + +### Group C: SuperPaymaster AA (Treatment) +* **Identity**: `OWNER2_PRIVATE_KEY` (Account C) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp with `SuperPaymaster`. +* **Setup (Pre-requisites)**: + 1. **Mint MySBT**: Account must own a generic or community-specific SBT. + 2. **Token Balance**: Account must hold enough `xPNTs` (or `GTOKEN`) to cover the "Gas Credit". +* **Flow**: + 1. SDK constructs `paymasterAndData` with `OPERATOR` address. + 2. SDK Estimates gas (Optimized: Verification 160k, PostOp 10k). + 3. SDK Signs & Submits. + +## 3. Implementation Roadmap + +### Phase 1: SDK Update (`packages/superpaymaster`) +* **Completed**: Implemented `getPaymasterMiddleware` taking `operatorAddress`. +* **Completed**: Implemented V3 Packing Logic (`concat([pm, verGas, postOpGas, op])`). +* **Completed**: Implemented `checkEligibility` helper. + +### Phase 2: Experiment Script (`run_experiment_data.ts`) +* **Initialization**: Load Keys from `.env` (using global `@env/.env`). +* **Pre-Flight Check**: + * Check Group C eligibility. + * **Auto-Mint**: Logic inspired by `mint-sbt-for-aa.js`. +* **Execution Loop (30 Runs)**: + * **Group A**: `walletClient.sendTransaction`. + * **Group B**: `smartAccountClient.sendUserOperation` (using Alchemy Provider). + * **Group C**: `smartAccountClient.sendUserOperation` (using SuperPaymaster Middleware). +* **Data Recording**: Capture `receipt.gasUsed`, `effectiveGasPrice`. + +## 4. Key Configuration (from `.env`) +```bash +# Identities +PRIVATE_KEY=... # EOA / Deployer +OWNER_PRIVATE_KEY=... # Standard AA Owner +OWNER2_PRIVATE_KEY=...# SuperPaymaster AA Owner + +# Contracts (Sepolia) +SUPER_PAYMASTER_ADDRESS=0x34671Bf95159bbDAb12Ac1DA8dbdfEc5D5dC1c24 +MYSBT_ADDRESS=0xD1e6BDfb907EacD26FF69a40BBFF9278b1E7Cf5C +GAS_TOKEN_ADDRESS=0xfb56CB85C9a214328789D3C92a496d6AA185e3d3 +OPERATOR_ADDRESS=0x411BD567E46C0781248dbB6a9211891C032885e5 +``` + +## 5. Account Preparation Strategy + +| Group | Identity (Key) | Mechanism | Preparation & Requirements | Transaction Execution | +| :--- | :--- | :--- | :--- | :--- | +| **A: Traditional EOA** | `PRIVATE_KEY` | `eth_sendTx` | **Needs ETH**: Transfer Sepolia ETH from Faucet or Deployer. | `walletClient.sendTransaction` | +| **B: Standard AA** | `OWNER_PRIVATE_KEY` | ERC-4337 | **Needs ETH/Paymaster**: Needs ETH (if self-pay) or Paymaster Policy (if sponsored). | `smartAccountClient.sendUserOperation` (Generic) | +| **C: SuperPaymaster** | `OWNER2_PRIVATE_KEY` | ERC-4337 | **Needs MySBT + xPNTs**:
1. **Mint SBT**: Must own a Soulbound Token.
2. **Fund xPNTs**: Must have gas token balance.
*SDK `checkEligibility` verifies this.* | `smartAccountClient.sendUserOperation`
(with `getPaymasterMiddleware`) | + + + +## Inite Test Account and Asset/Data + +•开发环境: Node.js, npm/yarn。 +•基础包: 安装 @account-abstraction/sdk (或选择其他 SDK)。 +•私钥: 一个用于充当智能合约账户 拥有者 (Owner) 的 EOA 钱包私钥。 +•Sepolia ETH: 确保您的 EOA 拥有者地址和/或预计算的智能账户地址中有足够的 Sepolia ETH (除非您使用 Paymaster 赞助 Gas 费)。 +•SimpleAccountFactory: 0x9406Cc6185a346906296840746125a0e44976454 + + +import { SimpleAccountAPI } from "@account-abstraction/sdk"; +import { Wallet, providers } from "ethers";// 1. 配置 const OWNER_KEY = "YOUR_EOA_PRIVATE_KEY"; // 您的 EOA 私钥 const RPC_URL = "YOUR_SEPOLIA_BUNDLER_RPC_URL"; // 最好使用 Bundler 提供的 RPC const ENTRYPOINT_ADDRESS = "0x5FF137D4B0FDCD49DcA30c7CF57E578a026d2789"; const FACTORY_ADDRESS = "0x9406Cc6185a346906296840746125a0e44976454";// 2. 初始化 const provider = new providers.JsonRpcProvider(RPC_URL); const owner = new Wallet(OWNER_KEY, provider);const accountApi = new SimpleAccountAPI({ provider, entryPointAddress: ENTRYPOINT_ADDRESS, owner, factoryAddress: FACTORY_ADDRESS, });// 3. 预计算地址 (可选) const accountAddress = await accountApi.getCounterFactualAddress(); console.log(Smart Account Address: ${accountAddress});// 4. 发送首笔交易 (如果账户未部署,将自动部署) async function sendFirstUserOp() { // 构造 UserOperation 的交易部分 (例如: 发送 0.01 ETH 给自己) const tx = { target: accountAddress, // 目标地址 data: "0x", // 交易数据 value: providers.utils.parseEther("0.01"), // 交易金额 }; + 创建 UserOperation const userOp = await accountApi.createSignedUserOp(tx);// 提交给 Bundler const userOpHash = await provider.send( "eth_sendUserOperation", [userOp, ENTRYPOINT_ADDRESS] );console.log(UserOperation Hash: ${userOpHash}); // 随后可以使用 eth_getUserOperationReceipt 等方法追踪状态 }sendFirstUserOp(); + + 要实现真正的 Gasless (无 Gas 费) 创建和交易,您需要在初始化 SimpleAccountAPI 或构造 UserOperation 时加入 Paymaster 参数。大多数 SDK 都提供了 Paymaster 的集成选项,您只需将 Bundler RPC 切换为支持 Paymaster 的服务商(例如 Alchemy、Stackup、Pimlico)的端点即可实现 Gas 赞助。 + +基于Viem实现生成测试账户: +```javascript +import { createPublicClient, http, encodeFunctionData, getContractAddress, concat, numberToHex, zeroAddress } from 'viem' +import { sepolia } from 'viem/chains' + +// 1. 配置常量 (使用 v0.6 版本) +const FACTORY_ADDRESS = '0x9406Cc6185a346906296840746125a0e44976454'; // 你提供的 v0.6 Factory +const ENTRY_POINT_ADDRESS = '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'; + +// 你的 EOA 私钥对应的公钥地址 (作为新 AA 账户的 owner) +const OWNER_ADDRESS = '0xYourEOAWalletAddressHere...'; +const SALT = 0n; // 盐值,改变它可以生成不同的地址 + +// SimpleAccountFactory 的 ABI 片段 +const factoryAbi = [ + { + inputs: [ + { name: "owner", type: "address" }, + { name: "salt", type: "uint256" } + ], + name: "createAccount", + outputs: [{ name: "ret", type: "address" }], + stateMutability: "nonpayable", + type: "function" + } +] as const; + +async function main() { + const client = createPublicClient({ + chain: sepolia, + transport: http(), // 默认使用公共节点,建议替换为 Alchemy/Infura + }); + + console.log("--- 生成 ERC-4337 v0.6 SimpleAccount ---"); + + // 2. 生成 initCode + // initCode = Factory地址 + 编码后的函数调用数据 + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [OWNER_ADDRESS, SALT] + }); + + const initCode = concat([FACTORY_ADDRESS, factoryData]); + console.log(`InitCode: ${initCode}`); + + // 3. 预计算 Counterfactual Address (未部署也能知道地址) + // SimpleAccountFactory 使用 CREATE2。 + // 注意:手动计算 CREATE2 比较麻烦,需要知道 Factory 内部具体的 Bytecode 逻辑。 + // 更简单的方法是使用 client.readContract 模拟调用,或者利用 EntryPoint 的 getSenderAddress 报错机制。 + + // 这里演示最简单的:通过 EntryPoint 的 getSenderAddress 方法获取 + // 这种方法虽然看起来像是在“报错”,但这是 ERC-4337 标准获取地址的方式 + try { + const entryPointAbi = [{ + inputs: [{ name: "initCode", type: "bytes" }], + name: "getSenderAddress", + outputs: [], + stateMutability: "nonpayable", // 注意这里通常是 revert + type: "function" + }] as const; + + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: entryPointAbi, + functionName: 'getSenderAddress', + args: [initCode], + }); + } catch (error: any) { + // EntryPoint 会 revert 并携带 SenderAddress + // 我们需要解析这个 revert error + const senderAddress = extractAddressFromError(error); + if (senderAddress) { + console.log(`\n🎉 你的 AA 钱包地址是: ${senderAddress}`); + console.log(`你可以往这个地址转入 Sepolia ETH,然后在第一笔 UserOp 中带上 initCode 即可自动部署。`); + } else { + console.error("无法解析地址,请检查 RPC 节点是否支持 debug", error); + } + } +} + +// 辅助函数:从 Revert Error 中提取地址 +// 不同 RPC 返回的错误格式可能不同,这里是通用逻辑 +function extractAddressFromError(error: any): string | null { + const message = error.details || error.message || ""; + // 匹配 0x 开头的 40 位 hex 字符串 + const match = message.match(/0x[a-fA-F0-9]{40}/); + // 或者专门解析 SenderAddressResult 错误 (0xe90b7b15) + return match ? match[0] : null; +} + +main(); +``` + + + +```javascript +import { + createPublicClient, + http, + encodeFunctionData, + concat, + Hex, + pad, + keccak256, + toBytes, + encodeAbiParameters, + parseAbiParameters, + createWalletClient +} from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { sepolia } from 'viem/chains' + +// --- 1. 配置常量 (v0.7 标准) --- +// 官方 EntryPoint v0.7 +const ENTRY_POINT_ADDRESS = '0x0000000071727De22E5E9d8BAf0edAc6f37da032'; +// 官方 SimpleAccountFactory v0.7 +const FACTORY_ADDRESS = '0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985'; + +// 替换为你的 Bundler RPC (这里必须是 Bundler 节点,不能是普通节点) +// 可以在 Pimlico 或 Alchemy 申请免费的测试网 Key +const BUNDLER_RPC = 'https://api.pimlico.io/v2/sepolia/rpc?apikey=YOUR_API_KEY'; + +// 你的 EOA 私钥 (Owner) +const PRIVATE_KEY = '0xYOUR_PRIVATE_KEY_HERE'; + +const account = privateKeyToAccount(PRIVATE_KEY as Hex); + +// --- ABIs --- +const factoryAbi = [ + { inputs: [{ name: "owner", type: "address" }, { name: "salt", type: "uint256" }], name: "createAccount", outputs: [{ name: "ret", type: "address" }],stateMutability: "nonpayable", type: "function" } +] as const; + +const accountAbi = [ + { inputs: [{ name: "dest", type: "address" }, { name: "value", type: "uint256" }, { name: "func", type: "bytes" }], name: "execute", outputs: [], stateMutability: "nonpayable", type: "function" } +] as const; + +async function main() { + console.log("🚀 开始构建 UserOp (v0.7)..."); + + // 初始化 Bundler Client (本质上就是一个特定 RPC 的 PublicClient) + const client = createPublicClient({ + chain: sepolia, + transport: http(BUNDLER_RPC) + }); + + // 1. 计算 Sender 地址 (AA 钱包地址) + // v0.7 Factory 使用 createAccount(owner, salt) + const salt = 0n; + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [account.address, salt] + }); + // 如果是第一次使用,需要提供 factory + factoryData;如果已部署,则为空 + // 这里为了演示,假设是第一次,始终携带 initCode + const initCode = concat([FACTORY_ADDRESS, factoryData]); + + // 利用 EntryPoint 的 getSenderAddress 获取地址 (会 Revert) + let senderAddress: Hex; + try { + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "initCode", type: "bytes" }], name: "getSenderAddress", outputs: [], stateMutability: "nonpayable", type: "function" }] as const, + functionName: 'getSenderAddress', + args: [initCode] + }); + senderAddress = "0x" // 理论上不会走到这里 + } catch (err: any) { + // 解析 Revert Error 获取地址 + const msg = err.details || err.message; + const match = msg.match(/0x[a-fA-F0-9]{40}/); + if (!match) throw new Error("无法获取 Sender 地址"); + senderAddress = match[0]; + } + console.log(`📝 AA 钱包地址: ${senderAddress}`); + + // ⚠️ 检查:你的 AA 钱包里必须有 ETH 支付 Gas + const balance = await client.getBalance({ address: senderAddress }); + console.log(`💰 当前余额: ${balance.toString()} wei`); + if (balance === 0n) { + console.error("❌ 余额不足!请先往 AA 地址转入 Sepolia ETH"); + return; + } + + // 2. 构建 CallData (你想让 AA 做什么) + // 例子:给自己转 0 ETH (或者转给其他人) + const callData = encodeFunctionData({ + abi: accountAbi, + functionName: 'execute', + args: [account.address, 0n, "0x"] // 目标地址,金额,数据 + }); + + // 3. 获取 Nonce + // v0.7 中 Nonce 是一个 uint256,高 192 位是 Key,低 64 位是 Sequence + // 这里使用简单版:读取 EntryPoint 的 getNonce + const nonce = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "sender", type: "address" }, { name: "key", type: "uint192" }], name: "getNonce", outputs: [{ name: "nonce", type: "uint256" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getNonce', + args: [senderAddress, 0n] + }); + + // 4. 组装部分 PackedUserOp + // 注意:Gas 限制通常通过 eth_estimateUserOperationGas 获取 + // 这里我们先填一些占位符,然后请求 Bundler 估算 + const partialUserOp = { + sender: senderAddress, + nonce: nonce, + initCode: nonce === 0n ? initCode : "0x", // 只有第一次交易需要 initCode + callData: callData, + accountGasLimits: "0x", // 稍后填 + preVerificationGas: 0n, // 稍后填 + gasFees: "0x", // 稍后填 + paymasterAndData: "0x", // 自己付钱,无 Paymaster + signature: "0x" // 稍后签名 + }; + + // 5. 请求 Bundler 估算 Gas + // 注意:不同 Bundler 的返回值格式可能略有不同,这里使用标准 JSON-RPC 格式 + // Viem 的 request 方法可以直接发原始 RPC + const gasEstimate: any = await client.request({ + method: 'eth_estimateUserOperationGas' as any, + params: [ + { + ...partialUserOp, + initCode: partialUserOp.initCode, + callData: partialUserOp.callData, + paymasterAndData: "0x", + signature: "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c" // 假签名用于估算 + }, + ENTRY_POINT_ADDRESS + ] + }); + + // 提取 Gas 参数 (v0.7 采用了 packed 格式) + // verificationGasLimit (16 bytes) | callGasLimit (16 bytes) + const verificationGasLimit = BigInt(gasEstimate.verificationGasLimit ?? gasEstimate.verificationGas ?? 100000n); + const callGasLimit = BigInt(gasEstimate.callGasLimit ?? 100000n); + const accountGasLimits = concat([ + pad(toBytes(verificationGasLimit), { size: 16 }), + pad(toBytes(callGasLimit), { size: 16 }) + ]); + + const preVerificationGas = BigInt(gasEstimate.preVerificationGas ?? 50000n); + + // 获取当前费率 + const block = await client.getBlock(); + const maxPriorityFeePerGas = await client.request({ method: 'eth_maxPriorityFeePerGas' as any }); + const maxFeePerGas = block.baseFeePerGas! * 2n + BigInt(maxPriorityFeePerGas); + + // maxPriorityFeePerGas (16 bytes) | maxFeePerGas (16 bytes) + const gasFees = concat([ + pad(toBytes(BigInt(maxPriorityFeePerGas)), { size: 16 }), + pad(toBytes(maxFeePerGas), { size: 16 }) + ]); + + // 6. 最终组装 PackedUserOp + const userOp = { + sender: senderAddress, + nonce: nonce, + initCode: partialUserOp.initCode, + callData: callData, + accountGasLimits: accountGasLimits, + preVerificationGas: preVerificationGas, + gasFees: gasFees, + paymasterAndData: "0x" as Hex, + signature: "0x" as Hex + }; + + // 7. 计算 UserOp Hash 并签名 + // 需要按照 ERC-4337 v0.7 规范进行 Hash + const userOpHash = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ components: [{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}], name: "userOp", type: "tuple" }], name: "getUserOpHash", outputs: [{ name: "", type: "bytes32" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getUserOpHash', + args: [userOp] + }); + + console.log(`🔑 UserOp Hash: ${userOpHash}`); + + // Owner 签名 + const signature = await account.signMessage({ + message: { raw: userOpHash } + }); + + // 将签名填回 UserOp + userOp.signature = signature; + + // 8. 发送 UserOp 到 Bundler + console.log("📨 正在发送 UserOp..."); + const userOpHashRes = await client.request({ + method: 'eth_sendUserOperation' as any, + params: [userOp, ENTRY_POINT_ADDRESS] + }); + + console.log(`✅ 发送成功! UserOp Hash: ${userOpHashRes}`); + console.log(`🔗 查看链接: https://jiffyscan.xyz/userOpHash/${userOpHashRes}?network=sepolia`); +} + +main().catch(console.error); + +``` + +代码原理解析 +createAccount (InitCode): + +在 v0.7 中,工厂方法签名依然是 createAccount。 + +如果 initCode 不为空,EntryPoint 会先执行这个代码来部署合约,然后再执行后续的 execute。这就是为什么你不需要单独去部署合约,使用即部署。 + +UserOp 打包 (Packing): + +请注意代码中的 accountGasLimits 和 gasFees。在 v0.6 中,这些都是独立的 uint256 字段。 + +在 v0.7 中,为了节省 CallData 的 Gas 费用,它们被压缩成了 bytes32 (两个 uint128 拼接)。这是 v0.7 最显著的代码层面变化。 + +签名流程: + +getUserOpHash 是在链下完成的(虽然我用了 readContract 调用 EntryPoint 里的纯函数,这样最准确)。 + +拿到 Hash 后,EOA (Owner) 进行 ECDSA 签名。 + +SimpleAccount 的合约逻辑就是:校验签名(UserOpHash, Signature) == Owner。 + +Bundler: + +最后一步 eth_sendUserOperation 不是发给普通的以太坊节点,而是发给 Bundler。Bundler 会把它打包成一笔以太坊交易 (handleOps) 上链。 + +你的下一步 +把 BUNDLER_RPC 换成你申请到的 API (推荐 Pimlico 或 Alchemy)。 + +运行代码拿到 AA 钱包地址。 + +往这个地址转 0.01 Sepolia ETH。 + +再次运行代码,你应该能看到 发送成功 并在 Jiffyscan 上查到这笔 UserOp。 + +------ + +npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🗂️ backup and recover secrets: https://dotenvx.com/ops +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx4W1-vUePAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87?network=sepolia + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06?network=sepolia + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497?network=sepolia +(base) XBOX at ~/Dev/mycelium/my-exploration/projects/aastar-sdk ±(main) ✗ ❯ ruby-3.3.2 + +--------- + +$ npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx41-vnwAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. diff --git a/0.16.23/guide/docs/verify.op-sepolia.contracts.md b/0.16.23/guide/docs/verify.op-sepolia.contracts.md new file mode 100644 index 000000000..e612eb8c1 --- /dev/null +++ b/0.16.23/guide/docs/verify.op-sepolia.contracts.md @@ -0,0 +1,22 @@ +# Verified SuperPaymaster Contracts (OP-Sepolia) + +The following contracts have been successfully verified on Etherscan/Blockscout for the Optimism Sepolia testnet. + +| Contract Name | Address | Explorer Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94#code) | +| **Registry** | `0xcf6860Ab57de8669756997e414D9c52B6e301972` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xcf6860Ab57de8669756997e414D9c52B6e301972#code) | +| **GToken** | `0xC341c88453372021d0221834307613c2e99fE718` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xC341c88453372021d0221834307613c2e99fE718#code) | +| **aPNTs** | `0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440#code) | +| **xPNTsFactory** | `0x7792a49C9E91e0E9B631B27D885d15e971B7482A` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x7792a49C9E91e0E9B631B27D885d15e971B7482A#code) | +| **GTokenStaking** | `0x5f57B931C849e8E255F22755506eB2255aB22a7C` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x5f57B931C849e8E255F22755506eB2255aB22a7C#code) | +| **MySBT** | `0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0#code) | +| **BLSValidator** | `0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5#code) | +| **BLSAggregator** | `0x6e06b17b1a4D2D973F7E3e026e24b4393315736c` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x6e06b17b1a4D2D973F7E3e026e24b4393315736c#code) | +| **ReputationSystem** | `0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9#code) | +| **DVTValidator** | `0x0087cA806109E150438116cAA414580BB5fa9195` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x0087cA806109E150438116cAA414580BB5fa9195#code) | +| **PaymasterFactory** | `0x1e3b9d12eAc27867a523d0537902441B0E7D98d8` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x1e3b9d12eAc27867a523d0537902441B0E7D98d8#code) | +| **PaymasterV4Impl** | `0x906123080207F250B1C9F299991512Cb31f35b2f` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x906123080207F250B1C9F299991512Cb31f35b2f#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/docs/verify.sepolia.contracts.md b/0.16.23/guide/docs/verify.sepolia.contracts.md new file mode 100644 index 000000000..945a2b372 --- /dev/null +++ b/0.16.23/guide/docs/verify.sepolia.contracts.md @@ -0,0 +1,22 @@ +# Verified SuperPaymaster Contracts (Sepolia) + +The following contracts have been successfully verified on Etherscan for the Sepolia testnet. + +| Contract Name | Address | Etherscan Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A` | [View on Etherscan](https://sepolia.etherscan.io/address/0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A#code) | +| **Registry** | `0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788` | [View on Etherscan](https://sepolia.etherscan.io/address/0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788#code) | +| **GToken** | `0x9ceDeC089921652D050819ca5BE53765fc05aa9E` | [View on Etherscan](https://sepolia.etherscan.io/address/0x9ceDeC089921652D050819ca5BE53765fc05aa9E#code) | +| **aPNTs** | `0xDf669834F04988BcEE0E3B6013B6b867Bd38778d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xDf669834F04988BcEE0E3B6013B6b867Bd38778d#code) | +| **xPNTsFactory** | `0x6EafdA3477F3eec1F848505e1c06dFB5532395b6` | [View on Etherscan](https://sepolia.etherscan.io/address/0x6EafdA3477F3eec1F848505e1c06dFB5532395b6#code) | +| **GTokenStaking** | `0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC#code) | +| **MySBT** | `0x677423f5Dad98D19cAE8661c36F094289cb6171a` | [View on Etherscan](https://sepolia.etherscan.io/address/0x677423f5Dad98D19cAE8661c36F094289cb6171a#code) | +| **BLSValidator** | `0x04590731005d25d379A55b6c3136B5CD1eaC757F` | [View on Etherscan](https://sepolia.etherscan.io/address/0x04590731005d25d379A55b6c3136B5CD1eaC757F#code) | +| **BLSAggregator** | `0xe380d443842A8A37F691B9f3EF58e40073759edc` | [View on Etherscan](https://sepolia.etherscan.io/address/0xe380d443842A8A37F691B9f3EF58e40073759edc#code) | +| **ReputationSystem** | `0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC#code) | +| **DVTValidator** | `0xcB42417Cfb374e923BAF729040d9973FB7676537` | [View on Etherscan](https://sepolia.etherscan.io/address/0xcB42417Cfb374e923BAF729040d9973FB7676537#code) | +| **PaymasterFactory** | `0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d#code) | +| **PaymasterV4Impl** | `0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf` | [View on Etherscan](https://sepolia.etherscan.io/address/0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60482a2B343004dF29EB205C4F6916E864700` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/getting-started.md b/0.16.23/guide/getting-started.md new file mode 100644 index 000000000..4a8c6f575 --- /dev/null +++ b/0.16.23/guide/getting-started.md @@ -0,0 +1,189 @@ +# AAstar SDK + +The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem. +AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。 + +[![npm version](https://img.shields.io/npm/v/@aastar/sdk.svg)](https://www.npmjs.com/package/@aastar/sdk) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +--- + +## 🌟 Introduction | 简介 + +AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors. + +AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。 + +### Core Modules | 核心模块 + +- **[`@aastar/community`](https://docs.aastar.io/api/@aastar/community)**: Launch & manage DAOs. (启动和管理 DAO) +- **[`@aastar/operator`](https://docs.aastar.io/api/@aastar/operator)**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益) +- **[`@aastar/enduser`](https://docs.aastar.io/api/@aastar/enduser)**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易) +- **[`@aastar/analytics`](https://docs.aastar.io/api/@aastar/analytics)**: Monitor ecosystem data. (监控生态系统数据) +- **[`@aastar/tokens`](https://docs.aastar.io/api/@aastar/tokens)**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具) +- **[`@aastar/identity`](https://docs.aastar.io/api/@aastar/identity)**: Reputation & SBT management. (声誉和 SBT 管理) +- **[`@aastar/account`](https://docs.aastar.io/api/@aastar/account)**: Smart Account (ERC-4337) utilities. (智能账户工具) +- **[`@aastar/core`](https://docs.aastar.io/api/@aastar/core)**: Shared logic, Roles, and configuration. (共享逻辑、角色和配置) +- **[`@aastar/paymaster`](https://docs.aastar.io/api/@aastar/paymaster)**: Low-level Paymaster interactions. (低层级 Paymaster 交互) +- **[`@aastar/dapp`](https://docs.aastar.io/api/@aastar/dapp)**: Pre-built UI components and React hooks. (预建 UI 组件和 React hooks) + +--- + +## 📦 Installation | 安装 + +```bash +pnpm add @aastar/sdk viem +# or +npm install @aastar/sdk viem +``` + +--- + +## 📚 Documentation | 文档导航 + +- **Docs Home**: https://docs.aastar.io/ +- **API Reference**: https://docs.aastar.io/api/ +- **Examples**: https://docs.aastar.io/examples/ +- **Deployments**: https://docs.aastar.io/guide/deployments/verify.sepolia.contracts +- **Configuration Sync**: https://docs.aastar.io/guide/docs/Configuration_Sync +- **Regression Testing**: https://docs.aastar.io/guide/docs/Regression_Testing_Guide +- **Gasless Tester Guide**: https://docs.aastar.io/guide/docs/TESTER_GUIDE_GASLESS +- **Price Keeper Guide**: [docs/guide/keeper.md](../../docs/guide/keeper.md) + +--- + +## 🚀 Usage | 使用指南 + +### 1. Initialize Client | 初始化客户端 + +```typescript +import { createPublicClient, createWalletClient, http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { CommunityClient, OperatorClient } from '@aastar/sdk'; + +// 1. Setup VIEM clients +const publicClient = createPublicClient({ chain: sepolia, transport: http() }); +const walletClient = createWalletClient({ chain: sepolia, transport: http() }); + +// 2. Initialize AAstar Clients +const communityClient = new CommunityClient(publicClient, walletClient); +const operatorClient = new OperatorClient(publicClient, walletClient); +``` + +### 2. "Pre-check" Pattern | "预检查" 模式 + +Avoid reverts and save gas by checking requirements off-chain first. +通过链下预检查避免交易回滚并节省 Gas。 + +```typescript +// ❌ Old Way (Prone to errors) +// await communityClient.launchCommunity(...); + +// ✅ New AAstar Way +const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33")); + +if (!check.hasEnoughGToken) { + console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`); + // Output: "Need 33 GT, have 10 GT" +} else { + // Safe to execute + await communityClient.launchCommunity({ + name: "My DAO", + tokenSymbol: "MDAO" + }); +} +``` + +### 3. Key Scenarios | 核心场景 + +#### 🏛️ For Community Owners (社区创建者) + +```typescript +// Configure SBT rules for your community +await communityClient.configureSBTRules({ + communityId: myCommunityId, + rule: { + minScore: 100, + requiredTags: ["OG"] + } +}); +``` + +#### ⚙️ For Operators (运营商) + +```typescript +// Check if you are ready to be a Super Paymaster +const status = await operatorClient.checkResources(myAddress); + +if (status.hasRole) { + await operatorClient.withdrawCollateral(parseEther("50")); +} else { + console.log(status.recommendations); + // "Fund aPNTs for collateral", "Stake GToken" +} +``` + +#### 📊 For Analysts (分析师) + +```typescript +import { AnalyticsClient } from '@aastar/sdk'; + +const analytics = new AnalyticsClient(publicClient); + +// Get real-time GToken metrics +const metrics = await analytics.getSupplyMetrics(); +console.log(`Deflation Rate: ${metrics.deflationRate}%`); +``` + +--- + +## 🔧 Architecture | 架构 + +AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives. + +AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。 + +| Package | Functionality (功能) | +|---------|---------------------| +| `@aastar/core` | Shared logic, Roles, RequirementChecker | +| `@aastar/community` | DAO Registry, XPNTs issuance | +| `@aastar/operator` | Paymaster ops, Staking management | +| `@aastar/enduser` | User onboarding, SBT minting | +| `@aastar/tokens` | Finance, Tokenomics, Approval flows | +| `@aastar/identity` | Reputation, Credit limits, ZK Proofs | +| `@aastar/paymaster` | EntryPoint & Paymaster low-level API | +| `@aastar/dapp` | React Components & Integration Hooks | + +--- + +## 📊 Gas Analytics & Reporting | Gas 分析与报表 +The SDK includes a powerful **Gas Analytics Module** for analyzing Paymaster efficiency, tracking costs, and generating industry comparison reports. +SDK 包含一个强大的 **Gas 分析模块**,用于分析 Paymaster 效率、追踪成本并生成行业对比报告。 + +### Quick Start | 快速开始 +Generate a real-time analysis of recent Sepolia transactions: +生成最近 Sepolia 交易的实时分析: +```bash +npx tsx packages/analytics/src/gas-analyzer-v4.ts +``` + +### Key Features | 核心功能 +- **Double-Layer Analysis (双层分析)**: Intrinsic EVM Efficiency vs. Economic USD Costs +- **Industry Benchmarking (行业对标)**: Compare AAStar vs. Optimism, Alchemy, Pimlico +- **Profit Tracking (利润追踪)**: Transparent breakdown of Protocol Revenue & Profit +- **L2 Simulation (L2 模拟)**: Estimate savings for migrating UserOps to Optimism + +👉 **[View Full Analytics Documentation | 查看完整分析文档](https://docs.aastar.io/guide/packages/analytics/)** + +--- + +## 🤝 Contributing | 贡献 + +We welcome contributions! Please see our Contributing Guide for details. +欢迎贡献!更多详情请参考贡献指南。 + +--- + +

+ Built with ❤️ by the AAstar Community +

diff --git a/0.16.23/guide/installation.md b/0.16.23/guide/installation.md new file mode 100644 index 000000000..1752fdb84 --- /dev/null +++ b/0.16.23/guide/installation.md @@ -0,0 +1,54 @@ +# Installation + +The AAStar SDK is built with TypeScript and can be used in any Node.js or browser environment. We recommend using `pnpm` for package management. + +## Install the Main Package + +The `@aastar/sdk` package provides the easiest entry point by grouping all core functionalities. + +```bash +pnpm add @aastar/sdk viem@2.x +pnpm add @aastar/sdk viem@2.x +``` + +### 🛡️ Integrity Verification + +> [!IMPORTANT] +> **Security Check**: Before using the SDK, verify that the downloaded source code matches the official release hash. + +Run the following command in your project root (verifies code, excludes .md): +```bash +git ls-files -z | grep -zvE '\.md$' | xargs -0 sha256sum | sha256sum +``` +**Expected Hash for v0.16.23**: `9b02e91aaae2081b68b8ddfcf4c3dd52d450b4f368a8746b5896e0024e441db7` + +--- + +## Modular Installation (Optional) + +If you only need specific functionalities, you can install individual packages to keep your bundle size small: + +```bash +# Core utilities and types +pnpm add @aastar/core + +# Account Abstraction and 7702 support +pnpm add @aastar/account + +# Paymaster and sponsorship logic +pnpm add @aastar/paymaster + +# Finance and GToken utilities +pnpm add @aastar/finance +``` + +## Prerequisites + +- **Node.js**: v18 or higher. +- **TypeScript**: v5.0 or higher (recommended for type safety). +- **Viem**: v2.43 or higher. + +## Next Steps + +- Choose your role and create a [Client](./quick-start). +- Explore the [Core Concepts](../concepts/account-abstraction). diff --git a/0.16.23/guide/keeper.md b/0.16.23/guide/keeper.md new file mode 100644 index 000000000..59dc5c679 --- /dev/null +++ b/0.16.23/guide/keeper.md @@ -0,0 +1,107 @@ +# Price Keeper (SuperPaymaster + Paymaster) + +This keeper is a long-running offchain agent that keeps `cachedPrice` fresh by calling `updatePrice()` only when needed. + +## What It Does + +- Reads `cachedPrice.updatedAt` and `priceStalenessThreshold()` from SuperPaymaster and the official Paymaster +- Reads `updatedAt` from the Chainlink ETH/USD feed +- Sends `updatePrice()` when the cached price is close to expiring and Chainlink has fresher data (handled independently per contract) +- Sends Telegram alerts on errors and an hourly heartbeat (optional) + +## Update Policy (Gas-Saving) + +The keeper submits `updatePrice()` only when all of the following are true: + +- `cachedPrice.updatedAt == 0` (bootstrap case), or +- Current time is within `safetyMarginSec` before `cachedPrice.updatedAt + priceStalenessThreshold` +- Chainlink has newer data than the cached price +- Chainlink data is not older than `priceStalenessThreshold` + +Additionally: + +- Enforces `maxUpdatesPerDay` to avoid abuse +- Optionally skips updates when base fee is above `maxBaseFeeGwei` (unless very close to expiry) + +## Addresses Source (No ENV Needed) + +By default, contract addresses are loaded from `@aastar/core` canonical constants (per chainId). + +Paymaster selection: + +- If the canonical constants include an official Paymaster instance address, the keeper uses it +- Otherwise it derives the official Paymaster address from `PaymasterFactory.paymasterByOperator(OFFICIAL_OPERATOR)` +- You can override with `--paymaster
` + +## How To Run + +From the monorepo root: + +```bash +pnpm keeper:op-sepolia +pnpm keeper:op-mainnet +``` + +One-shot mode: + +```bash +pnpm keeper:op-mainnet -- --once +``` + +Cast (keystore) mode: + +```bash +pnpm keeper:op-mainnet -- --mode cast --keystore /path/to/keystore.json +``` + +Cast (named account) mode: + +```bash +pnpm keeper:op-mainnet -- --mode cast --cast-account optimism-deployer +``` + +If `--cast-account` is omitted, the keeper uses `DEPLOYER_ACCOUNT` from `.env.` by default. + +In cast mode (non-dry-run), the keeper will prompt once for the keystore password at startup and reuse it for subsequent updates. For unattended runs, set `CAST_KEYSTORE_PASSWORD` in `.env.` so no interactive prompt is needed. + +Private-key mode: + +```bash +pnpm keeper:op-mainnet -- --mode privateKey +``` + +## Required ENV + +The keeper loads `.env.` from the current working directory. + +- `RPC_URL` +- `TEST_PRIVATE_KEY` (required by shared network loader) + +Optional: + +- `KEEPER_PRIVATE_KEY` (privateKey mode) +- `PRIVATE_KEY_SUPPLIER` (fallback for privateKey mode) +- `CAST_KEYSTORE_PASSWORD` (cast mode; otherwise it prompts) +- `DEPLOYER_ACCOUNT` (cast mode default account name for `--cast-account`) +- `OFFICIAL_OPERATOR` (used to derive official Paymaster from the factory when no canonical instance exists) +- `TELEGRAM_BOT_TOKEN` +- `TELEGRAM_CHAT_ID` (must be numeric like `123...`/`-100...` or start with `@`) + +## CLI Flags + +- `--network op-sepolia|op-mainnet|sepolia|mainnet|anvil` +- `--mode cast|privateKey` +- `--keystore ` (cast mode) +- `--cast-account ` (cast mode, uses Foundry keystore account name) +- `--superpaymaster
` (override) +- `--paymaster
` (override) +- `--paymaster-operator
` (override OFFICIAL_OPERATOR) +- `--disable-superpaymaster` / `--no-superpaymaster` +- `--disable-paymaster` / `--no-paymaster` +- `--poll-interval ` (default: 30) +- `--safety-margin ` (default: 600) +- `--max-updates-per-day ` (default: 24) +- `--max-base-fee-gwei ` (optional) +- `--dry-run` +- `--once` +- `--logo` / `--no-logo` diff --git a/0.16.23/guide/old-solution.md b/0.16.23/guide/old-solution.md new file mode 100644 index 000000000..a05e97a78 --- /dev/null +++ b/0.16.23/guide/old-solution.md @@ -0,0 +1,1078 @@ + +A nodejs sdk for all developers to integrate AAStar's power abilities. + +AAStar npm packages collection: +You can use +``` +pnpm install @aastar/airaccount +@aastar/superpaymaster +@aastar/cometens +@aastar/openpnts +@aastar/opencards +@aastar/arcadia +@aastar/cos72 +``` +or +``` +pnpm install aastar +``` + +## For developers +Why do you install this package? +### airaccount +Provide a moveable\self-custody\crypto account with life cycle service. +Permissionless. +Trustless. +Decentralized. +In 3 steps: bind, send, claim, move(recover) + +### superpaymaster +Embbeded into AirAccount, but provide ERC20 gas token ability for any community individually. + +### cometens +Embbeded into AirAccount, but provide set your own ENS name for your community individually. + + +# 从零开始开发和发布 npm 包:完整指南 + +## 目录 + +1. [前期准备](#前期准备) +2. [初始化项目](#初始化项目) +3. [配置开发环境](#配置开发环境) +4. [开发 SDK](#开发-sdk) +5. [测试](#测试) +6. [构建和打包](#构建和打包) +7. [发布到 npm](#发布到-npm) +8. [文档和示例](#文档和示例) +9. [版本管理和更新](#版本管理和更新) +10. [持续集成和自动发布](#持续集成和自动发布) +11. [SDK 开发最佳实践](#sdk-开发最佳实践) +12. [问题排查](#问题排查) + +## 前期准备 + +### 1. 安装必要工具 + +```bash +# 安装 Node.js (推荐使用 nvm 管理 Node.js 版本) +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash +nvm install node # 安装最新版 +nvm install --lts # 或安装长期支持版 + +# 确认安装 +node --version +npm --version + +# 安装一些全局工具 +npm install -g typescript ts-node np +``` + +### 2. 创建 npm 账号 + +1. 访问 [npm 官网](https://www.npmjs.com/) 并注册 +2. 在命令行登录 npm (后续发布时需要) + +```bash +npm login +``` + +### 3. 规划你的 SDK + +在开始编码前,确定以下内容: + +- SDK 的目标和用途 +- 核心功能和 API 设计 +- 依赖关系 +- 支持的平台 (浏览器、Node.js、React Native 等) +- 命名规范 (包名必须唯一) +- 核心 API 结构 + +## 初始化项目 + +### 1. 创建项目目录 + +```bash +# 创建项目目录 (使用你希望的包名) +mkdir my-awesome-sdk +cd my-awesome-sdk +``` + +### 2. 初始化 npm 项目 + +```bash +npm init +``` + +按照提示填写信息: + +- `name`: 包名 (可以使用 `@组织名/包名` 格式) +- `version`: 版本号 (推荐从 0.1.0 开始) +- `description`: 简短描述 +- `main`: 入口文件 (通常是 `dist/index.js`) +- `scripts`: 构建脚本 +- `repository`: 代码仓库地址 +- `keywords`: 关键词,帮助用户发现你的包 +- `author`: 作者信息 +- `license`: 许可证 (如 MIT) + +### 3. 初始化 Git 仓库 + +```bash +git init +echo "node_modules\ndist\n.env\n*.log" > .gitignore +``` + +### 4. 创建基本目录结构 + +```bash +mkdir src tests examples docs +touch src/index.ts README.md LICENSE +``` + +## 配置开发环境 + +### 1. 配置 TypeScript + +```bash +# 安装 TypeScript +npm install typescript --save-dev + +# 初始化 TypeScript 配置 +npx tsc --init +``` + +编辑 `tsconfig.json`: + +```json +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["node_modules", "tests", "examples", "dist"] +} +``` + +### 2. 配置代码格式化和 Lint + +```bash +# 安装 ESLint 和 Prettier +npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier --save-dev + +# 创建 ESLint 配置 +``` + +创建 `.eslintrc.js`: + +```javascript +module.exports = { + parser: "@typescript-eslint/parser", + extends: [ + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + parserOptions: { + ecmaVersion: 2018, + sourceType: "module", + }, + rules: { + // 自定义规则 + }, +}; +``` + +创建 `.prettierrc`: + +```json +{ + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100, + "tabWidth": 2, + "semi": true +} +``` + +### 3. 配置测试环境 + +```bash +# 安装 Jest +npm install jest ts-jest @types/jest --save-dev +``` + +创建 `jest.config.js`: + +```javascript +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + testMatch: ["**/tests/**/*.test.ts"], + collectCoverage: true, + coverageDirectory: "coverage", + collectCoverageFrom: ["src/**/*.ts"], +}; +``` + +### 4. 更新 package.json 脚本 + +编辑 `package.json` 添加以下脚本: + +```json +"scripts": { + "build": "tsc", + "test": "jest", + "lint": "eslint 'src/**/*.ts'", + "format": "prettier --write 'src/**/*.ts'", + "prepare": "npm run build", + "prepublishOnly": "npm test && npm run lint", + "preversion": "npm run lint", + "version": "npm run format && git add -A src", + "postversion": "git push && git push --tags" +} +``` + +## 开发 SDK + +### 1. 创建基本结构 + +在 `src/index.ts` 创建 SDK 的入口点: + +```typescript +// 导出所有公共 API +export * from "./client"; +export * from "./types"; +// ... 其他导出 + +// 导出默认客户端 +import { Client } from "./client"; +export default Client; +``` + +### 2. 创建核心模块 + +例如,创建 `src/client.ts` 实现主要客户端类: + +```typescript +import { ApiResponse, ClientOptions } from "./types"; + +export class Client { + private apiKey: string; + private baseUrl: string; + + constructor(options: ClientOptions) { + this.apiKey = options.apiKey; + this.baseUrl = options.baseUrl || "https://api.example.com/v1"; + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + const url = `${this.baseUrl}/${endpoint}`; + + try { + const response = await fetch(url, { + method, + headers: { + "Content-Type": "application/json", + "Authorization": `Bearer ${this.apiKey}`, + }, + body: data ? JSON.stringify(data) : undefined, + }); + + const responseData = await response.json(); + + if (!response.ok) { + throw new Error(responseData.message || "API request failed"); + } + + return { + data: responseData, + status: response.status, + headers: response.headers, + }; + } catch (error) { + throw error; + } + } + + // 公共 API 方法 + async getUser(userId: string) { + return this.makeRequest(`users/${userId}`); + } + + // 更多 API 方法... +} +``` + +### 3. 定义类型 + +创建 `src/types.ts` 定义类型: + +```typescript +export interface ClientOptions { + apiKey: string; + baseUrl?: string; +} + +export interface ApiResponse { + data: T; + status: number; + headers: Headers; +} + +// 更多类型定义... +``` + +### 4. 使用模块化设计 + +将 SDK 拆分为多个模块,例如: + +``` +src/ + index.ts # 主入口 + client.ts # 核心客户端类 + types.ts # 类型定义 + modules/ + auth.ts # 认证相关功能 + users.ts # 用户相关功能 + products.ts # 产品相关功能 + utils/ + request.ts # 请求工具 + validation.ts # 验证工具 +``` + +## 测试 + +### 1. 编写单元测试 + +在 `tests` 目录中创建测试文件,例如 `tests/client.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 模拟 fetch API +global.fetch = jest.fn(); + +describe("Client", () => { + let client: Client; + + beforeEach(() => { + client = new Client({ apiKey: "test-api-key" }); + (global.fetch as jest.Mock).mockClear(); + }); + + test("makeRequest should call fetch with correct parameters", async () => { + (global.fetch as jest.Mock).mockResolvedValueOnce({ + ok: true, + status: 200, + json: async () => ({ id: "123", name: "Test User" }), + headers: new Headers(), + }); + + const result = await client.makeRequest("users/123"); + + expect(global.fetch).toHaveBeenCalledWith( + "https://api.example.com/v1/users/123", + expect.objectContaining({ + method: "GET", + headers: expect.objectContaining({ + "Authorization": "Bearer test-api-key", + }), + }), + ); + + expect(result.data).toEqual({ id: "123", name: "Test User" }); + }); + + // 更多测试... +}); +``` + +### 2. 运行测试 + +```bash +npm test +``` + +### 3. 编写集成测试 + +创建与真实 API 交互的集成测试,例如 `tests/integration.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 这些测试需要一个有效的 API 密钥 +// 通常通过环境变量提供 +const apiKey = process.env.API_KEY; + +// 只在提供 API 密钥时运行集成测试 +(apiKey ? describe : describe.skip)("Integration tests", () => { + let client: Client; + + beforeAll(() => { + client = new Client({ apiKey }); + }); + + test("can get a user", async () => { + const result = await client.getUser("test-user-id"); + expect(result.status).toBe(200); + expect(result.data).toHaveProperty("id"); + }); + + // 更多集成测试... +}); +``` + +## 构建和打包 + +### 1. 配置 npm 包文件 + +编辑 `package.json` 指定要包含的文件: + +```json +{ + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "LICENSE", + "README.md" + ] +} +``` + +### 2. 支持不同的模块格式 (可选) + +如果你想同时支持 CommonJS 和 ES 模块,可以使用 `rollup` 或 `tsup` 等工具。 + +使用 `tsup` 示例: + +```bash +# 安装 tsup +npm install tsup --save-dev +``` + +更新 `package.json`: + +```json +{ + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } + }, + "scripts": { + "build": "tsup src/index.ts --format cjs,esm --dts --clean" + } +} +``` + +## 发布到 npm + +### 1. 准备发布 + +确保你的包名是唯一的,并已登录 npm。如果使用组织名称,确保已创建组织。 + +```bash +# 检查是否登录 +npm whoami + +# 如果未登录 +npm login +``` + +### 2. 测试包 + +在发布前,使用 `npm pack` 创建一个本地包进行测试: + +```bash +npm pack +``` + +这将创建一个 `.tgz` 文件,可以在另一个项目中使用它进行测试: + +```bash +# 在测试项目中 +npm install ../path/to/your-package-1.0.0.tgz +``` + +### 3. 发布包 + +```bash +# 首次发布 +npm publish + +# 如果是组织包并想设为公共 +npm publish --access public +``` + +### 4. 更新包 + +修改 `package.json` 中的版本号或使用 `npm version` 命令: + +```bash +# 更新补丁版本 (1.0.0 -> 1.0.1) +npm version patch + +# 更新小版本 (1.0.0 -> 1.1.0) +npm version minor + +# 更新大版本 (1.0.0 -> 2.0.0) +npm version major +``` + +然后发布更新: + +```bash +npm publish +``` + +## 文档和示例 + +### 1. 编写 README + +一个好的 README 应包含: + +- 项目描述 +- 安装指南 +- 基本用法示例 +- API 文档链接 +- 配置选项 +- 常见问题 + +示例 README 结构: + +````markdown +# My Awesome SDK + +A JavaScript/TypeScript SDK for interacting with the Example API. + +## Installation + +```bash +npm install my-awesome-sdk +``` +```` + +## Quick Start + +```javascript +import Client from "my-awesome-sdk"; + +const client = new Client({ apiKey: "your-api-key" }); + +// Get a user +client.getUser("user123") + .then((response) => console.log(response.data)) + .catch((error) => console.error(error)); +``` + +## Documentation + +For full documentation, visit [docs.example.com](https://docs.example.com). + +## Configuration + +The client accepts the following options: + +| Option | Type | Required | Default | Description | +| ------- | ------ | -------- | -------------------------- | ---------------- | +| apiKey | string | Yes | - | Your API key | +| baseUrl | string | No | https://api.example.com/v1 | The API base URL | + +## License + +MIT + +```` +### 2. 示例代码 + +在 `examples` 目录中创建示例代码: + +```typescript +// examples/basic-usage.ts +import Client from '../src'; + +async function main() { + const client = new Client({ apiKey: 'your-api-key' }); + + try { + const user = await client.getUser('user123'); + console.log('User:', user.data); + + // More examples... + } catch (error) { + console.error('Error:', error); + } +} + +main(); +```` + +### 3. 生成 API 文档 + +可以使用 TypeDoc 生成 API 文档: + +```bash +npm install typedoc --save-dev +``` + +添加 `package.json` 脚本: + +```json +"scripts": { + "docs": "typedoc --out docs src/index.ts" +} +``` + +## 版本管理和更新 + +### 1. 遵循语义化版本规范 + +- **补丁版本**(1.0.x):修复 bug,小改进 +- **小版本**(1.x.0):添加向后兼容的新功能 +- **大版本**(x.0.0):不向后兼容的变更 + +### 2. 维护更新日志 + +创建 `CHANGELOG.md` 并记录每个版本的变更: + +```markdown +# Changelog + +## [1.1.0] - 2023-05-01 + +### Added + +- New feature X +- Support for Y + +### Changed + +- Improved error handling +- Better performance for Z + +### Fixed + +- Bug in getUser method + +## [1.0.0] - 2023-04-01 + +Initial release +``` + +## 持续集成和自动发布 + +### 1. 设置 GitHub Actions + +创建 `.github/workflows/ci.yml`: + +```yaml +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: npm test + - run: npm run lint +``` + +### 2. 设置自动发布 + +创建 `.github/workflows/publish.yml`: + +```yaml +name: Publish + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run build + - run: npm test + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +在 GitHub 仓库设置中,添加 `NPM_TOKEN` 秘密。 + +## SDK 开发最佳实践 + +### 1. API 设计原则 + +- **简单直观**:API 应该易于理解和使用 +- **一致性**:保持命名和模式一致 +- **错误处理**:提供清晰的错误信息和类型 +- **文档完善**:每个公共方法都应有文档 +- **链式调用**:考虑支持方法链接 + +### 2. 错误处理 + +创建自定义错误类: + +```typescript +// src/errors.ts +export class ApiError extends Error { + statusCode: number; + data: any; + + constructor(message: string, statusCode: number, data?: any) { + super(message); + this.name = "ApiError"; + this.statusCode = statusCode; + this.data = data; + Object.setPrototypeOf(this, ApiError.prototype); + } +} + +export class ValidationError extends Error { + errors: any[]; + + constructor(message: string, errors: any[]) { + super(message); + this.name = "ValidationError"; + this.errors = errors; + Object.setPrototypeOf(this, ValidationError.prototype); + } +} +``` + +### 3. 浏览器兼容性 + +如果 SDK 需要在浏览器中运行,考虑: + +- 使用 `fetch` 时提供兼容性封装 +- 考虑使用 `axios` 等库处理请求 +- 使用 polyfills 确保兼容性 + +### 4. 安全性 + +- 不要在客户端代码中存储敏感信息 +- 使用 HTTPS +- 避免将敏感信息记录到控制台 +- 提供 API 令牌轮换机制 + +## 问题排查 + +### 1. 常见问题 + +- **包名冲突**:在 npm 上查找是否已存在同名包 +- **构建错误**:检查 TypeScript 配置和依赖 +- **发布失败**:确保已登录 npm 并有权限发布 + +### 2. 调试技巧 + +```typescript +// 添加调试配置 +export class Client { + private debug: boolean; + + constructor(options: ClientOptions) { + this.debug = options.debug || false; + // ... + } + + private log(...args: any[]) { + if (this.debug) { + console.log("[SDK]", ...args); + } + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + this.log("Request:", method, endpoint, data); + + // ...请求逻辑... + + this.log("Response:", responseData); + return response; + } +} +``` + +### 3. 提供用户支持 + +- 在 GitHub 上设置 Issues 模板 +- 提供常见问题和解决方案 +- 考虑设置讨论区或社区渠道 + +# NPM包组织 + +您想要建立一个名为"aastar"的NPM组织,其中包含多个子包,既可以单独安装也可以整体安装。这是一个非常好的组织方式,类似于许多流行的库如Next.js、Ant +Design等采用的结构。 + +要实现这样的结构,您需要采用"Monorepo"(单体仓库)架构,以下是详细的规划和实现步骤: + +## 1. 创建Monorepo项目结构 + +首先,建立基本的项目结构: + +``` +aastar/ +├── packages/ +│ ├── airaccount/ # 子包1 +│ ├── superpaymaster/ # 子包2 +│ └── ... # 其他子包 +├── package.json # 根项目配置 +├── pnpm-workspace.yaml # 工作区配置 +├── lerna.json # (可选)Lerna配置 +└── tsconfig.json # 基础TypeScript配置 +``` + +## 2. 配置工作区 + +在根目录创建`pnpm-workspace.yaml`文件: + +```yaml +packages: + - 'packages/*' +``` + +## 3. 配置每个子包 + +在每个子包目录中创建`package.json`,例如`packages/airaccount/package.json`: + +```json +{ + "name": "@aastar/airaccount", + "version": "0.1.0", + "description": "AIR账户管理模块", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "jest" + }, + "dependencies": { + // 此包的依赖 + }, + "peerDependencies": { + // 可选的同级依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +## 4. 创建主包作为入口点 + +在`packages`目录下创建一个集合包,例如`packages/aastar/package.json`: + +```json +{ + "name": "aastar", + "version": "0.1.0", + "description": "AASTAR SDK全集合", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "dependencies": { + "@aastar/airaccount": "workspace:*", + "@aastar/superpaymaster": "workspace:*" + // 添加其他所有子包作为依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +然后创建相应的入口文件`packages/aastar/src/index.ts`,导出所有子包: + +```typescript +export * from "@aastar/airaccount"; +export * from "@aastar/superpaymaster"; +// 导出其他所有子包 +``` + +## 5. 使用工具管理版本和发布 + +您可以使用以下工具之一来管理版本和发布: + +### 选项1: 使用pnpm + changesets + +1. 安装changesets: + +```bash +pnpm add -D -w @changesets/cli +pnpm changeset init +``` + +2. 配置发布脚本:在根目录的`package.json`中添加: + +```json +{ + "scripts": { + "build": "pnpm -r build", + "version": "changeset version", + "publish": "pnpm build && changeset publish" + } +} +``` + +### 选项2: 使用Lerna + +1. 安装Lerna: + +```bash +pnpm add -D -w lerna +``` + +2. 创建`lerna.json`: + +```json +{ + "version": "independent", + "npmClient": "pnpm", + "useWorkspaces": true, + "command": { + "publish": { + "ignoreChanges": ["*.md"], + "message": "chore(release): publish" + } + } +} +``` + +## 6. 处理包之间的依赖关系 + +如果子包之间有依赖关系,在依赖包的`package.json`中添加: + +```json +{ + "dependencies": { + "@aastar/some-dependency": "workspace:*" + } +} +``` + +## 7. 统一配置和构建 + +创建一个根目录的`tsconfig.json`作为基础配置: + +```json +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "node", + "declaration": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + } +} +``` + +然后,每个子包可以扩展此配置: + +```json +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"] +} +``` + +## 8. 发布流程 + +1. 创建npm组织: + - 在npm网站上注册`aastar`组织 + +2. 发布所有包: + +```bash +# 使用changesets +pnpm changeset +pnpm version +pnpm publish + +# 或使用Lerna +pnpm lerna publish +``` + +## 使用示例 + +用户可以按您希望的方式安装和使用SDK: + +```bash +# 安装单个包 +pnpm install @aastar/airaccount @aastar/superpaymaster + +# 或安装全部功能 +pnpm install aastar +``` + +使用示例: + +```javascript +// 单个包使用方式 +import { someFunction } from "@aastar/airaccount"; + +// 全部功能使用方式 +import { airaccount, superpaymaster } from "aastar"; +``` + +这种结构的主要优点是: + +1. 用户可以根据需求选择安装单个包或全部功能 +2. 包之间可以共享代码,但又保持独立发布 +3. 可以统一管理版本,简化发布流程 +4. 便于维护和扩展 + +您对这种结构有什么特别的需求或问题吗? diff --git a/0.16.23/guide/packages/analytics/index.md b/0.16.23/guide/packages/analytics/index.md new file mode 100644 index 000000000..8ba9794ef --- /dev/null +++ b/0.16.23/guide/packages/analytics/index.md @@ -0,0 +1,440 @@ +# Analytics Package (AAStar Gas Analytics & Experimentation) + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It supports **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis with rigorous, on-chain ground truth verification. + +```bash +# 快速入口(从 aastar-sdk 根目录运行) + +# 收集 OP Mainnet paymaster 基线 +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts --network op-mainnet --n 50 + +# 收集 Paper7 专属数据 +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 + +# 全流程协调器 +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia + +# Gas 分析报告文档 +packages/analytics/docs/OP_Mainnet_Gas_Analysis_Report.md +``` + +--- + +## System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # Traffic Generation Logic +│ ├── collectors/ # Etherscan/RPC Fetchers +│ │ └── EventFetcher.ts # On-chain UserOperationEvent collector +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── scripts/ # ← All data collection scripts (consolidated) +│ ├── collect_paymaster_baselines.ts # OP mainnet V4/SuperPM baselines +│ ├── collect_eoa_erc20_baseline.ts # EOA ERC20 transfer baseline +│ ├── collect_industry_baseline.ts # Alchemy/Pimlico baselines +│ ├── compute_cost_summary.ts # Aggregated cost breakdown table +│ ├── gasless-collect.ts # Gasless data collector (OP mainnet) +│ ├── paper7-exclusive-data.ts # Paper7 closed-loop data (anvil) +│ ├── paper7_credit_loop.ts # Credit→Debt→Repay cycle runner +│ ├── paper7_reputation_credit.ts # Reputation→Credit mapping runner +│ ├── run_analytics_coordinator.ts # Full pipeline coordinator +│ ├── run_paper7_exclusive_data.sh # Paper7 shell wrapper (CI-friendly) +│ ├── fetch-tx-hashes.ts # TX hash fetcher utility +│ └── scrape-tx.ts # Puppeteer Etherscan scraper +├── docs/ # ← Research reports and analysis documents +│ └── OP_Mainnet_Gas_Analysis_Report.md # Paper3/Paper7 gas cost evidence +├── data/ # Raw data store +│ ├── gasless_data_collection.csv # T1/T2/T2.1/T5 baseline (v1) +│ ├── gasless_data_collection_v2.csv # Controlled single-UserOp (v2) +│ ├── gasless_metrics_detailed.csv # Full L1/L2 fee decomposition +│ ├── industry_paymaster_baselines.csv # Alchemy, Pimlico on-chain baselines +│ ├── eoa_erc20_baseline.csv # Raw EOA transfer baseline +│ ├── paper7_exclusive/ # Paper7 credit/reputation/liquidity +│ └── paper_gas_op_mainnet/ # Paper3 per-date controlled datasets +│ ├── 2026-02-17/ # V4 n=36, SuperPM n=43 +│ └── 2026-02-18/ # V4/SuperPM with sender (n=50) +└── reports/ # HTML/Markdown summaries +``` + +--- + +## Workflows + +### A. Collect OP Mainnet Paymaster Baselines (Paper3) +```bash +# V4 baseline: strict single UserOp + ERC20 transfer filter +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type v4 --n 50 --strict-transfer --single-userop + +# SuperPaymaster baseline +pnpm tsx packages/analytics/scripts/collect_paymaster_baselines.ts \ + --network op-mainnet --type super --n 50 +``` + +### B. Run Full Experiment (Coordinator) +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --network sepolia +``` + +### C. Fetch Historical Data Only +```bash +pnpm tsx packages/analytics/scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### D. Transaction Scraper (Etherscan) +Reads from `data/gasless_data_collection.csv`, outputs to `data/gasless_metrics_detailed.csv`. +```bash +pnpm tsx packages/analytics/scripts/scrape-tx.ts +``` + +--- + +## Data Directory + +| File | Description | +|------|-------------| +| `data/gasless_data_collection.csv` | T1/T2/T2.1/T5 records with TxHash + Label | +| `data/gasless_data_collection_v2.csv` | High-fidelity controlled dataset (single-UserOp, ERC20) | +| `data/gasless_metrics_detailed.csv` | L1 Fee, L2 Fee, Gas Used (Puppeteer scraped) | +| `data/industry_paymaster_baselines.csv` | Alchemy (mean=257k) + Pimlico (mean=387k) on-chain baselines | +| `data/eoa_erc20_baseline.csv` | Raw EOA ERC20 transfer baseline | +| `data/paper7_exclusive/` | Credit cycle + reputation + liquidity simulation (Anvil) | +| `data/paper_gas_op_mainnet/2026-02-17/` | V4 n=36, SuperPM n=43 (strict filter) | +| `data/paper_gas_op_mainnet/2026-02-18/` | V4/SuperPM with sender field (n=50) | + +--- + +## Paper7 Exclusive Data (Credit / Reputation / Liquidity) + +Paper7 requires a distinct set of evidence to prove **CommunityFi closed-loop semantics**: + +- **Reputation → Credit**: contribution/reputation synced into Registry, credit limit observed to change +- **Credit → Debt → Repay**: debt recorded in Paymaster/Registry, cleared via xPNTs +- **Liquidity (Baseline)**: simulation curve showing gas-redeemable vs non-redeemable points over time + +### Running + +```bash +# Unified entry (Anvil auto-start, deploy, sync, run all subtasks) +pnpm exec tsx packages/analytics/scripts/paper7-exclusive-data.ts --network anvil --cycles 5 + +# Shell wrapper (CI-friendly) +bash packages/analytics/scripts/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### Output Structure + +```text +data/paper7_exclusive// + credit_cycle_1.json # credit→debt→repay per account + ... + reputation_credit.json # reputation sync → credit limit mapping + liquidity_velocity_simulation.csv + synced_config.anvil.json +``` + +#### `credit_cycle_*.json` fields +- `creditLimitWei / creditLimitEth`: credit limit in Registry +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`: debt lifecycle +- `gasUsed.*`: per-step gas units (approve, setCreditTier, recordDebt, mint) + +#### `reputation_credit.json` fields +- `score` / `globalReputation` / `creditLimitWei`: reputation → credit mapping +- `gasUsed.*`: setRule, syncToRegistry, etc. + +#### `liquidity_velocity_simulation.csv` columns +- `day`: simulation step +- `points_gas_redeemable`: points stock when gas-redeemable +- `points_baseline`: points stock without gas redemption + +--- + +## Key Modules + +### 1. Traffic Generators (`src/generators/`) +- **EOAGenerator**: Baseline ETH transfers for network cost measurement. +- **SuperPaymasterGenerator**: Treatment group — credit/asset-oriented gasless model. +- **PaymasterV4Generator**: Treatment group B — deposit model for comparison. + +### 2. Data Collectors (`src/collectors/`) +- **HistoricalFetcher**: Etherscan/OptimismScan API for full transaction histories. +- **EventFetcher**: On-chain `UserOperationEvent` log collector with strict filtering. + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +- **Attribution**: L1 Security | L2 Execution | Protocol Overhead breakdown. +- **Comparison**: T1 vs T2 vs T2.1 vs T5 vs industry baselines. + + +> **Status**: Active | **Version**: 3.0 (PhD Research Edition) + +This module is the core data intelligence engine for the AAStar ecosystem. It has been upgraded to support **Scientific Data Collection** for the "Asset-Oriented Abstraction" thesis, moving beyond simple log analysis to rigorous, on-chain ground truth verification. +工作流: + +收集数据(日常运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia +产生新实验数据(需要时运行): +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --gen-traffic + +收集events +pnpm tsx scripts/run_analytics_coordinator.ts --network sepolia --fetch-events + +分析报告(查看结果): +pnpm tsx packages/analytics/src/gas-analyzer-v4.ts --network sepolia + +步骤是解耦的,按需执行即可 +--- + +## 🏗 System Architecture + +The Analytics module operates on a **Pipeline Architecture** composed of three distinct stages: **Generation**, **Collection**, and **Analysis**. + +```mermaid +graph TD + subgraph "Phase 1: Traffic Generation" + TG[Traffic Coordinator] -->|Trigger| G1[EOA Generator] + TG -->|Trigger| G2[Standard AA Generator] + TG -->|Trigger| G3[SuperPaymaster Generator] + TG -->|Trigger| G4[Paymaster V4 Generator] + G1 & G2 & G3 & G4 -->|Execute Tx| BLOCKCHAIN((Blockchain)) + end + + subgraph "Phase 2: Data Collection" + BLOCKCHAIN -->|Receipts| HF[Historical Fetcher] + HF -->|Raw Data| CACHE[(Data Store / JSON)] + style HF fill:#f9f,stroke:#333 + end + + subgraph "Phase 3: Analysis Engine" + CACHE -->|Load| DC[DataCollector] + DC -->|Enrich| CC[CostCalculator] + + CC --> AA[Attribution Analyzer] + CC --> CA[Comparison Analyzer] + CC --> TA[Trend Analyzer] + + AA & CA & TA --> REPORT[Final Academic Report] + end +``` + +--- + +## 🧩 Key Modules + +### 1. Traffic Generators (`src/generators/`) +Responsible for creating controlled, verifiable traffic patterns on testnets (Sepolia, OP Sepolia) and mainnets. +- **EOAGenerator**: Baseline ETH transfers to measure intrinsic network costs. +- **StandardAAGenerator**: ERC-4337 flows using industry-standard Paymasters (Pimlico/Alchemy). +- **SuperPaymasterGenerator**: **Treatment Group**. Uses the `EndUserClient` to execute gasless transactions via the "Credit/Asset-Oriented" model (Dual-Token). +- **PaymasterV4Generator**: **Treatment Group B**. Uses the "Deposit" model (Single-Token) for comparative analysis. + +### 2. Data Collectors (`src/collectors/`) +Responsible for gathering "Ground Truth" data. +- **HistoricalFetcher**: Connects to Etherscan/OptimismScan APIs to retrieve full transaction histories for test accounts defined in `l4-state.json`. **Crucial for auditability.** +- **LogParser**: Legacy parser for development logs (kept for backward compatibility). + +### 3. Analysis Engine (`src/core/` & `src/analyzers/`) +The brain of the operation. +- **Double-Layer Analysis**: + - **Intrinsic Layer**: Gas used, Blob gas, Calldata efficiency. + - **Economic Layer**: USD costs, Protocol Revenue, Net Profit. +- **Attribution**: Breaks down cost into L1 Security, L2 Execution, and Protocol Overhead. + +--- + +## 🚀 Workflows + +### A. Run Full Experiment (Coordinator) +The `run_analytics_coordinator.ts` script orchestrates the entire lifecycle. + +```bash +# 1. Fetch History -> 2. Generate Missing Traffic -> 3. Analyze +npx tsx scripts/run_analytics_coordinator.ts --network sepolia +``` + +### B. Fetch Historical Data Only +Useful for auditing existing accounts without spending gas. +```bash +npx tsx scripts/run_analytics_coordinator.ts --fetch-only --network op-sepolia +``` + +### C. Traffic Generation Only +Generate a specific number of transactions for a specific group. +```bash +npx tsx packages/analytics/src/generators/cli.ts --group superpaymaster --runs 10 +``` + +--- + +## 📊 Data & Metrics + +We prioritize **Intrinsic Metrics** to ensure scientific validity independent of market volatility. + +| Metric | Definition | Source | +| :--- | :--- | :--- | +| **Gas Used** | Total gas consumed by the transaction | `receipt.gasUsed` | +| **L1 Fee** | Cost of posting data to L1 (for L2s) | Oracle Contract / Header | +| **Latency** | Time from `UserOp` submission to inclusion | Client-side Timestamp | +| **Steps** | Number of signatures/interactions required | Protocol Definition | + +--- + +## 📂 Directory Structure + +```text +packages/analytics/ +├── src/ +│ ├── generators/ # [NEW] Traffic Generation Logic +│ ├── collectors/ # [NEW] Etherscan/RPC Fetchers +│ ├── core/ # Core Analysis Engines +│ ├── analyzers/ # Specific Analysis Strategies +│ └── gas-analyzer.ts # Main Entry Point +├── data/ # Raw JSON Data Store +└── reports/ # HTML/Markdown Reports +``` + +--- + +## 🕷️ Transaction Scraper + +A Puppeteer-based scraper to extract detailed gas and fee metrics from Optimism Etherscan. + +### Prerequisites + +- Node.js & pnpm +- Chrome browser (Puppeteer will attempt to install this automatically, but you can run `npx puppeteer browsers install chrome` if needed) + +### Running the Scraper + +The scraper reads transaction hashes from `data/gasless_data_collection.csv` and outputs enriched metrics to `data/gasless_metrics_detailed.csv`. + +```bash +pnpm tsx scripts/scrape-tx.ts +``` + +## 📂 Data Directory (Paper7 Ground Truth) + +- `data/gasless_data_collection.csv`: 输入文件,包含 `Timestamp,Label,TxHash`,用于抓取交易详情。 +- `data/gasless_data_collection_v2.csv`: 主网/测试网的高保真样本集合(包含 `GasUsed(L2)`, `L2ExecutionFee(Wei)`, `L1DataFee(Wei)` 等列),用于论文/报告里的“真实网络成本与可用性”对照。 +- `data/gasless_metrics_detailed.csv`: 抓取后的明细输出(L1 Fee, L2 Fee, Gas Used 等),主要由 `scripts/scrape-tx.ts` 生成。 + +--- + +## 🧪 Paper7 专属数据:Credit / Reputation / Liquidity Loop + +Paper7 需要一组**与通用 gasless 基线不同**的专属证据,用来证明 CommunityFi 的闭环语义成立(而不仅是“能跑通 gasless”): + +- **Reputation → Credit**:将贡献/声誉同步进 Registry,并观察信用额度随之变化 +- **Credit → Debt → Repay**:在 Paymaster/Registry 侧记录债务,再用 xPNTs 完成清算归零 +- **Liquidity(Baseline Liquidity)**:用可复现实验/仿真曲线展示“积分可用于偿债/赞助”对流动性速度的影响(作为机制层证据,不依赖市场价格) + +### 1) 如何运行(推荐) + +统一入口脚本(负责启动 Anvil、必要时自动部署并同步配置,然后跑各子任务): + +```bash +pnpm exec tsx scripts/paper7-exclusive-data.ts --network anvil --cycles 5 +``` + +等价的 shell 包装(更适合 CI/重复跑批): + +```bash +./packages/analytics/run_paper7_exclusive_data.sh --network anvil --cycles 5 +``` + +### 2) 脚本目标与流程定位 + +- `scripts/paper7-exclusive-data.ts` + - **目标**:生成 Paper7 专属闭环数据(credit cycles + reputation→credit + liquidity simulation)。 + - **作用位置**:属于“可重复的受控实验层”,用 gas units 固定地刻画合约路径开销与状态变化,避免 ETH/USD 等市场变量污染结论。 +- `scripts/paper7_credit_loop.ts` + - **目标**:跑一次完整 **credit→debt→repay** 闭环(Anvil-only,依赖 `anvil_*` RPC)。 + - **产出**:每次运行写一个 `credit_cycle_*.json`。 +- `scripts/paper7_reputation_credit.ts` + - **目标**:跑一次 **reputation sync → registry credit update**,并记录关键读数与每笔交易 gasUsed。 + - **产出**:写 `reputation_credit.json`。 +- `liquidity_velocity_simulation.csv` + - **目标**:给论文提供“Baseline Liquidity 机制”的直观趋势证据(对比可用于 gas 清算 vs 不可清算时,积分存量随时间的衰减/累积差异)。 + +### 3) 数据产物(在哪里、是什么、怎么看) + +所有 Paper7 专属数据默认写入: + +`packages/analytics/data/paper7_exclusive//` + +典型结构如下: + +```text +paper7_exclusive// + credit_cycle_1.json + credit_cycle_2.json + ... + reputation_credit.json + liquidity_velocity_simulation.csv + anvil.log # 若自动启动/部署,保留日志便于审计 + deploy.log # 若触发自动部署,保留 forge 日志便于复现 + synced_config.anvil.json # 若触发自动同步,记录当次使用的合约地址快照 +``` + +#### A) `credit_cycle_*.json`(闭环清算) + +每个 cycle 都是一次独立账户的闭环验证,核心字段: + +- `creditLimitWei / creditLimitEth`:该账户在 Registry 的信用额度(用于赞助/欠款边界) +- `debtBeforeWei / debtAfterRecordWei / debtAfterRepayWei`:欠款从 0 → 增加 → 清算归零 +- `gasUsed.*`:每一步合约调用的 gas units(`approve`, `setCreditTier`, `recordDebt`, `mint`) +- `tx.*`:对应交易哈希(便于回溯 receipts / debug) + +#### B) `reputation_credit.json`(声誉到信用映射) + +用于证明 Reputation sync 后,Registry 中的 `globalReputation` 与 `getCreditLimit` 发生预期变化,并给出每步 gas units: + +- `score`:ReputationSystem 计算出的 score +- `globalReputation`:Registry 聚合后的全局声誉 +- `creditLimitWei / creditLimitEth`:映射后的信用额度 +- `gasUsed.*`:`setRule`, `setReputationSource`, `setEntropyFactor`, `syncToRegistry` + +#### C) `liquidity_velocity_simulation.csv`(基线流动性趋势) + +列定义: + +- `day`:仿真步(天) +- `points_gas_redeemable`:积分可用于 gas 清算/赞助时的积分存量曲线 +- `points_baseline`:积分不可清算(仅基础用途)时的积分存量曲线 diff --git a/0.16.23/guide/paper-data-collection.md b/0.16.23/guide/paper-data-collection.md new file mode 100644 index 000000000..d9c29a8ad --- /dev/null +++ b/0.16.23/guide/paper-data-collection.md @@ -0,0 +1,69 @@ +# 論文數據採集指南 (PhD Data Collection Guide) + +本文檔為 AAStar 系統論文中的數據採集提供標準化指南。所有實驗數據必須通過 `aastar-sdk` 獲取,以確保真實性與可重複性。 + +## 1. 實驗設置 (Environmental Setup) + +### 網絡環境 +- **Local**: 使用 `anvil` 進行基準測試(無網絡延遲)。 +- **Testnet**: 使用 `Sepolia` 進行公鏈環境驗證。 +- **L2**: 使用 `Optimism` (或 OP Sepolia) 進行低 Gas 性能測試。 + +### 賬戶準備 +確保 `.env.v3` 中配置了以下地址: +- `TEST_SIMPLE_ACCOUNT_A`: 標準 AA 賬戶。 +- `TEST_SIMPLE_ACCOUNT_B`: AOA (V4) 實驗賬戶。 +- `TEST_SIMPLE_ACCOUNT_C`: SuperPaymaster 實驗賬戶。 + +--- + +## 2. 核心指標 (Key Metrics) + +實驗腳本會自動採集以下維度: + +| 指標 | 英文名稱 | 採集方式 | +| :--- | :--- | :--- | +| **Gas 消耗** | Gas Usage | `receipt.gasUsed` | +| **延遲** | Latency | `Date.now() - start` (毫秒) | +| **交易成本** | Tx Cost | `gasUsed * effectiveGasPrice` | +| **吞吐量** | Throughput | 批量運行時的 `count / total_time` | + +--- + +## 3. 自動化運行 (Automation) + +直接使用統一腳本運行: + +```bash +# 運行所有配置的網絡(推薦) +./scripts/run_automated_experiment.sh all + +# 僅運行本地測試 +./scripts/run_automated_experiment.sh local + +# 僅運行 Sepolia 測試 +./scripts/run_automated_experiment.sh sepolia +``` + +## 4. 數據導出與處理 + +數據會自動保存至 `sdk_experiment_data.csv`。 + +**建議流程**: +1. 每個場景運行 30 次 (`EXPERIMENT_RUNS=30`) 以獲取統計顯著性。 +2. 使用 `pandas` 或 `Excel` 計算均值 (Mean) 與標準差 (Std Dev)。 +3. 使用 `scripts/collect_industry_baseline.ts` 獲取對比組(EOA, Pimlico)數據。 + +--- + +## 5. 常規檢查清單 + +- [ ] RPC 節點是否連通。 +- [ ] 實驗賬戶是否有足夠的 Gas 餘額 (或代幣)。 +- [ ] `PRIVATE_KEY_JASON` 是否已在本地導出。 +- [ ] 是否已清理舊的 CSV 數據。 + +--- + +> [!IMPORTANT] +> **嚴禁**手動修改 CSV 數據。所有偏差應在論文的 "Limitations" 或 "Discussion" 章節中說明。 diff --git a/0.16.23/guide/quick-start.md b/0.16.23/guide/quick-start.md new file mode 100644 index 000000000..121cbf5b7 --- /dev/null +++ b/0.16.23/guide/quick-start.md @@ -0,0 +1,52 @@ +# Quick Start + +Get up and running with the AAStar SDK in less than 5 minutes. + +## 1. Environment Setup + +Create a `.env` file with your private key and RPC provider: + +```bash +PRIVATE_KEY_JASON=0x... +SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/... +``` + +## 2. Basic Initialization + +Initialize the SDK by choosing a role-based client. Most developers start with the `EndUserClient`. + +```typescript +import { createEndUserClient } from '@aastar/sdk'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const account = privateKeyToAccount(process.env.PRIVATE_KEY_JASON); + +const user = createEndUserClient({ + chain: sepolia, + transport: http(process.env.SEPOLIA_RPC_URL), + account +}); +``` + +## 3. Execute a Gasless Transaction + +Enable your users to interact with your dapp without holding native gas tokens. + +```typescript +// Send a sponsored transaction via SuperPaymaster +const hash = await user.sendGaslessTransaction({ + to: '0x...', + data: '0x...', + communityAddress: '0x...', // Your registered community +}); + +console.log(`Transaction sent: ${hash}`); +``` + +## 4. Next Steps + +- **Manage Communities**: Use the [CommunityClient](../api/roles/community) to set reputation rules. +- **Become a Provider**: Use the [OperatorClient](../api/roles/operator) to stake and sponsor gas. +- **Advanced Features**: Explore the [API Reference](../api/) for deep customization. diff --git a/0.16.23/guide/real-l3-demo-log.md b/0.16.23/guide/real-l3-demo-log.md new file mode 100644 index 000000000..ab2177af1 --- /dev/null +++ b/0.16.23/guide/real-l3-demo-log.md @@ -0,0 +1,131 @@ +jason@HuifengjiaodeMacBook-Pro-3: ~/Dev/mycelium/my-exploration/projects/aastar-sdk l3-refine +$ npx tsx examples/l3-complete-demo.ts --network seoplia [8:48:34] +npm warn Unknown project config "pnpm-lock.yaml". This will stop working in the next major version of npm. +npm warn Unknown project config "frozen-lockfile". This will stop working in the next major version of npm. +npm warn Unknown project config "auto-install-peers". This will stop working in the next major version of npm. +npm warn Unknown project config "strict-peer-dependencies". This will stop working in the next major version of npm. +🔍 DATA SOURCE: tests/regression/config.ts (TS Source) +🚀 Starting L3 Complete Lifecycle Demo (Real Transactions)... +📄 Loading config from: /Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/.env.sepolia +[dotenv@17.2.3] injecting env (31) from .env.sepolia -- tip: ⚙️ override existing env vars with { override: true } + 🔍 DEBUG: PRIVATE_KEY_SUPPLIER present? true + 🔍 DEBUG: Supplier Key Length: 66 +✅ Loaded contract addresses from: /Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/config.sepolia.json + Keys found: aPNTs, blsAggregator, blsValidator, dvtValidator, entryPoint, gToken, paymasterFactory, paymasterV4Impl, priceFeed, registry, reputationSystem, sbt, simpleAccountFactory, srcHash, staking, superPaymaster, updateTime, xPNTsFactory + ✅ Found Third-Party in ENV: entryPoint -> 0x0000000071727De22E5E9d8BAf0edAc6f37da032 + ✅ Found Third-Party in ENV: priceFeed -> 0x694AA1769357215DE4FAC081bf1f309aDC325306 + ✅ Found Third-Party in ENV: simpleAccountFactory -> 0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985 +[dotenv@17.2.3] injecting env (31) from .env.sepolia -- tip: 👥 sync secrets across teammates & machines: https://dotenvx.com/ops +📡 Network: sepolia +⛽ Supplier: 0xb5600060e6de5E11D3636731964218E53caadf0E +🏭 Registry: 0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788 + +🔹 Step 1: Creating New Operator (Alice)... + 👤 Alice (Operator): 0xa4A3C92cdb59303BdfB14c7859523508ee1d9058 + 💸 Sending 0.1 ETH to Alice... + ⏳ Waiting for Fund Alice ETH (0x904a3222b3fe938af010cf125b2c13cfca39a5c41ec906a80e7f87dc0124e222)... + ✅ Fund Alice ETH Confirmed in block 10138297 + 🪙 Minting 100 GTokens to Alice... + ⏳ Waiting for Mint GToken (0x6af3278325a4488b004dd219c377a60b33b47db63f07852e5f071125bd857e7c)... + ✅ Mint GToken Confirmed in block 10138298 + 🪙 Minting 4,000 aPNTs to Alice... + ⏳ Waiting for Mint aPNTs (0x406be5561ebc76456c34bd1c5caa59a63e0dc5c88f8aee5a9310a0f67ab00e21)... + ✅ Mint aPNTs Confirmed in block 10138300 + 📊 Status Before: Configured=false, Balance=0 + +🔹 Step 2: Alice Launching Community (One-Click Setup)... + 🔄 Attempt 1/3 to launch community... + ✅ Community Launched! Hashes: 0xd50372bcda95d39927f0bbc9c99f2c19a4b660f18e971587690f115019b01e18, 0x6898dc6858f163ba1f7cdcf54eb8f2a37c28929ee6730859a10fc1500692ecbf + ⏳ Waiting for Community Launch (0xd50372bcda95d39927f0bbc9c99f2c19a4b660f18e971587690f115019b01e18)... + ✅ Community Launch Confirmed in block 10138302 + ⏳ Waiting for Community Launch (0x6898dc6858f163ba1f7cdcf54eb8f2a37c28929ee6730859a10fc1500692ecbf)... + ✅ Community Launch Confirmed in block 10138304 + 🔗 Linking Token to SuperPaymaster... + ⏳ Waiting for Link Token to SuperPM (0xdd4c4d21b49543d91014bc22edc8cd90551dc8b41b4567b4f26630c2cc09d5ad)... + ✅ Link Token to SuperPM Confirmed in block 10138305 + +🔹 Step 3: Alice Onboarding as SuperPaymaster Operator... + ⚙️ Setting up Node (Deposit + Register)... + ⏳ Waiting for Setup Node (Register) (0xa41aa8e4cc0f185cf20dac918fb9a3cd4c52c24591ff43f7cc25c01fe1d02070)... + ✅ Setup Node (Register) Confirmed in block 10138307 + ⏳ Waiting for Setup Node (Register) (0xba97284360744a7769c88b67bf64196126481d539ba5d8ae83b40980d3ce11a8)... + ✅ Setup Node (Register) Confirmed in block 10138308 + ⏳ Waiting for SuperPM Role to index... + ✅ Role Verified on-chain. + 💰 Depositing Collateral (4000 aPNTs)... + ⏳ Waiting for Deposit Collateral (0x84998727523d94d01de449b733547e3a78c7f5408c5c41cd8e0e1139190a3d35)... + ✅ Deposit Collateral Confirmed in block 10138309 + ⚙️ Forcing Operator Configuration... + ⏳ Waiting for Configure Operator (0x1057d5ac3eeb4a14ca764042bb54158923e1366ddb63513072439b6ff9e84ee1)... + ✅ Configure Operator Confirmed in block 10138310 + 🔄 Refreshing Oracle Price (DVT)... + ⏳ Waiting for Update Price DVT (0x2e8e743965be0d848fad8a8d96617366f0e104ca3de63139b259561fbb91cec6)... + ✅ Update Price DVT Confirmed in block 10138311 + ✅ Price Updated via DVT! + 📊 Status After: Configured=true + +🔹 Step 3: Creating New User (Bob)... + 👤 Bob (EOA): 0x65a64728223eDF09B89E2194F0F8d327325D6879 + 🤖 Bob (AA): 0xE4b09B969b91800D15a8e2f8F3B4b8a9C2B8D27c + 💸 Funding Bob's EOA for gas... + ⏳ Waiting for Fund Bob EOA (0xd44953372188391fe76ef48899ea06aa3ad4493c631040ebb94f215027d94207)... + ✅ Fund Bob EOA Confirmed in block 10138312 + 🚀 Deploying Bob's AA Account... + ⏳ Waiting for Deploy Bob AA (0xb5d66d6d9c0ebd4595cebb3aadfba8381e68864fdb0daeab77ae1c1083395238)... + ✅ Deploy Bob AA Confirmed in block 10138313 + 💸 Funding Bob's AA with 0.1 ETH + 20 GTokens... + ⏳ Waiting for Fund Bob AA ETH (0x5c6a4060b57c8f9b7413d0b3542ddbd7c82169ef043ed168505db43c7aff80c6)... + ✅ Fund Bob AA ETH Confirmed in block 10138314 + ⏳ Waiting for Fund Bob AA GToken (0xe5ad35a284c74122519db1966ab0e2c25b655d740894958722d51ea9056a2979)... + ✅ Fund Bob AA GToken Confirmed in block 10138315 + +🔹 Step 5: Bob Onboarding to Alice's Community... + 🔸 Alice Community Role: true + 🔸 Bob's AA GToken Balance: 20 + 🧐 Eligible: true + 📝 Bob calling onboard()... + 🔍 Debug Allowance: Account=0xE4b09B969b91800D15a8e2f8F3B4b8a9C2B8D27c, Allowance=0, Needed=400000000000000000 + 🔍 Debug Onboard: Community=0xa4A3C92cdb59303BdfB14c7859523508ee1d9058, AA=0xE4b09B969b91800D15a8e2f8F3B4b8a9C2B8D27c, Stake=400000000000000000 + 🔍 Debug Batch: Txs=2, Targets=0x9ceDeC089921652D050819ca5BE53765fc05aa9E,0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788 + ✅ Onboard Result: Success=true, Tx=0x252475ba662d0c67a05c159d50641d3839689a2beef13ffc03f5a5990e6dfd66 + ⏳ Waiting for Onboard (0x252475ba662d0c67a05c159d50641d3839689a2beef13ffc03f5a5990e6dfd66)... + ✅ Onboard Confirmed in block 10138318 + +🔹 Step 6: Bob Executing Gasless Transaction... +[SuperPaymasterClient] 🎯 Target Info: + - Paymaster: 0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A + - Token: 0x9ceDeC089921652D050819ca5BE53765fc05aa9E + - Operator: 0xa4A3C92cdb59303BdfB14c7859523508ee1d9058 +[SuperPaymasterClient] ☁️ Estimating Gas usage... +[PaymasterClient] Gas Estimation Result: { + "preVerificationGas": "0x186a0", + "callGasLimit": "0x7a120", + "verificationGasLimit": "0x3d090", + "paymasterVerificationGasLimit": "0x493e0" +} +[SuperPaymasterClient] ☁️ Bundler Estimates: { + preVerificationGas: 100000n, + verificationGasLimit: 250000n, + callGasLimit: 550000n, + paymasterVerificationGasLimit: 300000n, + paymasterPostOpGasLimit: 100000n +} +[SuperPaymasterClient] 🔧 Tuned Limits: VGL=330000, PMVGL=133333, PostOp=110000 +[PaymasterClient] Priority Fee 2158783 too low, clamping to 0.5 Gwei +[PaymasterClient] Fees Set: MaxFee=1836352542, Priority=500000000 +[PaymasterClient] Using alchemy Bundler +[PaymasterClient] ✅ Submitted via alchemy hash: 0xc5a09bc6d916dc145e21165d3a39de2d62f57e4116a6e4897055483a49cc63b9 + ✅ UserOp Hash: 0xc5a09bc6d916dc145e21165d3a39de2d62f57e4116a6e4897055483a49cc63b9 + ✅ Gasless Tx Success! Tx Hash: 0x101861483a4e50f8a7e6d73a925f24548a2440a8b4325578c17eb3f69d01e5d6 + +🔹 Step 7: Exit Phase... + 🚪 Bob leaving community... + ⏳ Waiting for Bob Leave Community (0xfce80ce0463787a72eda06cadbd4621d1e5e32da40e8605d898e72fc5cc42939)... + ✅ Bob Leave Community Confirmed in block 10138320 + ✅ Bob Left (SBT Burned): 0xfce80ce0463787a72eda06cadbd4621d1e5e32da40e8605d898e72fc5cc42939 + 🏦 Alice withdrawing funds & exiting role... + ⚠️ Withdrawal/Exit Failed (Expected if Locked): Unauthorized to perform this action + ℹ️ Note: Registry roles typically have a lock period (e.g. 30 days) before exit is final. + +🎉 L3 Demo Complete! +(base) diff --git a/0.16.23/guide/release_plan_v0.16.12.md b/0.16.23/guide/release_plan_v0.16.12.md new file mode 100644 index 000000000..d5530194d --- /dev/null +++ b/0.16.23/guide/release_plan_v0.16.12.md @@ -0,0 +1,49 @@ +# Release Plan v0.16.12: NPM Publishing Fixes + +## 1. Overview +This plan addresses the issues encountered during the v0.16.11 release, specifically the accidental publishing of the root repository files and the inclusion of unnecessary development files (tests, `node_modules`) in certain packages. + +## 2. Package Structure & Strategy + +We follow a **Monorepo** structure where: +1. **Root (`@aastar/monorepo`)**: The development workspace. **PRIVATE**. Never published. +2. **Umbrella (`@aastar/sdk`)**: The main entry point for users. Installs all other packages as dependencies. +3. **Modules (`@aastar/core`, etc.)**: Individual functional units. Can be installed separately if needed. + +### Why this strategy? +- **Developer Experience**: Users only need to install `@aastar/sdk` to get everything. +- **Modularity**: Advanced users can pick and choose (e.g., only `@aastar/paymaster`). +- **Efficiency**: Shared logic (like `@aastar/core`) is reused without duplication. + +## 3. Current Issues & Proposed Fixes + +| Package | Status | Issue | Proposed Fix | +| :--- | :--- | :--- | :--- | +| **ROOT** | ❌ **CRITICAL** | Named `@aastar/sdk`, `private: false`. Publishes entire repo! | Rename to `@aastar/monorepo`, set `private: true`. | +| `@aastar/sdk` | ✅ OK | Correctly configured as public umbrella. | No change (ensure `files: ["dist"]`). | +| `@aastar/core` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/tokens` | ✅ OK | Correctly whitelist `dist`. | Fix `tsconfig` to prevent deep nesting (optional polish). | +| `@aastar/community` | ❌ Bloated | Missing `files` whitelist. Publishes src/tests. | Add `"files": ["dist"]`. | +| `@aastar/operator` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/analytics` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/enduser` | ❌ Bloated | Missing `files` whitelist. | Add `"files": ["dist"]`. | +| `@aastar/paymaster` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/account` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/dapp` | ✅ OK | Correctly whitelist `dist`. | No change. | +| `@aastar/identity` | ✅ OK | Correctly whitelist `dist`. | No change. | + +## 4. Execution Plan + +1. **Root Fix**: Rename `package.json` -> `@aastar/monorepo`, `private: true`. +2. **Cleanup**: Add `"files": ["dist"]` to `community`, `operator`, `analytics`, `enduser` package.jsons. +3. **Version Bump**: Update all packages to `0.16.12` using `update-version.sh`. +4. **Verify**: Dry-run publish or inspect tarball content. +5. **Publish**: execute `pnpm publish -r --no-git-checks --access public`. + +## 5. Benefits +- **Fixes "Root Publish"**: Prevents the root folder (with all scripts and config) from overwriting `@aastar/sdk` on NPM. +- **Small Install Size**: Users only download compiled JS/DTS files, not your tests or source code. +- **Professional**: Clean packages without `node_modules` or `.test.ts` garbage. + +## 6. User Action +Please review and confirm this plan. Upon approval, I will apply the fixes and perform the formatting. diff --git a/0.16.23/guide/task_breakdown.md b/0.16.23/guide/task_breakdown.md new file mode 100644 index 000000000..1fd785f49 --- /dev/null +++ b/0.16.23/guide/task_breakdown.md @@ -0,0 +1,121 @@ +# SuperPaymaster Experiment Task Breakdown + +Based on the PhD research requirements and the "Three-Step" (Prepare, Test, Analyze) strategy. + +## Phase 0: Foundation & Configuration + +- [x] **0.1. Environment Setup (`.env.v3`)** + - [x] Create `projects/env/.env.v3`. + - [x] Populate RPC variables (`SEPOLIA_RPC_URL`, `ALCHEMY_BUNDLER_RPC_URL`). + - [x] Populate Account Key in .env.v3 + - [x] Populate Contract Addresses (Superseding `.env` if needed, but prioritizing `@aastar/shared-config`). + +- [x] **0.2. SDK Architecture Refinement** + - [x] Validate `@aastar/shared-config` integration for addresses (`SuperPaymaster`, `MySBT`, `GToken`). + - [x] Ensure `@aastar/core` exports `viem` clients configured for Sepolia and all networks. + + +## Phase 1: Preparation (The "Ammo") + +- [x] **1.1. Automated Preparation (The "Ammo") (`scripts/01_prepare_all.ts`)** + - [x] **Unified Script**: Runs all checks below. + - [x] **Account Check**: Computes addresses for A, B, C. + - [x] **ETH Check**: Funds 0.05 ETH from Supplier if low. + - [x] **Identity Check**: Checks MySBT balance for SuperPaymaster User (C). Mints if missing. + - [x] **Asset Check**: Checks xPNTs (GToken) balance for SuperPaymaster User (C). Transfers if low. + +## Phase 2: Testing (The Execution) +1. Transfer ERC20 Test in sepolia, op sepolia and op mainnet. +2. Perform 48 times ERC20 Transfers, 2 times per hour in random time in one hour. +3. Use Alchemy bundler RPC in .env.v3 as default bundler. +4. Use PIM as erc20 gas token in pimlico paymaster test. +5. Make all scripts for every test and use run_daily_experiment.ts to orchestrate the above scripts. +6. Transfer any ERC20(use aPNTs, get it from supplier) to target receiver: TEST_RECEIVER_ADDRESS in .env.v3. + +- [/] **2.1. Baseline 1: EOA Transfers (`scripts/02_test_eoa.ts`)** + - [ ] Use `PRIVATE_KEY_RELAYER` as test EOA, address: 0xb5600060e6de5E11D3636731964218E53caadf0E. + - [ ] Log metrics. + +- [ ] **2.2. Baseline 2: Standard AA (`scripts/03_test_standard_aa.ts`)** + - [ ] Use `TEST_SIMPLE_ACCOUNT_A` + `pimlico/permissionless` ,https://docs.pimlico.io/references/bundler/endpoints/eth_sendUserOperation, use PIM as erc20 gas token, get it from supplier, token address: 0xFC3e86566895Fb007c6A0d3809eb2827DF94F751, use Alchemy bundler RPC in .env.v3 + - [ ] Perform 48 UserOps in 24 hours. + - [ ] Log metrics. + +- [ ] **2.3. Experiment: SuperPaymaster (`scripts/04_test_superpaymaster.ts`)** + *Core of the PhD contribution.* + - [ ] Use `TEST_SIMPLE_ACCOUNT_B` +Alchemy bundler + Paymaster (Verifying Paymaster V4.1,来自于@aastar/shared-config). + - [ ] Use `TEST_SIMPLE_ACCOUNT_C` + `@aastar/superpaymaster` get address from @aastar/shared-config, use Alchemy bundler. + - [ ] Construct UserOp with `paymasterAndData` (V3 format). + - [ ] Send to Bundler. + - [ ] Log metrics (Gas Used, L1 Fee, Time). + +- [ ] **2.4. Automation Runner (`scripts/run_daily_experiment.ts`)** + - [ ] Orchestrate the above scripts. + - [ ] Add random delays (simulation of real usage). + - [ ] Output to `data/raw_experiment_data.csv`. + +## Phase 3: Analysis (The Result) + +- [ ] **3.1. Data Analysis (`scripts/05_analyze_data.ts`)** + - [ ] Read CSV. + - [ ] Compute Averages & Standard Deviation. + - [ ] Compare Cost vs Baseline. + - [ ] Compare Time vs Baseline. + - [ ] Generate Markdown Table for Thesis. + +## Phase 4: 特性验证与联动测试 [/] + +### Phase 5: Staking 退出与 Slash 测试 (12_*.ts) [⚠️ Debugging] +- [ ] unlock → withdraw 正常流程 (Fixed: Slash deduction bug) +- [ ] Slash 参数验证(罚没、国库、退款) +- [ ] 时间锁测试(提前退出拒绝) + - [ ] 在 Registry 中增加 roleLockDurations 映射 +- [ ] Debug Registry.sol registration logic (RoleNotGranted) +- [ ] Fix syntax errors and add raw error logging in 13_test_sbt_burn_linkage.ts +- [ ] Verify active SBT burn and exit linkage + +### Phase 6: MySBT Burn & Linkage Integration (Active Debugging) +- [ ] 实现 Registry.exitRole 与 MySBT 销毁/停用联动 + - [ ] 在 IMySBTV3 中添加 deactivateMembership 接口 + - [ ] 在 MySBT 中实现权限受控的 deactivateMembership + - [ ] 在 Registry.exitRole 中增加对 ROLE_ENDUSER 的 SBT 联动调用 +- [ ] 验证 `13_test_sbt_burn_linkage.ts` + - [ ] 完整流程 (正在解决 Anvil Revert) + - [ ] 同步最新合约 ABI 到 SDK +- [ ] 解决 registerRoleSelf 报错 (正在排查 Eve 地址与角色状态) +- [ ] 确保 getMemberships 在角色退出后返回 isActive: false + +### Phase 7: 集成与覆盖率报告 +- [ ] 更新 test:local 脚本包含所有新测试 +- [ ] 生成覆盖率报告(目标 80%+) +- [ ] 执行完整回归并验证通过 + +## Phase 8: SDK 架构演进与对齐 [⚠️ 暂停] + +> **WARNING**: 优先级调整:在达到 80% 测试覆盖率之前,暂停以下工作: +> - SDK 标准化封装(SuperPaymasterClient) +> - 链上数据采集与基准测试 + +### 阶段一:架构标准化 (v0.4.x) +- [ ] 基于 viem 与 AirAccount (Permissionless-style) 的架构重构 +- [ ] 定义 SuperPaymasterClient 与语义化 Error Mapper + +### 阶段二:生产力工具 (v0.5.x) +- [ ] UserOp Factory 与基线/对比测试数据导出 (CSV) + +### 阶段三:UI 集成 (v0.6.x) +- [ ] React Hooks 与评价面板组件 + +## Phase 9: 论文量化评估准备 [⚠️ 暂停] +- [ ] 搭建基线测试 (EOA vs Pimlico) 脚本 +- [ ] 自动化 CSV 采集与绘图数据预处理 + +## Appendix: Account Roles & Keys + +| Role | Variable | Purpose | +| :--- | :--- | :--- | +| **Supplier** | `SUPPLIER_KEY` | Holds test ETH & GTokens. Funds others. | +| **Operator** | `OPERATOR_JASON_KEY` | Admin of AAStar. Mints SBTs. | +| **Relayer** | `RELAYER_KEY` | Performs EOA baseline tests. | +| **AA User 1**| `OWNER_JASON_KEY` | Controls SuperPaymaster AA. | +| **AA User 2**| `OWNER_ANNI_KEY` | Controls Standard Paymaster AA. | diff --git a/0.16.23/guide/technical_plan.md b/0.16.23/guide/technical_plan.md new file mode 100644 index 000000000..96a0104c9 --- /dev/null +++ b/0.16.23/guide/technical_plan.md @@ -0,0 +1,510 @@ +# Technical Plan: SuperPaymaster & AAStar SDK Experiment + +Based on the analysis of `projects/SuperPaymaster/scripts/gasless-test/test-gasless-viem-v2-final.js`, here is the detailed technical plan for implementing the SDK and the 3-category account experiment. + +## 1. Paymaster Data Structure (SuperPaymaster V3/V4) +Unlike generic Paymasters, SuperPaymaster V3 uses a specific packed format for `paymasterAndData` to optimize for gas and community attribution. + +**Format (72 bytes):** +1. **Paymaster Address** (20 bytes) +2. **Verification Gas Limit** (16 bytes, uint128) - Default 160k (Safe buffer over 120k actual) +3. **PostOp Gas Limit** (16 bytes, uint128) - Default 10k +4. **Operator Address** (20 bytes) - *The Community Node sponsoring the tx* + +**Verification Logic:** +* **On-chain**: Checks if `sender` holds `MySBT` (Soulbound Token) and has sufficient `xPNTs` (Gas Token) balance. +* **Off-chain**: No HTTP signature required. Purely asset-based validation. + +## 2. Experiment Groups & Setup + +### Group A: Traditional EOA (Baseline) +* **Identity**: `PRIVATE_KEY` (Account A) from `.env`. +* **Mechanism**: Standard `eth_sendTransaction`. +* **Setup**: Needs ETH for gas. + +### Group B: Standard AA (Control) +* **Identity**: `OWNER_PRIVATE_KEY` (Account B) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp. +* **Paymaster**: Third-party Provider (e.g., Alchemy Gas Manager) or Bundler's native paymaster. +* **Setup**: Needs a Policy ID or Paymaster RPC URL. + +### Group C: SuperPaymaster AA (Treatment) +* **Identity**: `OWNER2_PRIVATE_KEY` (Account C) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp with `SuperPaymaster`. +* **Setup (Pre-requisites)**: + 1. **Mint MySBT**: Account must own a generic or community-specific SBT. + 2. **Token Balance**: Account must hold enough `xPNTs` (or `GTOKEN`) to cover the "Gas Credit". +* **Flow**: + 1. SDK constructs `paymasterAndData` with `OPERATOR` address. + 2. SDK Estimates gas (Optimized: Verification 160k, PostOp 10k). + 3. SDK Signs & Submits. + +## 3. Implementation Roadmap + +### Phase 1: SDK Update (`packages/superpaymaster`) +* **Completed**: Implemented `getPaymasterMiddleware` taking `operatorAddress`. +* **Completed**: Implemented V3 Packing Logic (`concat([pm, verGas, postOpGas, op])`). +* **Completed**: Implemented `checkEligibility` helper. + +### Phase 2: Experiment Script (`run_experiment_data.ts`) +* **Initialization**: Load Keys from `.env` (using global `@env/.env`). +* **Pre-Flight Check**: + * Check Group C eligibility. + * **Auto-Mint**: Logic inspired by `mint-sbt-for-aa.js`. +* **Execution Loop (30 Runs)**: + * **Group A**: `walletClient.sendTransaction`. + * **Group B**: `smartAccountClient.sendUserOperation` (using Alchemy Provider). + * **Group C**: `smartAccountClient.sendUserOperation` (using SuperPaymaster Middleware). +* **Data Recording**: Capture `receipt.gasUsed`, `effectiveGasPrice`. + +## 4. Key Configuration (from `.env`) +```bash +# Identities +PRIVATE_KEY=... # EOA / Deployer +OWNER_PRIVATE_KEY=... # Standard AA Owner +OWNER2_PRIVATE_KEY=...# SuperPaymaster AA Owner + +# Contracts (Sepolia) +SUPER_PAYMASTER_ADDRESS=0x34671Bf95159bbDAb12Ac1DA8dbdfEc5D5dC1c24 +MYSBT_ADDRESS=0xD1e6BDfb907EacD26FF69a40BBFF9278b1E7Cf5C +GAS_TOKEN_ADDRESS=0xfb56CB85C9a214328789D3C92a496d6AA185e3d3 +OPERATOR_ADDRESS=0x411BD567E46C0781248dbB6a9211891C032885e5 +``` + +## 5. Account Preparation Strategy + +| Group | Identity (Key) | Mechanism | Preparation & Requirements | Transaction Execution | +| :--- | :--- | :--- | :--- | :--- | +| **A: Traditional EOA** | `PRIVATE_KEY` | `eth_sendTx` | **Needs ETH**: Transfer Sepolia ETH from Faucet or Deployer. | `walletClient.sendTransaction` | +| **B: Standard AA** | `OWNER_PRIVATE_KEY` | ERC-4337 | **Needs ETH/Paymaster**: Needs ETH (if self-pay) or Paymaster Policy (if sponsored). | `smartAccountClient.sendUserOperation` (Generic) | +| **C: SuperPaymaster** | `OWNER2_PRIVATE_KEY` | ERC-4337 | **Needs MySBT + xPNTs**:
1. **Mint SBT**: Must own a Soulbound Token.
2. **Fund xPNTs**: Must have gas token balance.
*SDK `checkEligibility` verifies this.* | `smartAccountClient.sendUserOperation`
(with `getPaymasterMiddleware`) | + + + +## Inite Test Account and Asset/Data + +•开发环境: Node.js, npm/yarn。 +•基础包: 安装 @account-abstraction/sdk (或选择其他 SDK)。 +•私钥: 一个用于充当智能合约账户 拥有者 (Owner) 的 EOA 钱包私钥。 +•Sepolia ETH: 确保您的 EOA 拥有者地址和/或预计算的智能账户地址中有足够的 Sepolia ETH (除非您使用 Paymaster 赞助 Gas 费)。 +•SimpleAccountFactory: 0x9406Cc6185a346906296840746125a0e44976454 + + +import { SimpleAccountAPI } from "@account-abstraction/sdk"; +import { Wallet, providers } from "ethers";// 1. 配置 const OWNER_KEY = "YOUR_EOA_PRIVATE_KEY"; // 您的 EOA 私钥 const RPC_URL = "YOUR_SEPOLIA_BUNDLER_RPC_URL"; // 最好使用 Bundler 提供的 RPC const ENTRYPOINT_ADDRESS = "0x5FF137D4B0FDCD49DcA30c7CF57E578a026d2789"; const FACTORY_ADDRESS = "0x9406Cc6185a346906296840746125a0e44976454";// 2. 初始化 const provider = new providers.JsonRpcProvider(RPC_URL); const owner = new Wallet(OWNER_KEY, provider);const accountApi = new SimpleAccountAPI({ provider, entryPointAddress: ENTRYPOINT_ADDRESS, owner, factoryAddress: FACTORY_ADDRESS, });// 3. 预计算地址 (可选) const accountAddress = await accountApi.getCounterFactualAddress(); console.log(Smart Account Address: ${accountAddress});// 4. 发送首笔交易 (如果账户未部署,将自动部署) async function sendFirstUserOp() { // 构造 UserOperation 的交易部分 (例如: 发送 0.01 ETH 给自己) const tx = { target: accountAddress, // 目标地址 data: "0x", // 交易数据 value: providers.utils.parseEther("0.01"), // 交易金额 }; + 创建 UserOperation const userOp = await accountApi.createSignedUserOp(tx);// 提交给 Bundler const userOpHash = await provider.send( "eth_sendUserOperation", [userOp, ENTRYPOINT_ADDRESS] );console.log(UserOperation Hash: ${userOpHash}); // 随后可以使用 eth_getUserOperationReceipt 等方法追踪状态 }sendFirstUserOp(); + + 要实现真正的 Gasless (无 Gas 费) 创建和交易,您需要在初始化 SimpleAccountAPI 或构造 UserOperation 时加入 Paymaster 参数。大多数 SDK 都提供了 Paymaster 的集成选项,您只需将 Bundler RPC 切换为支持 Paymaster 的服务商(例如 Alchemy、Stackup、Pimlico)的端点即可实现 Gas 赞助。 + +基于Viem实现生成测试账户: +```javascript +import { createPublicClient, http, encodeFunctionData, getContractAddress, concat, numberToHex, zeroAddress } from 'viem' +import { sepolia } from 'viem/chains' + +// 1. 配置常量 (使用 v0.6 版本) +const FACTORY_ADDRESS = '0x9406Cc6185a346906296840746125a0e44976454'; // 你提供的 v0.6 Factory +const ENTRY_POINT_ADDRESS = '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'; + +// 你的 EOA 私钥对应的公钥地址 (作为新 AA 账户的 owner) +const OWNER_ADDRESS = '0xYourEOAWalletAddressHere...'; +const SALT = 0n; // 盐值,改变它可以生成不同的地址 + +// SimpleAccountFactory 的 ABI 片段 +const factoryAbi = [ + { + inputs: [ + { name: "owner", type: "address" }, + { name: "salt", type: "uint256" } + ], + name: "createAccount", + outputs: [{ name: "ret", type: "address" }], + stateMutability: "nonpayable", + type: "function" + } +] as const; + +async function main() { + const client = createPublicClient({ + chain: sepolia, + transport: http(), // 默认使用公共节点,建议替换为 Alchemy/Infura + }); + + console.log("--- 生成 ERC-4337 v0.6 SimpleAccount ---"); + + // 2. 生成 initCode + // initCode = Factory地址 + 编码后的函数调用数据 + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [OWNER_ADDRESS, SALT] + }); + + const initCode = concat([FACTORY_ADDRESS, factoryData]); + console.log(`InitCode: ${initCode}`); + + // 3. 预计算 Counterfactual Address (未部署也能知道地址) + // SimpleAccountFactory 使用 CREATE2。 + // 注意:手动计算 CREATE2 比较麻烦,需要知道 Factory 内部具体的 Bytecode 逻辑。 + // 更简单的方法是使用 client.readContract 模拟调用,或者利用 EntryPoint 的 getSenderAddress 报错机制。 + + // 这里演示最简单的:通过 EntryPoint 的 getSenderAddress 方法获取 + // 这种方法虽然看起来像是在“报错”,但这是 ERC-4337 标准获取地址的方式 + try { + const entryPointAbi = [{ + inputs: [{ name: "initCode", type: "bytes" }], + name: "getSenderAddress", + outputs: [], + stateMutability: "nonpayable", // 注意这里通常是 revert + type: "function" + }] as const; + + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: entryPointAbi, + functionName: 'getSenderAddress', + args: [initCode], + }); + } catch (error: any) { + // EntryPoint 会 revert 并携带 SenderAddress + // 我们需要解析这个 revert error + const senderAddress = extractAddressFromError(error); + if (senderAddress) { + console.log(`\n🎉 你的 AA 钱包地址是: ${senderAddress}`); + console.log(`你可以往这个地址转入 Sepolia ETH,然后在第一笔 UserOp 中带上 initCode 即可自动部署。`); + } else { + console.error("无法解析地址,请检查 RPC 节点是否支持 debug", error); + } + } +} + +// 辅助函数:从 Revert Error 中提取地址 +// 不同 RPC 返回的错误格式可能不同,这里是通用逻辑 +function extractAddressFromError(error: any): string | null { + const message = error.details || error.message || ""; + // 匹配 0x 开头的 40 位 hex 字符串 + const match = message.match(/0x[a-fA-F0-9]{40}/); + // 或者专门解析 SenderAddressResult 错误 (0xe90b7b15) + return match ? match[0] : null; +} + +main(); +``` + + + +```javascript +import { + createPublicClient, + http, + encodeFunctionData, + concat, + Hex, + pad, + keccak256, + toBytes, + encodeAbiParameters, + parseAbiParameters, + createWalletClient +} from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { sepolia } from 'viem/chains' + +// --- 1. 配置常量 (v0.7 标准) --- +// 官方 EntryPoint v0.7 +const ENTRY_POINT_ADDRESS = '0x0000000071727De22E5E9d8BAf0edAc6f37da032'; +// 官方 SimpleAccountFactory v0.7 +const FACTORY_ADDRESS = '0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985'; + +// 替换为你的 Bundler RPC (这里必须是 Bundler 节点,不能是普通节点) +// 可以在 Pimlico 或 Alchemy 申请免费的测试网 Key +const BUNDLER_RPC = 'https://api.pimlico.io/v2/sepolia/rpc?apikey=YOUR_API_KEY'; + +// 你的 EOA 私钥 (Owner) +const PRIVATE_KEY = '0xYOUR_PRIVATE_KEY_HERE'; + +const account = privateKeyToAccount(PRIVATE_KEY as Hex); + +// --- ABIs --- +const factoryAbi = [ + { inputs: [{ name: "owner", type: "address" }, { name: "salt", type: "uint256" }], name: "createAccount", outputs: [{ name: "ret", type: "address" }],stateMutability: "nonpayable", type: "function" } +] as const; + +const accountAbi = [ + { inputs: [{ name: "dest", type: "address" }, { name: "value", type: "uint256" }, { name: "func", type: "bytes" }], name: "execute", outputs: [], stateMutability: "nonpayable", type: "function" } +] as const; + +async function main() { + console.log("🚀 开始构建 UserOp (v0.7)..."); + + // 初始化 Bundler Client (本质上就是一个特定 RPC 的 PublicClient) + const client = createPublicClient({ + chain: sepolia, + transport: http(BUNDLER_RPC) + }); + + // 1. 计算 Sender 地址 (AA 钱包地址) + // v0.7 Factory 使用 createAccount(owner, salt) + const salt = 0n; + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [account.address, salt] + }); + // 如果是第一次使用,需要提供 factory + factoryData;如果已部署,则为空 + // 这里为了演示,假设是第一次,始终携带 initCode + const initCode = concat([FACTORY_ADDRESS, factoryData]); + + // 利用 EntryPoint 的 getSenderAddress 获取地址 (会 Revert) + let senderAddress: Hex; + try { + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "initCode", type: "bytes" }], name: "getSenderAddress", outputs: [], stateMutability: "nonpayable", type: "function" }] as const, + functionName: 'getSenderAddress', + args: [initCode] + }); + senderAddress = "0x" // 理论上不会走到这里 + } catch (err: any) { + // 解析 Revert Error 获取地址 + const msg = err.details || err.message; + const match = msg.match(/0x[a-fA-F0-9]{40}/); + if (!match) throw new Error("无法获取 Sender 地址"); + senderAddress = match[0]; + } + console.log(`📝 AA 钱包地址: ${senderAddress}`); + + // ⚠️ 检查:你的 AA 钱包里必须有 ETH 支付 Gas + const balance = await client.getBalance({ address: senderAddress }); + console.log(`💰 当前余额: ${balance.toString()} wei`); + if (balance === 0n) { + console.error("❌ 余额不足!请先往 AA 地址转入 Sepolia ETH"); + return; + } + + // 2. 构建 CallData (你想让 AA 做什么) + // 例子:给自己转 0 ETH (或者转给其他人) + const callData = encodeFunctionData({ + abi: accountAbi, + functionName: 'execute', + args: [account.address, 0n, "0x"] // 目标地址,金额,数据 + }); + + // 3. 获取 Nonce + // v0.7 中 Nonce 是一个 uint256,高 192 位是 Key,低 64 位是 Sequence + // 这里使用简单版:读取 EntryPoint 的 getNonce + const nonce = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "sender", type: "address" }, { name: "key", type: "uint192" }], name: "getNonce", outputs: [{ name: "nonce", type: "uint256" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getNonce', + args: [senderAddress, 0n] + }); + + // 4. 组装部分 PackedUserOp + // 注意:Gas 限制通常通过 eth_estimateUserOperationGas 获取 + // 这里我们先填一些占位符,然后请求 Bundler 估算 + const partialUserOp = { + sender: senderAddress, + nonce: nonce, + initCode: nonce === 0n ? initCode : "0x", // 只有第一次交易需要 initCode + callData: callData, + accountGasLimits: "0x", // 稍后填 + preVerificationGas: 0n, // 稍后填 + gasFees: "0x", // 稍后填 + paymasterAndData: "0x", // 自己付钱,无 Paymaster + signature: "0x" // 稍后签名 + }; + + // 5. 请求 Bundler 估算 Gas + // 注意:不同 Bundler 的返回值格式可能略有不同,这里使用标准 JSON-RPC 格式 + // Viem 的 request 方法可以直接发原始 RPC + const gasEstimate: any = await client.request({ + method: 'eth_estimateUserOperationGas' as any, + params: [ + { + ...partialUserOp, + initCode: partialUserOp.initCode, + callData: partialUserOp.callData, + paymasterAndData: "0x", + signature: "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c" // 假签名用于估算 + }, + ENTRY_POINT_ADDRESS + ] + }); + + // 提取 Gas 参数 (v0.7 采用了 packed 格式) + // verificationGasLimit (16 bytes) | callGasLimit (16 bytes) + const verificationGasLimit = BigInt(gasEstimate.verificationGasLimit ?? gasEstimate.verificationGas ?? 100000n); + const callGasLimit = BigInt(gasEstimate.callGasLimit ?? 100000n); + const accountGasLimits = concat([ + pad(toBytes(verificationGasLimit), { size: 16 }), + pad(toBytes(callGasLimit), { size: 16 }) + ]); + + const preVerificationGas = BigInt(gasEstimate.preVerificationGas ?? 50000n); + + // 获取当前费率 + const block = await client.getBlock(); + const maxPriorityFeePerGas = await client.request({ method: 'eth_maxPriorityFeePerGas' as any }); + const maxFeePerGas = block.baseFeePerGas! * 2n + BigInt(maxPriorityFeePerGas); + + // maxPriorityFeePerGas (16 bytes) | maxFeePerGas (16 bytes) + const gasFees = concat([ + pad(toBytes(BigInt(maxPriorityFeePerGas)), { size: 16 }), + pad(toBytes(maxFeePerGas), { size: 16 }) + ]); + + // 6. 最终组装 PackedUserOp + const userOp = { + sender: senderAddress, + nonce: nonce, + initCode: partialUserOp.initCode, + callData: callData, + accountGasLimits: accountGasLimits, + preVerificationGas: preVerificationGas, + gasFees: gasFees, + paymasterAndData: "0x" as Hex, + signature: "0x" as Hex + }; + + // 7. 计算 UserOp Hash 并签名 + // 需要按照 ERC-4337 v0.7 规范进行 Hash + const userOpHash = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ components: [{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}], name: "userOp", type: "tuple" }], name: "getUserOpHash", outputs: [{ name: "", type: "bytes32" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getUserOpHash', + args: [userOp] + }); + + console.log(`🔑 UserOp Hash: ${userOpHash}`); + + // Owner 签名 + const signature = await account.signMessage({ + message: { raw: userOpHash } + }); + + // 将签名填回 UserOp + userOp.signature = signature; + + // 8. 发送 UserOp 到 Bundler + console.log("📨 正在发送 UserOp..."); + const userOpHashRes = await client.request({ + method: 'eth_sendUserOperation' as any, + params: [userOp, ENTRY_POINT_ADDRESS] + }); + + console.log(`✅ 发送成功! UserOp Hash: ${userOpHashRes}`); + console.log(`🔗 查看链接: https://jiffyscan.xyz/userOpHash/${userOpHashRes}?network=sepolia`); +} + +main().catch(console.error); + +``` + +代码原理解析 +createAccount (InitCode): + +在 v0.7 中,工厂方法签名依然是 createAccount。 + +如果 initCode 不为空,EntryPoint 会先执行这个代码来部署合约,然后再执行后续的 execute。这就是为什么你不需要单独去部署合约,使用即部署。 + +UserOp 打包 (Packing): + +请注意代码中的 accountGasLimits 和 gasFees。在 v0.6 中,这些都是独立的 uint256 字段。 + +在 v0.7 中,为了节省 CallData 的 Gas 费用,它们被压缩成了 bytes32 (两个 uint128 拼接)。这是 v0.7 最显著的代码层面变化。 + +签名流程: + +getUserOpHash 是在链下完成的(虽然我用了 readContract 调用 EntryPoint 里的纯函数,这样最准确)。 + +拿到 Hash 后,EOA (Owner) 进行 ECDSA 签名。 + +SimpleAccount 的合约逻辑就是:校验签名(UserOpHash, Signature) == Owner。 + +Bundler: + +最后一步 eth_sendUserOperation 不是发给普通的以太坊节点,而是发给 Bundler。Bundler 会把它打包成一笔以太坊交易 (handleOps) 上链。 + +你的下一步 +把 BUNDLER_RPC 换成你申请到的 API (推荐 Pimlico 或 Alchemy)。 + +运行代码拿到 AA 钱包地址。 + +往这个地址转 0.01 Sepolia ETH。 + +再次运行代码,你应该能看到 发送成功 并在 Jiffyscan 上查到这笔 UserOp。 + +------ + +npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🗂️ backup and recover secrets: https://dotenvx.com/ops +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx4W1-vUePAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87?network=sepolia + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06?network=sepolia + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497?network=sepolia +(base) XBOX at ~/Dev/mycelium/my-exploration/projects/aastar-sdk ±(main) ✗ ❯ ruby-3.3.2 + +--------- + +$ npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx41-vnwAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. diff --git a/0.16.23/guide/use-cases/community-management.md b/0.16.23/guide/use-cases/community-management.md new file mode 100644 index 000000000..8fd172d9c --- /dev/null +++ b/0.16.23/guide/use-cases/community-management.md @@ -0,0 +1,141 @@ +# Community Management Guide + +Complete guide for managing DAOs and communities with AAStar SDK. + +## Overview + +This guide shows how to: +- Register a community +- Manage members with SBTs +- Configure reputation systems +- Deploy community tokens +- Set up gas sponsorship + +--- + +## Prerequisites + +- Community admin account +- Basic understanding of DAOs +- Testnet ETH for transactions + +--- + +## Step 1: Register Community + +```typescript +import { createCommunityClient } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const community = createCommunityClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.COMMUNITY_KEY), +}); + +// Register community +const txHash = await community.registerCommunity({ + name: 'DevDAO', + metadata: 'ipfs://QmCommunityMetadata...', +}); + +console.log('Community registered:', txHash); +``` + +--- + +## Step 2: Deploy Community Token + +```typescript +import { parseEther } from 'viem'; + +const tokenAddress = await community.deployXPNTs({ + name: 'DevDAO Points', + symbol: 'DDP', + initialSupply: parseEther('1000000'), +}); + +console.log('Token deployed at:', tokenAddress); +``` + +--- + +## Step 3: Configure Reputation System + +```typescript +await community.setReputationRules({ + rules: [ + { metric: 'code_contributions', weight: 40 }, + { metric: 'community_engagement', weight: 30 }, + { metric: 'governance_participation', weight: 30 }, + ], +}); +``` + +--- + +## Step 4: Manage Members + +```typescript +// Mint membership SBT +await community.mintSBT({ + to: memberAddress, + tokenId: 1n, + metadata: 'ipfs://QmMembershipBadge...', +}); + +// Distribute points +import { mintXPNTs } from '@aastar/tokens'; + +await mintXPNTs(community, memberAddress, parseEther('100')); +``` + +--- + +## Complete Example + +```typescript +async function setupCommunity() { + const community = createCommunityClient({...}); + + // 1. Register + await community.registerCommunity({ + name: 'DevDAO', + metadata: 'ipfs://...', + }); + + // 2. Deploy token + const tokenAddress = await community.deployXPNTs({ + name: 'DevDAO Points', + symbol: 'DDP', + initialSupply: parseEther('1000000'), + }); + + // 3. Set reputation rules + await community.setReputationRules({ + rules: [ + { metric: 'contributions', weight: 50 }, + { metric: 'engagement', weight: 50 }, + ], + }); + + // 4. Onboard members + const members = ['0x...', '0x...']; + for (const member of members) { + await community.mintSBT({ to: member, tokenId: 1n }); + await mintXPNTs(community, member, parseEther('100')); + } + + console.log('Community setup complete!'); +} +``` + +--- + +## Related + +- [Community API](/0.16.23/api/roles/community) +- [Tokens Module](/0.16.23/api/modules/tokens) +- [Identity Module](/0.16.23/api/modules/identity) diff --git a/0.16.23/guide/use-cases/gasless-transactions.md b/0.16.23/guide/use-cases/gasless-transactions.md new file mode 100644 index 000000000..938892c0b --- /dev/null +++ b/0.16.23/guide/use-cases/gasless-transactions.md @@ -0,0 +1,71 @@ +# Gasless Transactions Guide + +Complete guide for implementing gasless transactions with SuperPaymaster. + +## Overview + +Enable users to send transactions without holding ETH for gas fees. + +--- + +## Prerequisites + +- User has community SBT +- Community has gas sponsorship enabled +- User within credit limit + +--- + +## Implementation + +```typescript +import { createEndUserClient } from '@aastar/core'; +import { getPaymasterAndData, checkEligibility } from '@aastar/paymaster'; + +async function sendGaslessTransaction() { + const user = createEndUserClient({...}); + + // 1. Check eligibility + const eligible = await checkEligibility( + user.account.address, + communityAddress, + process.env.RPC_URL + ); + + if (!eligible) { + throw new Error('Not eligible'); + } + + // 2. Check credit + const credit = await user.getCreditLimit(); + console.log('Credit:', formatEther(credit)); + + // 3. Create UserOperation + const userOp = {...}; + + // 4. Get paymaster data + const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, + }); + + // 5. Submit + const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, + }); + + console.log('Gasless TX:', txHash); +} +``` + +--- + +## Related + +- [End User API](/0.16.23/api/roles/enduser) +- [Paymaster Module](/0.16.23/api/modules/paymaster) +- [SuperPaymaster Concept](/0.16.23/guide/concepts/superpaymaster) diff --git a/0.16.23/guide/use-cases/operator-staking.md b/0.16.23/guide/use-cases/operator-staking.md new file mode 100644 index 000000000..1c3325076 --- /dev/null +++ b/0.16.23/guide/use-cases/operator-staking.md @@ -0,0 +1,84 @@ +# Operator Staking Guide + +Complete guide for becoming a Paymaster operator. + +## Overview + +Stake GTokens and provide gas sponsorship services. + +--- + +## Steps + +### 1. Acquire GTokens + +```typescript +import { mintGToken } from '@aastar/tokens'; + +await mintGToken(client, operatorAddress, parseEther('1000')); +``` + +### 2. Approve Staking Contract + +```typescript +import { approveGToken } from '@aastar/tokens'; +import { CONTRACTS } from '@aastar/core'; + +await approveGToken( + client, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') +); +``` + +### 3. Stake + +```typescript +import { createOperatorClient } from '@aastar/core'; + +const operator = createOperatorClient({...}); + +await operator.stake({ amount: parseEther('100') }); +``` + +### 4. Deposit to Paymaster + +```typescript +await operator.deposit({ amount: parseEther('10') }); +``` + +--- + +## Complete Example + +```typescript +async function becomeOperator() { + const operator = createOperatorClient({...}); + + // 1. Mint GTokens + await mintGToken(operator, operator.account.address, parseEther('1000')); + + // 2. Approve + await approveGToken( + operator, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') + ); + + // 3. Stake + await operator.stake({ amount: parseEther('100') }); + + // 4. Deposit + await operator.deposit({ amount: parseEther('10') }); + + console.log('Operator setup complete!'); +} +``` + +--- + +## Related + +- [Operator API](/0.16.23/api/roles/operator) +- [Tokens Module](/0.16.23/api/modules/tokens) +- [Core Module](/0.16.23/api/modules/core) diff --git a/0.16.23/guide/use-cases/yop.md b/0.16.23/guide/use-cases/yop.md new file mode 100644 index 000000000..7ad1ec8ee --- /dev/null +++ b/0.16.23/guide/use-cases/yop.md @@ -0,0 +1,72 @@ +# Build Your Own Protocol (YOP) + +Guide for building custom protocols on AAStar infrastructure. + +## Overview + +AAStar SDK provides infrastructure to build Your Own Protocol with: +- Account Abstraction +- Gas sponsorship +- Community management +- Reputation systems + +--- + +## Architecture + +``` +Your Protocol +├── Smart Contracts +│ └── Custom logic +├── AAStar SDK +│ ├── Account Abstraction +│ ├── SuperPaymaster +│ └── Community Management +└── Frontend DApp + └── React + @aastar/dapp +``` + +--- + +## Example: Custom DeFi Protocol + +```typescript +import { createEndUserClient, createCommunityClient } from '@aastar/core'; + +// 1. Set up community +const community = createCommunityClient({...}); +await community.registerCommunity({ name: 'MyDeFi' }); + +// 2. Deploy community token +const tokenAddress = await community.deployXPNTs({ + name: 'MyDeFi Points', + symbol: 'MDP', + initialSupply: parseEther('1000000'), +}); + +// 3. Enable gasless transactions for users +const user = createEndUserClient({...}); +const eligible = await user.checkEligibility(communityAddress); + +// 4. Users can interact without gas fees +if (eligible) { + await sendGaslessTransaction(); +} +``` + +--- + +## Key Features + +1. **Gasless UX**: Users don't need ETH +2. **Community Tokens**: Custom reward systems +3. **Reputation**: On-chain reputation tracking +4. **Flexible**: Build any protocol logic + +--- + +## Related + +- [Core Module](/0.16.23/api/modules/core) +- [Community API](/0.16.23/api/roles/community) +- [SuperPaymaster Concept](/0.16.23/guide/concepts/superpaymaster) diff --git a/0.16.23/guide/verify.op-sepolia.contracts.md b/0.16.23/guide/verify.op-sepolia.contracts.md new file mode 100644 index 000000000..e612eb8c1 --- /dev/null +++ b/0.16.23/guide/verify.op-sepolia.contracts.md @@ -0,0 +1,22 @@ +# Verified SuperPaymaster Contracts (OP-Sepolia) + +The following contracts have been successfully verified on Etherscan/Blockscout for the Optimism Sepolia testnet. + +| Contract Name | Address | Explorer Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x9eC1FE8134A1C05aD34ba2E4e8758dAe0a009B94#code) | +| **Registry** | `0xcf6860Ab57de8669756997e414D9c52B6e301972` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xcf6860Ab57de8669756997e414D9c52B6e301972#code) | +| **GToken** | `0xC341c88453372021d0221834307613c2e99fE718` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0xC341c88453372021d0221834307613c2e99fE718#code) | +| **aPNTs** | `0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x3BBcA92Ad828b3dD619c980Ba09f929b9d2BC440#code) | +| **xPNTsFactory** | `0x7792a49C9E91e0E9B631B27D885d15e971B7482A` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x7792a49C9E91e0E9B631B27D885d15e971B7482A#code) | +| **GTokenStaking** | `0x5f57B931C849e8E255F22755506eB2255aB22a7C` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x5f57B931C849e8E255F22755506eB2255aB22a7C#code) | +| **MySBT** | `0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x2c3Ca1553dC1B8870381E8E56C7b3e3A3ae162f0#code) | +| **BLSValidator** | `0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x260fa905CcE1f5b29Afe9d627c01fAAE4A66A7F5#code) | +| **BLSAggregator** | `0x6e06b17b1a4D2D973F7E3e026e24b4393315736c` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x6e06b17b1a4D2D973F7E3e026e24b4393315736c#code) | +| **ReputationSystem** | `0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x891EC0f84D9275839B8dAf74e87B23F2DBd7f9c9#code) | +| **DVTValidator** | `0x0087cA806109E150438116cAA414580BB5fa9195` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x0087cA806109E150438116cAA414580BB5fa9195#code) | +| **PaymasterFactory** | `0x1e3b9d12eAc27867a523d0537902441B0E7D98d8` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x1e3b9d12eAc27867a523d0537902441B0E7D98d8#code) | +| **PaymasterV4Impl** | `0x906123080207F250B1C9F299991512Cb31f35b2f` | [View on Explorer](https://sepolia-optimism.etherscan.io/address/0x906123080207F250B1C9F299991512Cb31f35b2f#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985` are infrastructure contracts and are already verified.* diff --git a/0.16.23/guide/verify.sepolia.contracts.md b/0.16.23/guide/verify.sepolia.contracts.md new file mode 100644 index 000000000..945a2b372 --- /dev/null +++ b/0.16.23/guide/verify.sepolia.contracts.md @@ -0,0 +1,22 @@ +# Verified SuperPaymaster Contracts (Sepolia) + +The following contracts have been successfully verified on Etherscan for the Sepolia testnet. + +| Contract Name | Address | Etherscan Link | +| :--- | :--- | :--- | +| **SuperPaymaster** | `0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A` | [View on Etherscan](https://sepolia.etherscan.io/address/0x16cE0c7d846f9446bbBeb9C5a84A4D140fAeD94A#code) | +| **Registry** | `0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788` | [View on Etherscan](https://sepolia.etherscan.io/address/0x7Ba70C5bFDb3A4d0cBd220534f3BE177fefc1788#code) | +| **GToken** | `0x9ceDeC089921652D050819ca5BE53765fc05aa9E` | [View on Etherscan](https://sepolia.etherscan.io/address/0x9ceDeC089921652D050819ca5BE53765fc05aa9E#code) | +| **aPNTs** | `0xDf669834F04988BcEE0E3B6013B6b867Bd38778d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xDf669834F04988BcEE0E3B6013B6b867Bd38778d#code) | +| **xPNTsFactory** | `0x6EafdA3477F3eec1F848505e1c06dFB5532395b6` | [View on Etherscan](https://sepolia.etherscan.io/address/0x6EafdA3477F3eec1F848505e1c06dFB5532395b6#code) | +| **GTokenStaking** | `0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x1118eAf2427a5B9e488e28D35338d22EaCBc37fC#code) | +| **MySBT** | `0x677423f5Dad98D19cAE8661c36F094289cb6171a` | [View on Etherscan](https://sepolia.etherscan.io/address/0x677423f5Dad98D19cAE8661c36F094289cb6171a#code) | +| **BLSValidator** | `0x04590731005d25d379A55b6c3136B5CD1eaC757F` | [View on Etherscan](https://sepolia.etherscan.io/address/0x04590731005d25d379A55b6c3136B5CD1eaC757F#code) | +| **BLSAggregator** | `0xe380d443842A8A37F691B9f3EF58e40073759edc` | [View on Etherscan](https://sepolia.etherscan.io/address/0xe380d443842A8A37F691B9f3EF58e40073759edc#code) | +| **ReputationSystem** | `0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC` | [View on Etherscan](https://sepolia.etherscan.io/address/0x4b256541Ff4021f8D8229908C2BEd9c15Fd8afCC#code) | +| **DVTValidator** | `0xcB42417Cfb374e923BAF729040d9973FB7676537` | [View on Etherscan](https://sepolia.etherscan.io/address/0xcB42417Cfb374e923BAF729040d9973FB7676537#code) | +| **PaymasterFactory** | `0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d` | [View on Etherscan](https://sepolia.etherscan.io/address/0xfDE4671581F21C9e54Cafa95FA6Da98678750F4d#code) | +| **PaymasterV4Impl** | `0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf` | [View on Etherscan](https://sepolia.etherscan.io/address/0x0EBEDa248D53678D493f62719b3ce34DDb3CAcFf#code) | + +--- +*Note: EntryPoint `0x0000000071727De22E5E9d8BAf0edAc6f37da032` and SimpleAccountFactory `0x91E60482a2B343004dF29EB205C4F6916E864700` are infrastructure contracts and are already verified.* diff --git a/0.16.23/index.md b/0.16.23/index.md new file mode 100644 index 000000000..6ac576c31 --- /dev/null +++ b/0.16.23/index.md @@ -0,0 +1,98 @@ +--- +layout: home + +hero: + name: AAStar SDK + text: Build Your Own Protocol + tagline: Account Abstraction infrastructure with SuperPaymaster, EOA Rainbow Bridge, and Community Management + image: + src: /aastar-logo.png + alt: AAStar SDK + actions: + - theme: brand + text: Get Started + link: /0.16.23/guide/getting-started + - theme: alt + text: View on GitHub + link: https://github.com/AAStarCommunity/aastar-sdk + +features: + - icon: 🚀 + title: Gasless Transactions + details: SuperPaymaster (AOA+) enables users to send transactions without holding native tokens for gas fees. + + - icon: 🌈 + title: EOA Rainbow Bridge + details: Seamlessly bridge between traditional EOA wallets and smart contract accounts. + + - icon: 🏛️ + title: Community Management + details: Built-in tools for managing DAOs, communities, and reputation systems. + + - icon: 🎯 + title: Reputation System + details: On-chain reputation tracking with customizable rules and scoring mechanisms. + + - icon: 🔐 + title: Account Abstraction + details: Full ERC-4337 support with advanced features like session keys and social recovery. + + - icon: ⚡ + title: Multi-Chain Ready + details: Deploy on Ethereum, Optimism, and other EVM-compatible chains. +--- + +> [!WARNING] +> **Archived documentation — SDK v0.16.23.** This is a frozen snapshot of an older release. For the latest version, see the [current documentation](/). + +

+ License: MIT + TypeScript + Status + Last Updated +

+ + + +## Quick Example + +```typescript +import { createOperatorClient } from '@aastar/sdk'; +import { parseEther, http } from 'viem'; +import { privateKeyToAccount } from 'viem/accounts'; +import { sepolia } from 'viem/chains'; + +// Create operator client +const operator = createOperatorClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.OPERATOR_KEY), +}); + +// Stake GTokens (used for role collateral) +await operator.stake({ + amount: parseEther('100'), +}); + +// Deposit aPNTs (used for sponsoring gas) +await operator.deposit({ + amount: parseEther('10'), +}); +``` + +## Why AAStar SDK? + +AAStar SDK provides a complete infrastructure for building **Your Own Protocol (YOP)** with Account Abstraction. Whether you're building a DAO, a DeFi protocol, or a consumer app, AAStar gives you the tools to: + +- **Eliminate gas friction** for your users +- **Manage communities** with on-chain reputation +- **Bridge traditional wallets** to smart accounts +- **Customize gas sponsorship** rules + +## Trusted By + +Used by developers building the next generation of Web3 applications. + + diff --git a/0.16.23/zh/api/index.md b/0.16.23/zh/api/index.md new file mode 100644 index 000000000..26829c722 --- /dev/null +++ b/0.16.23/zh/api/index.md @@ -0,0 +1,7 @@ +# API 文档 + +API 参考文档统一维护英语版本,以确保信息的准确性与实时性。 + +请访问: +- [API 概览与快速入门](/0.16.23/api/) +- [SDK 核心模块](/0.16.23/api/@aastar/sdk) diff --git a/0.16.23/zh/examples/community-flow.md b/0.16.23/zh/examples/community-flow.md new file mode 100644 index 000000000..94311acf5 --- /dev/null +++ b/0.16.23/zh/examples/community-flow.md @@ -0,0 +1,38 @@ +# 社区流程 (Community Flow) + +本示例演示了社区管理员如何注册社区并为成员配置声誉规则。 + +## 关键步骤 + +1. **注册**: 在 Registry 中登记社区信息。 +2. **配置 SBT**: 设置灵魂绑定代币的元数据及其发放规则。 +3. **铸造 (Mint)**: 为新加入的成员分发 SBT。 +4. **声誉规则 (Reputation)**: 设置基于链上行为的自动积分逻辑。 + +## 代码预览 + +```typescript +import { createCommunityClient } from '@aastar/sdk'; + +const community = createCommunityClient({ + // ... 配置项 +}); + +// 1. 注册新社区 +await community.registerCommunity({ + name: '创新开发者 DAO', + metadata: 'ipfs://Qm...', +}); + +// 2. 为成员分发身份标识 +await community.mintSBT({ + to: '0xMemberAddress', + tokenId: 1n, +}); +``` + +## 运行方式 + +```bash +pnpm run example:community +``` diff --git a/0.16.23/zh/examples/complete-workflow.md b/0.16.23/zh/examples/complete-workflow.md new file mode 100644 index 000000000..4379477b2 --- /dev/null +++ b/0.16.23/zh/examples/complete-workflow.md @@ -0,0 +1,10 @@ +# Complete Workflow Example + +This example demonstrates a complete workflow using all SDK features. + +Based on the regression test suite. + +\`\`\`typescript +// See SDK repo: scripts/99_final_v2_regression.ts +// for the complete implementation +\`\`\` diff --git a/0.16.23/zh/examples/enduser-flow.md b/0.16.23/zh/examples/enduser-flow.md new file mode 100644 index 000000000..aecc08bf9 --- /dev/null +++ b/0.16.23/zh/examples/enduser-flow.md @@ -0,0 +1,33 @@ +# 终端用户流程 (End User Flow) + +本示例展示了普通用户如何利用社区信用实现 Gasless (免 Gas) 交易。 + +## 关键步骤 + +1. **账户连接**: 识别或创建用户的智能账户 (Smart Account)。 +2. **信用查询**: 确认用户在目标社区是否有足够的可用信用。 +3. **构造交易**: 准备业务数据(如 Token 转账或合约调用)。 +4. **免 Gas 发送**: 调用 `sendGaslessTransaction`,由 SuperPaymaster 支付手续费。 + +## 代码预览 + +```typescript +import { createEndUserClient } from '@aastar/sdk'; + +const user = createEndUserClient({ + // ... 配置项 +}); + +// 使用社区信用发起转账,无需持有 ETH +await user.sendGaslessTransaction({ + to: '0xTargetReceiver', + data: '0x...', + communityAddress: '0xMyCommunity', +}); +``` + +## 运行方式 + +```bash +pnpm run example:enduser +``` diff --git a/0.16.23/zh/examples/index.md b/0.16.23/zh/examples/index.md new file mode 100644 index 000000000..0ad699552 --- /dev/null +++ b/0.16.23/zh/examples/index.md @@ -0,0 +1,18 @@ +# 完整示例概览 (Examples Overview) + +本章节包含 AAStar SDK 在各种角色和使用场景下的完整端到端示例。 + +## 可用示例 + +- **[运营商流程 (Operator Flow)](./operator-flow)**: 质押与管理 SuperPaymaster。 +- **[社区流程 (Community Flow)](./community-flow)**: 注册社区并设置声誉规则。 +- **[终端用户流程 (End User Flow)](./enduser-flow)**: 使用社区信用发送 Gasless 交易。 +- **[多链配置 (Multi-Chain Setup)](./multi-chain)**: 在不同网络间配置和使用 SDK。 + +## 本地运行示例 + +大多数示例可以在本地 Anvil 实例上运行。请确保你已预先在本地部署了 [AAStar 合约](https://github.com/AAStarCommunity/SuperPaymaster)。 + +```bash +pnpm run example:local +``` diff --git a/0.16.23/zh/examples/multi-chain.md b/0.16.23/zh/examples/multi-chain.md new file mode 100644 index 000000000..a008782b5 --- /dev/null +++ b/0.16.23/zh/examples/multi-chain.md @@ -0,0 +1,46 @@ +# 多链配置 (Multi-Chain Setup) + +AAStar SDK 原生支持多链架构,允许开发者在不同的 EVM 网络上无缝切换。 + +## 支持的网络 + +目前 SDK 预置了以下网络配置: + +- **Sepolia**: 默认主测试网。 +- **OP Sepolia**: 用于测试 L2 性能的优化网络。 +- **Foundry/Anvil**: 用于极速迭代的本地网络。 + +## 网络切换示例 + +```typescript +import { createEndUserClient } from '@aastar/sdk'; +import { optimismSepolia } from 'viem/chains'; +import { http } from 'viem'; + +// 切换到 Optimism Sepolia +const user = createEndUserClient({ + chain: optimismSepolia, + transport: http('https://opt-sepolia.g.alchemy.com/v2/...'), + account: myAccount, +}); + +// SDK 会自动注入该链的官方合约地址 +console.log('当前 Registry 地址:', user.addresses.registry); +``` + +## 自定义网络 + +如果使用的是私有链或未预置的测试网: + +```typescript +const customUser = createEndUserClient({ + chain: myCustomChain, + transport: http(), + account: myAccount, + addresses: { + registry: '0x...', + superPaymaster: '0x...', + // ... 手动指定合约地址 + } +}); +``` diff --git a/0.16.23/zh/examples/operator-flow.md b/0.16.23/zh/examples/operator-flow.md new file mode 100644 index 000000000..1bd74117a --- /dev/null +++ b/0.16.23/zh/examples/operator-flow.md @@ -0,0 +1,37 @@ +# 运营商流程 (Operator Flow) + +本示例展示了如何使用 `OperatorClient` 来质押代币并注册成为 SuperPaymaster 提供者。 + +## 关键步骤 + +1. **初始化**: 创建 `OperatorClient`。 +2. **质押 (Staking)**: 向合约质押 GTokens。 +3. **存款 (Deposit)**: 向 Paymaster 资金池存入代币以供用户使用。 +4. **状态查询**: 验证运营商的在线状态和抵押率。 + +## 代码预览 + +```typescript +import { createOperatorClient } from '@aastar/sdk'; +import { parseEther } from 'viem'; + +const operator = createOperatorClient({ + // ... 配置项 +}); + +// 1. 质押 100 GTokens +await operator.stake({ + amount: parseEther('100'), +}); + +// 2. 存入 10 ETH 作为 Gas 储备 +await operator.deposit({ + amount: parseEther('10'), +}); +``` + +## 运行方式 + +```bash +pnpm run example:operator +``` diff --git a/0.16.23/zh/guide/CLI_GUIDE.md b/0.16.23/zh/guide/CLI_GUIDE.md new file mode 100644 index 000000000..ab1feb75a --- /dev/null +++ b/0.16.23/zh/guide/CLI_GUIDE.md @@ -0,0 +1,48 @@ +# SuperPaymaster V3 SDK 测试指南 (CLI) + +本文档面向开发者,提供 SuperPaymaster V3 系统在本地 Anvil 环境下的各种测试和初始化命令。 + +## 🛠 准备工作 +在开始任何测试前,请确保: +1. 本地 `anvil` 已启动 (`anvil`)。 +2. 位于 `projects/aastar-sdk` 目录。 +3. `.env.v3` 文件存在(如果不存在,运行初始化脚本会自动创建)。 + +--- + +## 🚀 常用指令集 + +### 1. 初始化运行 (Init & Setup) +**场景**: 第一次运行测试,或者 Anvil 重启后需要重新同步合约状态。 +```bash +./run_full_regression.sh --init-only +# 或者直接运行全量回归,它会自动包含初始化 +pnpm run test:full +``` + +### 2. 快速回归测试 (Fast Test / Pre-commit) +**场景**: 日常开发中,快速验证核心安全逻辑(权限检查、影子账户等)。这也集成在 Git Pre-commit Hook 中。 +```bash +pnpm run test:fast +``` +*运行脚本: `scripts/99_bug_hunting_fast.ts`* + +### 3. 全量场景回归 (Full Regression) +**场景**: 发布前验收,验证全部 72 个真实业务场景。包括重新部署、同步配置和运行所有核心测试脚本。 +```bash +pnpm run test:full +``` + +--- + +## 📊 测试报告解析 +测试完成后,你会看到一个统一的报告。 + +> [!IMPORTANT] +> **报喜也报忧**: 我们的测试套件会截获每个脚本的内部 Revert。如果脚本输出中包含 "reverted" 或 "Error",即便脚本没退出,回归套件也会将其标记为 **FAILED**。 + +--- + +## 🔍 故障排查 +- **Panic: Allocated too much memory**: 这是 Anvil 在处理复杂 `roleData` 时的已知限制。 +- **DepositNotVerified**: 确保在调用 `notifyDeposit` 前,对应账户已向 Paymaster 合约转入足够的 aPNTs 代币。 diff --git a/0.16.23/zh/guide/DOCUMENTATION_PLAN.md b/0.16.23/zh/guide/DOCUMENTATION_PLAN.md new file mode 100644 index 000000000..c28a7aac0 --- /dev/null +++ b/0.16.23/zh/guide/DOCUMENTATION_PLAN.md @@ -0,0 +1,455 @@ +# AAStar SDK 文档生成和发布方案 + +## 概述 + +本文档定义了AAStar SDK的完整文档生成、维护和发布流程。 + +--- + +## 1. 技术栈选择 + +### 推荐方案: VitePress + +**优势**: +- ⚡ 基于Vite,构建速度极快 +- 📝 原生Markdown支持 +- 🎨 Vue组件集成 +- 🔍 内置全文搜索 +- 📱 响应式设计 +- 🚀 零配置部署到GitHub Pages/Vercel + +**替代方案**: Docusaurus (React生态) + +--- + +## 2. 仓库架构 + +### 2.1 SDK仓库 (`aastar-sdk`) + +``` +aastar-sdk/ +├── packages/ # SDK源码 +│ ├── core/ +│ ├── account/ +│ ├── paymaster/ +│ └── ... +├── docs/ # 文档源文件 +│ ├── guide/ # 手写指南 +│ │ ├── getting-started.md +│ │ ├── concepts.md +│ │ └── use-cases/ +│ │ ├── community-management.md +│ │ ├── gasless-transactions.md +│ │ └── operator-staking.md +│ ├── api/ # 自动生成的API文档 +│ │ ├── core.md +│ │ ├── account.md +│ │ └── ... +│ └── examples/ # 完整示例 +│ ├── operator-flow.md +│ ├── community-flow.md +│ └── enduser-flow.md +├── scripts/ +│ ├── generate-api-docs.ts # API文档生成脚本 +│ └── sync-to-docs-repo.sh # 同步到文档仓库 +└── package.json +``` + +### 2.2 文档仓库 (`aastar-docs`) + +``` +aastar-docs/ +├── .vitepress/ +│ ├── config.ts # VitePress配置 +│ ├── theme/ # 自定义主题 +│ └── components/ # Vue组件 +├── public/ # 静态资源 +│ ├── logo.svg +│ └── images/ +├── index.md # 首页 +├── guide/ # 从SDK repo同步 +├── api/ # 从SDK repo同步 +├── examples/ # 从SDK repo同步 +└── package.json +``` + +--- + +## 3. 自动化工作流 + +### 3.1 API文档自动生成 + +使用 **TypeDoc** 或 **API Extractor** 从TypeScript源码提取API文档。 + +**脚本**: `scripts/generate-api-docs.ts` + +```typescript +import { Application } from 'typedoc'; + +async function generateAPIDocs() { + const app = new Application(); + + app.options.addReader(new TypeDocReader()); + app.bootstrap({ + entryPoints: ['packages/*/src/index.ts'], + out: 'docs/api', + plugin: ['typedoc-plugin-markdown'], + }); + + const project = app.convert(); + await app.generateDocs(project, 'docs/api'); +} +``` + +### 3.2 文档同步流程 + +文档同步使用 `scripts/extract-docs.sh` 腳本,手動調用命令為 `pnpm run docs:sync`。 + +**流程**: +1. 在 `aastar-sdk` 運行 `pnpm run docs:generate` 生成最新 API 文檔。 +2. 運行 `pnpm run docs:sync` 將 `docs/` 文件夾內容同步到 `aastar-docs`。 +3. 同步過程會保持相同的目錄結構 (`guide/`, `api/`, `examples/`)。 + +**Shell 腳本核心邏輯**: +\`\`\`bash +# 同步 Guide +cp -r "$SDK_REPO/docs/guide/"* "$DOCS_REPO/guide/" +# 同步 API +cp -r "$SDK_REPO/docs/api/"* "$DOCS_REPO/api/" +# 同步 Examples +cp -r "$SDK_REPO/docs/examples/"* "$DOCS_REPO/examples/" +\`\`\` + + + +### 3.3 文档站点部署 + +Use docs repo shell to deploy. +--- + +## 4. 文档结构设计 + +### 4.1 首页 (index.md) + +```markdown +# AAStar SDK + +> Build Your Own Protocol (YOP) with Account Abstraction + +## Features +- 🚀 Gasless Transactions (SuperPaymaster AOA+) +- 🌈 EOA Rainbow Bridge +- 🏛️ Community Management +- 🎯 Reputation System + +## Quick Start +[Get Started →](/0.16.23/guide/getting-started) +``` + +### 4.2 指南结构 + +``` +guide/ +├── index.md # 指南概览 +├── getting-started.md # 快速开始 +├── concepts/ +│ ├── account-abstraction.md +│ ├── superpaymaster.md +│ └── reputation-system.md +├── use-cases/ +│ ├── community-management.md +│ ├── gasless-transactions.md +│ ├── operator-staking.md +│ └── rainbow-bridge.md +└── advanced/ + ├── custom-paymaster.md + └── multi-chain.md +``` + +### 4.3 API文档结构 (按角色组织) + +``` +api/ +├── index.md # API概览 +├── roles/ +│ ├── operator.md # Operator角色API +│ ├── community.md # Community角色API +│ ├── enduser.md # EndUser角色API +│ └── admin.md # Admin角色API +├── modules/ +│ ├── core.md # Core模块 +│ ├── account.md # Account模块 +│ ├── paymaster.md # Paymaster模块 +│ ├── tokens.md # Tokens模块 +│ └── identity.md # Identity模块 +└── types/ + ├── common.md # 通用类型 + └── errors.md # 错误类型 +``` + +--- + +## 5. API文档模板 + +### 5.1 模块文档模板 + +```markdown +# @aastar/core + +Core configuration and client creation utilities. + +## Installation + +\`\`\`bash +pnpm add @aastar/core +\`\`\` + +## Exports + +- [Networks](#networks) +- [Contracts](#contracts) +- [Clients](#clients) +- [Constants](#constants) + +--- + +## Networks + +### getNetwork() + +Get network configuration for a supported network. + +**Signature:** +\`\`\`typescript +function getNetwork(network: SupportedNetwork): NetworkConfig +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| network | `SupportedNetwork` | Network name ('sepolia' \| 'optimism' \| 'anvil') | + +**Returns:** +| Type | Description | +|------|-------------| +| `NetworkConfig` | Network configuration object | + +**Type Definitions:** +\`\`\`typescript +type SupportedNetwork = 'sepolia' | 'optimism' | 'optimism-sepolia' | 'anvil'; + +interface NetworkConfig { + chainId: number; + name: string; + rpcUrl: string; + blockExplorer: string; + nativeCurrency: { + name: string; + symbol: string; + decimals: number; + }; +} +\`\`\` + +**Example:** +\`\`\`typescript +import { getNetwork } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log(network.chainId); // 11155111 +console.log(network.rpcUrl); // 'https://rpc.sepolia.org' +\`\`\` + +**Errors:** +- Throws if network is not supported + +**See Also:** +- [getTxUrl()](#gettxurl) +- [getChainId()](#getchainid) +``` + +### 5.2 角色文档模板 + +```markdown +# Operator API + +API reference for Paymaster operators. + +## Overview + +Operators are responsible for: +- Staking GTokens +- Depositing to Paymaster +- Managing withdrawals +- Monitoring performance + +## Client Creation + +### createOperatorClient() + +Create a client for Paymaster operators. + +[详细文档...] + +## Actions + +### stake() + +Stake GTokens to become an operator. + +**Context:** Use this when you want to register as a Paymaster operator. + +**Prerequisites:** +- Must have GTokens +- Must approve GTokenStaking contract + +**Signature:** +\`\`\`typescript +stake(params: StakeParams): Promise +\`\`\` + +**Parameters:** +| Name | Type | Description | +|------|------|-------------| +| params.amount | `bigint` | Amount to stake (in wei) | + +**Returns:** +| Type | Description | +|------|-------------| +| `Promise` | Transaction hash | + +**Example:** +\`\`\`typescript +import { createOperatorClient } from '@aastar/core'; +import { parseEther } from 'viem'; + +const operator = createOperatorClient({...}); + +// Approve first +await operator.approveGToken({ + spender: CONTRACTS.sepolia.gTokenStaking, + amount: parseEther('100'), +}); + +// Then stake +const txHash = await operator.stake({ + amount: parseEther('100'), +}); +\`\`\` + +**Errors:** +- `InsufficientBalance` - Not enough GTokens +- `InsufficientAllowance` - Need to approve first +- `MinimumStakeNotMet` - Amount below minimum + +**Events Emitted:** +- `Staked(operator, amount)` + +**See Also:** +- [deposit()](#deposit) +- [withdraw()](#withdraw) +``` + +--- + +## 6. 实施步骤 + +### Phase 1: 基础设施搭建 (1-2天) + +- [ ] 创建`aastar-docs`仓库 +- [ ] 安装VitePress并配置 +- [ ] 设置GitHub Actions自动部署 +- [ ] 配置自定义域名`docs.aastar.io` + +### Phase 2: API文档生成 (2-3天) + +- [ ] 安装TypeDoc和相关插件 +- [ ] 编写`generate-api-docs.ts`脚本 +- [ ] 为每个模块生成API文档 +- [ ] 添加类型定义和错误说明 + +### Phase 3: 指南编写 (3-5天) + +- [ ] 编写快速开始指南 +- [ ] 编写核心概念文档 +- [ ] 编写用例文档(社区管理、无Gas交易等) +- [ ] 编写高级主题文档 + +### Phase 4: 角色文档 (2-3天) + +- [ ] 按角色组织API文档 +- [ ] 为每个角色编写完整工作流 +- [ ] 添加实际代码示例 +- [ ] 添加最佳实践 + +### Phase 5: 自动化和优化 (1-2天) + +- [ ] 设置自动同步workflow +- [ ] 添加文档搜索功能 +- [ ] 优化移动端显示 +- [ ] 添加代码playground (可选) + +--- + +## 7. 维护流程 + +### 日常维护 + +1. **代码变更时**: + - 开发者提交PR + - CI自动运行`pnpm run docs:generate` + - 检查API文档变更 + - 合并后自动同步到docs repo + +2. **手动文档更新**: + - 在SDK repo的`docs/`目录编辑 + - 提交后自动同步 + +3. **版本发布**: + - 打tag时自动生成版本化文档 + - 保留历史版本文档 + +### 质量保证 + +- [ ] 文档链接检查 +- [ ] 代码示例可运行性测试 +- [ ] TypeScript类型检查 +- [ ] Markdown格式检查 + +--- + +## 8. 工具和脚本 + +### package.json scripts + +```json +{ + "scripts": { + "docs:generate": "tsx scripts/generate-api-docs.ts", + "docs:dev": "vitepress dev docs", + "docs:build": "vitepress build docs", + "docs:preview": "vitepress preview docs", + "docs:sync": "bash scripts/sync-to-docs-repo.sh" + } +} +``` + +--- + +## 9. 参考资源 + +- [VitePress官方文档](https://vitepress.dev) +- [TypeDoc文档](https://typedoc.org) +- [Viem文档](https://viem.sh) (参考其文档结构) +- [Ethers.js文档](https://docs.ethers.org) (参考其API组织方式) + +--- + +## 11. 論文數據採集指南 (PhD Data collection) + +詳細指南請參見: [paper-data-collection.md](file:///Users/jason/Dev/mycelium/my-exploration/projects/aastar-sdk/docs/paper-data-collection.md) + +**核心要點**: +- 所有實驗必須使用 `aastar-sdk` 實作。 +- 使用 `run_automated_experiment.sh` 進行自動化運行。 +- 數據採集涵蓋: Gas Usage, Latency, Throughput (TPS), Cost (USD)。 diff --git a/0.16.23/zh/guide/Plan.md b/0.16.23/zh/guide/Plan.md new file mode 100644 index 000000000..a886088d8 --- /dev/null +++ b/0.16.23/zh/guide/Plan.md @@ -0,0 +1,266 @@ +# AAStar计划 + + +## V2 + +好的,完全理解你的思路!MVP阶段聚焦核心功能,快速验证,是非常明智的选择。 + +根据你的优先级分析: + +* **最高优先级 (High Priority - H)**: + 1. 核心账户功能 (二次签名验证 + 整体集成,包括Relay) + 2. Demo 应用 (页面JS版本 + 简单后端配合,为后续集成COS72做准备) +* **中等优先级 (Medium Priority - M)**: + 1. 基础的Gasless功能对接 (SuperPaymaster的初步集成) +* **低优先级 (Low Priority - L)**: + 1. SDSS的完全去中心化 (先采用中心化或简化版) + 2. 完整的SDK化 + 3. 其他高级功能和研究性课题 + +现在,我们基于这个思路,从你之前的详细任务列表中筛选和重组,形成一个更聚焦的MVP计划表格。 + +--- + +## AirAccount MVP 开发计划 (V2) + +### 一、最高优先级 (High Priority - H) + +#### H1. 核心账户功能与集成 (Core Account Functionality & Integration) + - [ ] **H1.1 账户基础与二次签名验证 (Account Primitives & Dual-Signature Verification)** + - [ ] H1.1.1 最小版二次签名验证账户的合约实现 (BLS with DVT or simplified approach for MVP, plan EIP-7212 for future) + - [ ] H1.1.2 账户的注册、生成流程实现 + - [ ] H1.1.3 指纹 (Passkey) 绑定与账户管理 (添加、查询) 的基本API和逻辑 + - [ ] **H1.2 TEE 集成与核心钱包逻辑 (TEE Integration & Core Wallet Logic)** + - [ ] H1.2.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) 的核心功能 (私钥安全存储与签名) + - [ ] H1.2.2 不可信应用 (CA) 与 TEE API 的基础交互逻辑 (用于Demo调用) + - [ ] H1.2.3 CA 与 TA 的核心交互流程联调 (签名请求与响应) + - [ ] **H1.3 Relay 与 Bundler 核心功能 (Relay & Bundler Core Functionality)** + - [ ] H1.3.1 内部 Bundler 的核心实现 (打包UserOperation) + - [ ] H1.3.2 Relay 的核心实现 (接收CA请求,与TEE交互,与Bundler交互,提交交易) + - [ ] **H1.4 整体核心流程联调 (Overall Core Flow Integration & Testing)** + - [ ] H1.4.1 从用户发起操作 (CA) -> Relay -> TEE签名 -> Bundler打包 -> 交易上链 的核心流程联调 + - [ ] H1.4.2 部署与测试环境搭建 (例如,本地测试网,目标硬件初步验证 NXP iMX93) + +#### H2. Demo 应用与初步用户体验 (Demo Application & Initial UX) + - [ ] **H2.1 Demo 前端页面 (JS 版本) (Demo Frontend - JS Version)** + - [ ] H2.1.1 核心账户操作的用户界面 (账户创建、指纹绑定、发起简单交易) + - [ ] H2.1.2 与后端/Relay交互的API调用实现 + - [ ] H2.1.3 基本的用户反馈和状态显示 + - [ ] **H2.2 Demo 简易后端/模拟服务 (Demo Simplified Backend/Mock Service)** + - [ ] H2.2.1 (如果需要) 提供必要的后端API支持Demo前端 (例如,用户管理、状态查询的简化版) + - [ ] H2.2.2 (如果需要) 模拟部分链上交互或TEE行为,以便前端独立开发和测试 + - [ ] **H2.3 Demo 流程验证与用户体验初步打磨 (Demo Flow Validation & Initial UX Refinement)** + - [ ] H2.3.1 完整演示核心账户创建、绑定、使用流程 + - [ ] H2.3.2 收集初步用户体验反馈,进行界面和流程优化 + +### 二、中等优先级 (Medium Priority - M) + +#### M1. 基础 Gasless 功能对接 (Basic Gasless Functionality Integration) + - [ ] **M1.1 SuperPaymaster 初步集成 (Initial SuperPaymaster Integration)** + - [ ] M1.1.1 部署或对接一个基础功能的 Paymaster 合约 + - [ ] M1.1.2 实现 AirAccount 账户与该 Paymaster 的交互逻辑 (例如,允许特定ERC20代付) + - [ ] M1.1.3 在 Demo 应用中集成基础的 Gasless 交易体验 (例如,特定操作免Gas) + - [ ] **M1.2 Gasless 流程测试与验证 (Gasless Flow Testing & Validation)** + - [ ] M1.2.1 测试通过 Paymaster 完成 ERC20 代付的流程 + - [ ] M1.2.2 验证 Gasless 交易的正确性和稳定性 + +--- + +**计划V2说明与思考:** + +1. **聚焦核心**: 这个版本严格筛选了任务,确保所有高优先级任务都直接服务于“可用的核心账户”和“能展示核心价值的Demo”。 +2. **二次签名验证的简化**: 在H1.1.1中提到 "BLS with DVT or simplified approach for MVP",意味着MVP阶段可以考虑一个更易于快速实现的二次签名方案,后续再升级到更复杂的链上验证方案。 +3. **TEE的核心价值**: H1.2 强调了TEE在私钥安全存储和签名方面的核心作用,这是AirAccount安全性的基石。 +4. **Relay是枢纽**: H1.3 将Relay和Bundler作为核心集成部分,它们是连接用户、TEE和区块链的关键。 +5. **Demo驱动**: H2 的目标是快速构建一个能跑通核心流程的Demo,用于验证、展示和收集早期反馈。先有JS版本,后续再考虑集成到COS72。 +6. **Gasless作为重要加分项**: M1 将基础的Gasless功能作为中等优先级,因为它能显著提升用户体验,是账户抽象的一个重要特性。MVP阶段实现基础对接即可。 +7. **隐含的任务**: + * **合约部署与管理**: 部署账户合约、Paymaster合约等。 + * **测试用例编写**: 对核心功能进行单元测试和集成测试。 + * **文档**: 核心API和流程的初步文档。 +8. **后续迭代**: + * **低优先级任务**: SDSS的去中心化、完整的SDK、社交恢复、ERC-7702、更多应用协议、AI集成等都放在MVP成功验证之后。 + * **COS72集成**: 在Demo JS版本稳定后,再考虑将其能力集成到更成熟的COS72框架中。 + +这个V2计划更加精炼,目标更明确,希望能帮助你的团队高效推进MVP的开发。记住,MVP的关键在于“最小”和“可行”,快速迭代,持续优化。 + +-------- +下面是V1的 + +------ + +好的,这是一个非常详细和全面的开发计划!我将根据你提供的架构思考、Research重点和明细开发任务,帮你整理成一个包含checkbox的计划表格。 + +**重要说明:** + +* **层级与拆解**: 你提到了“表格罗列两层任务足够”,但你提供的明细任务非常细致,很多可以看作是第三层甚至第四层的任务。为了保持表格的可读性,我会尽量将相关的细致任务组织在更大的特性或模块下。 +* **负责人与时间**: 这个表格**不包含**负责人和预计完成时间,这些需要你和你的团队根据实际情况来分配。 +* **依赖关系**: 很多任务之间存在依赖关系,这个表格主要关注任务列表,具体的依赖管理需要在项目管理工具中体现。 +* **动态调整**: 这是一个初步的计划,实际开发过程中肯定会遇到变化,需要灵活调整。 +* **N0-N3**: 我理解这是指不同的部署阶段或节点类型,在相关任务中会体现。 + +**开发计划表格 (Markdown格式)** + +--- + +## AirAccount 开发计划 + +### 一、基础设施 (Infrastructure) + +#### 1. 核心账户与签名 (Core Account & Signature) + - [ ] **1.1 账户基础 (Account Primitives)** + - [ ] 1.1.1 最小版二次签名验证账户的注册、生成 (BLS with DVT, plan EIP-7212) + - [ ] 1.1.2 指纹 (Passkey) 绑定与账户管理 (添加、查询) + - [ ] **1.2 Paymaster 与 Gas 管理 (Paymaster & Gas Management)** + - [ ] 1.2.1 使用 Paymaster 完成 ERC20 代付 + - [ ] 1.2.2 Gas Card 设计:查询、绑定、ERC20 代扣 + - [ ] **1.3 Bundler 与 Relay (Bundler & Relay)** + - [ ] 1.3.1 Bundler 实现:从外部依赖过渡到内部 Bundler + - [ ] 1.3.2 优化:内部 Bundler 与 Paymaster Relay 合并,实现一步提交 + - [ ] **1.4 TEE 集成与硬件钱包交互 (TEE Integration & HW Wallet Interaction)** + - [ ] 1.4.1 AirAccount Relay 在 ARM 平台运行 TEE Wallet (TA) + - [ ] 1.4.2 不可信应用 (CA) 开发 + - [ ] 1.4.3 CA 通过 TEE API 调用可信应用 TA (硬件钱包) 的联合调试 + - [ ] **1.5 社交恢复与账户升级 (Social Recovery & Account Upgrade)** + - [ ] 1.5.1 AirAccount 社交恢复的多签账户设计与实现 + - [ ] 1.5.2 AirAccount 账户升级到社交恢复多签账户的流程 + - [ ] 1.5.3 (可选) ERC-7702 账户集成与多签恢复嵌入 + - [ ] **1.6 整体联调与测试 (Overall Integration & Testing)** + - [ ] 1.6.1 整体 AirAccount 基础设施联调 (目标平台: NXP iMX93 或更低配置) + +#### 2. SDSS (Standardized Decentralized Service System) - V0.1 + - [ ] **2.1 核心服务与API (Core Services & API)** + - [ ] 2.1.1 SDSS ENS (或类似域名服务) 实现 + - [ ] 2.1.2 SDSS API 服务基础框架搭建 + - [ ] 2.1.3 路由注册、发现机制 + - [ ] 2.1.4 API 标准数据提交、更新、缓存、错误处理机制 + - [ ] **2.2 核心提交服务 (Core Submission Service)** + - [ ] 2.2.1 SDSS Submit 服务基础:一次提交 (Gas Sponsor + Bundler 上链) + +#### 3. 客户端与工具 (Client & Tools) + - [ ] **3.1 Tauri 客户端 (Tauri Client)** + - [ ] 3.1.1 Tauri 客户端多端发布与测试 + - [ ] 3.1.2 Tauri 集成测试:COS72 基础 Web 版本开发与集成 + - [ ] **3.2 SSO 与 SDK (SSO & SDK)** + - [ ] 3.2.1 SSO (单点登录) 插件/JS/SDK 开发与测试 + +### 二、框架层 (Framework) + +#### 4. AAStar SDK 与集成 + - [ ] **4.1 AAStar SDK 开发 (AAStar SDK Development)** + - [ ] 4.1.1 AAStar SDK Web 版本开发与测试 + - [ ] **4.2 COS72 与 AAStar SDK 集成 (COS72 & AAStar SDK Integration)** + - [ ] 4.2.1 COS72 与 AAStar SDK 集成测试 + +#### 5. Relay 技术栈演进与集成 (Relay Stack Evolution & Integration) + - [ ] **5.1 Relay 版本统一 (Relay Version Unification)** + - [ ] 5.1.1 Go 版本 Relay 与 Rust 版本 Relay 的尝试合并/搬迁 + - [ ] **5.2 Rust Relay 集成 (Rust Relay Integration)** + - [ ] 5.2.1 Rust 版本 Relay 集成到 COS72 (N0-N3 部署) + +#### 6. SDSS 服务集成到 COS72 (SDSS Service Integration into COS72) + - [ ] **6.1 文件服务 SDSS (File Service SDSS)** + - [ ] 6.1.1 文件服务 SDSS 集成到 COS72 + - [ ] **6.2 Supabase SDSS (Supabase SDSS)** + - [ ] 6.2.1 Supabase (或类似 BaaS) SDSS 集成到 COS72 + - [ ] **6.3 硬件钱包 SDSS (Hardware Wallet SDSS)** + - [ ] 6.3.1 硬件钱包 SDSS 集成到 COS72 + +#### 7. COS72 可定制化与发布 (COS72 Customization & Release) + - [ ] **7.1 可定制化 COS72 (Customizable COS72)** + - [ ] 7.1.1 COS72 配置化方案设计与实现 + - [ ] 7.1.2 COS72 构建 (Build) 流程优化 + - [ ] 7.1.3 COS72 发布流程建立 + +### 三、应用层 (Application) + +#### 8. 核心协议与应用 (Core Protocols & Applications) + - [ ] **8.1 OpenPNTs (Programmable Non-fungible Tokens)** + - [ ] 8.1.1 OpenPNTs 协议设计与基础应用开发 + - [ ] 8.1.2 OpenPNTs 集成到 COS72 + - [ ] **8.2 OpenCards** + - [ ] 8.2.1 OpenCards 协议设计与基础应用开发 + - [ ] 8.2.2 OpenCards 集成到 COS72 + - [ ] **8.3 Uniswap V4 Launchpad (可选/探索)** + - [ ] 8.3.1 Uniswap V4 Launchpad 功能开发 + +#### 9. PNTs 发行与演示 (PNTs Issuance & Demo) + - [ ] **9.1 PNTs 发行流程设计 (PNTs Issuance Flow Design)** + - [ ] 9.1.1 PNTs 发行流程 (线上线下、链上) Demo 设计 + - [ ] **9.2 PNTs 发行流程开发 (PNTs Issuance Flow Development)** + - [ ] 9.2.1 PNTs 发行流程功能开发 + +#### 10. COS72 版本发布 (COS72 Release) + - [ ] **10.1 COS72 V0.14 发布** + - [ ] 10.1.1 实现无侵入使用特性 + - [ ] 10.1.2 实现随时解绑账户特性 + - [ ] 10.1.3 支持用户发行自己的积分和 GasCard + +#### 11. AAStar 生态应用 (AAStar Ecosystem Applications) + - [ ] **11.1 AAStar 积分 (aPNTs)** + - [ ] 11.1.1 AAStar 发行自己的积分 aPNTs (基于 OpenPNTs) + - [ ] 11.1.2 aPNTs 引入 SDSS,管理积分发行 + +#### 12. Arcadia (探索性项目) + - [ ] **12.1 Arcadia 设计与 Demo 开发** + - [ ] 12.1.1 Arcadia 概念讨论与哲学 AI 基础研究 + - [ ] 12.1.2 Arcadia Demo2 开发 + +#### 13. 插件生态 (Plugin Ecosystem) + - [ ] **13.1 插件规划** + - [ ] 13.1.1 ~20+ 插件的思考、规划与优先级排序 + +### 四、AI 集成 (AI Integration) - (探索与研究阶段为主) + +#### 14. AI 辅助决策与知识库 (AI-Assisted Decision Making & Knowledge Base) + - [ ] **14.1 人生路径与未来知识库** + - [ ] 14.1.1 知识库构建与使用场景探索 + - [ ] **14.2 常规选择与决策 AI 辅助** + - [ ] 14.2.1 AI 辅助模型研究与原型 + - [ ] **14.3 消费决策 AI** + - [ ] 14.3.1 消费决策 AI 模型研究与原型 + +#### 15. Crypto + AI (Asset3) + - [ ] **15.1 Asset3 概念与实现探索** + - [ ] 15.1.1 Crypto 资产与 AI 结合的创新应用探索 + +### 五、Research 重点 (与开发并行或指导开发) + +*(这些是研究方向,可能不会直接转化为开发任务,但会影响设计和实现)* + - [ ] **R1. 签名方案研究** + - [ ] R1.1 当前签名方案优化与安全性分析 (BLS, EIP-7212 等) + - [ ] R1.2 后量子密码 (PQC) 签名方案调研与集成可行性分析 + - [ ] **R2. TEE 可信方案研究** + - [ ] R2.1 TEE 技术栈选择与安全性评估 (e.g., Intel SGX, ARM TrustZone) + - [ ] R2.2 TEE 证明与远程认证机制研究 + - [ ] **R3. 漏洞与作恶防范研究** + - [ ] R3.1 硬件层面漏洞分析与防范 (TEE, Secure Element) + - [ ] R3.2 应用层面安全设计与代码审计方法研究 + - [ ] R3.3 智能合约安全审计与形式化验证方法研究 + - [ ] **R4. 隐私保护技术研究** + - [ ] R4.1 ZKP (零知识证明) 在账户抽象和 SDSS 中的应用研究 + - [ ] R4.2 匿名地址与隐私交易方案研究 + - [ ] **R5. SDSS V0.1 性能评估** + - [ ] R5.1 SDSS V0.1 效率、吞吐量、延迟等性能指标测试与分析 + - [ ] **R6. SDSS V0.2 (P2P) 演进研究** + - [ ] R6.1 SDSS 引入 P2P 网络后的架构变化、性能影响、去中心化程度分析 + +--- + +**使用建议:** + +1. **优先级排序**: 你的任务列表非常庞大。强烈建议根据 MVP (最小可行产品) 原则,对这些任务进行优先级排序。哪些是核心功能,哪些是后续迭代? +2. **分配负责人和时间**: 将每个 `- [ ]` 任务分配给具体的负责人,并估算完成时间。 +3. **工具**: 使用专业的项目管理工具 (如 Jira, Trello, Asana, Notion, ClickUp 等) 来跟踪这些任务、依赖关系和进度。这个 Markdown 表格可以作为初始导入或高级概览。 +4. **迭代**: 将开发过程划分为多个 Sprint 或迭代,每个迭代有明确的目标。 +5. **定期同步**: 团队内部需要定期开会同步进度、讨论问题和调整计划。 + +这个计划表非常宏大,预祝你的项目顺利推进! + +分析和思考: +当务之急是MVP,因此 +1. 低优先级:SDSS是去中心化的,可以独立和分离,因此降低优先级,先中心化,再去中心,迁移难度不大 +2. 低优先级:相对独立的Superpaymaster,Gasless是独立的,可选的,因此中等优先级,完成基础的对接和基础的gasless即可 +3. 最高优先级:账户是串联所有的基础,目前核心是二次签名验证+整体集成(relay等),非SDK(后面再整合为sdk) +4. 考虑demo也是高优先级,因此需要页面和服务器配合,先有页面js版本,再集成到cos72 +5. 所以计划的第二个版本,只设计高优先级(两个)和中等优先级(1个),请按这个思路筛选,不必那么严苛任务数量 diff --git a/0.16.23/zh/guide/SDK_Optimization_Evaluation_Plan.md b/0.16.23/zh/guide/SDK_Optimization_Evaluation_Plan.md new file mode 100644 index 000000000..df05ce7f5 --- /dev/null +++ b/0.16.23/zh/guide/SDK_Optimization_Evaluation_Plan.md @@ -0,0 +1,51 @@ +# SDK & Contract Optimization Evaluation Plan (GBT5.2 Recommendations) + +## 概述 +本方案针对 GBT5.2 对 `aastar-sdk` 及相关合约 ABI 扫描后给出的建议进行评估,并制定后续优化计划。我们将建议分为 **SDK 优化**、**合约安全加固** 以及 **架构对齐** 三个维度,并根据优先级划定动作:**优化 (Optimize)**、**置之不理 (Ignore)** 或 **更好的方案 (Better Solution)**。 + +--- + +## 评估与动作列表 + +### 1. SDK 侧建议评估 (packages/superpaymaster & core) + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`getPaymasterAndData` 输入上界校验** | 高 | **优化 (Optimize)** | `uint128` 溢出或格式错误会导致 Bundler 端不可预测的失败。应在 SDK 侧拦截并抛出清晰错误。 | +| **`checkEligibility` 移除硬编码 Sepolia** | 中 | **优化 (Optimize)** | 支持多链是 SDK 的基本要求。应允许用户传入 `chainId` 或从 `provider` 自动获取。 | +| **`formatUserOpToBundlerV07` 字段长度严格断言** | 高 | **优化 (Optimize)** | V0.7 格式对字节长度(如 `0x...` 字符串长度)有严格要求,由于 JS 没有原生固定长度字节类型,SDK 必须代劳检查。 | + +### 2. 合约侧(基于 ABI 反推)建议评估 + +| 建议点 | 评估 | 动作 | 理由/方案 | +| :--- | :--- | :--- | :--- | +| **`PaymasterV4` 价格预言机新鲜度与权限校验** | 极高 | **优化 (Optimize)** | 关键安全路径。需确认合约源码中是否有 `updatedAt` 和 `roundId` 校验。SDK 侧无法修正,需同步到合约端。 | +| **`SuperPaymasterV3` 债务隔离与 Slash 路径** | 高 | **优化 (Optimize)** | 多运营方模式下,用户债务必须隔离。Slash 逻辑需严格绑定 BLS 证明,防止误伤或攻击。 | +| **`BLS/DVT` 聚合签名实操验证** | 极高 | **更好的方案 (Better Solution)** | 若目前仅为逻辑占位,主网前必须实现完整的 BLS 配对验证,或先行降级为多签治理方案以保安全。 | +| **`Registry` 重放攻击防御 (Epoch/Nonce)** | 中 | **优化 (Optimize)** | Reputation 同步必须单调递增或带 Nonce,防止过期状态覆盖新状态。 | +| **`ReputationSystemV3` 数组上限与 NFT 真实性** | 中 | **优化 (Optimize)** | 防止 Gas DoS 攻击。NFT Boost 必须做 `balanceOf` 校验而非仅仅依赖输入数组。 | + +--- + +## 执行计划与优先级 + +### 第一阶段:SDK 鲁棒性增强 (Priority: P0) +**目标**:确保 SDK 生成的 Payload 100% 符合规范,并能拦截低级输入错误。 +- [ ] 在 `getPaymasterAndData` 中增加 `uint128` 范围检查与地址合法性检查。 +- [ ] 重构 `checkEligibility`,支持从配置或环境中读取 `chainId`。 +- [ ] 为 `formatUserOpToBundlerV07` 增加对 `Hex` 长度的显式断言。 + +### 第二阶段:合约安全与逻辑核对 (Priority: P1) +**目标**:将 ABI 发现的高风险点在合约源码中进行逐一核对与修复。 +- [ ] 对接 `SuperPaymaster` 仓库,核对 `PaymasterV4` 和 `SuperPaymasterV3` 的关键权限代码。 +- [ ] 评估 `BLS/DVT` 的实现深度,并给出迁移/补全方案。 + +### 第三阶段:文档与标准对齐 (Priority: P2) +**目标**:更新技术文档,确保 SDK 行为与合约逻辑完全一致。 +- [ ] 更新 `projects/aastar-sdk/docs` 下的各组件文档。 + +--- + +## 备注 +> [!IMPORTANT] +> 由于本仓库仅包含 ABI 且当前处于 SDK 开发模式,上述合约侧建议需在切换至合约仓库时强制执行。SDK 的优化可即刻开始。 diff --git a/0.16.23/zh/guide/Security-solution.md b/0.16.23/zh/guide/Security-solution.md new file mode 100644 index 000000000..52e99439f --- /dev/null +++ b/0.16.23/zh/guide/Security-solution.md @@ -0,0 +1,106 @@ +除了 `pnpm audit`(主要针对已知 CVE 漏洞),一个健壮的 npm/TypeScript 项目还需要在**供应链安全**、**代码静态分析**、**密钥管理**和**CI/CD 集成**这几个维度建立防线。 + +针对你作为资深开发者的背景(Web3/Rust/Node),以下是更进阶的**最佳实践和工具推荐**: + +### 1. 供应链安全防御 (Supply Chain Security) + +`pnpm audit` 只能告诉你依赖包有没有“已知漏洞”,但无法检测**恶意代码注入**(如 typosquatting 或被劫持的包)。 + +* **Socket.dev (强烈推荐)** +* **作用:** 它不仅检查 CVE,还分析包的“行为”。比如:一个 UI 库突然开始读取环境变量或发送网络请求,Socket 会报警。 +* **集成:** 有 GitHub App,也可以作为 CLI 运行。它能拦截包含恶意 install script 的包。 + + +* **OSSF Scorecard** +* **作用:** Google 开源的工具,给依赖项打分。它会检查维护状态、是否有 CI、是否进行代码审查等,帮助你判断引入一个库是否“健康”。 + + +* **Lockfile 锁定** +* **实践:** 在 CI/CD 环境中必须使用 `pnpm install --frozen-lockfile`。这确保了 CI 构建使用的版本与你本地完全一致,防止在构建时悄悄拉取了被篡改的补丁版本。 + + + +### 2. 静态代码分析 (SAST) + +利用工具在代码运行前发现逻辑漏洞。 + +* **ESLint Security Plugins** +* 不要只用标准的 lint 规则,需添加安全专用插件: +* `eslint-plugin-security`: 识别潜在的热点(如正则表达式 DoS 攻击 ReDoS、不安全的 `eval` 等)。 +* `eslint-plugin-no-secrets`: 防止意外提交密钥。 + + +* **CodeQL (GitHub Native)** +* **作用:** 如果你的项目在 GitHub 上,开启 **Code Scanning**。CodeQL 是一种语义代码分析引擎,能发现数据流中的漏洞(如 SQL 注入、NoSQL 注入、XSS),比正则匹配更深入。 + + +* **SonarQube / SonarCloud** +* 企业级的代码质量和安全扫描,对于 TypeScript 的支持非常好,能发现复杂的逻辑漏洞(Code Smells)。 + + + +### 3. TypeScript 专有安全配置 + +TypeScript 本身就是第一道防线,但需要正确配置: + +* **启用 `strict: true`** +* 这是基础。除此之外,开启 `noImplicitAny` 和 `strictNullChecks` 可以消除绝大多数 `undefined` 导致的运行时崩溃(DoS 风险)。 + + +* **避免类型断言 (`as`) 和 `any`** +* 使用 `zod` 或 `io-ts` 进行**运行时数据验证 (Runtime Validation)**。不要盲目相信 API 返回的数据就是 TS 定义的类型。 +* **Bad:** `const data = await res.json() as User;` +* **Good:** `const data = UserSchema.parse(await res.json());` (这在 Web3 数据处理中尤为重要,防止恶意构造的 Payload 导致逻辑错误)。 + + + +### 4. 脚本与权限控制 (Scripts & Permissions) + +npm 的 `postinstall` 脚本是恶意软件最常见的入侵途径。 + +* **禁用 Install Scripts** +* 在 `.npmrc` 中设置 `ignore-scripts=true`。 +* 如果是必须运行脚本的依赖(如 `husky`, `esbuild`),使用 `pnpm approve-builds` (pnpm 特有功能) 或 `allow-scripts` 插件来**白名单**放行特定包。 + + +* **LavaMoat (进阶)** +* 由 MetaMask 團隊開發(很適合你的背景)。它可以為每個 npm 包生成策略文件,限制某个包只能访问 `fs` 模块,或者只能访问特定的全局变量。 + + + +### 5. 密钥与硬编码扫描 + +Web3 项目最怕泄露私钥或 API Key。 + +* **GitGuardian / TruffleHog** +* **作用:** 在 commit 之前(pre-commit hook)或 CI 阶段扫描代码库,寻找像 AWS Key、Private Key、Infura Key 这种高熵字符串。 + + +* **Dotenv 最佳实践** +* 强制将 `.env` 加入 `.gitignore`。 +* 使用 `dotenv-safe` 或 `envalid` 库,在应用启动时校验必要的环境变量是否存在且符合格式,否则直接报错退出。 + + + +### 6. 自动化依赖更新 (Bot) + +* **Renovate Bot (优于 Dependabot)** +* 相比 Dependabot,Renovate 配置更灵活。你可以设置策略:补丁版本(Patch)自动合并,次要版本(Minor)需人工 Review。保持依赖最新可以大大减少被利用已知漏洞的窗口期。 + + + +### 总结:一份推荐的 CI/CD 安全检查清单 + +在你的 GitHub Actions / GitLab CI 中,建议包含以下步骤: + +1. **Checkout** +2. **Secret Scan:** 运行 `trufflehog` 检查本次 commit 是否包含密钥。 +3. **Dependency Integrity:** `pnpm install --frozen-lockfile --ignore-scripts`。 +4. **SCA Scan:** 运行 `socket` (Socket.dev) 或 `snyk test` 检查依赖风险。 +5. **Linting:** `pnpm lint` (包含 `eslint-plugin-security`)。 +6. **Build:** 确保构建成功(利用 TS 类型检查)。 +7. **Test:** 单元测试覆盖核心业务逻辑。 + +### 下一步 + +如果你对 **Socket.dev** 或 **LavaMoat** 感兴趣,我可以为你提供一个具体的配置示例,或者帮你写一个 GitHub Action 的 workflow 文件来集成这些工具。 \ No newline at end of file diff --git a/0.16.23/zh/guide/TEST_COMMANDS.md b/0.16.23/zh/guide/TEST_COMMANDS.md new file mode 100644 index 000000000..63c5507d9 --- /dev/null +++ b/0.16.23/zh/guide/TEST_COMMANDS.md @@ -0,0 +1,125 @@ +# 🚀 AAStar SDK 测试命令完整指南 + +本文档提供所有测试命令的详细说明,包括如何在不同网络间切换。 + +--- + +## 📋 快速参考 + +### 主要测试命令 + +| 命令 | 用途 | 网络依赖 | 时间 | +|------|------|---------|------| +| `pnpm run test:full_anvil` | 完整协议回归(72场景) | Anvil专用 | 5-10分钟 | +| `pnpm run test:full_sdk` | SDK功能验证(6场景) | **任意网络** | ~30秒 | +| `pnpm run test:init` | 环境初始化 | Anvil | ~2分钟 | + +--- + +## 🌐 网络切换指南(适用于 `test:full_sdk`) + +`test:full_sdk` 可以在任意 EVM 网络上运行,只需修改配置文件: + +### 方法1: 使用不同的 `.env` 文件 + +#### 步骤1: 创建网络专用配置文件 + +```bash +# Sepolia测试网配置 +cp .env.v3 .env.sepolia + +# Mainnet配置 +cp .env.v3 .env.mainnet +``` + +#### 步骤2: 编辑配置文件 + +**`.env.sepolia` 示例**: +```bash +# 网络RPC +RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_API_KEY + +# 管理员私钥(请从加密存储中读取,不要硬编码!) +ADMIN_KEY=0x... + +# Sepolia上的合约地址 +REGISTRY_ADDRESS=0x1234... +GTOKEN_ADDRESS=0x5678... +GTOKEN_STAKING_ADDRESS=0x9abc... +SUPER_PAYMASTER_ADDRESS=0xdef0... +APNTS_ADDRESS=0x1111... +MYSBT_ADDRESS=0x2222... +``` + +#### 步骤3: 运行测试时指定配置 + +修改 `scripts/99_final_v2_regression.ts` 第26行: + +```typescript +// 默认(Anvil本地) +dotenv.config({ path: path.resolve(process.cwd(), '.env.v3') }); + +// 切换到Sepolia +dotenv.config({ path: path.resolve(process.cwd(), '.env.sepolia') }); +``` + +--- + +### 方法2: 使用环境变量覆盖(推荐) + +直接在命令行传递参数: + +```bash +# Sepolia测试 +RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY \ +ADMIN_KEY=0xYourKey \ +REGISTRY_ADDRESS=0x... \ +pnpm run test:full_sdk +``` + +--- + +## 📝 详细命令说明 + +### 1. **完整协议回归测试** - `test:full_anvil` + +```bash +pnpm run test:full_anvil +``` + +**特点**: +- 🔄 自动重启 Anvil(干净状态) +- 📦 自动部署所有合约 +- 🧪 运行 17 个独立测试脚本 +- ⚠️ **仅支持 Anvil**(使用 anvil 特殊 RPC 功能) + +### 2. **SDK功能验证** - `test:full_sdk` + +```bash +pnpm run test:full_sdk +``` + +**特点**: +- 🌐 **支持任意 EVM 网络**(Anvil/Sepolia/Mainnet) +- 🚀 快速执行(~30秒) +- ✅ 自动检测并初始化测试环境 + +--- + +## 📊 测试覆盖率对比 + +| 测试套件 | 场景数 | 分支覆盖 | 网络支持 | 执行时间 | +|---------|-------|---------|---------|---------| +| `test:full_anvil` | 72 | 95% | Anvil | 5-10分钟 | +| `test:full_sdk` | 6 | SDK核心 | **任意** | ~30秒 | + +--- + +## 🔗 相关资源 + +- **SDK开发指南**: [`README.md`](../README.md) +- **架构设计**: [`docs/task_breakdown.md`](./task_breakdown.md) + +--- + +**由 AAStarCommunity 维护 | 最后更新: 2025-12-25** diff --git a/0.16.23/zh/guide/TEST_COVERAGE_MATRIX.md b/0.16.23/zh/guide/TEST_COVERAGE_MATRIX.md new file mode 100644 index 000000000..4abb12241 --- /dev/null +++ b/0.16.23/zh/guide/TEST_COVERAGE_MATRIX.md @@ -0,0 +1,72 @@ +# SDK测试覆盖率矩阵 + +## 当前覆盖状态 (scripts/99_final_v2_regression.ts) + +### 角色覆盖率: 100% (4/4) + +| 角色 | 客户端 | 已覆盖场景 | 缺失场景 | 覆盖率 | +|------|--------|-----------|---------|--------| +| **运营商** | OperatorClient | Staking, Deposit (Push) | Withdraw, Pull Deposit, Treasury管理 | 40% | +| **社区** | CommunityClient | Registration, SBT Minting | xPNTs部署, 声誉规则配置, SBT空投 | 33% | +| **终端用户** | EndUserClient | Credit Query | Gasless Transaction, 债务还款 | 20% | +| **管理员** | AdminClient | Slashing | 全局参数, DVT配置, 费用调整 | 25% | + +### 用户场景覆盖率: 100% (17/17) ✅ **Phase 2 完成** + +#### ✅ 已覆盖场景 (6个) + +1. **Operator Staking** - 运营商质押GToken +2. **Paymaster Deposit (Push)** - 运营商存款(Push模式) +3. **Community Registration** - 社区注册 +4. **SBT Minting** - SBT铸造(通过registerRoleSelf) +5. **Admin Slashing** - 管理员惩罚 +6. **Credit Query** - 信用额度查询 + +#### ❌ 缺失场景 (5个 - Phase 2) + +**运营商场景** (2个): +13. Operator Pull Deposit - Pull模式存款 +14. Treasury Management - 国库地址管理 + +**社区场景** (1个): +15. Community Pause - 暂停/恢复社区 + +**管理员场景** (2个): +16. Global Parameters - 全局参数调整(完整实现) +17. Fee Configuration - 费用配置 + +--- + +## 扩展计划 + +### Phase 1: 核心场景补充 (优先级: P0) + +添加以下6个高优先级场景到 `99_final_v2_regression.ts`: + +1. **Operator Withdraw** - 验证提款逻辑 +2. **xPNTs Deployment** - 社区代币部署 +3. **Gasless Transaction** - 终端用户无Gas交易 +4. **Reputation Rules** - 声誉规则配置 +5. **SBT Airdrop** - 批量空投 +6. **Global Parameters** - 全局参数调整 + +### Phase 2: 完整覆盖 (优先级: P1) + +添加剩余5个场景,达到95%覆盖率 (16/17)。 + +--- + +## 目标 + +- **角色覆盖**: 100% (已达成) +- **场景覆盖**: 95% (16/17) - 当前35% (6/17) +- **分支覆盖**: 90%+ (核心逻辑) + +--- + +## 实施状态 + +- [x] 创建覆盖率矩阵文档 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 1) - 70%覆盖率达成 +- [x] 扩展 `99_final_v2_regression.ts` (Phase 2) - **100%覆盖率达成** 🎉 +- [x] 验证100%覆盖率达成 diff --git a/0.16.23/zh/guide/concepts/account-abstraction.md b/0.16.23/zh/guide/concepts/account-abstraction.md new file mode 100644 index 000000000..612d8e7c2 --- /dev/null +++ b/0.16.23/zh/guide/concepts/account-abstraction.md @@ -0,0 +1,95 @@ +# Account Abstraction + +Understanding Account Abstraction (ERC-4337) in AAStar SDK. + +## What is Account Abstraction? + +Account Abstraction (AA) allows users to use smart contract wallets instead of traditional Externally Owned Accounts (EOAs). This enables advanced features like: + +- **Gasless Transactions**: Users don't need ETH for gas +- **Social Recovery**: Recover accounts without seed phrases +- **Session Keys**: Temporary permissions for DApps +- **Batch Transactions**: Multiple operations in one transaction +- **Custom Validation**: Flexible signature schemes + +## ERC-4337 Overview + +ERC-4337 is the standard for Account Abstraction. Key components: + +### UserOperation + +A pseudo-transaction object that represents a user's intent: + +```typescript +interface UserOperation { + sender: Address; // Smart account address + nonce: bigint; // Anti-replay protection + callData: Hex; // Actual transaction data + paymasterAndData: Hex; // Paymaster info (for gasless tx) + signature: Hex; // User signature + // ... gas fields +} +``` + +### EntryPoint + +The singleton contract that processes UserOperations. + +### Bundler + +Off-chain service that bundles UserOperations and submits them to the EntryPoint. + +### Paymaster + +Contract that sponsors gas fees for users. + +## AAStar Implementation + +AAStar SDK provides a complete AA infrastructure: + +### Smart Accounts + +```typescript +import { createSmartAccount } from '@aastar/account'; + +const account = await createSmartAccount({ + owner: ownerAddress, + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); +``` + +### Gasless Transactions + +```typescript +import { createEndUserClient } from '@aastar/core'; + +const user = createEndUserClient({...}); + +// Check eligibility +const eligible = await user.checkEligibility(communityAddress); + +if (eligible) { + // Send gasless transaction + await sendGaslessTransaction(); +} +``` + +## Benefits + +1. **Better UX**: Users don't need to understand gas or hold ETH +2. **Security**: Smart contract wallets are more secure than EOAs +3. **Flexibility**: Custom validation logic and recovery mechanisms +4. **Programmability**: Wallets can have complex logic + +## Learn More + +- [ERC-4337 Specification](https://eips.ethereum.org/EIPS/eip-4337) +- [Account Module API](/0.16.23/api/modules/account) +- [End User API](/0.16.23/api/roles/enduser) + +## Next Steps + +- [SuperPaymaster (AOA+)](/0.16.23/guide/concepts/superpaymaster) +- [Quick Start](/0.16.23/guide/quick-start) +- [Examples](/0.16.23/examples/) diff --git a/0.16.23/zh/guide/concepts/rainbow-bridge.md b/0.16.23/zh/guide/concepts/rainbow-bridge.md new file mode 100644 index 000000000..b8665f50d --- /dev/null +++ b/0.16.23/zh/guide/concepts/rainbow-bridge.md @@ -0,0 +1,68 @@ +# EOA Rainbow Bridge + +Seamlessly bridge between traditional EOA wallets and smart contract accounts. + +## Overview + +The EOA Rainbow Bridge enables users to: +- Use existing EOA wallets +- Upgrade to smart accounts +- Maintain backward compatibility +- Seamless transition + +## How It Works + +``` +EOA Wallet → Rainbow Bridge → Smart Account + ↓ ↓ ↓ + Private Key Ownership Advanced Features +``` + +## Implementation + +```typescript +import { createSmartAccount } from '@aastar/account'; +import { privateKeyToAccount } from 'viem/accounts'; + +// 1. Start with EOA +const eoaAccount = privateKeyToAccount(process.env.PRIVATE_KEY); + +// 2. Create smart account owned by EOA +const smartAccount = await createSmartAccount({ + owner: eoaAccount.address, + salt: 0n, + factoryAddress: CONTRACTS.sepolia.simpleAccountFactory, +}); + +// 3. Use smart account for advanced features +const user = createEndUserClient({ + chain: sepolia, + transport: http(), + account: smartAccount, +}); + +// Now user has: +// - Gasless transactions +// - Social recovery +// - Session keys +// - Batch operations +``` + +## Benefits + +1. **No Learning Curve**: Users keep their familiar wallets +2. **Gradual Adoption**: Upgrade when needed +3. **Best of Both Worlds**: EOA simplicity + smart account features +4. **Backward Compatible**: Works with existing DApps + +## Use Cases + +- Onboarding new users +- Migrating existing users +- Multi-wallet support +- Progressive enhancement + +## Related + +- [Account Module](/0.16.23/api/modules/account) +- [Account Abstraction](/0.16.23/guide/concepts/account-abstraction) diff --git a/0.16.23/zh/guide/concepts/reputation.md b/0.16.23/zh/guide/concepts/reputation.md new file mode 100644 index 000000000..b1048ecbb --- /dev/null +++ b/0.16.23/zh/guide/concepts/reputation.md @@ -0,0 +1,95 @@ +# Reputation System + +On-chain reputation tracking with customizable rules and scoring. + +## Overview + +The Reputation System enables: +- On-chain reputation tracking +- Customizable scoring rules +- Community-specific metrics +- Credit limit calculation + +## Architecture + +``` +User Actions → Metrics → Reputation Score → Credit Limit +``` + +## Components + +### 1. Metrics + +Measurable user activities: +- Code contributions +- Community engagement +- Governance participation +- Transaction history + +### 2. Scoring Rules + +Community-defined weights: + +```typescript +await community.setReputationRules({ + rules: [ + { metric: 'contributions', weight: 40 }, + { metric: 'engagement', weight: 30 }, + { metric: 'governance', weight: 30 }, + ], +}); +``` + +### 3. Reputation Score + +Calculated from metrics and weights: + +``` +score = (metric1 * weight1) + (metric2 * weight2) + ... +``` + +### 4. Credit Limit + +Based on reputation: + +``` +creditLimit = baseLimit * (reputationScore / 1000) +``` + +## Usage + +```typescript +import { getReputationScore } from '@aastar/identity'; + +// Get user's reputation +const score = await getReputationScore( + client, + userAddress, + communityAddress +); + +console.log('Reputation:', score.toString()); + +// Higher reputation = higher credit limit +const credit = await user.getCreditLimit(); +``` + +## Benefits + +1. **Trustless**: On-chain, verifiable +2. **Customizable**: Each community sets rules +3. **Fair**: Transparent scoring +4. **Dynamic**: Updates with user activity + +## Use Cases + +- Gas credit limits +- Governance voting power +- Access control +- Reward distribution + +## Related + +- [Identity Module](/0.16.23/api/modules/identity) +- [Community API](/0.16.23/api/roles/community) +- [End User API](/0.16.23/api/roles/enduser) diff --git a/0.16.23/zh/guide/concepts/superpaymaster.md b/0.16.23/zh/guide/concepts/superpaymaster.md new file mode 100644 index 000000000..af2ac4052 --- /dev/null +++ b/0.16.23/zh/guide/concepts/superpaymaster.md @@ -0,0 +1,141 @@ +# SuperPaymaster (AOA+) + +Advanced On-chain Accounting Paymaster with credit system. + +## Overview + +SuperPaymaster is AAStar's innovative gas sponsorship solution that enables truly gasless transactions through an on-chain credit system. + +## Key Features + +### 1. Credit-Based System + +Users get gas credit based on: +- **SBT Ownership**: Community membership tokens +- **Reputation Score**: On-chain reputation +- **Historical Behavior**: Past transaction patterns +- **Community Rules**: Custom eligibility criteria + +### 2. Operator Network + +Decentralized network of Paymaster operators who: +- Stake GTokens to participate +- Deposit funds for gas sponsorship +- Earn fees from communities +- Get slashed for misbehavior + +### 3. Community Governance + +Communities can: +- Set their own eligibility rules +- Configure credit limits +- Manage operator selection +- Customize fee structures + +## How It Works + +```mermaid +sequenceDiagram + User->>SuperPaymaster: Request gasless tx + SuperPaymaster->>Registry: Check eligibility + Registry->>SuperPaymaster: Return credit limit + SuperPaymaster->>Operator: Sponsor gas + Operator->>EntryPoint: Pay gas + EntryPoint->>User: Execute transaction + User->>SuperPaymaster: Repay debt (later) +``` + +## Architecture + +### Components + +1. **SuperPaymaster Contract**: Core logic for gas sponsorship +2. **Registry**: Manages communities, operators, and users +3. **GTokenStaking**: Operator stake management +4. **ReputationSystem**: On-chain reputation tracking + +### Credit Calculation + +```typescript +credit = baseCreditLimit + * reputationMultiplier + * communityBonus + - outstandingDebt +``` + +## Usage Example + +```typescript +import { createEndUserClient } from '@aastar/core'; +import { getPaymasterAndData } from '@aastar/paymaster'; + +// 1. Check eligibility +const user = createEndUserClient({...}); +const eligible = await user.checkEligibility(communityAddress); + +if (!eligible) { + throw new Error('Not eligible for gasless transactions'); +} + +// 2. Get credit limit +const creditLimit = await user.getCreditLimit(); +console.log('Available credit:', formatEther(creditLimit)); + +// 3. Create UserOperation with paymaster data +const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, +}); + +// 4. Submit gasless transaction +const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, +}); +``` + +## Benefits + +### For Users +- ✅ No need to hold ETH for gas +- ✅ Seamless transaction experience +- ✅ Credit-based system (pay later) +- ✅ Community-specific benefits + +### For Communities +- ✅ Attract more users +- ✅ Customizable rules +- ✅ Better user retention +- ✅ Governance control + +### For Operators +- ✅ Earn fees from gas sponsorship +- ✅ Decentralized network +- ✅ Stake-based participation +- ✅ Performance incentives + +## Comparison with Traditional Paymasters + +| Feature | Traditional Paymaster | SuperPaymaster (AOA+) | +|---------|----------------------|----------------------| +| Gas Sponsorship | ✅ | ✅ | +| Credit System | ❌ | ✅ | +| Decentralized | ❌ | ✅ | +| Community Governance | ❌ | ✅ | +| Reputation-Based | ❌ | ✅ | +| Operator Network | ❌ | ✅ | + +## Learn More + +- [Operator API](/0.16.23/api/roles/operator) - Become an operator +- [Community API](/0.16.23/api/roles/community) - Set up gas sponsorship +- [End User API](/0.16.23/api/roles/enduser) - Use gasless transactions + +## Next Steps + +- [EOA Rainbow Bridge](/0.16.23/guide/concepts/rainbow-bridge) +- [Reputation System](/0.16.23/guide/concepts/reputation) +- [Quick Start](/0.16.23/guide/quick-start) diff --git a/0.16.23/zh/guide/getting-started.md b/0.16.23/zh/guide/getting-started.md new file mode 100644 index 000000000..ff0a31d10 --- /dev/null +++ b/0.16.23/zh/guide/getting-started.md @@ -0,0 +1,133 @@ +# 开始使用 (Getting Started) + +

+ License: MIT + TypeScript + Status +

+ +**完整的账户抽象基础设施 SDK - 为 Mycelium 网络提供动力** + +--- + +## 📚 目录 + +- [简介](#简介) +- [SDK v2 架构设计](#sdk-v2-架构设计) +- [安装](#安装) +- [快速开始](#快速开始) +- [测试命令](#测试命令) +- [开发指南](#开发指南) +- [学术研究](#学术研究) + +--- + +## 简介 (Introduction) + +**AAStar SDK** 是 Mycelium 网络的高集成度开发工具包。我们将原有的 17 个碎片化模块重构为 7 个专业核心包,旨在提供统一、高性能且易于维护的开发体验。 + +### 核心特性 + +- ✅ **角色化客户端**: 为终端用户、社区、运营商和协议管理员提供专属 API +- ✅ **基础设施就绪**: 深度集成 SuperPaymaster 与 EOA Rainbow Bridge +- ✅ **无感交互体验**: 基于社区信用系统的 Gasless 交易 +- ✅ **DVT 安全模块**: 去中心化验证与聚合签名 +- ✅ **科学可复现**: 锁定依赖版本,支持学术论文数据采集 + +--- + +## SDK v2 架构设计 + +AAStar SDK v2 采用 **「装饰器 (Actions-Decorator)」** 模式(借鉴自 `viem` 与 `permissionless.js`)。它将低层次的合约交互与高层次的业务逻辑解耦,为生态系统中的四种角色提供专属的 Client 封装。 + +### 核心理念 + +- **语义化 Action**: 将复杂流程(如「运营商入驻」)封装为单次 SDK 调用 +- **Provider 无关性**: 完美适配任何 `viem` 传输层(Pimlico, Alchemy 或本地 Anvil) +- **安全加固**: 锁定依赖版本并实施自动化供应链审计 + +### 角色化 API 矩阵 + +| 客户端 | 目标开发者 | 核心职责 | +| :--- | :--- | :--- | +| **`EndUserClient`** | dApp 开发者 | 核心账户抽象交互、Gasless UX、查询信用状态 | +| **`CommunityClient`** | 社区/DAO 管理者 | 自动化入驻、部署 xPNTs 代币、配置 SBT 规则 | +| **`OperatorClient`** | 节点/运营商 | SuperPaymaster 注册与质押、资金池管理 | +| **`AdminClient`** | 协议维护者 | 提交 DVT 聚合签名、执行奖惩、调整全局参数 | + +--- + +## 安装 (Installation) + +```bash +pnpm install @aastar/sdk @aastar/core viem +``` + +--- + +## 快速开始 (Quick Start) + +### 基础示例 (Operator) + +```typescript +import { createOperatorClient } from '@aastar/sdk'; +import { privateKeyToAccount } from 'viem/accounts'; +import { foundry } from 'viem/chains'; +import { http } from 'viem'; + +// 创建运营商客户端 +const operatorClient = createOperatorClient({ + chain: foundry, + transport: http('http://127.0.0.1:8545'), + account: privateKeyToAccount('0x...'), +}); + +// 一键入驻 SuperPaymaster(质押 + 存款) +await operatorClient.onboardToSuperPaymaster({ + stakeAmount: parseEther('50'), + depositAmount: parseEther('50') +}); +``` + +--- + +## 核心测试场景 (Core Testing) + +本项目提供两套完整的回归测试。 + +### SDK 回归测试(使用 SDK 客户端) + +```bash +pnpm run test:full_sdk +``` + +- **测试场景**: + - ✅ Operator Staking (质押) + - ✅ Paymaster Deposit (存款) + - ✅ Community Registration (社区注册) + - ✅ SBT Minting (SBT 铸造) + - ✅ Admin Slashing (惩罚) + - ✅ Credit Query (信用查询) + +### 完整协议回归测试(Anvil 专用,72 场景) + +```bash +pnpm run test:full_anvil +``` + +--- + +## 学术研究 (Research) + +本 SDK 支撑了 SuperPaymaster 论文的博士实验数据采集: + +- **`scripts/19_sdk_experiment_runner.ts`**: 官方实验记录器 +- **覆盖率**: 95% 用户用例分支,72 个完整场景 + +--- + +## 支持与贡献 (Support) + +- **代码仓库**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk) +- **Discord**: [加入我们的社区](https://discord.gg/aastar) +- **许可证**: MIT diff --git a/0.16.23/zh/guide/installation.md b/0.16.23/zh/guide/installation.md new file mode 100644 index 000000000..472d9d0d3 --- /dev/null +++ b/0.16.23/zh/guide/installation.md @@ -0,0 +1,107 @@ +# 安装 (Installation) + +## 包管理器 + +AAStar SDK 可通过 npm 获得。为了获得最佳体验,我们推荐使用 **pnpm**。 + +### 使用 pnpm (推荐) + +```bash +pnpm add @aastar/sdk +``` + +### 使用 npm + +```bash +npm install @aastar/sdk +``` + +### 使用 yarn + +```bash +yarn add @aastar/sdk +``` + +## 独立安装包 + +你也可以根据需求安装特定模块: + +```bash +# 核心工具与客户端创建 +pnpm add @aastar/core + +# 账户抽象 (Account Abstraction) +pnpm add @aastar/account + +# Paymaster 與贊助邏輯 +pnpm add @aastar/paymaster + +# 代幣工具 (GToken, xPNTs, SBT) +pnpm add @aastar/tokens + +# 身份與聲譽系統 +pnpm add @aastar/identity + +# React Hook 支持 +pnpm add @aastar/dapp +``` + +## 同行依赖 (Peer Dependencies) + +SDK 需要以下同行依赖: + +```bash +pnpm add viem@^2.43.0 +``` + +## TypeScript 配置 + +为了获得最佳的 TypeScript 体验,请在 `tsconfig.json` 中添加以下设置: + +```json +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + } +} +``` + +## 环境配置 + +创建一个 `.env` 文件用于存储配置: + +```bash +# 网络 RPC 节点 +RPC_URL=https://rpc.sepolia.org + +# 你的私钥 (千万不要提交此文件!) +PRIVATE_KEY=0x... + +# 合约地址 (可选,SDK 默认提供官方地址) +REGISTRY_ADDRESS=0x... +PAYMASTER_ADDRESS=0x... +``` + +## 验证安装 + +编写一段简单的代码验证安装是否成功: + +```typescript +import { getNetwork, CONTRACTS } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log('Network:', network.name); +console.log('Chain ID:', network.chainId); +console.log('Registry:', CONTRACTS.sepolia.registry); +``` + +## 下一步 + +- [快速开始](/0.16.23/guide/quick-start) +- [核心概念](/0.16.23/guide/concepts/account-abstraction) +- [API 参考](/0.16.23/api/) diff --git a/0.16.23/zh/guide/old-solution.md b/0.16.23/zh/guide/old-solution.md new file mode 100644 index 000000000..a05e97a78 --- /dev/null +++ b/0.16.23/zh/guide/old-solution.md @@ -0,0 +1,1078 @@ + +A nodejs sdk for all developers to integrate AAStar's power abilities. + +AAStar npm packages collection: +You can use +``` +pnpm install @aastar/airaccount +@aastar/superpaymaster +@aastar/cometens +@aastar/openpnts +@aastar/opencards +@aastar/arcadia +@aastar/cos72 +``` +or +``` +pnpm install aastar +``` + +## For developers +Why do you install this package? +### airaccount +Provide a moveable\self-custody\crypto account with life cycle service. +Permissionless. +Trustless. +Decentralized. +In 3 steps: bind, send, claim, move(recover) + +### superpaymaster +Embbeded into AirAccount, but provide ERC20 gas token ability for any community individually. + +### cometens +Embbeded into AirAccount, but provide set your own ENS name for your community individually. + + +# 从零开始开发和发布 npm 包:完整指南 + +## 目录 + +1. [前期准备](#前期准备) +2. [初始化项目](#初始化项目) +3. [配置开发环境](#配置开发环境) +4. [开发 SDK](#开发-sdk) +5. [测试](#测试) +6. [构建和打包](#构建和打包) +7. [发布到 npm](#发布到-npm) +8. [文档和示例](#文档和示例) +9. [版本管理和更新](#版本管理和更新) +10. [持续集成和自动发布](#持续集成和自动发布) +11. [SDK 开发最佳实践](#sdk-开发最佳实践) +12. [问题排查](#问题排查) + +## 前期准备 + +### 1. 安装必要工具 + +```bash +# 安装 Node.js (推荐使用 nvm 管理 Node.js 版本) +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash +nvm install node # 安装最新版 +nvm install --lts # 或安装长期支持版 + +# 确认安装 +node --version +npm --version + +# 安装一些全局工具 +npm install -g typescript ts-node np +``` + +### 2. 创建 npm 账号 + +1. 访问 [npm 官网](https://www.npmjs.com/) 并注册 +2. 在命令行登录 npm (后续发布时需要) + +```bash +npm login +``` + +### 3. 规划你的 SDK + +在开始编码前,确定以下内容: + +- SDK 的目标和用途 +- 核心功能和 API 设计 +- 依赖关系 +- 支持的平台 (浏览器、Node.js、React Native 等) +- 命名规范 (包名必须唯一) +- 核心 API 结构 + +## 初始化项目 + +### 1. 创建项目目录 + +```bash +# 创建项目目录 (使用你希望的包名) +mkdir my-awesome-sdk +cd my-awesome-sdk +``` + +### 2. 初始化 npm 项目 + +```bash +npm init +``` + +按照提示填写信息: + +- `name`: 包名 (可以使用 `@组织名/包名` 格式) +- `version`: 版本号 (推荐从 0.1.0 开始) +- `description`: 简短描述 +- `main`: 入口文件 (通常是 `dist/index.js`) +- `scripts`: 构建脚本 +- `repository`: 代码仓库地址 +- `keywords`: 关键词,帮助用户发现你的包 +- `author`: 作者信息 +- `license`: 许可证 (如 MIT) + +### 3. 初始化 Git 仓库 + +```bash +git init +echo "node_modules\ndist\n.env\n*.log" > .gitignore +``` + +### 4. 创建基本目录结构 + +```bash +mkdir src tests examples docs +touch src/index.ts README.md LICENSE +``` + +## 配置开发环境 + +### 1. 配置 TypeScript + +```bash +# 安装 TypeScript +npm install typescript --save-dev + +# 初始化 TypeScript 配置 +npx tsc --init +``` + +编辑 `tsconfig.json`: + +```json +{ + "compilerOptions": { + "target": "es2018", + "module": "commonjs", + "declaration": true, + "outDir": "./dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["node_modules", "tests", "examples", "dist"] +} +``` + +### 2. 配置代码格式化和 Lint + +```bash +# 安装 ESLint 和 Prettier +npm install eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier --save-dev + +# 创建 ESLint 配置 +``` + +创建 `.eslintrc.js`: + +```javascript +module.exports = { + parser: "@typescript-eslint/parser", + extends: [ + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + parserOptions: { + ecmaVersion: 2018, + sourceType: "module", + }, + rules: { + // 自定义规则 + }, +}; +``` + +创建 `.prettierrc`: + +```json +{ + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100, + "tabWidth": 2, + "semi": true +} +``` + +### 3. 配置测试环境 + +```bash +# 安装 Jest +npm install jest ts-jest @types/jest --save-dev +``` + +创建 `jest.config.js`: + +```javascript +module.exports = { + preset: "ts-jest", + testEnvironment: "node", + testMatch: ["**/tests/**/*.test.ts"], + collectCoverage: true, + coverageDirectory: "coverage", + collectCoverageFrom: ["src/**/*.ts"], +}; +``` + +### 4. 更新 package.json 脚本 + +编辑 `package.json` 添加以下脚本: + +```json +"scripts": { + "build": "tsc", + "test": "jest", + "lint": "eslint 'src/**/*.ts'", + "format": "prettier --write 'src/**/*.ts'", + "prepare": "npm run build", + "prepublishOnly": "npm test && npm run lint", + "preversion": "npm run lint", + "version": "npm run format && git add -A src", + "postversion": "git push && git push --tags" +} +``` + +## 开发 SDK + +### 1. 创建基本结构 + +在 `src/index.ts` 创建 SDK 的入口点: + +```typescript +// 导出所有公共 API +export * from "./client"; +export * from "./types"; +// ... 其他导出 + +// 导出默认客户端 +import { Client } from "./client"; +export default Client; +``` + +### 2. 创建核心模块 + +例如,创建 `src/client.ts` 实现主要客户端类: + +```typescript +import { ApiResponse, ClientOptions } from "./types"; + +export class Client { + private apiKey: string; + private baseUrl: string; + + constructor(options: ClientOptions) { + this.apiKey = options.apiKey; + this.baseUrl = options.baseUrl || "https://api.example.com/v1"; + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + const url = `${this.baseUrl}/${endpoint}`; + + try { + const response = await fetch(url, { + method, + headers: { + "Content-Type": "application/json", + "Authorization": `Bearer ${this.apiKey}`, + }, + body: data ? JSON.stringify(data) : undefined, + }); + + const responseData = await response.json(); + + if (!response.ok) { + throw new Error(responseData.message || "API request failed"); + } + + return { + data: responseData, + status: response.status, + headers: response.headers, + }; + } catch (error) { + throw error; + } + } + + // 公共 API 方法 + async getUser(userId: string) { + return this.makeRequest(`users/${userId}`); + } + + // 更多 API 方法... +} +``` + +### 3. 定义类型 + +创建 `src/types.ts` 定义类型: + +```typescript +export interface ClientOptions { + apiKey: string; + baseUrl?: string; +} + +export interface ApiResponse { + data: T; + status: number; + headers: Headers; +} + +// 更多类型定义... +``` + +### 4. 使用模块化设计 + +将 SDK 拆分为多个模块,例如: + +``` +src/ + index.ts # 主入口 + client.ts # 核心客户端类 + types.ts # 类型定义 + modules/ + auth.ts # 认证相关功能 + users.ts # 用户相关功能 + products.ts # 产品相关功能 + utils/ + request.ts # 请求工具 + validation.ts # 验证工具 +``` + +## 测试 + +### 1. 编写单元测试 + +在 `tests` 目录中创建测试文件,例如 `tests/client.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 模拟 fetch API +global.fetch = jest.fn(); + +describe("Client", () => { + let client: Client; + + beforeEach(() => { + client = new Client({ apiKey: "test-api-key" }); + (global.fetch as jest.Mock).mockClear(); + }); + + test("makeRequest should call fetch with correct parameters", async () => { + (global.fetch as jest.Mock).mockResolvedValueOnce({ + ok: true, + status: 200, + json: async () => ({ id: "123", name: "Test User" }), + headers: new Headers(), + }); + + const result = await client.makeRequest("users/123"); + + expect(global.fetch).toHaveBeenCalledWith( + "https://api.example.com/v1/users/123", + expect.objectContaining({ + method: "GET", + headers: expect.objectContaining({ + "Authorization": "Bearer test-api-key", + }), + }), + ); + + expect(result.data).toEqual({ id: "123", name: "Test User" }); + }); + + // 更多测试... +}); +``` + +### 2. 运行测试 + +```bash +npm test +``` + +### 3. 编写集成测试 + +创建与真实 API 交互的集成测试,例如 `tests/integration.test.ts`: + +```typescript +import { Client } from "../src/client"; + +// 这些测试需要一个有效的 API 密钥 +// 通常通过环境变量提供 +const apiKey = process.env.API_KEY; + +// 只在提供 API 密钥时运行集成测试 +(apiKey ? describe : describe.skip)("Integration tests", () => { + let client: Client; + + beforeAll(() => { + client = new Client({ apiKey }); + }); + + test("can get a user", async () => { + const result = await client.getUser("test-user-id"); + expect(result.status).toBe(200); + expect(result.data).toHaveProperty("id"); + }); + + // 更多集成测试... +}); +``` + +## 构建和打包 + +### 1. 配置 npm 包文件 + +编辑 `package.json` 指定要包含的文件: + +```json +{ + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "LICENSE", + "README.md" + ] +} +``` + +### 2. 支持不同的模块格式 (可选) + +如果你想同时支持 CommonJS 和 ES 模块,可以使用 `rollup` 或 `tsup` 等工具。 + +使用 `tsup` 示例: + +```bash +# 安装 tsup +npm install tsup --save-dev +``` + +更新 `package.json`: + +```json +{ + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + } + }, + "scripts": { + "build": "tsup src/index.ts --format cjs,esm --dts --clean" + } +} +``` + +## 发布到 npm + +### 1. 准备发布 + +确保你的包名是唯一的,并已登录 npm。如果使用组织名称,确保已创建组织。 + +```bash +# 检查是否登录 +npm whoami + +# 如果未登录 +npm login +``` + +### 2. 测试包 + +在发布前,使用 `npm pack` 创建一个本地包进行测试: + +```bash +npm pack +``` + +这将创建一个 `.tgz` 文件,可以在另一个项目中使用它进行测试: + +```bash +# 在测试项目中 +npm install ../path/to/your-package-1.0.0.tgz +``` + +### 3. 发布包 + +```bash +# 首次发布 +npm publish + +# 如果是组织包并想设为公共 +npm publish --access public +``` + +### 4. 更新包 + +修改 `package.json` 中的版本号或使用 `npm version` 命令: + +```bash +# 更新补丁版本 (1.0.0 -> 1.0.1) +npm version patch + +# 更新小版本 (1.0.0 -> 1.1.0) +npm version minor + +# 更新大版本 (1.0.0 -> 2.0.0) +npm version major +``` + +然后发布更新: + +```bash +npm publish +``` + +## 文档和示例 + +### 1. 编写 README + +一个好的 README 应包含: + +- 项目描述 +- 安装指南 +- 基本用法示例 +- API 文档链接 +- 配置选项 +- 常见问题 + +示例 README 结构: + +````markdown +# My Awesome SDK + +A JavaScript/TypeScript SDK for interacting with the Example API. + +## Installation + +```bash +npm install my-awesome-sdk +``` +```` + +## Quick Start + +```javascript +import Client from "my-awesome-sdk"; + +const client = new Client({ apiKey: "your-api-key" }); + +// Get a user +client.getUser("user123") + .then((response) => console.log(response.data)) + .catch((error) => console.error(error)); +``` + +## Documentation + +For full documentation, visit [docs.example.com](https://docs.example.com). + +## Configuration + +The client accepts the following options: + +| Option | Type | Required | Default | Description | +| ------- | ------ | -------- | -------------------------- | ---------------- | +| apiKey | string | Yes | - | Your API key | +| baseUrl | string | No | https://api.example.com/v1 | The API base URL | + +## License + +MIT + +```` +### 2. 示例代码 + +在 `examples` 目录中创建示例代码: + +```typescript +// examples/basic-usage.ts +import Client from '../src'; + +async function main() { + const client = new Client({ apiKey: 'your-api-key' }); + + try { + const user = await client.getUser('user123'); + console.log('User:', user.data); + + // More examples... + } catch (error) { + console.error('Error:', error); + } +} + +main(); +```` + +### 3. 生成 API 文档 + +可以使用 TypeDoc 生成 API 文档: + +```bash +npm install typedoc --save-dev +``` + +添加 `package.json` 脚本: + +```json +"scripts": { + "docs": "typedoc --out docs src/index.ts" +} +``` + +## 版本管理和更新 + +### 1. 遵循语义化版本规范 + +- **补丁版本**(1.0.x):修复 bug,小改进 +- **小版本**(1.x.0):添加向后兼容的新功能 +- **大版本**(x.0.0):不向后兼容的变更 + +### 2. 维护更新日志 + +创建 `CHANGELOG.md` 并记录每个版本的变更: + +```markdown +# Changelog + +## [1.1.0] - 2023-05-01 + +### Added + +- New feature X +- Support for Y + +### Changed + +- Improved error handling +- Better performance for Z + +### Fixed + +- Bug in getUser method + +## [1.0.0] - 2023-04-01 + +Initial release +``` + +## 持续集成和自动发布 + +### 1. 设置 GitHub Actions + +创建 `.github/workflows/ci.yml`: + +```yaml +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build + - run: npm test + - run: npm run lint +``` + +### 2. 设置自动发布 + +创建 `.github/workflows/publish.yml`: + +```yaml +name: Publish + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' + - run: npm ci + - run: npm run build + - run: npm test + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +``` + +在 GitHub 仓库设置中,添加 `NPM_TOKEN` 秘密。 + +## SDK 开发最佳实践 + +### 1. API 设计原则 + +- **简单直观**:API 应该易于理解和使用 +- **一致性**:保持命名和模式一致 +- **错误处理**:提供清晰的错误信息和类型 +- **文档完善**:每个公共方法都应有文档 +- **链式调用**:考虑支持方法链接 + +### 2. 错误处理 + +创建自定义错误类: + +```typescript +// src/errors.ts +export class ApiError extends Error { + statusCode: number; + data: any; + + constructor(message: string, statusCode: number, data?: any) { + super(message); + this.name = "ApiError"; + this.statusCode = statusCode; + this.data = data; + Object.setPrototypeOf(this, ApiError.prototype); + } +} + +export class ValidationError extends Error { + errors: any[]; + + constructor(message: string, errors: any[]) { + super(message); + this.name = "ValidationError"; + this.errors = errors; + Object.setPrototypeOf(this, ValidationError.prototype); + } +} +``` + +### 3. 浏览器兼容性 + +如果 SDK 需要在浏览器中运行,考虑: + +- 使用 `fetch` 时提供兼容性封装 +- 考虑使用 `axios` 等库处理请求 +- 使用 polyfills 确保兼容性 + +### 4. 安全性 + +- 不要在客户端代码中存储敏感信息 +- 使用 HTTPS +- 避免将敏感信息记录到控制台 +- 提供 API 令牌轮换机制 + +## 问题排查 + +### 1. 常见问题 + +- **包名冲突**:在 npm 上查找是否已存在同名包 +- **构建错误**:检查 TypeScript 配置和依赖 +- **发布失败**:确保已登录 npm 并有权限发布 + +### 2. 调试技巧 + +```typescript +// 添加调试配置 +export class Client { + private debug: boolean; + + constructor(options: ClientOptions) { + this.debug = options.debug || false; + // ... + } + + private log(...args: any[]) { + if (this.debug) { + console.log("[SDK]", ...args); + } + } + + async makeRequest( + endpoint: string, + method: string = "GET", + data?: any, + ): Promise> { + this.log("Request:", method, endpoint, data); + + // ...请求逻辑... + + this.log("Response:", responseData); + return response; + } +} +``` + +### 3. 提供用户支持 + +- 在 GitHub 上设置 Issues 模板 +- 提供常见问题和解决方案 +- 考虑设置讨论区或社区渠道 + +# NPM包组织 + +您想要建立一个名为"aastar"的NPM组织,其中包含多个子包,既可以单独安装也可以整体安装。这是一个非常好的组织方式,类似于许多流行的库如Next.js、Ant +Design等采用的结构。 + +要实现这样的结构,您需要采用"Monorepo"(单体仓库)架构,以下是详细的规划和实现步骤: + +## 1. 创建Monorepo项目结构 + +首先,建立基本的项目结构: + +``` +aastar/ +├── packages/ +│ ├── airaccount/ # 子包1 +│ ├── superpaymaster/ # 子包2 +│ └── ... # 其他子包 +├── package.json # 根项目配置 +├── pnpm-workspace.yaml # 工作区配置 +├── lerna.json # (可选)Lerna配置 +└── tsconfig.json # 基础TypeScript配置 +``` + +## 2. 配置工作区 + +在根目录创建`pnpm-workspace.yaml`文件: + +```yaml +packages: + - 'packages/*' +``` + +## 3. 配置每个子包 + +在每个子包目录中创建`package.json`,例如`packages/airaccount/package.json`: + +```json +{ + "name": "@aastar/airaccount", + "version": "0.1.0", + "description": "AIR账户管理模块", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "test": "jest" + }, + "dependencies": { + // 此包的依赖 + }, + "peerDependencies": { + // 可选的同级依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +## 4. 创建主包作为入口点 + +在`packages`目录下创建一个集合包,例如`packages/aastar/package.json`: + +```json +{ + "name": "aastar", + "version": "0.1.0", + "description": "AASTAR SDK全集合", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc" + }, + "dependencies": { + "@aastar/airaccount": "workspace:*", + "@aastar/superpaymaster": "workspace:*" + // 添加其他所有子包作为依赖 + }, + "publishConfig": { + "access": "public" + } +} +``` + +然后创建相应的入口文件`packages/aastar/src/index.ts`,导出所有子包: + +```typescript +export * from "@aastar/airaccount"; +export * from "@aastar/superpaymaster"; +// 导出其他所有子包 +``` + +## 5. 使用工具管理版本和发布 + +您可以使用以下工具之一来管理版本和发布: + +### 选项1: 使用pnpm + changesets + +1. 安装changesets: + +```bash +pnpm add -D -w @changesets/cli +pnpm changeset init +``` + +2. 配置发布脚本:在根目录的`package.json`中添加: + +```json +{ + "scripts": { + "build": "pnpm -r build", + "version": "changeset version", + "publish": "pnpm build && changeset publish" + } +} +``` + +### 选项2: 使用Lerna + +1. 安装Lerna: + +```bash +pnpm add -D -w lerna +``` + +2. 创建`lerna.json`: + +```json +{ + "version": "independent", + "npmClient": "pnpm", + "useWorkspaces": true, + "command": { + "publish": { + "ignoreChanges": ["*.md"], + "message": "chore(release): publish" + } + } +} +``` + +## 6. 处理包之间的依赖关系 + +如果子包之间有依赖关系,在依赖包的`package.json`中添加: + +```json +{ + "dependencies": { + "@aastar/some-dependency": "workspace:*" + } +} +``` + +## 7. 统一配置和构建 + +创建一个根目录的`tsconfig.json`作为基础配置: + +```json +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "node", + "declaration": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + } +} +``` + +然后,每个子包可以扩展此配置: + +```json +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src" + }, + "include": ["src/**/*"] +} +``` + +## 8. 发布流程 + +1. 创建npm组织: + - 在npm网站上注册`aastar`组织 + +2. 发布所有包: + +```bash +# 使用changesets +pnpm changeset +pnpm version +pnpm publish + +# 或使用Lerna +pnpm lerna publish +``` + +## 使用示例 + +用户可以按您希望的方式安装和使用SDK: + +```bash +# 安装单个包 +pnpm install @aastar/airaccount @aastar/superpaymaster + +# 或安装全部功能 +pnpm install aastar +``` + +使用示例: + +```javascript +// 单个包使用方式 +import { someFunction } from "@aastar/airaccount"; + +// 全部功能使用方式 +import { airaccount, superpaymaster } from "aastar"; +``` + +这种结构的主要优点是: + +1. 用户可以根据需求选择安装单个包或全部功能 +2. 包之间可以共享代码,但又保持独立发布 +3. 可以统一管理版本,简化发布流程 +4. 便于维护和扩展 + +您对这种结构有什么特别的需求或问题吗? diff --git a/0.16.23/zh/guide/paper-data-collection.md b/0.16.23/zh/guide/paper-data-collection.md new file mode 100644 index 000000000..6e4bb332e --- /dev/null +++ b/0.16.23/zh/guide/paper-data-collection.md @@ -0,0 +1,69 @@ +# 论文数据采集指南 (PhD Data Collection Guide) + +本文档为 AAStar 系统论文中的数据采集提供标准化指南。所有实验数据必须通过 `aastar-sdk` 获取,以确保真实性与可重复性。 + +## 1. 实验设置 (Environmental Setup) + +### 网络环境 +- **Local**: 使用 `anvil` 进行基准测试(无网络延迟)。 +- **Testnet**: 使用 `Sepolia` 进行公链环境验证。 +- **L2**: 使用 `Optimism` (或 OP Sepolia) 进行低 Gas 性能测试。 + +### 账户准备 +确保 `.env.v3` 中配置了以下地址: +- `TEST_SIMPLE_ACCOUNT_A`: 标准 AA 账户。 +- `TEST_SIMPLE_ACCOUNT_B`: AOA (V4) 实验账户。 +- `TEST_SIMPLE_ACCOUNT_C`: SuperPaymaster 实验账户。 + +--- + +## 2. 核心指标 (Key Metrics) + +实验脚本会自动采集以下维度: + +| 指标 | 英文名称 | 采集方式 | +| :--- | :--- | :--- | +| **Gas 消耗** | Gas Usage | `receipt.gasUsed` | +| **延迟** | Latency | `Date.now() - start` (毫秒) | +| **交易成本** | Tx Cost | `gasUsed * effectiveGasPrice` | +| **吞吐量** | Throughput | 批量运行时的 `count / total_time` | + +--- + +## 3. 自动化运行 (Automation) + +直接使用统一脚本运行: + +```bash +# 运行所有配置的网络(推荐) +./scripts/run_automated_experiment.sh all + +# 仅运行本地测试 +./scripts/run_automated_experiment.sh local + +# 仅运行 Sepolia 测试 +./scripts/run_automated_experiment.sh sepolia +``` + +## 4. 数据导出与处理 + +数据会自动保存至 `sdk_experiment_data.csv`。 + +**建议流程**: +1. 每个场景运行 30 次 (`EXPERIMENT_RUNS=30`) 以获取统计显著性。 +2. 使用 `pandas` 或 `Excel` 计算均值 (Mean) 与标准差 (Std Dev)。 +3. 使用 `scripts/collect_industry_baseline.ts` 获取对比组(EOA, Pimlico)数据。 + +--- + +## 5. 常规检查清单 + +- [ ] RPC 节点是否连通。 +- [ ] 实验账户是否有足够的 Gas 余额 (或代币)。 +- [ ] `PRIVATE_KEY_JASON` 是否已在本地导出。 +- [ ] 是否已清理旧的 CSV 数据。 + +--- + +> [!IMPORTANT] +> **严禁**手动修改 CSV 数据。所有偏差应在论文的 "Limitations" 或 "Discussion" 章节中说明。 diff --git a/0.16.23/zh/guide/quick-start.md b/0.16.23/zh/guide/quick-start.md new file mode 100644 index 000000000..828e02110 --- /dev/null +++ b/0.16.23/zh/guide/quick-start.md @@ -0,0 +1,134 @@ +# 快速开始 (Quick Start) + +在 5 分钟内上手使用 AAStar SDK。 + +## 第一步:安装 SDK + +```bash +pnpm add @aastar/sdk viem +``` + +## 第二步:设置环境 + +创建一个 `.env` 文件: + +```bash +RPC_URL=https://rpc.sepolia.org +PRIVATE_KEY=your_private_key_here +``` + +## 第三步:创建你的第一个客户端 + +根据你的角色选择客户端: + +### 针对终端用户 (dApp 开发者) + +```typescript +import { createEndUserClient } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const client = createEndUserClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.PRIVATE_KEY), +}); + +// 查询信用额度 +const credit = await client.getCreditLimit(); +console.log('可用信用余额:', credit); +``` + +### 针对运营商 (Paymaster 提供者) + +```typescript +import { createOperatorClient, CONTRACTS } from '@aastar/core'; +import { parseEther } from 'viem'; + +const operator = createOperatorClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.OPERATOR_KEY), +}); + +// 质押 GTokens +await operator.stake({ + amount: parseEther('100'), +}); + +// 向 Paymaster 存款 +await operator.deposit({ + amount: parseEther('10'), +}); +``` + +### 针对社区 (DAO 管理者) + +```typescript +import { createCommunityClient } from '@aastar/core'; + +const community = createCommunityClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.COMMUNITY_KEY), +}); + +// 注册社区 +await community.registerCommunity({ + name: 'MyAwesomeDAO', + metadata: 'ipfs://...', +}); + +// 为成员铸造 SBT +await community.mintSBT({ + to: memberAddress, + tokenId: 1n, +}); +``` + +## 第四步:运行代码 + +```bash +tsx your-script.ts +``` + +## 常见模式 + +### 检查网络配置 + +```typescript +import { getNetwork, CONTRACTS } from '@aastar/core'; + +const network = getNetwork('sepolia'); +console.log('Chain ID:', network.chainId); +console.log('RPC URL:', network.rpcUrl); +console.log('Registry 地址:', CONTRACTS.sepolia.registry); +``` + +### 异常处理 + +```typescript +try { + await operator.stake({ amount: parseEther('100') }); +} catch (error) { + if (error.message.includes('insufficient balance')) { + console.error('GToken 余额不足'); + } else { + console.error('质押失败:', error); + } +} +``` + +## 下一步 + +- [了解账户抽象](/0.16.23/guide/concepts/account-abstraction) +- [探索使用场景](/0.16.23/guide/use-cases/community-management) +- [阅读完整的 API 参考](/0.16.23/api/) +- [尝试完整示例](/0.16.23/examples/) + +## 需要帮助? + +- [GitHub Issues](https://github.com/AAStarCommunity/aastar-sdk/issues) +- [Discord](https://discord.gg/aastar) +- [官方文档站](https://docs.aastar.io) diff --git a/0.16.23/zh/guide/sdk-readme.md b/0.16.23/zh/guide/sdk-readme.md new file mode 100644 index 000000000..47f62cdf2 --- /dev/null +++ b/0.16.23/zh/guide/sdk-readme.md @@ -0,0 +1,253 @@ +# AAStar SDK (Mycelium 网络) + +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue)](https://www.typescriptlang.org/) +[![Status](https://img.shields.io/badge/Status-Beta%20v2.0-green)](https://github.com/AAStarCommunity/aastar-sdk) + +**完整的账户抽象基础设施SDK - 为Mycelium网络提供动力** + +--- + +## 📚 目录 + +- [简介](#简介) +- [SDK v2 架构设计](#sdk-v2-架构设计) +- [快速开始](#快速开始) +- [测试命令](#测试命令) +- [开发指南](#开发指南) +- [学术研究](#学术研究) + +--- + +## 简介 + +**AAStar SDK** 是 Mycelium 网络的高集成度开发工具包。我们将原有的17个碎片化模块重构为7个专业核心包,旨在提供统一、高性能且易于维护的开发体验。 + +### 核心特性 + +- ✅ **角色化客户端**: 为终端用户、社区、运营商和协议管理员提供专属API +- ✅ **账户对象支持**: 完整兼容 `viem` v2.x Account 架构 +- ✅ **零Gas体验**: 基于信用系统的无感Gas支付 +- ✅ **DVT安全模块**: 去中心化验证与聚合签名 +- ✅ **科学可复现**: 锁定依赖版本,支持学术论文数据采集 + +--- + +## SDK v2 架构设计 + +AAStar SDK v2 采用 **「装饰器 (Actions-Decorator)」** 模式(借鉴自 `viem` 与 `permissionless.js`)。它将低层次的合约交互与高层次的业务逻辑解耦,为生态系统中的四种角色提供专属的 Client 封装。 + +### 核心理念 + +- **语义化 Action**: 将复杂流程(如「运营商入驻」)封装为单次 SDK 调用 +- **Provider 无关性**: 完美适配任何 `viem` 传输层(Pimlico, Alchemy 或本地 Anvil) +- **安全加固**: 锁定依赖版本并实施自动化供应链审计,防范安全漏洞 + +### 角色化 API 矩阵 + +| 客户端 | 目标开发者 | 核心职责 | +| :--- | :--- | :--- | +| **`EndUserClient`** | dApp 开发者 | 实现无感 Gas UX、管理智能账户、查询信用/债务状态 | +| **`CommunityClient`** | 社区/DAO 管理者 | 自动化入驻、部署 xPNTs 代币、配置SBT & 声誉规则 | +| **`OperatorClient`** | 节点/运营商 | SuperPaymaster 注册与质押、资金池(ETH/aPNTs)管理 | +| **`AdminClient`** | 协议维护者 | 提交 DVT 聚合签名、执行奖惩 Slashing、调整全局参数 | + +### 预览:终端用户 Gasless 流程 + +```typescript +import { createEndUserClient } from '@aastar/sdk'; + +const user = createEndUserClient({ + account, + paymasterUrl: 'https://paymaster.aastar.io' +}); + +// 使用社区信用代付 Gas,无需持有 ETH +await user.sendGaslessTransaction({ + to: TARGET_ADDR, + data: CALL_DATA +}); +``` + +详细测试命令和网络切换指南,请参考 **[📖 测试命令完整指南](./docs/TEST_COMMANDS.md)** + +--- + +## 快速开始 + +### 安装 + +```bash +pnpm install @aastar/sdk @aastar/core viem +``` + +### 基础示例 + +```typescript +import { createOperatorClient } from '@aastar/sdk'; +import { privateKeyToAccount } from 'viem/accounts'; +import { foundry } from 'viem/chains'; +import { http } from 'viem'; + +// 创建运营商客户端 +const operatorClient = createOperatorClient({ + chain: foundry, + transport: http('http://127.0.0.1:8545'), + account: privateKeyToAccount('0x...'), + addresses: { + registry: '0x...', + gToken: '0x...', + // ...更多合约地址 + } +}); + +// 一键入驻 SuperPaymaster(质押 + 存款) +await operatorClient.onboardToSuperPaymaster({ + stakeAmount: parseEther('50'), + depositAmount: parseEther('50') +}); +``` + +--- + +## 测试命令 + +本项目提供两套完整的回归测试。详细说明请参考 **[📖 测试命令完整指南](./docs/TEST_COMMANDS.md)** + +### 快速开始 + +```bash +# SDK回归测试(支持任意网络) +pnpm run test:full_sdk + +# 完整协议回归(Anvil专用,72场景) +pnpm run test:full_anvil +``` + +### 网络切换 + +`test:full_sdk` 可在任意网络运行,只需修改配置: + +```bash +# 方法1: 使用环境变量 +RPC_URL=https://eth-sepolia.g.alchemy.com/v2/KEY \ +REGISTRY_ADDRESS=0xSepoliaAddress \ +pnpm run test:full_sdk + +# 方法2: 创建专用配置文件 +cp .env.v3 .env.sepolia # 编辑填入Sepolia地址 +dotenv -e .env.sepolia -- pnpm run test:full_sdk +``` + +完整网络切换指南(包括Mainnet配置)请查看 [测试命令文档](./docs/TEST_COMMANDS.md#🌐-网络切换指南)。 + +### 1. 完整协议回归测试(不使用SDK) + +```bash +pnpm run test:full_anvil +``` + +- **说明**: 运行17个独立测试脚本,覆盖72个场景 +- **用途**: 完整的协议功能验证(直接使用viem) +- **特点**: 自动重启Anvil、部署合约、同步配置 +- **预期时间**: 5-10分钟 + +### 2. SDK回归测试(使用SDK客户端) + +```bash +pnpm run test:full_sdk +``` + +- **说明**: 验证SDK核心功能(使用四种专属客户端) +- **用途**: SDK v2架构验证 +- **特点**: 自动检测Anvil并初始化环境 +- **预期时间**: ~30秒 +- **测试场景**: + - ✅ Operator Staking (质押) + - ✅ Paymaster Deposit (存款) + - ✅ Community Registration (社区注册) + - ✅ SBT Minting (SBT铸造) + - ✅ Admin Slashing (惩罚) + - ✅ Credit Query (信用查询) + +### 3. 仅初始化环境 + +```bash +pnpm run test:init +``` + +- **说明**: 重启Anvil + 部署合约 + 同步配置(不运行 + +测试) +- **用途**: 手动调试前的环境准备 + +详细文档请参考:[`docs/TEST_COMMANDS.md`](./docs/TEST_COMMANDS.md) + +--- + +## 开发指南 + +### 项目结构 + +``` +aastar-sdk/ +├── packages/ +│ ├── core/ # 核心Actions和ABI定义 +│ ├── sdk/ # 四种角色化客户端 +│ ├── shared-config/ # 共享配置和常量 +│ └── finance/ # xPNTs代币工厂 +├── scripts/ # 测试和实验脚本 +├── docs/ # 完整文档 +└── run_full_regression.sh # 自动化回归测试 +``` + +### 构建 + +```bash +# 安装依赖 +pnpm install + +# 构建所有包 +pnpm run build + +# 运行测试 +pnpm run test:full_sdk +``` + +--- + +## 学术研究 + +本 SDK 支撑了 SuperPaymaster 论文的博士实验数据采集: + +- **`scripts/19_sdk_experiment_runner.ts`**: 官方实验记录器 +- **安全策略**: 严格版本锁定,确保数据的可重复性 +- **覆盖率**: 95%用户用例分支,72个完整场景 + +--- + +## 许可证 + +MIT License - 详见 [LICENSE](./LICENSE) + +--- + +## 贡献 + +欢迎提交Issues和Pull Requests!请确保: + +1. 所有测试通过 (`pnpm run test:full`) +2. 代码符合TypeScript规范 +3. 提交信息遵循 [Conventional Commits](https://www.conventionalcommits.org/) + +--- + +## 相关链接 + +- **SuperPaymaster 论文**: [最新版本](../SuperPaymaster/docs/) +- **Mycelium 网络**: [项目主页](https://github.com/AAStarCommunity) +- **开发者文档**: [`docs/TEST_COMMANDS.md`](./docs/TEST_COMMANDS.md) + +--- + +**由 AAStarCommunity 维护 | Powered by Mycelium Network** diff --git a/0.16.23/zh/guide/task_breakdown.md b/0.16.23/zh/guide/task_breakdown.md new file mode 100644 index 000000000..a2eb14886 --- /dev/null +++ b/0.16.23/zh/guide/task_breakdown.md @@ -0,0 +1,76 @@ +# SuperPaymaster 实验任务分解 (Task Breakdown) + +基于博士研究需求和“三步走”(准备、测试、分析)策略。 + +## 阶段 0: 基础与配置 + +- [x] **0.1. 环境设置 (`.env.v3`)** + - [x] 创建 `projects/env/.env.v3`。 + - [x] 填充 RPC 变量 (`SEPOLIA_RPC_URL` 等)。 + - [x] 填充账户私钥。 + - [x] 配置合约地址(优先使用 `@aastar/shared-config`)。 + +- [x] **0.2. SDK 架构优化** + - [x] 验证 `@aastar/shared-config` 的集成。 + - [x] 确保 `@aastar/core` 导出适配各网络的客户端。 + + +## 阶段 1: 准备 (储备“弹药”) + +- [x] **1.1. 自动化准备 (`scripts/01_prepare_all.ts`)** + - [x] **统一脚本**: 运行以下所有检查。 + - [x] **账户检查**: 计算 A、B、C 账户地址。 + - [x] **ETH 检查**: 余额不足时从 Supplier 节点注资。 + - [x] **身份检查**: 检查 C 账户 MySBT 余额,缺失时自动铸造。 + - [x] **资产检查**: 检查 C 账户 xPNTs (GToken) 余额,不足时自动转账。 + +## 阶段 2: 测试 (执行阶段) + +1. 在 Sepolia, OP Sepolia 和 OP Mainnet 进行 ERC20 转账测试。 +2. 每小时随机进行 2 次转账,24 小时共 48 次。 +3. 默认使用 Alchemy Bundler RPC。 +4. 在 Pimlico Paymaster 测试中使用 PIM 作为 ERC20 Gas 代币。 +5. 使用 `run_daily_experiment.ts` 编排所有脚本。 + +- [/] **2.1. 基准 1: EOA 转账 (`scripts/02_test_eoa.ts`)** + - [ ] 使用 `PRIVATE_KEY_RELAYER` 作为测试 EOA。 + - [ ] 记录各项指标。 + +- [ ] **2.2. 基准 2: 标准 AA (`scripts/03_test_standard_aa.ts`)** + - [ ] 使用 `TEST_SIMPLE_ACCOUNT_A` + Pimlico Paymaster。 + - [ ] 记录各项指标。 + +- [ ] **2.3. 实验组: SuperPaymaster (`scripts/04_test_superpaymaster.ts`)** + *博士论文贡献的核心。* + - [ ] 使用 `TEST_SIMPLE_ACCOUNT_C` + AAStar SuperPaymaster。 + - [ ] 构造 UserOp 并发送给 Bundler。 + - [ ] 记录指标 (Gas Used, L1 Fee, Time)。 + +## 阶段 3: 分析 (结果产出) + +- [ ] **3.1. 数据分析 (`scripts/05_analyze_data.ts`)** + - [ ] 读取 CSV 结果。 + - [ ] 计算均值与标准差。 + - [ ] 对比成本与耗时。 + - [ ] 生成用于论文的 Markdown 表格。 + +## 阶段 4: 特性验证与联动测试 [/] + +### 阶段 5: Staking 退出与 Slash 测试 (12_*.ts) +- [ ] unlock → withdraw 正常流程 +- [ ] Slash 参数验证(罚没、国库、退款) +- [ ] 时间锁测试(提前退出拒绝) + +### 阶段 6: MySBT 销毁与联动集成 +- [ ] 实现 Registry.exitRole 与 MySBT 销毁联动 +- [ ] 确保角色退出后成员资格失效 + +## 附录: 账户角色与私钥 + +| 角色 | 变量名称 | 用途 | +| :--- | :--- | :--- | +| **Supplier** | `SUPPLIER_KEY` | 持有测试 ETH 和 GTokens,负责注资 | +| **Operator** | `OPERATOR_JASON_KEY` | 管理员,负责铸造 SBT | +| **Relayer** | `RELAYER_KEY` | 执行 EOA 基准测试 | +| **AA User 1** | `OWNER_JASON_KEY` | 控制 SuperPaymaster AA 账户 | +| **AA User 2** | `OWNER_ANNI_KEY` | 控制标准 Paymaster AA 账户 | diff --git a/0.16.23/zh/guide/technical_plan.md b/0.16.23/zh/guide/technical_plan.md new file mode 100644 index 000000000..96a0104c9 --- /dev/null +++ b/0.16.23/zh/guide/technical_plan.md @@ -0,0 +1,510 @@ +# Technical Plan: SuperPaymaster & AAStar SDK Experiment + +Based on the analysis of `projects/SuperPaymaster/scripts/gasless-test/test-gasless-viem-v2-final.js`, here is the detailed technical plan for implementing the SDK and the 3-category account experiment. + +## 1. Paymaster Data Structure (SuperPaymaster V3/V4) +Unlike generic Paymasters, SuperPaymaster V3 uses a specific packed format for `paymasterAndData` to optimize for gas and community attribution. + +**Format (72 bytes):** +1. **Paymaster Address** (20 bytes) +2. **Verification Gas Limit** (16 bytes, uint128) - Default 160k (Safe buffer over 120k actual) +3. **PostOp Gas Limit** (16 bytes, uint128) - Default 10k +4. **Operator Address** (20 bytes) - *The Community Node sponsoring the tx* + +**Verification Logic:** +* **On-chain**: Checks if `sender` holds `MySBT` (Soulbound Token) and has sufficient `xPNTs` (Gas Token) balance. +* **Off-chain**: No HTTP signature required. Purely asset-based validation. + +## 2. Experiment Groups & Setup + +### Group A: Traditional EOA (Baseline) +* **Identity**: `PRIVATE_KEY` (Account A) from `.env`. +* **Mechanism**: Standard `eth_sendTransaction`. +* **Setup**: Needs ETH for gas. + +### Group B: Standard AA (Control) +* **Identity**: `OWNER_PRIVATE_KEY` (Account B) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp. +* **Paymaster**: Third-party Provider (e.g., Alchemy Gas Manager) or Bundler's native paymaster. +* **Setup**: Needs a Policy ID or Paymaster RPC URL. + +### Group C: SuperPaymaster AA (Treatment) +* **Identity**: `OWNER2_PRIVATE_KEY` (Account C) controlling a Smart Account. +* **Mechanism**: ERC-4337 UserOp with `SuperPaymaster`. +* **Setup (Pre-requisites)**: + 1. **Mint MySBT**: Account must own a generic or community-specific SBT. + 2. **Token Balance**: Account must hold enough `xPNTs` (or `GTOKEN`) to cover the "Gas Credit". +* **Flow**: + 1. SDK constructs `paymasterAndData` with `OPERATOR` address. + 2. SDK Estimates gas (Optimized: Verification 160k, PostOp 10k). + 3. SDK Signs & Submits. + +## 3. Implementation Roadmap + +### Phase 1: SDK Update (`packages/superpaymaster`) +* **Completed**: Implemented `getPaymasterMiddleware` taking `operatorAddress`. +* **Completed**: Implemented V3 Packing Logic (`concat([pm, verGas, postOpGas, op])`). +* **Completed**: Implemented `checkEligibility` helper. + +### Phase 2: Experiment Script (`run_experiment_data.ts`) +* **Initialization**: Load Keys from `.env` (using global `@env/.env`). +* **Pre-Flight Check**: + * Check Group C eligibility. + * **Auto-Mint**: Logic inspired by `mint-sbt-for-aa.js`. +* **Execution Loop (30 Runs)**: + * **Group A**: `walletClient.sendTransaction`. + * **Group B**: `smartAccountClient.sendUserOperation` (using Alchemy Provider). + * **Group C**: `smartAccountClient.sendUserOperation` (using SuperPaymaster Middleware). +* **Data Recording**: Capture `receipt.gasUsed`, `effectiveGasPrice`. + +## 4. Key Configuration (from `.env`) +```bash +# Identities +PRIVATE_KEY=... # EOA / Deployer +OWNER_PRIVATE_KEY=... # Standard AA Owner +OWNER2_PRIVATE_KEY=...# SuperPaymaster AA Owner + +# Contracts (Sepolia) +SUPER_PAYMASTER_ADDRESS=0x34671Bf95159bbDAb12Ac1DA8dbdfEc5D5dC1c24 +MYSBT_ADDRESS=0xD1e6BDfb907EacD26FF69a40BBFF9278b1E7Cf5C +GAS_TOKEN_ADDRESS=0xfb56CB85C9a214328789D3C92a496d6AA185e3d3 +OPERATOR_ADDRESS=0x411BD567E46C0781248dbB6a9211891C032885e5 +``` + +## 5. Account Preparation Strategy + +| Group | Identity (Key) | Mechanism | Preparation & Requirements | Transaction Execution | +| :--- | :--- | :--- | :--- | :--- | +| **A: Traditional EOA** | `PRIVATE_KEY` | `eth_sendTx` | **Needs ETH**: Transfer Sepolia ETH from Faucet or Deployer. | `walletClient.sendTransaction` | +| **B: Standard AA** | `OWNER_PRIVATE_KEY` | ERC-4337 | **Needs ETH/Paymaster**: Needs ETH (if self-pay) or Paymaster Policy (if sponsored). | `smartAccountClient.sendUserOperation` (Generic) | +| **C: SuperPaymaster** | `OWNER2_PRIVATE_KEY` | ERC-4337 | **Needs MySBT + xPNTs**:
1. **Mint SBT**: Must own a Soulbound Token.
2. **Fund xPNTs**: Must have gas token balance.
*SDK `checkEligibility` verifies this.* | `smartAccountClient.sendUserOperation`
(with `getPaymasterMiddleware`) | + + + +## Inite Test Account and Asset/Data + +•开发环境: Node.js, npm/yarn。 +•基础包: 安装 @account-abstraction/sdk (或选择其他 SDK)。 +•私钥: 一个用于充当智能合约账户 拥有者 (Owner) 的 EOA 钱包私钥。 +•Sepolia ETH: 确保您的 EOA 拥有者地址和/或预计算的智能账户地址中有足够的 Sepolia ETH (除非您使用 Paymaster 赞助 Gas 费)。 +•SimpleAccountFactory: 0x9406Cc6185a346906296840746125a0e44976454 + + +import { SimpleAccountAPI } from "@account-abstraction/sdk"; +import { Wallet, providers } from "ethers";// 1. 配置 const OWNER_KEY = "YOUR_EOA_PRIVATE_KEY"; // 您的 EOA 私钥 const RPC_URL = "YOUR_SEPOLIA_BUNDLER_RPC_URL"; // 最好使用 Bundler 提供的 RPC const ENTRYPOINT_ADDRESS = "0x5FF137D4B0FDCD49DcA30c7CF57E578a026d2789"; const FACTORY_ADDRESS = "0x9406Cc6185a346906296840746125a0e44976454";// 2. 初始化 const provider = new providers.JsonRpcProvider(RPC_URL); const owner = new Wallet(OWNER_KEY, provider);const accountApi = new SimpleAccountAPI({ provider, entryPointAddress: ENTRYPOINT_ADDRESS, owner, factoryAddress: FACTORY_ADDRESS, });// 3. 预计算地址 (可选) const accountAddress = await accountApi.getCounterFactualAddress(); console.log(Smart Account Address: ${accountAddress});// 4. 发送首笔交易 (如果账户未部署,将自动部署) async function sendFirstUserOp() { // 构造 UserOperation 的交易部分 (例如: 发送 0.01 ETH 给自己) const tx = { target: accountAddress, // 目标地址 data: "0x", // 交易数据 value: providers.utils.parseEther("0.01"), // 交易金额 }; + 创建 UserOperation const userOp = await accountApi.createSignedUserOp(tx);// 提交给 Bundler const userOpHash = await provider.send( "eth_sendUserOperation", [userOp, ENTRYPOINT_ADDRESS] );console.log(UserOperation Hash: ${userOpHash}); // 随后可以使用 eth_getUserOperationReceipt 等方法追踪状态 }sendFirstUserOp(); + + 要实现真正的 Gasless (无 Gas 费) 创建和交易,您需要在初始化 SimpleAccountAPI 或构造 UserOperation 时加入 Paymaster 参数。大多数 SDK 都提供了 Paymaster 的集成选项,您只需将 Bundler RPC 切换为支持 Paymaster 的服务商(例如 Alchemy、Stackup、Pimlico)的端点即可实现 Gas 赞助。 + +基于Viem实现生成测试账户: +```javascript +import { createPublicClient, http, encodeFunctionData, getContractAddress, concat, numberToHex, zeroAddress } from 'viem' +import { sepolia } from 'viem/chains' + +// 1. 配置常量 (使用 v0.6 版本) +const FACTORY_ADDRESS = '0x9406Cc6185a346906296840746125a0e44976454'; // 你提供的 v0.6 Factory +const ENTRY_POINT_ADDRESS = '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789'; + +// 你的 EOA 私钥对应的公钥地址 (作为新 AA 账户的 owner) +const OWNER_ADDRESS = '0xYourEOAWalletAddressHere...'; +const SALT = 0n; // 盐值,改变它可以生成不同的地址 + +// SimpleAccountFactory 的 ABI 片段 +const factoryAbi = [ + { + inputs: [ + { name: "owner", type: "address" }, + { name: "salt", type: "uint256" } + ], + name: "createAccount", + outputs: [{ name: "ret", type: "address" }], + stateMutability: "nonpayable", + type: "function" + } +] as const; + +async function main() { + const client = createPublicClient({ + chain: sepolia, + transport: http(), // 默认使用公共节点,建议替换为 Alchemy/Infura + }); + + console.log("--- 生成 ERC-4337 v0.6 SimpleAccount ---"); + + // 2. 生成 initCode + // initCode = Factory地址 + 编码后的函数调用数据 + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [OWNER_ADDRESS, SALT] + }); + + const initCode = concat([FACTORY_ADDRESS, factoryData]); + console.log(`InitCode: ${initCode}`); + + // 3. 预计算 Counterfactual Address (未部署也能知道地址) + // SimpleAccountFactory 使用 CREATE2。 + // 注意:手动计算 CREATE2 比较麻烦,需要知道 Factory 内部具体的 Bytecode 逻辑。 + // 更简单的方法是使用 client.readContract 模拟调用,或者利用 EntryPoint 的 getSenderAddress 报错机制。 + + // 这里演示最简单的:通过 EntryPoint 的 getSenderAddress 方法获取 + // 这种方法虽然看起来像是在“报错”,但这是 ERC-4337 标准获取地址的方式 + try { + const entryPointAbi = [{ + inputs: [{ name: "initCode", type: "bytes" }], + name: "getSenderAddress", + outputs: [], + stateMutability: "nonpayable", // 注意这里通常是 revert + type: "function" + }] as const; + + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: entryPointAbi, + functionName: 'getSenderAddress', + args: [initCode], + }); + } catch (error: any) { + // EntryPoint 会 revert 并携带 SenderAddress + // 我们需要解析这个 revert error + const senderAddress = extractAddressFromError(error); + if (senderAddress) { + console.log(`\n🎉 你的 AA 钱包地址是: ${senderAddress}`); + console.log(`你可以往这个地址转入 Sepolia ETH,然后在第一笔 UserOp 中带上 initCode 即可自动部署。`); + } else { + console.error("无法解析地址,请检查 RPC 节点是否支持 debug", error); + } + } +} + +// 辅助函数:从 Revert Error 中提取地址 +// 不同 RPC 返回的错误格式可能不同,这里是通用逻辑 +function extractAddressFromError(error: any): string | null { + const message = error.details || error.message || ""; + // 匹配 0x 开头的 40 位 hex 字符串 + const match = message.match(/0x[a-fA-F0-9]{40}/); + // 或者专门解析 SenderAddressResult 错误 (0xe90b7b15) + return match ? match[0] : null; +} + +main(); +``` + + + +```javascript +import { + createPublicClient, + http, + encodeFunctionData, + concat, + Hex, + pad, + keccak256, + toBytes, + encodeAbiParameters, + parseAbiParameters, + createWalletClient +} from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { sepolia } from 'viem/chains' + +// --- 1. 配置常量 (v0.7 标准) --- +// 官方 EntryPoint v0.7 +const ENTRY_POINT_ADDRESS = '0x0000000071727De22E5E9d8BAf0edAc6f37da032'; +// 官方 SimpleAccountFactory v0.7 +const FACTORY_ADDRESS = '0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985'; + +// 替换为你的 Bundler RPC (这里必须是 Bundler 节点,不能是普通节点) +// 可以在 Pimlico 或 Alchemy 申请免费的测试网 Key +const BUNDLER_RPC = 'https://api.pimlico.io/v2/sepolia/rpc?apikey=YOUR_API_KEY'; + +// 你的 EOA 私钥 (Owner) +const PRIVATE_KEY = '0xYOUR_PRIVATE_KEY_HERE'; + +const account = privateKeyToAccount(PRIVATE_KEY as Hex); + +// --- ABIs --- +const factoryAbi = [ + { inputs: [{ name: "owner", type: "address" }, { name: "salt", type: "uint256" }], name: "createAccount", outputs: [{ name: "ret", type: "address" }],stateMutability: "nonpayable", type: "function" } +] as const; + +const accountAbi = [ + { inputs: [{ name: "dest", type: "address" }, { name: "value", type: "uint256" }, { name: "func", type: "bytes" }], name: "execute", outputs: [], stateMutability: "nonpayable", type: "function" } +] as const; + +async function main() { + console.log("🚀 开始构建 UserOp (v0.7)..."); + + // 初始化 Bundler Client (本质上就是一个特定 RPC 的 PublicClient) + const client = createPublicClient({ + chain: sepolia, + transport: http(BUNDLER_RPC) + }); + + // 1. 计算 Sender 地址 (AA 钱包地址) + // v0.7 Factory 使用 createAccount(owner, salt) + const salt = 0n; + const factoryData = encodeFunctionData({ + abi: factoryAbi, + functionName: 'createAccount', + args: [account.address, salt] + }); + // 如果是第一次使用,需要提供 factory + factoryData;如果已部署,则为空 + // 这里为了演示,假设是第一次,始终携带 initCode + const initCode = concat([FACTORY_ADDRESS, factoryData]); + + // 利用 EntryPoint 的 getSenderAddress 获取地址 (会 Revert) + let senderAddress: Hex; + try { + await client.simulateContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "initCode", type: "bytes" }], name: "getSenderAddress", outputs: [], stateMutability: "nonpayable", type: "function" }] as const, + functionName: 'getSenderAddress', + args: [initCode] + }); + senderAddress = "0x" // 理论上不会走到这里 + } catch (err: any) { + // 解析 Revert Error 获取地址 + const msg = err.details || err.message; + const match = msg.match(/0x[a-fA-F0-9]{40}/); + if (!match) throw new Error("无法获取 Sender 地址"); + senderAddress = match[0]; + } + console.log(`📝 AA 钱包地址: ${senderAddress}`); + + // ⚠️ 检查:你的 AA 钱包里必须有 ETH 支付 Gas + const balance = await client.getBalance({ address: senderAddress }); + console.log(`💰 当前余额: ${balance.toString()} wei`); + if (balance === 0n) { + console.error("❌ 余额不足!请先往 AA 地址转入 Sepolia ETH"); + return; + } + + // 2. 构建 CallData (你想让 AA 做什么) + // 例子:给自己转 0 ETH (或者转给其他人) + const callData = encodeFunctionData({ + abi: accountAbi, + functionName: 'execute', + args: [account.address, 0n, "0x"] // 目标地址,金额,数据 + }); + + // 3. 获取 Nonce + // v0.7 中 Nonce 是一个 uint256,高 192 位是 Key,低 64 位是 Sequence + // 这里使用简单版:读取 EntryPoint 的 getNonce + const nonce = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ name: "sender", type: "address" }, { name: "key", type: "uint192" }], name: "getNonce", outputs: [{ name: "nonce", type: "uint256" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getNonce', + args: [senderAddress, 0n] + }); + + // 4. 组装部分 PackedUserOp + // 注意:Gas 限制通常通过 eth_estimateUserOperationGas 获取 + // 这里我们先填一些占位符,然后请求 Bundler 估算 + const partialUserOp = { + sender: senderAddress, + nonce: nonce, + initCode: nonce === 0n ? initCode : "0x", // 只有第一次交易需要 initCode + callData: callData, + accountGasLimits: "0x", // 稍后填 + preVerificationGas: 0n, // 稍后填 + gasFees: "0x", // 稍后填 + paymasterAndData: "0x", // 自己付钱,无 Paymaster + signature: "0x" // 稍后签名 + }; + + // 5. 请求 Bundler 估算 Gas + // 注意:不同 Bundler 的返回值格式可能略有不同,这里使用标准 JSON-RPC 格式 + // Viem 的 request 方法可以直接发原始 RPC + const gasEstimate: any = await client.request({ + method: 'eth_estimateUserOperationGas' as any, + params: [ + { + ...partialUserOp, + initCode: partialUserOp.initCode, + callData: partialUserOp.callData, + paymasterAndData: "0x", + signature: "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c" // 假签名用于估算 + }, + ENTRY_POINT_ADDRESS + ] + }); + + // 提取 Gas 参数 (v0.7 采用了 packed 格式) + // verificationGasLimit (16 bytes) | callGasLimit (16 bytes) + const verificationGasLimit = BigInt(gasEstimate.verificationGasLimit ?? gasEstimate.verificationGas ?? 100000n); + const callGasLimit = BigInt(gasEstimate.callGasLimit ?? 100000n); + const accountGasLimits = concat([ + pad(toBytes(verificationGasLimit), { size: 16 }), + pad(toBytes(callGasLimit), { size: 16 }) + ]); + + const preVerificationGas = BigInt(gasEstimate.preVerificationGas ?? 50000n); + + // 获取当前费率 + const block = await client.getBlock(); + const maxPriorityFeePerGas = await client.request({ method: 'eth_maxPriorityFeePerGas' as any }); + const maxFeePerGas = block.baseFeePerGas! * 2n + BigInt(maxPriorityFeePerGas); + + // maxPriorityFeePerGas (16 bytes) | maxFeePerGas (16 bytes) + const gasFees = concat([ + pad(toBytes(BigInt(maxPriorityFeePerGas)), { size: 16 }), + pad(toBytes(maxFeePerGas), { size: 16 }) + ]); + + // 6. 最终组装 PackedUserOp + const userOp = { + sender: senderAddress, + nonce: nonce, + initCode: partialUserOp.initCode, + callData: callData, + accountGasLimits: accountGasLimits, + preVerificationGas: preVerificationGas, + gasFees: gasFees, + paymasterAndData: "0x" as Hex, + signature: "0x" as Hex + }; + + // 7. 计算 UserOp Hash 并签名 + // 需要按照 ERC-4337 v0.7 规范进行 Hash + const userOpHash = await client.readContract({ + address: ENTRY_POINT_ADDRESS, + abi: [{ inputs: [{ components: [{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}], name: "userOp", type: "tuple" }], name: "getUserOpHash", outputs: [{ name: "", type: "bytes32" }], stateMutability: "view", type: "function" }] as const, + functionName: 'getUserOpHash', + args: [userOp] + }); + + console.log(`🔑 UserOp Hash: ${userOpHash}`); + + // Owner 签名 + const signature = await account.signMessage({ + message: { raw: userOpHash } + }); + + // 将签名填回 UserOp + userOp.signature = signature; + + // 8. 发送 UserOp 到 Bundler + console.log("📨 正在发送 UserOp..."); + const userOpHashRes = await client.request({ + method: 'eth_sendUserOperation' as any, + params: [userOp, ENTRY_POINT_ADDRESS] + }); + + console.log(`✅ 发送成功! UserOp Hash: ${userOpHashRes}`); + console.log(`🔗 查看链接: https://jiffyscan.xyz/userOpHash/${userOpHashRes}?network=sepolia`); +} + +main().catch(console.error); + +``` + +代码原理解析 +createAccount (InitCode): + +在 v0.7 中,工厂方法签名依然是 createAccount。 + +如果 initCode 不为空,EntryPoint 会先执行这个代码来部署合约,然后再执行后续的 execute。这就是为什么你不需要单独去部署合约,使用即部署。 + +UserOp 打包 (Packing): + +请注意代码中的 accountGasLimits 和 gasFees。在 v0.6 中,这些都是独立的 uint256 字段。 + +在 v0.7 中,为了节省 CallData 的 Gas 费用,它们被压缩成了 bytes32 (两个 uint128 拼接)。这是 v0.7 最显著的代码层面变化。 + +签名流程: + +getUserOpHash 是在链下完成的(虽然我用了 readContract 调用 EntryPoint 里的纯函数,这样最准确)。 + +拿到 Hash 后,EOA (Owner) 进行 ECDSA 签名。 + +SimpleAccount 的合约逻辑就是:校验签名(UserOpHash, Signature) == Owner。 + +Bundler: + +最后一步 eth_sendUserOperation 不是发给普通的以太坊节点,而是发给 Bundler。Bundler 会把它打包成一笔以太坊交易 (handleOps) 上链。 + +你的下一步 +把 BUNDLER_RPC 换成你申请到的 API (推荐 Pimlico 或 Alchemy)。 + +运行代码拿到 AA 钱包地址。 + +往这个地址转 0.01 Sepolia ETH。 + +再次运行代码,你应该能看到 发送成功 并在 Jiffyscan 上查到这笔 UserOp。 + +------ + +npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🗂️ backup and recover secrets: https://dotenvx.com/ops +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx4W1-vUePAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xe109d637d5788faa3a56ac82c33dd63de744ab0b624b8f215f89c264bc687a87?network=sepolia + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xf096878c6389d56d71450e00e5149ff943f012fb3e6fdd2eb1e4d7a61588ff06?network=sepolia + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ❌ NO + Balance: 0.07 ETH + 🛠 Constructing UserOp... + ⚠️ Estimation failed, using fallback (Unpacked Fields)... + 🔑 Hash: 0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497 + 📨 Sending (Fallback Unpacked)... + ✅ Sent! https://jiffyscan.xyz/userOpHash/0xd82fea49a60b4f8c1ced70192a4f43965b6f5b35ea9c343805977c55fa538497?network=sepolia +(base) XBOX at ~/Dev/mycelium/my-exploration/projects/aastar-sdk ±(main) ✗ ❯ ruby-3.3.2 + +--------- + +$ npx tsx scripts/deploy_test_accounts.ts +[dotenv@17.2.3] injecting env (18) from ../env/.env.v3 -- tip: 🔐 prevent building .env in docker: https://dotenvx.com/prebuild +Using RPC: https://eth-sepolia.g.alchemy.com/v2/Bx41-vnwAAD7N +Owner: 0xb5600060e6de5E11D3636731964218E53caadf0E + +-------------------------------------------- +🚀 Processing Baseline (A) [Salt 0] +-------------------------------------------- +📝 Address: 0xECD9C07f648B09CFb78906302822Ec52Ab87dd70 + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing Standard (B) [Salt 1] +-------------------------------------------- +📝 Address: 0x179Faf25600c01DBFcEf7971f15DcFa3FbE5d31C + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. + +-------------------------------------------- +🚀 Processing SuperPaymaster (C) [Salt 2] +-------------------------------------------- +📝 Address: 0xb78ef5C8DD059ABa48b65c8069641f30BBf0A1ED + Deployed: ✅ YES + Balance: 0.0596 ETH + ✅ Already deployed. Skipping. diff --git a/0.16.23/zh/guide/use-cases/community-management.md b/0.16.23/zh/guide/use-cases/community-management.md new file mode 100644 index 000000000..8fd172d9c --- /dev/null +++ b/0.16.23/zh/guide/use-cases/community-management.md @@ -0,0 +1,141 @@ +# Community Management Guide + +Complete guide for managing DAOs and communities with AAStar SDK. + +## Overview + +This guide shows how to: +- Register a community +- Manage members with SBTs +- Configure reputation systems +- Deploy community tokens +- Set up gas sponsorship + +--- + +## Prerequisites + +- Community admin account +- Basic understanding of DAOs +- Testnet ETH for transactions + +--- + +## Step 1: Register Community + +```typescript +import { createCommunityClient } from '@aastar/core'; +import { http } from 'viem'; +import { sepolia } from 'viem/chains'; +import { privateKeyToAccount } from 'viem/accounts'; + +const community = createCommunityClient({ + chain: sepolia, + transport: http(process.env.RPC_URL), + account: privateKeyToAccount(process.env.COMMUNITY_KEY), +}); + +// Register community +const txHash = await community.registerCommunity({ + name: 'DevDAO', + metadata: 'ipfs://QmCommunityMetadata...', +}); + +console.log('Community registered:', txHash); +``` + +--- + +## Step 2: Deploy Community Token + +```typescript +import { parseEther } from 'viem'; + +const tokenAddress = await community.deployXPNTs({ + name: 'DevDAO Points', + symbol: 'DDP', + initialSupply: parseEther('1000000'), +}); + +console.log('Token deployed at:', tokenAddress); +``` + +--- + +## Step 3: Configure Reputation System + +```typescript +await community.setReputationRules({ + rules: [ + { metric: 'code_contributions', weight: 40 }, + { metric: 'community_engagement', weight: 30 }, + { metric: 'governance_participation', weight: 30 }, + ], +}); +``` + +--- + +## Step 4: Manage Members + +```typescript +// Mint membership SBT +await community.mintSBT({ + to: memberAddress, + tokenId: 1n, + metadata: 'ipfs://QmMembershipBadge...', +}); + +// Distribute points +import { mintXPNTs } from '@aastar/tokens'; + +await mintXPNTs(community, memberAddress, parseEther('100')); +``` + +--- + +## Complete Example + +```typescript +async function setupCommunity() { + const community = createCommunityClient({...}); + + // 1. Register + await community.registerCommunity({ + name: 'DevDAO', + metadata: 'ipfs://...', + }); + + // 2. Deploy token + const tokenAddress = await community.deployXPNTs({ + name: 'DevDAO Points', + symbol: 'DDP', + initialSupply: parseEther('1000000'), + }); + + // 3. Set reputation rules + await community.setReputationRules({ + rules: [ + { metric: 'contributions', weight: 50 }, + { metric: 'engagement', weight: 50 }, + ], + }); + + // 4. Onboard members + const members = ['0x...', '0x...']; + for (const member of members) { + await community.mintSBT({ to: member, tokenId: 1n }); + await mintXPNTs(community, member, parseEther('100')); + } + + console.log('Community setup complete!'); +} +``` + +--- + +## Related + +- [Community API](/0.16.23/api/roles/community) +- [Tokens Module](/0.16.23/api/modules/tokens) +- [Identity Module](/0.16.23/api/modules/identity) diff --git a/0.16.23/zh/guide/use-cases/gasless-transactions.md b/0.16.23/zh/guide/use-cases/gasless-transactions.md new file mode 100644 index 000000000..938892c0b --- /dev/null +++ b/0.16.23/zh/guide/use-cases/gasless-transactions.md @@ -0,0 +1,71 @@ +# Gasless Transactions Guide + +Complete guide for implementing gasless transactions with SuperPaymaster. + +## Overview + +Enable users to send transactions without holding ETH for gas fees. + +--- + +## Prerequisites + +- User has community SBT +- Community has gas sponsorship enabled +- User within credit limit + +--- + +## Implementation + +```typescript +import { createEndUserClient } from '@aastar/core'; +import { getPaymasterAndData, checkEligibility } from '@aastar/paymaster'; + +async function sendGaslessTransaction() { + const user = createEndUserClient({...}); + + // 1. Check eligibility + const eligible = await checkEligibility( + user.account.address, + communityAddress, + process.env.RPC_URL + ); + + if (!eligible) { + throw new Error('Not eligible'); + } + + // 2. Check credit + const credit = await user.getCreditLimit(); + console.log('Credit:', formatEther(credit)); + + // 3. Create UserOperation + const userOp = {...}; + + // 4. Get paymaster data + const paymasterAndData = getPaymasterAndData(userOp, { + paymasterAddress: CONTRACTS.sepolia.superPaymaster, + communityAddress, + xPNTsAddress: CONTRACTS.sepolia.xPNTsToken, + verificationGasLimit: 100000n, + postOpGasLimit: 50000n, + }); + + // 5. Submit + const txHash = await submitUserOperation({ + ...userOp, + paymasterAndData, + }); + + console.log('Gasless TX:', txHash); +} +``` + +--- + +## Related + +- [End User API](/0.16.23/api/roles/enduser) +- [Paymaster Module](/0.16.23/api/modules/paymaster) +- [SuperPaymaster Concept](/0.16.23/guide/concepts/superpaymaster) diff --git a/0.16.23/zh/guide/use-cases/operator-staking.md b/0.16.23/zh/guide/use-cases/operator-staking.md new file mode 100644 index 000000000..1c3325076 --- /dev/null +++ b/0.16.23/zh/guide/use-cases/operator-staking.md @@ -0,0 +1,84 @@ +# Operator Staking Guide + +Complete guide for becoming a Paymaster operator. + +## Overview + +Stake GTokens and provide gas sponsorship services. + +--- + +## Steps + +### 1. Acquire GTokens + +```typescript +import { mintGToken } from '@aastar/tokens'; + +await mintGToken(client, operatorAddress, parseEther('1000')); +``` + +### 2. Approve Staking Contract + +```typescript +import { approveGToken } from '@aastar/tokens'; +import { CONTRACTS } from '@aastar/core'; + +await approveGToken( + client, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') +); +``` + +### 3. Stake + +```typescript +import { createOperatorClient } from '@aastar/core'; + +const operator = createOperatorClient({...}); + +await operator.stake({ amount: parseEther('100') }); +``` + +### 4. Deposit to Paymaster + +```typescript +await operator.deposit({ amount: parseEther('10') }); +``` + +--- + +## Complete Example + +```typescript +async function becomeOperator() { + const operator = createOperatorClient({...}); + + // 1. Mint GTokens + await mintGToken(operator, operator.account.address, parseEther('1000')); + + // 2. Approve + await approveGToken( + operator, + CONTRACTS.sepolia.gTokenStaking, + parseEther('100') + ); + + // 3. Stake + await operator.stake({ amount: parseEther('100') }); + + // 4. Deposit + await operator.deposit({ amount: parseEther('10') }); + + console.log('Operator setup complete!'); +} +``` + +--- + +## Related + +- [Operator API](/0.16.23/api/roles/operator) +- [Tokens Module](/0.16.23/api/modules/tokens) +- [Core Module](/0.16.23/api/modules/core) diff --git a/0.16.23/zh/guide/use-cases/yop.md b/0.16.23/zh/guide/use-cases/yop.md new file mode 100644 index 000000000..7ad1ec8ee --- /dev/null +++ b/0.16.23/zh/guide/use-cases/yop.md @@ -0,0 +1,72 @@ +# Build Your Own Protocol (YOP) + +Guide for building custom protocols on AAStar infrastructure. + +## Overview + +AAStar SDK provides infrastructure to build Your Own Protocol with: +- Account Abstraction +- Gas sponsorship +- Community management +- Reputation systems + +--- + +## Architecture + +``` +Your Protocol +├── Smart Contracts +│ └── Custom logic +├── AAStar SDK +│ ├── Account Abstraction +│ ├── SuperPaymaster +│ └── Community Management +└── Frontend DApp + └── React + @aastar/dapp +``` + +--- + +## Example: Custom DeFi Protocol + +```typescript +import { createEndUserClient, createCommunityClient } from '@aastar/core'; + +// 1. Set up community +const community = createCommunityClient({...}); +await community.registerCommunity({ name: 'MyDeFi' }); + +// 2. Deploy community token +const tokenAddress = await community.deployXPNTs({ + name: 'MyDeFi Points', + symbol: 'MDP', + initialSupply: parseEther('1000000'), +}); + +// 3. Enable gasless transactions for users +const user = createEndUserClient({...}); +const eligible = await user.checkEligibility(communityAddress); + +// 4. Users can interact without gas fees +if (eligible) { + await sendGaslessTransaction(); +} +``` + +--- + +## Key Features + +1. **Gasless UX**: Users don't need ETH +2. **Community Tokens**: Custom reward systems +3. **Reputation**: On-chain reputation tracking +4. **Flexible**: Build any protocol logic + +--- + +## Related + +- [Core Module](/0.16.23/api/modules/core) +- [Community API](/0.16.23/api/roles/community) +- [SuperPaymaster Concept](/0.16.23/guide/concepts/superpaymaster) diff --git a/index.md b/index.md index 41936fcf6..520bf685c 100644 --- a/index.md +++ b/index.md @@ -43,7 +43,7 @@ features: ---

- License: MIT + License: Apache-2.0 TypeScript Status Last Updated