@aastar/sdk 0.16.11 → 0.16.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -128
- package/dist/clients/ExperimentClient.d.ts +34 -0
- package/{packages/sdk/src/clients/ExperimentClient.ts → dist/clients/ExperimentClient.js} +11 -33
- package/dist/clients/ExperimentClient.test.d.ts +1 -0
- package/dist/clients/ExperimentClient.test.js +53 -0
- package/dist/clients/admin.d.ts +11 -0
- package/dist/clients/admin.js +20 -0
- package/dist/clients/admin.test.d.ts +1 -0
- package/dist/clients/admin.test.js +79 -0
- package/dist/clients/clients.test.d.ts +1 -0
- package/dist/clients/clients.test.js +91 -0
- package/dist/clients/community.d.ts +40 -0
- package/{packages/sdk/src/clients/community.ts → dist/clients/community.js} +86 -189
- package/dist/clients/community.test.d.ts +1 -0
- package/dist/clients/community.test.js +99 -0
- package/dist/clients/endUser.d.ts +77 -0
- package/dist/clients/endUser.js +298 -0
- package/dist/clients/endUser.test.d.ts +1 -0
- package/dist/clients/endUser.test.js +188 -0
- package/dist/clients/operator.d.ts +66 -0
- package/{packages/sdk/src/clients/operator.ts → dist/clients/operator.js} +66 -137
- package/dist/clients/operator.test.d.ts +1 -0
- package/dist/clients/operator.test.js +139 -0
- package/dist/core/src/abis/BLSAggregator.json +686 -0
- package/dist/core/src/abis/BLSValidator.json +42 -0
- package/dist/core/src/abis/DVTValidator.json +368 -0
- package/dist/core/src/abis/EntryPoint.json +1382 -0
- package/dist/core/src/abis/GToken.json +513 -0
- package/dist/core/src/abis/GTokenStaking.json +949 -0
- package/dist/core/src/abis/MySBT.json +1518 -0
- package/dist/core/src/abis/Paymaster.json +1143 -0
- package/dist/core/src/abis/PaymasterFactory.json +640 -0
- package/dist/core/src/abis/Registry.json +1942 -0
- package/dist/core/src/abis/ReputationSystem.json +699 -0
- package/dist/core/src/abis/SimpleAccount.json +560 -0
- package/dist/core/src/abis/SimpleAccountFactory.json +111 -0
- package/dist/core/src/abis/SuperPaymaster.json +1781 -0
- package/dist/core/src/abis/xPNTsFactory.json +718 -0
- package/dist/core/src/abis/xPNTsToken.json +1280 -0
- package/dist/errors/AAStarError.d.ts +26 -0
- package/dist/errors/AAStarError.js +32 -0
- package/dist/errors/AAStarError.test.d.ts +1 -0
- package/dist/errors/AAStarError.test.js +74 -0
- package/dist/errors/decoder.d.ts +6 -0
- package/{packages/sdk/src/errors/decoder.ts → dist/errors/decoder.js} +15 -19
- package/dist/errors/decoder.test.d.ts +1 -0
- package/dist/errors/decoder.test.js +90 -0
- package/dist/index.d.ts +18 -0
- package/{packages/sdk/src/index.ts → dist/index.js} +0 -3
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.js +7 -0
- package/dist/types/result.d.ts +15 -0
- package/dist/types/result.js +23 -0
- package/dist/utils/errorHandler.d.ts +40 -0
- package/{packages/sdk/src/utils/errorHandler.ts → dist/utils/errorHandler.js} +22 -75
- package/dist/utils/errorHandler.test.d.ts +1 -0
- package/dist/utils/errorHandler.test.js +89 -0
- package/dist/utils/eventDecoder.d.ts +7 -0
- package/dist/utils/eventDecoder.js +54 -0
- package/dist/utils/eventDecoder.test.d.ts +1 -0
- package/dist/utils/eventDecoder.test.js +48 -0
- package/dist/utils/funding.d.ts +115 -0
- package/{packages/sdk/src/utils/funding.ts → dist/utils/funding.js} +27 -119
- package/dist/utils/funding.test.d.ts +1 -0
- package/dist/utils/funding.test.js +105 -0
- package/dist/utils/keys.d.ts +61 -0
- package/{packages/sdk/src/utils/keys.ts → dist/utils/keys.js} +15 -44
- package/dist/utils/keys.test.d.ts +1 -0
- package/dist/utils/keys.test.js +81 -0
- package/dist/utils/roleData.d.ts +66 -0
- package/{packages/sdk/src/utils/roleData.ts → dist/utils/roleData.js} +34 -57
- package/dist/utils/roleData.test.d.ts +1 -0
- package/dist/utils/roleData.test.js +74 -0
- package/dist/utils/testScenarios.d.ts +33 -0
- package/dist/utils/testScenarios.js +85 -0
- package/dist/utils/testScenarios.test.d.ts +1 -0
- package/dist/utils/testScenarios.test.js +68 -0
- package/dist/utils/userOp.d.ts +78 -0
- package/{packages/sdk/src/utils/userOp.ts → dist/utils/userOp.js} +59 -126
- package/dist/utils/userOp.test.d.ts +1 -0
- package/dist/utils/userOp.test.js +152 -0
- package/package.json +25 -61
- package/.github/workflows/gas-analytics-daily.yml +0 -52
- package/.gitmodules +0 -9
- package/CHANGELOG.md +0 -43
- package/aastar-sdk.code-workspace +0 -14
- package/abis/BLSAggregator.json +0 -572
- package/abis/BLSValidator.json +0 -39
- package/abis/DVTValidator.json +0 -383
- package/abis/Eip7702Support.json +0 -24
- package/abis/EntryPoint.json +0 -1379
- package/abis/GToken.json +0 -510
- package/abis/GTokenStaking.json +0 -918
- package/abis/LegacyAccount.json +0 -625
- package/abis/MySBT.json +0 -1547
- package/abis/Paymaster.json +0 -1192
- package/abis/PaymasterFactory.json +0 -637
- package/abis/PaymasterV4_2.json +0 -1193
- package/abis/Registry.json +0 -1677
- package/abis/ReputationSystem.json +0 -659
- package/abis/SenderCreator.json +0 -99
- package/abis/Simple7702Account.json +0 -395
- package/abis/SimpleAccount.json +0 -625
- package/abis/SimpleAccountFactory.json +0 -108
- package/abis/SimpleAccountFactoryV08.json +0 -87
- package/abis/SimpleAccountV08.json +0 -557
- package/abis/SuperPaymaster.json +0 -1568
- package/abis/UserOperationLib.json +0 -57
- package/abis/aPNTs.json +0 -1160
- package/abis/xPNTsFactory.json +0 -715
- package/abis/xPNTsToken.json +0 -1160
- package/backup/run_sdk_regression.sh +0 -135
- package/config/networks/README.md +0 -54
- package/config/networks/mainnet.env.example +0 -39
- package/config/networks/optimism-sepolia.env.example +0 -35
- package/config/networks/optimism.env.example +0 -36
- package/config/networks/sepolia.env.example +0 -36
- package/config.anvil.json +0 -1
- package/config.sepolia.json +0 -19
- package/config.test.json +0 -27
- package/data/experiment_data.csv +0 -36
- package/data/industry_baseline_2025-12-23.json +0 -154
- package/data/industry_baseline_latest.json +0 -154
- package/docs/ABI_MAINTENANCE_PLAN.md +0 -132
- package/docs/API_REFERENCE.md +0 -796
- package/docs/Configuration_Sync.md +0 -47
- package/docs/DAO_Mining_Distribution_Plan.md +0 -522
- package/docs/DEMO_REFACTOR_PLAN.md +0 -289
- package/docs/DOCUMENTATION_PLAN.md +0 -455
- package/docs/ENV_SEPOLIA_UPDATE.md +0 -68
- package/docs/L2_BUSINESS_CLIENTS_PLAN.md +0 -394
- package/docs/L4_Manual_Test_CheatSheet.md +0 -172
- package/docs/Plan.md +0 -266
- package/docs/Regression_Testing_Guide.md +0 -70
- package/docs/Reputation-to-Credit_Mapping_Whitepaper.md +0 -242
- package/docs/SDK_ABI_COVERAGE.md +0 -839
- package/docs/SDK_COVERAGE_STRATEGY.md +0 -397
- package/docs/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/SDK_REGRESSION_AND_API_PLAN.md +0 -98
- package/docs/SDK_STAGE3_PLAN.md +0 -151
- package/docs/SEPOLIA_ENV_REFERENCE.md +0 -51
- package/docs/STAGE3.md +0 -191
- package/docs/Script_Comparison_Report.md +0 -91
- package/docs/Sepolia_Latest_Deployment.md +0 -117
- package/docs/TESTER_GUIDE_GASLESS.md +0 -409
- package/docs/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/TODO_SDK_COVERAGE.md +0 -55
- package/docs/USER_CASE_DESIGN.md +0 -110
- package/docs/Verifier_L4_Gasless_Plan.md +0 -454
- package/docs/api/@aastar/account/README.md +0 -15
- package/docs/api/@aastar/account/classes/UserOpClient.md +0 -87
- package/docs/api/@aastar/account/functions/createEOAWalletClient.md +0 -21
- package/docs/api/@aastar/account/functions/getUserOpHash.md +0 -23
- package/docs/api/@aastar/account/functions/packUserOpLimits.md +0 -19
- package/docs/api/@aastar/account/functions/toSimpleSmartAccount.md +0 -83
- package/docs/api/@aastar/account/type-aliases/EOAWalletClient.md +0 -37
- package/docs/api/@aastar/account/type-aliases/SimpleSmartAccount.md +0 -39
- package/docs/api/@aastar/core/README.md +0 -211
- package/docs/api/@aastar/core/classes/BLSSigner.md +0 -147
- package/docs/api/@aastar/core/classes/BaseClient.md +0 -9657
- package/docs/api/@aastar/core/classes/ContractConfigManager.md +0 -25
- package/docs/api/@aastar/core/classes/RequirementChecker.md +0 -1837
- package/docs/api/@aastar/core/classes/SepoliaFaucetAPI.md +0 -13661
- package/docs/api/@aastar/core/classes/StateValidator.md +0 -133
- package/docs/api/@aastar/core/enumerations/EntryPointVersion.md +0 -17
- package/docs/api/@aastar/core/enumerations/NodeType.md +0 -33
- package/docs/api/@aastar/core/enumerations/RolePermissionLevel.md +0 -43
- package/docs/api/@aastar/core/functions/accountActions.md +0 -2720
- package/docs/api/@aastar/core/functions/accountFactoryActions.md +0 -2720
- package/docs/api/@aastar/core/functions/aggregatorActions.md +0 -2720
- package/docs/api/@aastar/core/functions/createAAStarPublicClient.md +0 -3105
- package/docs/api/@aastar/core/functions/dvtActions.md +0 -2720
- package/docs/api/@aastar/core/functions/entryPointActions.md +0 -2724
- package/docs/api/@aastar/core/functions/gTokenActions.md +0 -2714
- package/docs/api/@aastar/core/functions/gTokenExtendedActions.md +0 -2720
- package/docs/api/@aastar/core/functions/getAddressUrl.md +0 -32
- package/docs/api/@aastar/core/functions/getAllCommunityConfigs.md +0 -9
- package/docs/api/@aastar/core/functions/getAllV2Contracts.md +0 -20
- package/docs/api/@aastar/core/functions/getBlockExplorer.md +0 -26
- package/docs/api/@aastar/core/functions/getChainId.md +0 -26
- package/docs/api/@aastar/core/functions/getCommunities.md +0 -76
- package/docs/api/@aastar/core/functions/getCommunity.md +0 -32
- package/docs/api/@aastar/core/functions/getCommunityConfig.md +0 -15
- package/docs/api/@aastar/core/functions/getContract.md +0 -37
- package/docs/api/@aastar/core/functions/getContractNetworks.md +0 -18
- package/docs/api/@aastar/core/functions/getContracts.md +0 -194
- package/docs/api/@aastar/core/functions/getCoreContracts.md +0 -71
- package/docs/api/@aastar/core/functions/getDeploymentDate.md +0 -32
- package/docs/api/@aastar/core/functions/getEntryPoint.md +0 -25
- package/docs/api/@aastar/core/functions/getNetwork.md +0 -26
- package/docs/api/@aastar/core/functions/getPaymasterV4_1.md +0 -25
- package/docs/api/@aastar/core/functions/getRoleName.md +0 -15
- package/docs/api/@aastar/core/functions/getRpcUrl.md +0 -25
- package/docs/api/@aastar/core/functions/getSimpleAccountFactory.md +0 -25
- package/docs/api/@aastar/core/functions/getSuperPaymasterV2.md +0 -25
- package/docs/api/@aastar/core/functions/getTestAccounts.md +0 -30
- package/docs/api/@aastar/core/functions/getTestTokenContracts.md +0 -38
- package/docs/api/@aastar/core/functions/getTokenContracts.md +0 -31
- package/docs/api/@aastar/core/functions/getTxUrl.md +0 -32
- package/docs/api/@aastar/core/functions/getV2ContractByAddress.md +0 -28
- package/docs/api/@aastar/core/functions/getV2ContractByName.md +0 -28
- package/docs/api/@aastar/core/functions/getV2ContractsByDate.md +0 -26
- package/docs/api/@aastar/core/functions/isContractNetworkSupported.md +0 -27
- package/docs/api/@aastar/core/functions/isRegisteredCommunity.md +0 -15
- package/docs/api/@aastar/core/functions/isV2Contract.md +0 -27
- package/docs/api/@aastar/core/functions/paymasterActions.md +0 -2720
- package/docs/api/@aastar/core/functions/paymasterFactoryActions.md +0 -2720
- package/docs/api/@aastar/core/functions/registryActions.md +0 -2720
- package/docs/api/@aastar/core/functions/reputationActions.md +0 -2720
- package/docs/api/@aastar/core/functions/sbtActions.md +0 -2720
- package/docs/api/@aastar/core/functions/stakingActions.md +0 -2720
- package/docs/api/@aastar/core/functions/superPaymasterActions.md +0 -2720
- package/docs/api/@aastar/core/functions/tokenActions.md +0 -2714
- package/docs/api/@aastar/core/functions/xPNTsFactoryActions.md +0 -2720
- package/docs/api/@aastar/core/interfaces/AccountBalance.md +0 -41
- package/docs/api/@aastar/core/interfaces/BalanceValidationParams.md +0 -51
- package/docs/api/@aastar/core/interfaces/ClientConfig.md +0 -4841
- package/docs/api/@aastar/core/interfaces/CommunityConfig.md +0 -81
- package/docs/api/@aastar/core/interfaces/ContractVersion.md +0 -63
- package/docs/api/@aastar/core/interfaces/DeploymentValidationParams.md +0 -39
- package/docs/api/@aastar/core/interfaces/RoleConfig.md +0 -83
- package/docs/api/@aastar/core/interfaces/RoleRequirement.md +0 -43
- package/docs/api/@aastar/core/interfaces/RoleValidationParams.md +0 -55
- package/docs/api/@aastar/core/interfaces/SuperPaymasterConfig.md +0 -57
- package/docs/api/@aastar/core/interfaces/TokenBalanceValidationParams.md +0 -63
- package/docs/api/@aastar/core/interfaces/TransactionOptions.md +0 -24
- package/docs/api/@aastar/core/interfaces/ValidationParams.md +0 -25
- package/docs/api/@aastar/core/interfaces/ValidationResult.md +0 -25
- package/docs/api/@aastar/core/type-aliases/AccountActions.md +0 -151
- package/docs/api/@aastar/core/type-aliases/AccountFactoryActions.md +0 -55
- package/docs/api/@aastar/core/type-aliases/AggregatorActions.md +0 -471
- package/docs/api/@aastar/core/type-aliases/BusinessResult.md +0 -12
- package/docs/api/@aastar/core/type-aliases/ContractCategory.md +0 -5
- package/docs/api/@aastar/core/type-aliases/ContractNetwork.md +0 -5
- package/docs/api/@aastar/core/type-aliases/DVTActions.md +0 -319
- package/docs/api/@aastar/core/type-aliases/EntryPointActions.md +0 -103
- package/docs/api/@aastar/core/type-aliases/GTokenExtendedActions.md +0 -239
- package/docs/api/@aastar/core/type-aliases/NetworkContracts.md +0 -5
- package/docs/api/@aastar/core/type-aliases/PaymasterActions.md +0 -1087
- package/docs/api/@aastar/core/type-aliases/PaymasterFactoryActions.md +0 -263
- package/docs/api/@aastar/core/type-aliases/RegistryActions.md +0 -1543
- package/docs/api/@aastar/core/type-aliases/ReputationActions.md +0 -811
- package/docs/api/@aastar/core/type-aliases/SBTActions.md +0 -1199
- package/docs/api/@aastar/core/type-aliases/StakingActions.md +0 -703
- package/docs/api/@aastar/core/type-aliases/SuperPaymasterActions.md +0 -1311
- package/docs/api/@aastar/core/type-aliases/SupportedNetwork.md +0 -3
- package/docs/api/@aastar/core/type-aliases/TokenActions.md +0 -1227
- package/docs/api/@aastar/core/type-aliases/XPNTsFactoryActions.md +0 -395
- package/docs/api/@aastar/core/variables/AASTAR_COMMUNITY.md +0 -8
- package/docs/api/@aastar/core/variables/ALL_ADDRESSES.md +0 -75
- package/docs/api/@aastar/core/variables/ALL_ROLES.md +0 -5
- package/docs/api/@aastar/core/variables/APNTS_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/BLSAggregatorABI.md +0 -3
- package/docs/api/@aastar/core/variables/BLSAggregatorArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/BLSHelpers.md +0 -101
- package/docs/api/@aastar/core/variables/BLSValidatorABI.md +0 -3
- package/docs/api/@aastar/core/variables/BLSValidatorArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/BPS_DENOMINATOR.md +0 -5
- package/docs/api/@aastar/core/variables/BRANDING.md +0 -67
- package/docs/api/@aastar/core/variables/BREAD_COMMUNITY.md +0 -8
- package/docs/api/@aastar/core/variables/CHAIN_MAINNET.md +0 -3
- package/docs/api/@aastar/core/variables/CHAIN_SEPOLIA.md +0 -5
- package/docs/api/@aastar/core/variables/COMMUNITIES.md +0 -5
- package/docs/api/@aastar/core/variables/COMMUNITY_OWNERS.md +0 -15
- package/docs/api/@aastar/core/variables/CONTRACTS.md +0 -179
- package/docs/api/@aastar/core/variables/CONTRACT_METADATA.md +0 -67
- package/docs/api/@aastar/core/variables/CONTRACT_SRC_HASH.md +0 -5
- package/docs/api/@aastar/core/variables/CORE_ADDRESSES.md +0 -51
- package/docs/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md +0 -17
- package/docs/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md +0 -5
- package/docs/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md +0 -3
- package/docs/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md +0 -5
- package/docs/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md +0 -3
- package/docs/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md +0 -5
- package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md +0 -3
- package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md +0 -5
- package/docs/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md +0 -5
- package/docs/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md +0 -5
- package/docs/api/@aastar/core/variables/DVTValidatorABI.md +0 -3
- package/docs/api/@aastar/core/variables/DVTValidatorArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/ENTRY_POINT_0_8_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/ENTRY_POINT_0_9_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/EntryPointABI.md +0 -3
- package/docs/api/@aastar/core/variables/EntryPointArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/FAUCET_API_URL.md +0 -5
- package/docs/api/@aastar/core/variables/GTOKEN_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/GTokenABI.md +0 -3
- package/docs/api/@aastar/core/variables/GTokenArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/GTokenStakingABI.md +0 -3
- package/docs/api/@aastar/core/variables/GTokenStakingArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md +0 -13
- package/docs/api/@aastar/core/variables/LINKS.md +0 -33
- package/docs/api/@aastar/core/variables/MAX_SERVICE_FEE.md +0 -5
- package/docs/api/@aastar/core/variables/MONITORING_ADDRESSES.md +0 -15
- package/docs/api/@aastar/core/variables/MySBTABI.md +0 -3
- package/docs/api/@aastar/core/variables/MySBTArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/NETWORKS.md +0 -79
- package/docs/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md +0 -31
- package/docs/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md +0 -11
- package/docs/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md +0 -15
- package/docs/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/PaymasterABI.md +0 -3
- package/docs/api/@aastar/core/variables/PaymasterArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/PaymasterFactoryABI.md +0 -3
- package/docs/api/@aastar/core/variables/PaymasterFactoryArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/PaymasterV4ABI.md +0 -3
- package/docs/api/@aastar/core/variables/PaymasterV4Artifact.md +0 -13
- package/docs/api/@aastar/core/variables/REGISTRY_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/ROLE_ANODE.md +0 -29
- package/docs/api/@aastar/core/variables/ROLE_COMMUNITY.md +0 -29
- package/docs/api/@aastar/core/variables/ROLE_DVT.md +0 -29
- package/docs/api/@aastar/core/variables/ROLE_ENDUSER.md +0 -33
- package/docs/api/@aastar/core/variables/ROLE_KMS.md +0 -29
- package/docs/api/@aastar/core/variables/ROLE_NAMES.md +0 -3
- package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md +0 -29
- package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md +0 -33
- package/docs/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md +0 -3
- package/docs/api/@aastar/core/variables/RegistryABI.md +0 -3
- package/docs/api/@aastar/core/variables/RegistryArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/ReputationSystemABI.md +0 -3
- package/docs/api/@aastar/core/variables/ReputationSystemArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/SBT_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md +0 -175
- package/docs/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md +0 -67
- package/docs/api/@aastar/core/variables/SERVICE_FEE_RATE.md +0 -5
- package/docs/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/SimpleAccountABI.md +0 -3
- package/docs/api/@aastar/core/variables/SimpleAccountArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/SimpleAccountFactoryABI.md +0 -3
- package/docs/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/SuperPaymasterABI.md +0 -3
- package/docs/api/@aastar/core/variables/SuperPaymasterArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md +0 -11
- package/docs/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md +0 -5
- package/docs/api/@aastar/core/variables/TEST_COMMUNITIES.md +0 -19
- package/docs/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md +0 -19
- package/docs/api/@aastar/core/variables/TOKEN_ADDRESSES.md +0 -11
- package/docs/api/@aastar/core/variables/V2_SUMMARY.md +0 -39
- package/docs/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md +0 -3
- package/docs/api/@aastar/core/variables/xPNTsFactoryABI.md +0 -3
- package/docs/api/@aastar/core/variables/xPNTsFactoryArtifact.md +0 -13
- package/docs/api/@aastar/core/variables/xPNTsTokenABI.md +0 -3
- package/docs/api/@aastar/core/variables/xPNTsTokenArtifact.md +0 -13
- package/docs/api/@aastar/paymaster/README.md +0 -23
- package/docs/api/@aastar/paymaster/classes/PaymasterClient.md +0 -388
- package/docs/api/@aastar/paymaster/classes/PaymasterOperator.md +0 -451
- package/docs/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md +0 -189
- package/docs/api/@aastar/paymaster/classes/SuperPaymasterClient.md +0 -55
- package/docs/api/@aastar/paymaster/functions/buildPaymasterData.md +0 -34
- package/docs/api/@aastar/paymaster/functions/buildSuperPaymasterData.md +0 -30
- package/docs/api/@aastar/paymaster/functions/checkEligibility.md +0 -28
- package/docs/api/@aastar/paymaster/functions/formatUserOpV07.md +0 -15
- package/docs/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md +0 -32
- package/docs/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md +0 -32
- package/docs/api/@aastar/paymaster/functions/getUserOpHashV07.md +0 -21
- package/docs/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md +0 -55
- package/docs/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md +0 -59
- package/docs/api/@aastar/paymaster/type-aliases/PaymasterConfig.md +0 -43
- package/docs/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md +0 -35
- package/docs/api/@aastar/tokens/README.md +0 -3
- package/docs/api/@aastar/tokens/classes/FinanceClient.md +0 -10385
- package/docs/api/README.md +0 -6
- package/docs/examples/community-flow.md +0 -28
- package/docs/examples/enduser-flow.md +0 -24
- package/docs/examples/index.md +0 -18
- package/docs/examples/multi-chain.md +0 -31
- package/docs/examples/operator-flow.md +0 -28
- package/docs/guide/CLI_GUIDE.md +0 -65
- package/docs/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/guide/Security-solution.md +0 -106
- package/docs/guide/TEST_COMMANDS.md +0 -320
- package/docs/guide/getting-started.md +0 -133
- package/docs/guide/installation.md +0 -40
- package/docs/guide/paper-data-collection.md +0 -69
- package/docs/guide/quick-start.md +0 -52
- package/docs/guide/task_breakdown.md +0 -121
- package/docs/old-solution.md +0 -1078
- package/docs/paper-data-collection.md +0 -69
- package/docs/technical_plan.md +0 -510
- package/docs/zh/examples/community-flow.md +0 -38
- package/docs/zh/examples/complete-workflow.md +0 -10
- package/docs/zh/examples/enduser-flow.md +0 -33
- package/docs/zh/examples/index.md +0 -18
- package/docs/zh/examples/multi-chain.md +0 -46
- package/docs/zh/examples/operator-flow.md +0 -37
- package/docs/zh/guide/CLI_GUIDE.md +0 -48
- package/docs/zh/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/zh/guide/Plan.md +0 -266
- package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/zh/guide/Security-solution.md +0 -106
- package/docs/zh/guide/TEST_COMMANDS.md +0 -125
- package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/zh/guide/concepts/account-abstraction.md +0 -95
- package/docs/zh/guide/concepts/rainbow-bridge.md +0 -68
- package/docs/zh/guide/concepts/reputation.md +0 -95
- package/docs/zh/guide/concepts/superpaymaster.md +0 -141
- package/docs/zh/guide/getting-started.md +0 -133
- package/docs/zh/guide/installation.md +0 -107
- package/docs/zh/guide/old-solution.md +0 -1078
- package/docs/zh/guide/paper-data-collection.md +0 -69
- package/docs/zh/guide/quick-start.md +0 -134
- package/docs/zh/guide/sdk-readme.md +0 -253
- package/docs/zh/guide/task_breakdown.md +0 -76
- package/docs/zh/guide/technical_plan.md +0 -510
- package/docs/zh/guide/use-cases/community-management.md +0 -141
- package/docs/zh/guide/use-cases/gasless-transactions.md +0 -71
- package/docs/zh/guide/use-cases/operator-staking.md +0 -84
- package/docs/zh/guide/use-cases/yop.md +0 -72
- package/env.template +0 -30
- package/examples/l1-api-demo.ts +0 -273
- package/examples/l2-clients-demo.ts +0 -135
- package/examples/l3-community-launch.ts +0 -49
- package/examples/l3-user-onboarding.ts +0 -56
- package/examples/prepare-gasless.ts +0 -89
- package/examples/sdk-demo/DEVELOPER_GUIDE.md +0 -159
- package/examples/sdk-demo/README.md +0 -30
- package/examples/sdk-demo/usage.ts +0 -137
- package/examples/simple-gasless-demo.ts +0 -109
- package/examples/simple-superpaymaster-demo.ts +0 -96
- package/ext/aastar-shared-config/.env.example +0 -6
- package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +0 -257
- package/ext/aastar-shared-config/AGENTS.md +0 -21
- package/ext/aastar-shared-config/CHANGELOG.md +0 -99
- package/ext/aastar-shared-config/LICENSE +0 -21
- package/ext/aastar-shared-config/QUICK_START.md +0 -215
- package/ext/aastar-shared-config/README.md +0 -412
- package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/ext/aastar-shared-config/check-locker-status.mjs +0 -7
- package/ext/aastar-shared-config/favicon.ico +0 -0
- package/ext/aastar-shared-config/generate-comparison-table.sh +0 -67
- package/ext/aastar-shared-config/package.json +0 -46
- package/ext/aastar-shared-config/pnpm-lock.yaml +0 -1182
- package/ext/aastar-shared-config/src/abis/BLSAggregator.json +0 -1
- package/ext/aastar-shared-config/src/abis/DVTValidator.json +0 -1
- package/ext/aastar-shared-config/src/abis/GToken.json +0 -1
- package/ext/aastar-shared-config/src/abis/GTokenStaking.json +0 -1
- package/ext/aastar-shared-config/src/abis/MySBT.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterV4.json +0 -1098
- package/ext/aastar-shared-config/src/abis/Registry.json +0 -1
- package/ext/aastar-shared-config/src/abis/SimpleAccount.json +0 -557
- package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/ext/aastar-shared-config/src/abis/index.ts +0 -45
- package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/xPNTsToken.json +0 -1
- package/ext/aastar-shared-config/src/branding.ts +0 -32
- package/ext/aastar-shared-config/src/communities.ts +0 -93
- package/ext/aastar-shared-config/src/constants.ts +0 -67
- package/ext/aastar-shared-config/src/contract-addresses.ts +0 -95
- package/ext/aastar-shared-config/src/contract-versions.ts +0 -374
- package/ext/aastar-shared-config/src/contracts.ts +0 -414
- package/ext/aastar-shared-config/src/index.ts +0 -14
- package/ext/aastar-shared-config/src/networks.ts +0 -117
- package/ext/aastar-shared-config/sync-abis.sh +0 -92
- package/ext/aastar-shared-config/sync-versions.mjs +0 -150
- package/ext/aastar-shared-config/tsconfig.json +0 -18
- package/ext/aastar-shared-config/tsup.config.ts +0 -10
- package/ext/aastar-shared-config/verify-all.sh +0 -207
- package/ext/aastar-shared-config/verify-contracts.sh +0 -85
- package/ext/aastar-shared-config/verify-mysbt-v243.mjs +0 -27
- package/ext/aastar-shared-config/verify-onchain-versions.mjs +0 -93
- package/l4-setup.sh +0 -1
- package/lib/SHARED_CONFIG_REFERENCE.md +0 -133
- package/lib/shared-config/.env.example +0 -6
- package/lib/shared-config/.github/workflows/check-secrets.yml +0 -257
- package/lib/shared-config/AGENTS.md +0 -21
- package/lib/shared-config/CHANGELOG.md +0 -99
- package/lib/shared-config/LICENSE +0 -21
- package/lib/shared-config/QUICK_START.md +0 -215
- package/lib/shared-config/README.md +0 -412
- package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/lib/shared-config/check-locker-status.mjs +0 -7
- package/lib/shared-config/favicon.ico +0 -0
- package/lib/shared-config/generate-comparison-table.sh +0 -67
- package/lib/shared-config/package.json +0 -46
- package/lib/shared-config/pnpm-lock.yaml +0 -1182
- package/lib/shared-config/src/abis/BLSAggregator.json +0 -1
- package/lib/shared-config/src/abis/DVTValidator.json +0 -1
- package/lib/shared-config/src/abis/GToken.json +0 -1
- package/lib/shared-config/src/abis/GTokenStaking.json +0 -1
- package/lib/shared-config/src/abis/MySBT.json +0 -1
- package/lib/shared-config/src/abis/PaymasterFactory.json +0 -1
- package/lib/shared-config/src/abis/PaymasterV4.json +0 -1098
- package/lib/shared-config/src/abis/Registry.json +0 -1
- package/lib/shared-config/src/abis/SimpleAccount.json +0 -557
- package/lib/shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/lib/shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/lib/shared-config/src/abis/index.ts +0 -45
- package/lib/shared-config/src/abis/xPNTsFactory.json +0 -1
- package/lib/shared-config/src/abis/xPNTsToken.json +0 -1
- package/lib/shared-config/src/branding.ts +0 -32
- package/lib/shared-config/src/communities.ts +0 -93
- package/lib/shared-config/src/constants.ts +0 -67
- package/lib/shared-config/src/contract-addresses.ts +0 -95
- package/lib/shared-config/src/contract-versions.ts +0 -374
- package/lib/shared-config/src/contracts.ts +0 -414
- package/lib/shared-config/src/index.ts +0 -14
- package/lib/shared-config/src/networks.ts +0 -117
- package/lib/shared-config/sync-abis.sh +0 -92
- package/lib/shared-config/sync-versions.mjs +0 -150
- package/lib/shared-config/tsconfig.json +0 -18
- package/lib/shared-config/tsup.config.ts +0 -10
- package/lib/shared-config/verify-all.sh +0 -207
- package/lib/shared-config/verify-contracts.sh +0 -85
- package/lib/shared-config/verify-mysbt-v243.mjs +0 -27
- package/lib/shared-config/verify-onchain-versions.mjs +0 -93
- package/packages/account/__tests__/index.test.ts +0 -9
- package/packages/account/node_modules/.bin/tsc +0 -21
- package/packages/account/node_modules/.bin/tsserver +0 -21
- package/packages/account/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/account/package.json +0 -21
- package/packages/account/src/accounts/simple.ts +0 -84
- package/packages/account/src/eoa.ts +0 -31
- package/packages/account/src/index.ts +0 -61
- package/packages/account/tsconfig.json +0 -12
- package/packages/analytics/README.md +0 -68
- package/packages/analytics/__tests__/index.test.ts +0 -25
- package/packages/analytics/data/attribution_dataset.csv +0 -29
- package/packages/analytics/data/complete_dataset.csv +0 -29
- package/packages/analytics/data/eth_price_cache.json +0 -4
- package/packages/analytics/data/full_dataset.csv +0 -11
- package/packages/analytics/data/full_dataset.json +0 -134
- package/packages/analytics/data/parsed_transactions.csv +0 -29
- package/packages/analytics/node_modules/.bin/tsc +0 -21
- package/packages/analytics/node_modules/.bin/tsserver +0 -21
- package/packages/analytics/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/analytics/package.json +0 -25
- package/packages/analytics/reports/full/attribution_analysis_20260119.md +0 -42
- package/packages/analytics/reports/full/attribution_analysis_fresh_20260119.md +0 -67
- package/packages/analytics/reports/full/competitive_analysis_20260119.md +0 -103
- package/packages/analytics/reports/full/comprehensive_analysis_20260119.md +0 -107
- package/packages/analytics/reports/full/comprehensive_analysis_v4_1_20260119.md +0 -74
- package/packages/analytics/reports/full/economic_audit_v4_2_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_3_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_4_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_5_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_6_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_final_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_final_v2_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_final_v3_20260119.md +0 -74
- package/packages/analytics/reports/full/profit_audit_v4_final_v4_20260119.md +0 -75
- package/packages/analytics/reports/full/profit_audit_v4_final_v5_20260119.md +0 -76
- package/packages/analytics/reports/full/two_layer_analysis_20260119.md +0 -81
- package/packages/analytics/reports/full/two_layer_analysis_academic_20260119.md +0 -81
- package/packages/analytics/reports/full/two_layer_analysis_dynamic_20260119.md +0 -81
- package/packages/analytics/reports/full/two_layer_analysis_final_20260119.md +0 -81
- package/packages/analytics/reports/full/two_layer_analysis_final_fixed_20260119.md +0 -81
- package/packages/analytics/reports/full/two_layer_analysis_fixed_20260119.md +0 -52
- package/packages/analytics/reports/full/two_layer_analysis_normalized_20260119.md +0 -81
- package/packages/analytics/reports/full/tx_0xc30cfcbb.md +0 -39
- package/packages/analytics/src/analyzers/AttributionAnalyzer.ts +0 -124
- package/packages/analytics/src/analyzers/ComparisonAnalyzer.ts +0 -89
- package/packages/analytics/src/analyzers/TransactionAnalyzer.ts +0 -111
- package/packages/analytics/src/analyzers/TrendAnalyzer.ts +0 -107
- package/packages/analytics/src/cli-analyze-tx.ts +0 -45
- package/packages/analytics/src/cli.ts +0 -39
- package/packages/analytics/src/core/BenchmarkLoader.ts +0 -163
- package/packages/analytics/src/core/CostCalculator.ts +0 -202
- package/packages/analytics/src/core/DataCollector.ts +0 -245
- package/packages/analytics/src/gas-analyzer-v4.ts +0 -118
- package/packages/analytics/src/gas-analyzer.ts +0 -184
- package/packages/analytics/src/index.ts +0 -145
- package/packages/analytics/src/test-logparser.ts +0 -63
- package/packages/analytics/src/utils/EventDecoder.ts +0 -152
- package/packages/analytics/src/utils/LogParser.ts +0 -220
- package/packages/analytics/src/utils/PriceOracle.ts +0 -117
- package/packages/analytics/test/AttributionAnalyzer.test.ts +0 -42
- package/packages/analytics/test/CostCalculator.test.ts +0 -75
- package/packages/analytics/tsconfig.json +0 -12
- package/packages/community/__tests__/index.test.ts +0 -9
- package/packages/community/node_modules/.bin/tsc +0 -21
- package/packages/community/node_modules/.bin/tsserver +0 -21
- package/packages/community/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/community/package.json +0 -27
- package/packages/community/src/index.ts +0 -326
- package/packages/community/tsconfig.json +0 -8
- package/packages/core/__tests__/actions/account-comprehensive.test.ts +0 -92
- package/packages/core/__tests__/actions/aggregator.test.ts +0 -62
- package/packages/core/__tests__/actions/comprehensive-batch1.test.ts +0 -86
- package/packages/core/__tests__/actions/comprehensive-batch2.test.ts +0 -39
- package/packages/core/__tests__/actions/comprehensive-batch3.test.ts +0 -35
- package/packages/core/__tests__/actions/comprehensive-error.test.ts +0 -115
- package/packages/core/__tests__/actions/dvt.test.ts +0 -39
- package/packages/core/__tests__/actions/edge-cases.test.ts +0 -39
- package/packages/core/__tests__/actions/error-paths.test.ts +0 -82
- package/packages/core/__tests__/actions/factory.test.ts +0 -81
- package/packages/core/__tests__/actions/faucet.test.ts +0 -131
- package/packages/core/__tests__/actions/paymaster.test.ts +0 -116
- package/packages/core/__tests__/actions/registry.test.ts +0 -81
- package/packages/core/__tests__/actions/reputation.test.ts +0 -43
- package/packages/core/__tests__/actions/sbt.test.ts +0 -145
- package/packages/core/__tests__/actions/staking.test.ts +0 -30
- package/packages/core/__tests__/actions/superPaymaster.test.ts +0 -158
- package/packages/core/__tests__/actions/tokens-extended.test.ts +0 -18
- package/packages/core/__tests__/actions/tokens.test.ts +0 -122
- package/packages/core/__tests__/clients.test.ts +0 -77
- package/packages/core/__tests__/contracts-config.test.ts +0 -69
- package/packages/core/__tests__/index.test.ts +0 -9
- package/packages/core/__tests__/mocks/client.ts +0 -40
- package/packages/core/node_modules/.bin/tsc +0 -21
- package/packages/core/node_modules/.bin/tsserver +0 -21
- package/packages/core/node_modules/.bin/tsx +0 -21
- package/packages/core/node_modules/.bin/vite +0 -21
- package/packages/core/node_modules/.bin/vitest +0 -21
- package/packages/core/node_modules/.bin/yaml +0 -21
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/core/package.json +0 -25
- package/packages/core/src/abis/BLSAggregator.json +0 -686
- package/packages/core/src/abis/BLSValidator.json +0 -42
- package/packages/core/src/abis/DVTValidator.json +0 -368
- package/packages/core/src/abis/Eip7702Support.json +0 -24
- package/packages/core/src/abis/EntryPoint.json +0 -1382
- package/packages/core/src/abis/GToken.json +0 -513
- package/packages/core/src/abis/GTokenStaking.json +0 -949
- package/packages/core/src/abis/LegacyAccount.json +0 -625
- package/packages/core/src/abis/MySBT.json +0 -1518
- package/packages/core/src/abis/Paymaster.json +0 -1143
- package/packages/core/src/abis/PaymasterFactory.json +0 -640
- package/packages/core/src/abis/Registry.json +0 -1942
- package/packages/core/src/abis/ReputationSystem.json +0 -699
- package/packages/core/src/abis/SenderCreator.json +0 -99
- package/packages/core/src/abis/Simple7702Account.json +0 -395
- package/packages/core/src/abis/SimpleAccount.json +0 -560
- package/packages/core/src/abis/SimpleAccountFactory.json +0 -111
- package/packages/core/src/abis/SimpleAccountFactoryV08.json +0 -87
- package/packages/core/src/abis/SimpleAccountV08.json +0 -557
- package/packages/core/src/abis/SuperPaymaster.json +0 -1781
- package/packages/core/src/abis/UserOperationLib.json +0 -57
- package/packages/core/src/abis/aPNTs.json +0 -1160
- package/packages/core/src/abis/abi.config.json +0 -24
- package/packages/core/src/abis/index.ts +0 -91
- package/packages/core/src/abis/xPNTsFactory.json +0 -718
- package/packages/core/src/abis/xPNTsToken.json +0 -1280
- package/packages/core/src/actions/StateValidator.ts +0 -253
- package/packages/core/src/actions/account.ts +0 -190
- package/packages/core/src/actions/aggregator.ts +0 -371
- package/packages/core/src/actions/dvt.ts +0 -269
- package/packages/core/src/actions/entryPoint.ts +0 -89
- package/packages/core/src/actions/factory.ts +0 -732
- package/packages/core/src/actions/faucet.ts +0 -280
- package/packages/core/src/actions/index.ts +0 -15
- package/packages/core/src/actions/paymaster.ts +0 -780
- package/packages/core/src/actions/registry.ts +0 -961
- package/packages/core/src/actions/reputation.ts +0 -668
- package/packages/core/src/actions/sbt.ts +0 -916
- package/packages/core/src/actions/staking.ts +0 -576
- package/packages/core/src/actions/superPaymaster.ts +0 -1093
- package/packages/core/src/actions/tokens.ts +0 -481
- package/packages/core/src/branding.ts +0 -32
- package/packages/core/src/clients/BaseClient.ts +0 -78
- package/packages/core/src/clients/BundlerClient.ts +0 -132
- package/packages/core/src/clients/types.ts +0 -69
- package/packages/core/src/clients.ts +0 -13
- package/packages/core/src/communities.ts +0 -93
- package/packages/core/src/config/ContractConfigManager.ts +0 -63
- package/packages/core/src/constants.ts +0 -114
- package/packages/core/src/contract-addresses.ts +0 -118
- package/packages/core/src/contract-versions.ts +0 -374
- package/packages/core/src/contracts.ts +0 -414
- package/packages/core/src/crypto/blsSigner.ts +0 -124
- package/packages/core/src/crypto/index.ts +0 -1
- package/packages/core/src/errors/index.ts +0 -173
- package/packages/core/src/index.ts +0 -23
- package/packages/core/src/networks.ts +0 -127
- package/packages/core/src/requirementChecker.ts +0 -225
- package/packages/core/src/roles.ts +0 -244
- package/packages/core/src/utils.ts +0 -23
- package/packages/core/src/validators/index.ts +0 -88
- package/packages/core/tsconfig.json +0 -13
- package/packages/dapp/__tests__/index.test.ts +0 -9
- package/packages/dapp/node_modules/.bin/tsc +0 -21
- package/packages/dapp/node_modules/.bin/tsserver +0 -21
- package/packages/dapp/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/dapp/package.json +0 -28
- package/packages/dapp/src/index.ts +0 -4
- package/packages/dapp/src/ui/components/EvaluationPanel.tsx +0 -40
- package/packages/dapp/src/ui/hooks/useCreditScore.ts +0 -44
- package/packages/dapp/src/ui/hooks/useSuperPaymaster.ts +0 -31
- package/packages/dapp/src/ui/index.ts +0 -22
- package/packages/dapp/tsconfig.json +0 -13
- package/packages/enduser/__tests__/CommunityClient.test.ts +0 -205
- package/packages/enduser/__tests__/UserClient.test.ts +0 -294
- package/packages/enduser/__tests__/index.test.ts +0 -16
- package/packages/enduser/__tests__/mocks/client.ts +0 -22
- package/packages/enduser/node_modules/.bin/tsc +0 -21
- package/packages/enduser/node_modules/.bin/tsserver +0 -21
- package/packages/enduser/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/enduser/package.json +0 -26
- package/packages/enduser/src/CommunityClient.ts +0 -235
- package/packages/enduser/src/UserClient.ts +0 -447
- package/packages/enduser/src/index.ts +0 -2
- package/packages/enduser/src/testAccountManager.ts +0 -374
- package/packages/enduser/tsconfig.json +0 -10
- package/packages/identity/__tests__/index.test.ts +0 -9
- package/packages/identity/node_modules/.bin/tsc +0 -21
- package/packages/identity/node_modules/.bin/tsserver +0 -21
- package/packages/identity/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/identity/package.json +0 -23
- package/packages/identity/src/index.ts +0 -114
- package/packages/identity/src/mysbt.ts +0 -48
- package/packages/identity/tsconfig.json +0 -12
- package/packages/operator/__tests__/PaymasterOperatorClient.test.ts +0 -258
- package/packages/operator/__tests__/ProtocolClient.test.ts +0 -135
- package/packages/operator/__tests__/index.test.ts +0 -16
- package/packages/operator/__tests__/mocks/client.ts +0 -22
- package/packages/operator/node_modules/.bin/tsc +0 -21
- package/packages/operator/node_modules/.bin/tsserver +0 -21
- package/packages/operator/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/operator/package.json +0 -26
- package/packages/operator/src/PaymasterOperatorClient.ts +0 -454
- package/packages/operator/src/ProtocolClient.ts +0 -154
- package/packages/operator/src/index.ts +0 -2
- package/packages/operator/tsconfig.json +0 -10
- package/packages/patterns/node_modules/.bin/tsc +0 -21
- package/packages/patterns/node_modules/.bin/tsserver +0 -21
- package/packages/paymaster/__tests__/PaymasterOperator.test.ts +0 -123
- package/packages/paymaster/__tests__/index.test.ts +0 -9
- package/packages/paymaster/node_modules/.bin/tsc +0 -21
- package/packages/paymaster/node_modules/.bin/tsserver +0 -21
- package/packages/paymaster/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/paymaster/package.json +0 -23
- package/packages/paymaster/src/SuperPaymaster/index.ts +0 -168
- package/packages/paymaster/src/V4/BundlerCompat.ts +0 -47
- package/packages/paymaster/src/V4/PaymasterClient.ts +0 -490
- package/packages/paymaster/src/V4/PaymasterOperator.ts +0 -282
- package/packages/paymaster/src/V4/PaymasterUtils.ts +0 -199
- package/packages/paymaster/src/V4/SuperPaymasterClient.ts +0 -129
- package/packages/paymaster/src/V4/index.ts +0 -4
- package/packages/paymaster/src/index.ts +0 -5
- package/packages/paymaster/tsconfig.json +0 -16
- package/packages/sdk/README.md +0 -171
- package/packages/sdk/__tests__/index.test.ts +0 -9
- package/packages/sdk/aastar/package.json +0 -21
- package/packages/sdk/aastar/src/index.ts +0 -3
- package/packages/sdk/aastar/tsconfig.json +0 -8
- package/packages/sdk/examples/config.json +0 -1
- package/packages/sdk/examples/regression_test.ts +0 -106
- package/packages/sdk/node_modules/.bin/tsc +0 -21
- package/packages/sdk/node_modules/.bin/tsserver +0 -21
- package/packages/sdk/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/sdk/package.json +0 -34
- package/packages/sdk/src/clients/admin.ts +0 -56
- package/packages/sdk/src/clients/endUser.ts +0 -428
- package/packages/sdk/src/utils/testScenarios.ts +0 -128
- package/packages/sdk/tests/scenarios/01_onboard_community.ts +0 -62
- package/packages/sdk/tests/scenarios/02_onboard_operator.ts +0 -109
- package/packages/sdk/tests/scenarios/03_onboard_user.ts +0 -53
- package/packages/sdk/tests/scenarios/04_gasless_tx_flow.ts +0 -68
- package/packages/sdk/tests/scenarios/check_entrypoint.ts +0 -19
- package/packages/sdk/tests/scenarios/check_initialization.ts +0 -65
- package/packages/sdk/tests/scenarios/debug_addresses.ts +0 -26
- package/packages/sdk/tests/scenarios/diagnose_scenario4.ts +0 -55
- package/packages/sdk/tests/scenarios/setup.ts +0 -33
- package/packages/sdk/tests/scenarios/test_entrypoint_nonce.ts +0 -46
- package/packages/sdk/tsconfig.json +0 -12
- package/packages/tokens/__tests__/index.test.ts +0 -9
- package/packages/tokens/node_modules/.bin/tsc +0 -21
- package/packages/tokens/node_modules/.bin/tsserver +0 -21
- package/packages/tokens/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/packages/tokens/package.json +0 -23
- package/packages/tokens/src/index.ts +0 -258
- package/packages/tokens/tsconfig.json +0 -12
- package/pnpm-workspace.yaml +0 -2
- package/publish.sh +0 -30
- package/run_l4_gasless_regression.sh +0 -109
- package/run_sdk_regression.sh +0 -232
- package/scripts/00_utils.ts +0 -59
- package/scripts/00_verify_phase1.ts +0 -130
- package/scripts/01_1_prep_gtoken.ts +0 -81
- package/scripts/01_2_register_sbt.ts +0 -88
- package/scripts/01_3_prep_tokens_paymaster.ts +0 -102
- package/scripts/01_prepare_all.ts +0 -271
- package/scripts/02_test_eoa.ts +0 -50
- package/scripts/03_test_standard_aa.ts +0 -173
- package/scripts/04_0_check_deploy.ts +0 -24
- package/scripts/04_1_check_allowance.ts +0 -44
- package/scripts/04_2_construct_verify.ts +0 -96
- package/scripts/04_3_verify_estimate.ts +0 -66
- package/scripts/04_4_verify_pack.ts +0 -74
- package/scripts/04_test_paymaster_v4.ts +0 -217
- package/scripts/05_1_deposit.ts +0 -48
- package/scripts/05_test_superpaymaster.ts +0 -380
- package/scripts/06_local_test_v3_admin.ts +0 -163
- package/scripts/06_local_test_v3_execution.ts +0 -132
- package/scripts/06_local_test_v3_full.ts +0 -490
- package/scripts/06_local_test_v3_funding.ts +0 -124
- package/scripts/06_local_test_v3_reputation.ts +0 -234
- package/scripts/07_local_test_v3_audit.ts +0 -181
- package/scripts/08_local_test_registry_lifecycle.ts +0 -382
- package/scripts/09_local_test_community_lifecycle.ts +0 -385
- package/scripts/09_local_test_community_simple.ts +0 -108
- package/scripts/09_scenario_bread_independent.ts +0 -247
- package/scripts/10_scenario_super_shared.ts +0 -196
- package/scripts/10_test_protocol_admin_full.ts +0 -173
- package/scripts/11_scenario_hacker_defense.ts +0 -104
- package/scripts/11_test_core_flows_full.ts +0 -279
- package/scripts/12_test_slash_mechanism.ts +0 -205
- package/scripts/12_test_slash_queries.ts +0 -83
- package/scripts/12_test_staking_exit.ts +0 -152
- package/scripts/12_test_staking_slash.ts +0 -301
- package/scripts/12_test_tier2_slash.ts +0 -139
- package/scripts/13_test_sbt_burn_linkage.ts +0 -266
- package/scripts/14_test_credit_redesign.ts +0 -266
- package/scripts/15_test_bls_full.ts +0 -148
- package/scripts/15_test_dvt_bls_full.ts +0 -140
- package/scripts/17_test_cross_role_collaboration.ts +0 -95
- package/scripts/18_sdk_e2e_verification.ts +0 -67
- package/scripts/18_test_dvt_sdk_flow.ts +0 -138
- package/scripts/18_test_lifecycle_completion.ts +0 -144
- package/scripts/19_sdk_experiment_runner.ts +0 -207
- package/scripts/19_sdk_experiment_runner.ts.backup +0 -391
- package/scripts/20_sdk_full_capability.ts +0 -95
- package/scripts/20_test_superpaymaster_new_apis.ts +0 -193
- package/scripts/21_test_paymasterv4_complete.ts +0 -341
- package/scripts/22_test_bls_signing.ts +0 -260
- package/scripts/23_test_middleware.ts +0 -197
- package/scripts/98_edge_reentrancy.ts +0 -85
- package/scripts/99_bug_hunting_fast.ts +0 -99
- package/scripts/analyze_abi_coverage.ts +0 -169
- package/scripts/analyze_missing_functions.ts +0 -136
- package/scripts/canary-bundler.ts +0 -47
- package/scripts/check-admin.ts +0 -95
- package/scripts/check-chainlink.ts +0 -28
- package/scripts/check-jason-status.ts +0 -85
- package/scripts/check-roles.ts +0 -36
- package/scripts/clear-nonce.ts +0 -47
- package/scripts/collect_industry_baseline.ts +0 -236
- package/scripts/complete-jack-superpaymaster.ts +0 -171
- package/scripts/complete_env_config.ts +0 -97
- package/scripts/deploy-sync.ts +0 -104
- package/scripts/deploy_and_init_v3.sh +0 -134
- package/scripts/deploy_anvil_accounts.ts +0 -144
- package/scripts/deploy_jason_pm.ts +0 -114
- package/scripts/deploy_paymaster_v4.ts +0 -139
- package/scripts/deploy_test_accounts.ts +0 -401
- package/scripts/deprecated/check_aa_entrypoint.ts +0 -29
- package/scripts/deprecated/check_paymaster_deposits.ts +0 -45
- package/scripts/deprecated/debug_aoa_function.ts +0 -28
- package/scripts/deprecated/debug_aoa_issue.ts +0 -16
- package/scripts/deprecated/debug_pimlico_aa23.ts +0 -40
- package/scripts/deprecated/debug_summary.ts +0 -34
- package/scripts/deprecated/deploy_v07_aa.ts +0 -99
- package/scripts/deprecated/fix_all_issues.ts +0 -61
- package/scripts/deprecated/fund_bpnts.ts +0 -52
- package/scripts/deprecated/get_factory_addresses.ts +0 -28
- package/scripts/deprecated/recheck_pim.ts +0 -34
- package/scripts/dev_tools/extract_abis.sh +0 -151
- package/scripts/dev_tools/extract_addresses_to_env.sh +0 -67
- package/scripts/dev_tools/final_safe_harmonize.py +0 -77
- package/scripts/dev_tools/safe_harmonize.py +0 -107
- package/scripts/dev_tools/surgical_harmonize.py +0 -83
- package/scripts/experiment/stage3/SETUP_GUIDE.md +0 -258
- package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +0 -78
- package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +0 -96
- package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +0 -112
- package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +0 -84
- package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +0 -86
- package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +0 -89
- package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +0 -83
- package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +0 -61
- package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +0 -60
- package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +0 -100
- package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +0 -149
- package/scripts/experiment/stage3/archived_scripts/README.md +0 -58
- package/scripts/experiment/stage3/archived_scripts/check_roles.ts +0 -29
- package/scripts/experiment/stage3/archived_scripts/decode_error.ts +0 -23
- package/scripts/experiment/stage3/archived_scripts/fund_user.ts +0 -51
- package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +0 -3
- package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/setup.ts +0 -105
- package/scripts/experiment/stage3/archived_scripts/test_key.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/verify_state.ts +0 -59
- package/scripts/experiment/stage3/refactored/00_token_distribution.ts +0 -46
- package/scripts/experiment/stage3/refactored/02_operator_setup.ts +0 -65
- package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +0 -68
- package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +0 -63
- package/scripts/experiment/stage3/refactored/README.md +0 -71
- package/scripts/extract-docs.sh +0 -72
- package/scripts/fund-jack.ts +0 -38
- package/scripts/generate_env_from_deployment.ts +0 -109
- package/scripts/inspect-anni-token.ts +0 -116
- package/scripts/inspect-factory.ts +0 -83
- package/scripts/l4-debug-bob.ts +0 -62
- package/scripts/l4-paymasterv4-transfer-test.ts +0 -220
- package/scripts/l4-setup.ts +0 -1347
- package/scripts/l4-state.json +0 -82
- package/scripts/manual-update-price.ts +0 -39
- package/scripts/phase1_verify_contracts.ts +0 -207
- package/scripts/pre_test_sync.ts +0 -83
- package/scripts/prepare_sepolia_resources.ts +0 -154
- package/scripts/publish_all.sh +0 -39
- package/scripts/query-jack-token.ts +0 -22
- package/scripts/quick_setup.ts +0 -124
- package/scripts/quick_setup_account.ts +0 -80
- package/scripts/run_automated_experiment.sh +0 -121
- package/scripts/run_daily_experiment.ts +0 -70
- package/scripts/run_full_regression.sh +0 -38
- package/scripts/run_l4_gasless_regression.sh +0 -32
- package/scripts/run_sdk_experiment.sh +0 -13
- package/scripts/run_sdk_regression-v2.sh +0 -38
- package/scripts/sdk_regression_v2.ts +0 -148
- package/scripts/security_audit.sh +0 -172
- package/scripts/setup-bbq-community.ts +0 -187
- package/scripts/setup-dancing-community.ts +0 -223
- package/scripts/setup_test_accounts.ts +0 -88
- package/scripts/setup_test_environment.ts +0 -147
- package/scripts/sync_anvil_config.cjs +0 -44
- package/scripts/sync_config_to_env.ts +0 -88
- package/scripts/sync_contract_addresses.ts +0 -186
- package/scripts/sync_sepolia_config.cjs +0 -90
- package/scripts/sync_sepolia_config.mjs +0 -74
- package/scripts/test-brown-v4-deploy.ts +0 -90
- package/scripts/test-faucet-and-gasless.ts +0 -150
- package/scripts/test-jack-gasless.ts +0 -119
- package/scripts/test-jack-registration.ts +0 -133
- package/scripts/test-jack-superpaymaster-api.ts +0 -112
- package/scripts/test-kms-gasless.ts +0 -352
- package/scripts/update-price-dvt.ts +0 -53
- package/scripts/update_env_from_config.ts +0 -83
- package/scripts/v2_regression/00_validate_env.ts +0 -101
- package/scripts/v2_regression/01_setup_and_fund.ts +0 -132
- package/scripts/v2_regression/02_operator_onboarding.ts +0 -300
- package/scripts/v2_regression/03_community_registry.ts +0 -173
- package/scripts/v2_regression/04_enduser_flow.ts +0 -174
- package/scripts/v2_regression/05_admin_audit.ts +0 -157
- package/scripts/v2_regression/README.md +0 -161
- package/scripts/validate_env.ts +0 -112
- package/scripts/verify-bob-token.ts +0 -41
- package/scripts/verify-tx-status.ts +0 -81
- package/scripts/verify_onchain_milestone.ts +0 -114
- package/scripts/verify_phase1.ts +0 -66
- package/scripts/verify_phase2.ts +0 -66
- package/sdk-abi-coverage.sh +0 -1
- package/sdk-build-and-test.sh +0 -1
- package/sdk-test-coverage.sh +0 -1
- package/sdk_experiment_data.csv +0 -4
- package/simple-test-paymaster.sh +0 -2
- package/simple-test-superpaymaster.sh +0 -3
- package/tests/check-aa-balance.ts +0 -31
- package/tests/l1-regression.test.ts +0 -437
- package/tests/l4-test-anni-gasless.ts +0 -517
- package/tests/l4-test-jason1-gasless.ts +0 -158
- package/tests/l4-test-jason2-gasless.ts +0 -180
- package/tests/l4-test-pmv4-deposit.ts +0 -111
- package/tests/l4-test-pmv4-gasless.ts +0 -166
- package/tests/l4-test-pmv4-submit.ts +0 -223
- package/tests/regression/README.md +0 -168
- package/tests/regression/config.ts +0 -217
- package/tests/regression/display-versions.ts +0 -85
- package/tests/regression/index.ts +0 -67
- package/tests/regression/l1-tests.ts +0 -248
- package/tests/regression/l2-tests.ts +0 -227
- package/tests/regression/l3-tests.ts +0 -28
- package/tests/regression/l4-comprehensive-gasless.ts +0 -478
- package/tests/regression/l4-gasless.ts +0 -999
- package/tests/regression/l4-reputation-tiers.ts +0 -102
- package/tests/regression/l4-runner.ts +0 -52
- package/tests/reports/phase1_contract_verification.md +0 -45
- package/tests/test-bundler-compat.ts +0 -132
- package/tests/test-candide-bundler.ts +0 -117
- package/tests/test-candide-paymaster.ts +0 -101
- package/tests/test-candide-sdk.ts +0 -116
- package/tests/test-candide-simple.ts +0 -204
- package/tests/test-pimlico-complete.ts +0 -134
- package/tests/utils/contractVerifier.ts +0 -237
- package/tests/utils/userOpHelper.ts +0 -194
- package/tsconfig.build.json +0 -23
- package/tsconfig.json +0 -27
- package/typedoc.json +0 -25
- package/update-version.sh +0 -20
- package/vitest.config.ts +0 -17
package/README.md
CHANGED
|
@@ -1,161 +1,140 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AAstar SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<img src="https://img.shields.io/badge/TypeScript-5.0-blue" alt="TypeScript" style="display:inline-block; margin-right: 10px;" />
|
|
6
|
-
<img src="https://img.shields.io/badge/Status-0.14.0-green" alt="Status" style="display:inline-block;" />
|
|
7
|
-
</p>
|
|
3
|
+
The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem.
|
|
4
|
+
AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
[](https://www.npmjs.com/package/@aastar/sdk)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
8
|
|
|
12
9
|
---
|
|
13
10
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
- [AAStar SDK (Mycelium Network)](#aastar-sdk-mycelium-network)
|
|
17
|
-
- [📚 Contents / 目录](#-contents--目录)
|
|
18
|
-
- [Introduction / 简介](#introduction--简介)
|
|
19
|
-
- [Core Features / 核心特性](#core-features--核心特性)
|
|
20
|
-
- [SDK v2 Architecture / 架构设计](#sdk-v2-architecture--架构设计)
|
|
21
|
-
- [Installation / 安装](#installation--安装)
|
|
22
|
-
- [Quick Start / 快速开始](#quick-start--快速开始)
|
|
23
|
-
- [End User Gasless Transaction / 终端用户 Gasless 流程](#end-user-gasless-transaction--终端用户-gasless-流程)
|
|
24
|
-
- [Testing Commands / 测试命令](#testing-commands--测试命令)
|
|
25
|
-
- [SDK Regression (Using SDK Clients)](#sdk-regression-using-sdk-clients)
|
|
26
|
-
- [Full Protocol Regression (Anvil Dedicated)](#full-protocol-regression-anvil-dedicated)
|
|
27
|
-
- [Academic Research / 学术研究](#academic-research--学术研究)
|
|
28
|
-
- [Support / 支援](#support--支援)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Introduction / 简介
|
|
33
|
-
|
|
34
|
-
**AAStar SDK** is a high-integration toolkit for the Mycelium network. We've refactored 17 fragmented modules into 7 professional core packages, providing a unified, high-performance, and easy-to-maintain development experience.
|
|
11
|
+
## 🌟 Introduction | 简介
|
|
35
12
|
|
|
36
|
-
|
|
13
|
+
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.
|
|
37
14
|
|
|
38
|
-
|
|
15
|
+
AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。
|
|
39
16
|
|
|
40
|
-
|
|
41
|
-
- ✅ **Infrastructure Ready**: Deep integration with SuperPaymaster and EOA Bridge. (**基础设施就绪**)
|
|
42
|
-
- ✅ **Seamless User Experience**: Gasless transactions via community credit system. (**无感交互体验**)
|
|
43
|
-
- ✅ **DVT Security Module**: Decentralized verification and aggregate signatures. (**DVT 安全模块**)
|
|
44
|
-
- ✅ **Scientific Reproducibility**: Version-locked for academic research. (**科学可复现**)
|
|
17
|
+
### Core Modules | 核心模块
|
|
45
18
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| :--- | :--- | :--- |
|
|
54
|
-
| **`EndUserClient`** | dApp Developer | Gasless UX, Smart Account management, Credit queries |
|
|
55
|
-
| **`CommunityClient`** | Community/DAO Admin | Auto-onboarding, xPNTs deployment, SBT & Reputation |
|
|
56
|
-
| **`OperatorClient`** | Node/Operator | SuperPaymaster registration, Staking, Pool management |
|
|
57
|
-
| **`AdminClient`** | Protocol Admin | DVT aggregations, Slashing, Global parameters |
|
|
19
|
+
- **`@aastar/community`**: Launch & manage DAOs. (启动和管理 DAO)
|
|
20
|
+
- **`@aastar/operator`**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益)
|
|
21
|
+
- **`@aastar/enduser`**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易)
|
|
22
|
+
- **`@aastar/analytics`**: Monitor ecosystem data. (监控生态系统数据)
|
|
23
|
+
- **`@aastar/tokens`**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具)
|
|
24
|
+
- **`@aastar/identity`**: Reputation & SBT management. (声誉和 SBT 管理)
|
|
25
|
+
- **`@aastar/account`**: Smart Account (ERC-4337) utilities. (智能账户工具)
|
|
58
26
|
|
|
59
27
|
---
|
|
60
28
|
|
|
61
|
-
## Installation
|
|
29
|
+
## 📦 Installation | 安装
|
|
62
30
|
|
|
63
31
|
```bash
|
|
64
|
-
pnpm
|
|
32
|
+
pnpm add @aastar/sdk viem
|
|
33
|
+
# or
|
|
34
|
+
npm install @aastar/sdk viem
|
|
65
35
|
```
|
|
66
36
|
|
|
67
37
|
---
|
|
68
38
|
|
|
69
|
-
##
|
|
39
|
+
## 🚀 Usage | 使用指南
|
|
70
40
|
|
|
71
|
-
###
|
|
41
|
+
### 1. Initialize Client | 初始化客户端
|
|
72
42
|
|
|
73
43
|
```typescript
|
|
74
|
-
import {
|
|
44
|
+
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
45
|
+
import { sepolia } from 'viem/chains';
|
|
46
|
+
import { CommunityClient, OperatorClient } from '@aastar/sdk';
|
|
75
47
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
48
|
+
// 1. Setup VIEM clients
|
|
49
|
+
const publicClient = createPublicClient({ chain: sepolia, transport: http() });
|
|
50
|
+
const walletClient = createWalletClient({ chain: sepolia, transport: http() });
|
|
80
51
|
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
data: CALL_DATA
|
|
85
|
-
});
|
|
52
|
+
// 2. Initialize AAstar Clients
|
|
53
|
+
const communityClient = new CommunityClient(publicClient, walletClient);
|
|
54
|
+
const operatorClient = new OperatorClient(publicClient, walletClient);
|
|
86
55
|
```
|
|
87
56
|
|
|
88
|
-
|
|
57
|
+
### 2. "Pre-check" Pattern | "预检查" 模式
|
|
89
58
|
|
|
90
|
-
|
|
59
|
+
Avoid reverts and save gas by checking requirements off-chain first.
|
|
60
|
+
通过链下预检查避免交易回滚并节省 Gas。
|
|
91
61
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
62
|
+
```typescript
|
|
63
|
+
// ❌ Old Way (Prone to errors)
|
|
64
|
+
// await communityClient.launchCommunity(...);
|
|
65
|
+
|
|
66
|
+
// ✅ New AAstar Way
|
|
67
|
+
const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33"));
|
|
68
|
+
|
|
69
|
+
if (!check.hasEnoughGToken) {
|
|
70
|
+
console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`);
|
|
71
|
+
// Output: "Need 33 GT, have 10 GT"
|
|
72
|
+
} else {
|
|
73
|
+
// Safe to execute
|
|
74
|
+
await communityClient.launchCommunity({
|
|
75
|
+
name: "My DAO",
|
|
76
|
+
tokenSymbol: "MDAO"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
95
79
|
```
|
|
96
80
|
|
|
81
|
+
### 3. Key Scenarios | 核心场景
|
|
97
82
|
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
pnpm run test:full_anvil
|
|
101
|
-
```
|
|
83
|
+
#### 🏛️ For Community Owners (社区创建者)
|
|
102
84
|
|
|
103
|
-
|
|
85
|
+
```typescript
|
|
86
|
+
// Configure SBT rules for your community
|
|
87
|
+
await communityClient.configureSBTRules({
|
|
88
|
+
communityId: myCommunityId,
|
|
89
|
+
rule: {
|
|
90
|
+
minScore: 100,
|
|
91
|
+
requiredTags: ["OG"]
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
```
|
|
104
95
|
|
|
105
|
-
|
|
96
|
+
#### ⚙️ For Operators (运营商)
|
|
106
97
|
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
```typescript
|
|
99
|
+
// Check if you are ready to be a Super Paymaster
|
|
100
|
+
const status = await operatorClient.checkResources(myAddress);
|
|
101
|
+
|
|
102
|
+
if (status.hasRole) {
|
|
103
|
+
await operatorClient.withdrawCollateral(parseEther("50"));
|
|
104
|
+
} else {
|
|
105
|
+
console.log(status.recommendations);
|
|
106
|
+
// "Fund aPNTs for collateral", "Stake GToken"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
#### 📊 For Analysts (分析师)
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
```typescript
|
|
113
|
+
import { AnalyticsClient } from '@aastar/sdk';
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
const analytics = new AnalyticsClient(publicClient);
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
cd projects/SuperPaymaster
|
|
120
|
-
# Edit .sol files...
|
|
117
|
+
// Get real-time GToken metrics
|
|
118
|
+
const metrics = await analytics.getSupplyMetrics();
|
|
119
|
+
console.log(`Deflation Rate: ${metrics.deflationRate}%`);
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
Auto-start Anvil, compile contracts, deploy, and sync config to SDK.
|
|
125
|
-
```bash
|
|
126
|
-
cd projects/aastar-sdk
|
|
127
|
-
# Runs Anvil + Deploy + Sync .env.anvil
|
|
128
|
-
./run_full_regression.sh --env anvil
|
|
129
|
-
```
|
|
122
|
+
---
|
|
130
123
|
|
|
131
|
-
|
|
132
|
-
Validate your changes with the full regression suite.
|
|
133
|
-
```bash
|
|
134
|
-
# Run all SDK & Protocol tests
|
|
135
|
-
./run_sdk_regression.sh
|
|
136
|
-
```
|
|
124
|
+
## 🔧 Architecture | 架构
|
|
137
125
|
|
|
138
|
-
|
|
139
|
-
1. Configure `aastar-sdk/.env.sepolia` with `ADMIN_KEY` and `SEPOLIA_RPC_URL`.
|
|
140
|
-
2. Run the deployment script (with resume capability).
|
|
141
|
-
```bash
|
|
142
|
-
cd projects/SuperPaymaster/contracts
|
|
143
|
-
# Deploy Core + Modules
|
|
144
|
-
export $(grep -v '^#' ../../aastar-sdk/.env.sepolia | xargs) && \
|
|
145
|
-
export PRIVATE_KEY=$ADMIN_KEY && \
|
|
146
|
-
forge script script/DeployV3FullSepolia.s.sol \
|
|
147
|
-
--rpc-url $SEPOLIA_RPC_URL \
|
|
148
|
-
--broadcast --verify --slow --resume
|
|
149
|
-
```
|
|
150
|
-
3. Update `aastar-sdk/.env.sepolia` with new contract addresses from `script/v3/config.json`.
|
|
126
|
+
AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives.
|
|
151
127
|
|
|
152
|
-
|
|
153
|
-
Run the regression suite against the live testnet.
|
|
154
|
-
```bash
|
|
155
|
-
cd projects/aastar-sdk
|
|
156
|
-
./run_full_regression.sh --env sepolia
|
|
157
|
-
```
|
|
128
|
+
AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。
|
|
158
129
|
|
|
130
|
+
| Package | Functionality (功能) |
|
|
131
|
+
|---------|---------------------|
|
|
132
|
+
| `@aastar/core` | Shared logic, Roles, RequirementChecker |
|
|
133
|
+
| `@aastar/community` | DAO Registry, XPNTs issuance |
|
|
134
|
+
| `@aastar/operator` | Paymaster ops, Staking management |
|
|
135
|
+
| `@aastar/enduser` | User onboarding, SBT minting |
|
|
136
|
+
| `@aastar/tokens` | Finance, Tokenomics, Approval flows |
|
|
137
|
+
| `@aastar/identity` | Reputation, Credit limits, ZK Proofs |
|
|
159
138
|
|
|
160
139
|
---
|
|
161
140
|
|
|
@@ -180,20 +159,13 @@ npx tsx packages/analytics/src/gas-analyzer-v4.ts
|
|
|
180
159
|
|
|
181
160
|
---
|
|
182
161
|
|
|
183
|
-
##
|
|
184
|
-
|
|
185
|
-
The SDK supports doctoral data collection for the SuperPaymaster paper. Official experiment logger is available at `scripts/19_sdk_experiment_runner.ts`.
|
|
162
|
+
## 🤝 Contributing | 贡献
|
|
186
163
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- [Stage 3 Scenario Experiment Plan](./docs/STAGE_3_SCENARIO_EXP_PLAN.md)
|
|
190
|
-
- [Reputation-to-Credit Mapping Whitepaper](./docs/Reputation-to-Credit_Mapping_Whitepaper.md) - 声誉与信用体系映射技术白皮书
|
|
164
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
165
|
+
欢迎贡献!更多详情请参考 [贡献指南](CONTRIBUTING.md)。
|
|
191
166
|
|
|
192
167
|
---
|
|
193
168
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- **GitHub**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk)
|
|
198
|
-
|
|
199
|
-
MIT © AAStar Community
|
|
169
|
+
<p align="center">
|
|
170
|
+
Built with ❤️ by the AAstar Community
|
|
171
|
+
</p>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Hash } from 'viem';
|
|
2
|
+
export interface ExperimentRecord {
|
|
3
|
+
id: string;
|
|
4
|
+
scenario: string;
|
|
5
|
+
group: 'EOA' | 'AA' | 'SuperPaymaster';
|
|
6
|
+
txHash: string;
|
|
7
|
+
gasUsed: bigint;
|
|
8
|
+
gasPrice: bigint;
|
|
9
|
+
costETH: string;
|
|
10
|
+
status: 'Success' | 'Failed';
|
|
11
|
+
timestamp: number;
|
|
12
|
+
meta?: any;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ExperimentClient: Business-layer tool for measuring and recording execution metrics
|
|
16
|
+
*/
|
|
17
|
+
export declare class ExperimentClient {
|
|
18
|
+
private records;
|
|
19
|
+
private scenarioId;
|
|
20
|
+
private group;
|
|
21
|
+
constructor(scenarioId: string, group: 'EOA' | 'AA' | 'SuperPaymaster');
|
|
22
|
+
/**
|
|
23
|
+
* Record a transaction result
|
|
24
|
+
*/
|
|
25
|
+
recordTx(txHash: Hash, receipt: {
|
|
26
|
+
gasUsed: any;
|
|
27
|
+
effectiveGasPrice: any;
|
|
28
|
+
}, status: 'Success' | 'Failed', meta?: any): ExperimentRecord;
|
|
29
|
+
/**
|
|
30
|
+
* Measure an async task (transaction) automatically
|
|
31
|
+
*/
|
|
32
|
+
measureTx(taskName: string, txPromise: Promise<Hash>, publicClient: any): Promise<Hash>;
|
|
33
|
+
getRecords(): ExperimentRecord[];
|
|
34
|
+
}
|
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface ExperimentRecord {
|
|
4
|
-
id: string;
|
|
5
|
-
scenario: string;
|
|
6
|
-
group: 'EOA' | 'AA' | 'SuperPaymaster';
|
|
7
|
-
txHash: string;
|
|
8
|
-
gasUsed: bigint;
|
|
9
|
-
gasPrice: bigint;
|
|
10
|
-
costETH: string;
|
|
11
|
-
status: 'Success' | 'Failed';
|
|
12
|
-
timestamp: number;
|
|
13
|
-
meta?: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
import { formatEther } from 'viem';
|
|
16
2
|
/**
|
|
17
3
|
* ExperimentClient: Business-layer tool for measuring and recording execution metrics
|
|
18
4
|
*/
|
|
19
5
|
export class ExperimentClient {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
constructor(scenarioId: string, group: 'EOA' | 'AA' | 'SuperPaymaster') {
|
|
6
|
+
records = [];
|
|
7
|
+
scenarioId;
|
|
8
|
+
group;
|
|
9
|
+
constructor(scenarioId, group) {
|
|
25
10
|
this.scenarioId = scenarioId;
|
|
26
11
|
this.group = group;
|
|
27
12
|
}
|
|
28
|
-
|
|
29
13
|
/**
|
|
30
14
|
* Record a transaction result
|
|
31
15
|
*/
|
|
32
|
-
|
|
16
|
+
recordTx(txHash, receipt, status, meta) {
|
|
33
17
|
const gasUsed = BigInt(receipt.gasUsed || 0);
|
|
34
18
|
const gasPrice = BigInt(receipt.effectiveGasPrice || 0);
|
|
35
19
|
const costBN = gasUsed * gasPrice;
|
|
36
|
-
|
|
37
|
-
const record: ExperimentRecord = {
|
|
20
|
+
const record = {
|
|
38
21
|
id: `${Date.now()}-${Math.floor(Math.random() * 1000)}`,
|
|
39
22
|
scenario: this.scenarioId,
|
|
40
23
|
group: this.group,
|
|
@@ -46,35 +29,30 @@ export class ExperimentClient {
|
|
|
46
29
|
timestamp: Date.now(),
|
|
47
30
|
meta
|
|
48
31
|
};
|
|
49
|
-
|
|
50
32
|
this.records.push(record);
|
|
51
33
|
return record;
|
|
52
34
|
}
|
|
53
|
-
|
|
54
35
|
/**
|
|
55
36
|
* Measure an async task (transaction) automatically
|
|
56
37
|
*/
|
|
57
|
-
|
|
38
|
+
async measureTx(taskName, txPromise, publicClient) {
|
|
58
39
|
console.log(`[Experiment: ${this.group}] Executing: ${taskName}...`);
|
|
59
40
|
const start = Date.now();
|
|
60
41
|
try {
|
|
61
42
|
const hash = await txPromise;
|
|
62
43
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
63
|
-
|
|
64
44
|
this.recordTx(hash, receipt, 'Success', { latency: Date.now() - start });
|
|
65
|
-
|
|
66
45
|
const gasUsed = BigInt(receipt.gasUsed || 0);
|
|
67
46
|
const gasPrice = BigInt(receipt.effectiveGasPrice || 0);
|
|
68
|
-
|
|
69
47
|
console.log(` ✅ Success! Gas: ${gasUsed} | Cost: ${formatEther(gasUsed * gasPrice)} ETH`);
|
|
70
48
|
return hash;
|
|
71
|
-
}
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
72
51
|
console.error(` ❌ Failed: ${taskName}`, e);
|
|
73
52
|
throw e;
|
|
74
53
|
}
|
|
75
54
|
}
|
|
76
|
-
|
|
77
|
-
public getRecords() {
|
|
55
|
+
getRecords() {
|
|
78
56
|
return this.records;
|
|
79
57
|
}
|
|
80
58
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { ExperimentClient } from './ExperimentClient.js';
|
|
3
|
+
describe('ExperimentClient', () => {
|
|
4
|
+
it('should record transaction result', () => {
|
|
5
|
+
const client = new ExperimentClient('test-scenario', 'AA');
|
|
6
|
+
const receipt = { gasUsed: 21000n, effectiveGasPrice: 1000000000n };
|
|
7
|
+
const record = client.recordTx('0xhash', receipt, 'Success');
|
|
8
|
+
expect(record.txHash).toBe('0xhash');
|
|
9
|
+
expect(record.group).toBe('AA');
|
|
10
|
+
expect(record.status).toBe('Success');
|
|
11
|
+
expect(record.costETH).toBe('0.000021');
|
|
12
|
+
expect(client.getRecords()).toHaveLength(1);
|
|
13
|
+
});
|
|
14
|
+
it('should measure transaction automatically', async () => {
|
|
15
|
+
const client = new ExperimentClient('test-scenario', 'SuperPaymaster');
|
|
16
|
+
const mockPublicClient = {
|
|
17
|
+
waitForTransactionReceipt: vi.fn().mockResolvedValue({
|
|
18
|
+
gasUsed: 50000n,
|
|
19
|
+
effectiveGasPrice: 2000000000n
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
const txPromise = Promise.resolve('0xhash');
|
|
23
|
+
const hash = await client.measureTx('test-task', txPromise, mockPublicClient);
|
|
24
|
+
expect(hash).toBe('0xhash');
|
|
25
|
+
expect(client.getRecords()).toHaveLength(1);
|
|
26
|
+
expect(client.getRecords()[0].status).toBe('Success');
|
|
27
|
+
});
|
|
28
|
+
it('should handle failed measureTx', async () => {
|
|
29
|
+
const client = new ExperimentClient('test-scenario', 'EOA');
|
|
30
|
+
const txPromise = Promise.reject(new Error('tx failed'));
|
|
31
|
+
await expect(client.measureTx('test-task', txPromise, {})).rejects.toThrow('tx failed');
|
|
32
|
+
});
|
|
33
|
+
it('should handle missing gas fields in receipt', () => {
|
|
34
|
+
const client = new ExperimentClient('test-scenario', 'AA');
|
|
35
|
+
const record = client.recordTx('0xhash', {}, 'Success');
|
|
36
|
+
expect(record.gasUsed).toBe(0n);
|
|
37
|
+
expect(record.gasPrice).toBe(0n);
|
|
38
|
+
expect(record.costETH).toBe('0');
|
|
39
|
+
});
|
|
40
|
+
it('should record latency in measureTx', async () => {
|
|
41
|
+
const client = new ExperimentClient('test-scenario', 'AA');
|
|
42
|
+
const mockPublicClient = {
|
|
43
|
+
waitForTransactionReceipt: vi.fn().mockResolvedValue({
|
|
44
|
+
gasUsed: 21000n,
|
|
45
|
+
effectiveGasPrice: 1000000000n
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
await client.measureTx('test', Promise.resolve('0xhash'), mockPublicClient);
|
|
49
|
+
const record = client.getRecords()[0];
|
|
50
|
+
expect(record.meta?.latency).toBeDefined();
|
|
51
|
+
expect(typeof record.meta.latency).toBe('number');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Client, type Transport, type Chain, type Account, type PublicActions, type WalletActions, type Address } from 'viem';
|
|
2
|
+
import { type RegistryActions, type SuperPaymasterActions, type PaymasterActions, type StakingActions, type SBTActions, type DVTActions, type XPNTsFactoryActions, type AggregatorActions } from '@aastar/core';
|
|
3
|
+
export type AdminClient = Client<Transport, Chain, Account | undefined> & PublicActions<Transport, Chain, Account | undefined> & WalletActions<Chain, Account | undefined> & RegistryActions & SuperPaymasterActions & PaymasterActions & StakingActions & SBTActions & DVTActions & XPNTsFactoryActions & AggregatorActions;
|
|
4
|
+
export declare function createAdminClient({ chain, transport, account, addresses }: {
|
|
5
|
+
chain: Chain;
|
|
6
|
+
transport: Transport;
|
|
7
|
+
account?: Account;
|
|
8
|
+
addresses?: {
|
|
9
|
+
[key: string]: Address;
|
|
10
|
+
};
|
|
11
|
+
}): AdminClient;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createClient, publicActions, walletActions } from 'viem';
|
|
2
|
+
import { registryActions, superPaymasterActions, paymasterActions, stakingActions, sbtActions, dvtActions, xPNTsFactoryActions, aggregatorActions, CORE_ADDRESSES, TOKEN_ADDRESSES } from '@aastar/core';
|
|
3
|
+
const ADDRESS_PLACEHOLDER = '0x0000000000000000000000000000000000000000';
|
|
4
|
+
export function createAdminClient({ chain, transport, account, addresses }) {
|
|
5
|
+
const baseClient = createClient({ chain, transport, account })
|
|
6
|
+
.extend(publicActions)
|
|
7
|
+
.extend(walletActions);
|
|
8
|
+
const usedAddresses = { ...CORE_ADDRESSES, ...TOKEN_ADDRESSES, ...addresses };
|
|
9
|
+
const actions = {
|
|
10
|
+
...registryActions(usedAddresses.registry)(baseClient),
|
|
11
|
+
...superPaymasterActions(usedAddresses.superPaymaster)(baseClient),
|
|
12
|
+
...paymasterActions(usedAddresses.paymasterV4)(baseClient),
|
|
13
|
+
...stakingActions(usedAddresses.gTokenStaking)(baseClient),
|
|
14
|
+
...sbtActions(usedAddresses.mySBT)(baseClient),
|
|
15
|
+
...dvtActions(ADDRESS_PLACEHOLDER)(baseClient),
|
|
16
|
+
...xPNTsFactoryActions(usedAddresses.xPNTsFactory || '0x')(baseClient),
|
|
17
|
+
...aggregatorActions(ADDRESS_PLACEHOLDER)(baseClient),
|
|
18
|
+
};
|
|
19
|
+
return Object.assign(baseClient, actions);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { createAdminClient } from './admin.js';
|
|
3
|
+
import { mainnet } from 'viem/chains';
|
|
4
|
+
import { http } from 'viem';
|
|
5
|
+
describe('AdminClient', () => {
|
|
6
|
+
const MOCK_ADDR = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266';
|
|
7
|
+
it('should create admin client and access modules', () => {
|
|
8
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
9
|
+
expect(client.system).toBeDefined();
|
|
10
|
+
expect(client.finance).toBeDefined();
|
|
11
|
+
expect(client.operators).toBeDefined();
|
|
12
|
+
});
|
|
13
|
+
describe('SystemModule', () => {
|
|
14
|
+
it('should grant role', async () => {
|
|
15
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
16
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
17
|
+
client.registryRegisterRole = spy;
|
|
18
|
+
const hash = await client.system.grantRole({ roleId: '0x1', user: MOCK_ADDR, data: '0x' });
|
|
19
|
+
expect(hash).toBe('0xhash');
|
|
20
|
+
expect(spy).toHaveBeenCalled();
|
|
21
|
+
});
|
|
22
|
+
it('should revoke role', async () => {
|
|
23
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
24
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
25
|
+
client.registryUnRegisterRole = spy;
|
|
26
|
+
const hash = await client.system.revokeRole({ roleId: '0x1', user: MOCK_ADDR });
|
|
27
|
+
expect(hash).toBe('0xhash');
|
|
28
|
+
expect(spy).toHaveBeenCalled();
|
|
29
|
+
});
|
|
30
|
+
it('should set super paymaster', async () => {
|
|
31
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
32
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
33
|
+
client.registrySetSuperPaymaster = spy;
|
|
34
|
+
const hash = await client.system.setSuperPaymaster(MOCK_ADDR);
|
|
35
|
+
expect(hash).toBe('0xhash');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('FinanceModule', () => {
|
|
39
|
+
it('should deposit', async () => {
|
|
40
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
41
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
42
|
+
client.superPaymasterDeposit = spy;
|
|
43
|
+
const hash = await client.finance.deposit({ amount: 100n });
|
|
44
|
+
expect(hash).toBe('0xhash');
|
|
45
|
+
});
|
|
46
|
+
it('should depositForOperator', async () => {
|
|
47
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
48
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
49
|
+
client.superPaymasterDepositFor = spy;
|
|
50
|
+
const hash = await client.finance.depositForOperator({ operator: MOCK_ADDR, amount: 100n });
|
|
51
|
+
expect(hash).toBe('0xhash');
|
|
52
|
+
});
|
|
53
|
+
it('should withdrawTo', async () => {
|
|
54
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
55
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
56
|
+
client.superPaymasterWithdrawTo = spy;
|
|
57
|
+
const hash = await client.finance.withdrawTo({ to: MOCK_ADDR, amount: 100n });
|
|
58
|
+
expect(hash).toBe('0xhash');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
describe('OperatorsModule', () => {
|
|
62
|
+
it('should ban/unban operator', async () => {
|
|
63
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
64
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
65
|
+
client.registryUpdateOperatorBlacklist = spy;
|
|
66
|
+
await client.operators.ban(MOCK_ADDR);
|
|
67
|
+
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ statuses: [true] }));
|
|
68
|
+
await client.operators.unban(MOCK_ADDR);
|
|
69
|
+
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ statuses: [false] }));
|
|
70
|
+
});
|
|
71
|
+
it('should setPaused', async () => {
|
|
72
|
+
const client = createAdminClient({ chain: mainnet, transport: http() });
|
|
73
|
+
const spy = vi.fn().mockResolvedValue('0xhash');
|
|
74
|
+
client.superPaymasterSetOperatorPaused = spy;
|
|
75
|
+
await client.operators.setPaused(MOCK_ADDR, true);
|
|
76
|
+
expect(spy).toHaveBeenCalledWith(expect.objectContaining({ paused: true }));
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|