@aastar/sdk 0.16.8 โ 0.16.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/gas-analytics-daily.yml +52 -0
- package/.gitmodules +9 -0
- package/CHANGELOG.md +43 -0
- package/README.md +147 -98
- package/aastar-sdk.code-workspace +14 -0
- package/abis/BLSAggregator.json +572 -0
- package/abis/BLSValidator.json +39 -0
- package/abis/DVTValidator.json +383 -0
- package/abis/Eip7702Support.json +24 -0
- package/abis/EntryPoint.json +1379 -0
- package/abis/GToken.json +510 -0
- package/abis/GTokenStaking.json +918 -0
- package/abis/LegacyAccount.json +625 -0
- package/abis/MySBT.json +1547 -0
- package/abis/Paymaster.json +1192 -0
- package/abis/PaymasterFactory.json +637 -0
- package/abis/PaymasterV4_2.json +1193 -0
- package/abis/Registry.json +1677 -0
- package/abis/ReputationSystem.json +659 -0
- package/abis/SenderCreator.json +99 -0
- package/abis/Simple7702Account.json +395 -0
- package/abis/SimpleAccount.json +625 -0
- package/abis/SimpleAccountFactory.json +108 -0
- package/abis/SimpleAccountFactoryV08.json +87 -0
- package/abis/SimpleAccountV08.json +557 -0
- package/abis/SuperPaymaster.json +1568 -0
- package/abis/UserOperationLib.json +57 -0
- package/abis/aPNTs.json +1160 -0
- package/abis/xPNTsFactory.json +715 -0
- package/abis/xPNTsToken.json +1160 -0
- package/backup/run_sdk_regression.sh +135 -0
- package/config/networks/README.md +54 -0
- package/config/networks/mainnet.env.example +39 -0
- package/config/networks/optimism-sepolia.env.example +35 -0
- package/config/networks/optimism.env.example +36 -0
- package/config/networks/sepolia.env.example +36 -0
- package/config.anvil.json +1 -0
- package/config.sepolia.json +19 -0
- package/config.test.json +27 -0
- package/data/experiment_data.csv +36 -0
- package/data/industry_baseline_2025-12-23.json +154 -0
- package/data/industry_baseline_latest.json +154 -0
- package/docs/ABI_MAINTENANCE_PLAN.md +132 -0
- package/docs/API_REFERENCE.md +796 -0
- package/docs/Configuration_Sync.md +47 -0
- package/docs/DAO_Mining_Distribution_Plan.md +522 -0
- package/docs/DEMO_REFACTOR_PLAN.md +289 -0
- package/docs/DOCUMENTATION_PLAN.md +455 -0
- package/docs/ENV_SEPOLIA_UPDATE.md +68 -0
- package/docs/L2_BUSINESS_CLIENTS_PLAN.md +394 -0
- package/docs/L4_Manual_Test_CheatSheet.md +172 -0
- package/docs/Plan.md +266 -0
- package/docs/Regression_Testing_Guide.md +70 -0
- package/docs/Reputation-to-Credit_Mapping_Whitepaper.md +242 -0
- package/docs/SDK_ABI_COVERAGE.md +839 -0
- package/docs/SDK_COVERAGE_STRATEGY.md +397 -0
- package/docs/SDK_Optimization_Evaluation_Plan.md +51 -0
- package/docs/SDK_REGRESSION_AND_API_PLAN.md +98 -0
- package/docs/SDK_STAGE3_PLAN.md +151 -0
- package/docs/SEPOLIA_ENV_REFERENCE.md +51 -0
- package/docs/STAGE3.md +191 -0
- package/docs/Script_Comparison_Report.md +91 -0
- package/docs/Sepolia_Latest_Deployment.md +117 -0
- package/docs/TESTER_GUIDE_GASLESS.md +409 -0
- package/docs/TEST_COVERAGE_MATRIX.md +72 -0
- package/docs/TODO_SDK_COVERAGE.md +55 -0
- package/docs/USER_CASE_DESIGN.md +110 -0
- package/docs/Verifier_L4_Gasless_Plan.md +454 -0
- package/docs/api/@aastar/account/README.md +15 -0
- package/docs/api/@aastar/account/classes/UserOpClient.md +87 -0
- package/docs/api/@aastar/account/functions/createEOAWalletClient.md +21 -0
- package/docs/api/@aastar/account/functions/getUserOpHash.md +23 -0
- package/docs/api/@aastar/account/functions/packUserOpLimits.md +19 -0
- package/docs/api/@aastar/account/functions/toSimpleSmartAccount.md +83 -0
- package/docs/api/@aastar/account/type-aliases/EOAWalletClient.md +37 -0
- package/docs/api/@aastar/account/type-aliases/SimpleSmartAccount.md +39 -0
- package/docs/api/@aastar/core/README.md +211 -0
- package/docs/api/@aastar/core/classes/BLSSigner.md +147 -0
- package/docs/api/@aastar/core/classes/BaseClient.md +9657 -0
- package/docs/api/@aastar/core/classes/ContractConfigManager.md +25 -0
- package/docs/api/@aastar/core/classes/RequirementChecker.md +1837 -0
- package/docs/api/@aastar/core/classes/SepoliaFaucetAPI.md +13661 -0
- package/docs/api/@aastar/core/classes/StateValidator.md +133 -0
- package/docs/api/@aastar/core/enumerations/EntryPointVersion.md +17 -0
- package/docs/api/@aastar/core/enumerations/NodeType.md +33 -0
- package/docs/api/@aastar/core/enumerations/RolePermissionLevel.md +43 -0
- package/docs/api/@aastar/core/functions/accountActions.md +2720 -0
- package/docs/api/@aastar/core/functions/accountFactoryActions.md +2720 -0
- package/docs/api/@aastar/core/functions/aggregatorActions.md +2720 -0
- package/docs/api/@aastar/core/functions/createAAStarPublicClient.md +3105 -0
- package/docs/api/@aastar/core/functions/dvtActions.md +2720 -0
- package/docs/api/@aastar/core/functions/entryPointActions.md +2724 -0
- package/docs/api/@aastar/core/functions/gTokenActions.md +2714 -0
- package/docs/api/@aastar/core/functions/gTokenExtendedActions.md +2720 -0
- package/docs/api/@aastar/core/functions/getAddressUrl.md +32 -0
- package/docs/api/@aastar/core/functions/getAllCommunityConfigs.md +9 -0
- package/docs/api/@aastar/core/functions/getAllV2Contracts.md +20 -0
- package/docs/api/@aastar/core/functions/getBlockExplorer.md +26 -0
- package/docs/api/@aastar/core/functions/getChainId.md +26 -0
- package/docs/api/@aastar/core/functions/getCommunities.md +76 -0
- package/docs/api/@aastar/core/functions/getCommunity.md +32 -0
- package/docs/api/@aastar/core/functions/getCommunityConfig.md +15 -0
- package/docs/api/@aastar/core/functions/getContract.md +37 -0
- package/docs/api/@aastar/core/functions/getContractNetworks.md +18 -0
- package/docs/api/@aastar/core/functions/getContracts.md +194 -0
- package/docs/api/@aastar/core/functions/getCoreContracts.md +71 -0
- package/docs/api/@aastar/core/functions/getDeploymentDate.md +32 -0
- package/docs/api/@aastar/core/functions/getEntryPoint.md +25 -0
- package/docs/api/@aastar/core/functions/getNetwork.md +26 -0
- package/docs/api/@aastar/core/functions/getPaymasterV4_1.md +25 -0
- package/docs/api/@aastar/core/functions/getRoleName.md +15 -0
- package/docs/api/@aastar/core/functions/getRpcUrl.md +25 -0
- package/docs/api/@aastar/core/functions/getSimpleAccountFactory.md +25 -0
- package/docs/api/@aastar/core/functions/getSuperPaymasterV2.md +25 -0
- package/docs/api/@aastar/core/functions/getTestAccounts.md +30 -0
- package/docs/api/@aastar/core/functions/getTestTokenContracts.md +38 -0
- package/docs/api/@aastar/core/functions/getTokenContracts.md +31 -0
- package/docs/api/@aastar/core/functions/getTxUrl.md +32 -0
- package/docs/api/@aastar/core/functions/getV2ContractByAddress.md +28 -0
- package/docs/api/@aastar/core/functions/getV2ContractByName.md +28 -0
- package/docs/api/@aastar/core/functions/getV2ContractsByDate.md +26 -0
- package/docs/api/@aastar/core/functions/isContractNetworkSupported.md +27 -0
- package/docs/api/@aastar/core/functions/isRegisteredCommunity.md +15 -0
- package/docs/api/@aastar/core/functions/isV2Contract.md +27 -0
- package/docs/api/@aastar/core/functions/paymasterActions.md +2720 -0
- package/docs/api/@aastar/core/functions/paymasterFactoryActions.md +2720 -0
- package/docs/api/@aastar/core/functions/registryActions.md +2720 -0
- package/docs/api/@aastar/core/functions/reputationActions.md +2720 -0
- package/docs/api/@aastar/core/functions/sbtActions.md +2720 -0
- package/docs/api/@aastar/core/functions/stakingActions.md +2720 -0
- package/docs/api/@aastar/core/functions/superPaymasterActions.md +2720 -0
- package/docs/api/@aastar/core/functions/tokenActions.md +2714 -0
- package/docs/api/@aastar/core/functions/xPNTsFactoryActions.md +2720 -0
- package/docs/api/@aastar/core/interfaces/AccountBalance.md +41 -0
- package/docs/api/@aastar/core/interfaces/BalanceValidationParams.md +51 -0
- package/docs/api/@aastar/core/interfaces/ClientConfig.md +4841 -0
- package/docs/api/@aastar/core/interfaces/CommunityConfig.md +81 -0
- package/docs/api/@aastar/core/interfaces/ContractVersion.md +63 -0
- package/docs/api/@aastar/core/interfaces/DeploymentValidationParams.md +39 -0
- package/docs/api/@aastar/core/interfaces/RoleConfig.md +83 -0
- package/docs/api/@aastar/core/interfaces/RoleRequirement.md +43 -0
- package/docs/api/@aastar/core/interfaces/RoleValidationParams.md +55 -0
- package/docs/api/@aastar/core/interfaces/SuperPaymasterConfig.md +57 -0
- package/docs/api/@aastar/core/interfaces/TokenBalanceValidationParams.md +63 -0
- package/docs/api/@aastar/core/interfaces/TransactionOptions.md +24 -0
- package/docs/api/@aastar/core/interfaces/ValidationParams.md +25 -0
- package/docs/api/@aastar/core/interfaces/ValidationResult.md +25 -0
- package/docs/api/@aastar/core/type-aliases/AccountActions.md +151 -0
- package/docs/api/@aastar/core/type-aliases/AccountFactoryActions.md +55 -0
- package/docs/api/@aastar/core/type-aliases/AggregatorActions.md +471 -0
- package/docs/api/@aastar/core/type-aliases/BusinessResult.md +12 -0
- package/docs/api/@aastar/core/type-aliases/ContractCategory.md +5 -0
- package/docs/api/@aastar/core/type-aliases/ContractNetwork.md +5 -0
- package/docs/api/@aastar/core/type-aliases/DVTActions.md +319 -0
- package/docs/api/@aastar/core/type-aliases/EntryPointActions.md +103 -0
- package/docs/api/@aastar/core/type-aliases/GTokenExtendedActions.md +239 -0
- package/docs/api/@aastar/core/type-aliases/NetworkContracts.md +5 -0
- package/docs/api/@aastar/core/type-aliases/PaymasterActions.md +1087 -0
- package/docs/api/@aastar/core/type-aliases/PaymasterFactoryActions.md +263 -0
- package/docs/api/@aastar/core/type-aliases/RegistryActions.md +1543 -0
- package/docs/api/@aastar/core/type-aliases/ReputationActions.md +811 -0
- package/docs/api/@aastar/core/type-aliases/SBTActions.md +1199 -0
- package/docs/api/@aastar/core/type-aliases/StakingActions.md +703 -0
- package/docs/api/@aastar/core/type-aliases/SuperPaymasterActions.md +1311 -0
- package/docs/api/@aastar/core/type-aliases/SupportedNetwork.md +3 -0
- package/docs/api/@aastar/core/type-aliases/TokenActions.md +1227 -0
- package/docs/api/@aastar/core/type-aliases/XPNTsFactoryActions.md +395 -0
- package/docs/api/@aastar/core/variables/AASTAR_COMMUNITY.md +8 -0
- package/docs/api/@aastar/core/variables/ALL_ADDRESSES.md +75 -0
- package/docs/api/@aastar/core/variables/ALL_ROLES.md +5 -0
- package/docs/api/@aastar/core/variables/APNTS_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/BLSAggregatorABI.md +3 -0
- package/docs/api/@aastar/core/variables/BLSAggregatorArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/BLSHelpers.md +101 -0
- package/docs/api/@aastar/core/variables/BLSValidatorABI.md +3 -0
- package/docs/api/@aastar/core/variables/BLSValidatorArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/BLS_AGGREGATOR_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/BLS_VALIDATOR_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/BPS_DENOMINATOR.md +5 -0
- package/docs/api/@aastar/core/variables/BRANDING.md +67 -0
- package/docs/api/@aastar/core/variables/BREAD_COMMUNITY.md +8 -0
- package/docs/api/@aastar/core/variables/CHAIN_MAINNET.md +3 -0
- package/docs/api/@aastar/core/variables/CHAIN_SEPOLIA.md +5 -0
- package/docs/api/@aastar/core/variables/COMMUNITIES.md +5 -0
- package/docs/api/@aastar/core/variables/COMMUNITY_OWNERS.md +15 -0
- package/docs/api/@aastar/core/variables/CONTRACTS.md +179 -0
- package/docs/api/@aastar/core/variables/CONTRACT_METADATA.md +67 -0
- package/docs/api/@aastar/core/variables/CONTRACT_SRC_HASH.md +5 -0
- package/docs/api/@aastar/core/variables/CORE_ADDRESSES.md +51 -0
- package/docs/api/@aastar/core/variables/DEFAULT_ADMIN_ROLE.md +17 -0
- package/docs/api/@aastar/core/variables/DEFAULT_APNTS_PRICE_USD.md +5 -0
- package/docs/api/@aastar/core/variables/DEFAULT_CALL_GAS_LIMIT.md +3 -0
- package/docs/api/@aastar/core/variables/DEFAULT_GAS_TOKEN_MINT_AMOUNT.md +5 -0
- package/docs/api/@aastar/core/variables/DEFAULT_PRE_VERIFICATION_GAS.md +3 -0
- package/docs/api/@aastar/core/variables/DEFAULT_TIMEOUT_MS.md +5 -0
- package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_NAME.md +3 -0
- package/docs/api/@aastar/core/variables/DEFAULT_TOKEN_SYMBOL.md +5 -0
- package/docs/api/@aastar/core/variables/DEFAULT_USDT_MINT_AMOUNT.md +5 -0
- package/docs/api/@aastar/core/variables/DEFAULT_VERIFICATION_GAS_LIMIT.md +5 -0
- package/docs/api/@aastar/core/variables/DVTValidatorABI.md +3 -0
- package/docs/api/@aastar/core/variables/DVTValidatorArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/DVT_VALIDATOR_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/ENTRY_POINT_0_8_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/ENTRY_POINT_0_9_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/ENTRY_POINT_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/EntryPointABI.md +3 -0
- package/docs/api/@aastar/core/variables/EntryPointArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/FAUCET_API_URL.md +5 -0
- package/docs/api/@aastar/core/variables/GTOKEN_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/GTOKEN_STAKING_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/GTokenABI.md +3 -0
- package/docs/api/@aastar/core/variables/GTokenArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/GTokenStakingABI.md +3 -0
- package/docs/api/@aastar/core/variables/GTokenStakingArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/INITIAL_ROLE_STAKES.md +13 -0
- package/docs/api/@aastar/core/variables/LINKS.md +33 -0
- package/docs/api/@aastar/core/variables/MAX_SERVICE_FEE.md +5 -0
- package/docs/api/@aastar/core/variables/MONITORING_ADDRESSES.md +15 -0
- package/docs/api/@aastar/core/variables/MySBTABI.md +3 -0
- package/docs/api/@aastar/core/variables/MySBTArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/NETWORKS.md +79 -0
- package/docs/api/@aastar/core/variables/NODE_STAKE_AMOUNTS.md +31 -0
- package/docs/api/@aastar/core/variables/OFFICIAL_ADDRESSES.md +11 -0
- package/docs/api/@aastar/core/variables/PAYMASTER_ADDRESSES.md +15 -0
- package/docs/api/@aastar/core/variables/PAYMASTER_FACTORY_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/PAYMASTER_V4_IMPL_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/PaymasterABI.md +3 -0
- package/docs/api/@aastar/core/variables/PaymasterArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/PaymasterFactoryABI.md +3 -0
- package/docs/api/@aastar/core/variables/PaymasterFactoryArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/PaymasterV4ABI.md +3 -0
- package/docs/api/@aastar/core/variables/PaymasterV4Artifact.md +13 -0
- package/docs/api/@aastar/core/variables/REGISTRY_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/REPUTATION_SYSTEM_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/ROLE_ANODE.md +29 -0
- package/docs/api/@aastar/core/variables/ROLE_COMMUNITY.md +29 -0
- package/docs/api/@aastar/core/variables/ROLE_DVT.md +29 -0
- package/docs/api/@aastar/core/variables/ROLE_ENDUSER.md +33 -0
- package/docs/api/@aastar/core/variables/ROLE_KMS.md +29 -0
- package/docs/api/@aastar/core/variables/ROLE_NAMES.md +3 -0
- package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_AOA.md +29 -0
- package/docs/api/@aastar/core/variables/ROLE_PAYMASTER_SUPER.md +33 -0
- package/docs/api/@aastar/core/variables/ROLE_PERMISSION_LEVELS.md +3 -0
- package/docs/api/@aastar/core/variables/RegistryABI.md +3 -0
- package/docs/api/@aastar/core/variables/RegistryArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/ReputationSystemABI.md +3 -0
- package/docs/api/@aastar/core/variables/ReputationSystemArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/SBT_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/SEPOLIA_CONTRACTS.md +175 -0
- package/docs/api/@aastar/core/variables/SEPOLIA_V2_VERSIONS.md +67 -0
- package/docs/api/@aastar/core/variables/SERVICE_FEE_RATE.md +5 -0
- package/docs/api/@aastar/core/variables/SUPER_PAYMASTER_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/SimpleAccountABI.md +3 -0
- package/docs/api/@aastar/core/variables/SimpleAccountArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/SimpleAccountFactoryABI.md +3 -0
- package/docs/api/@aastar/core/variables/SimpleAccountFactoryArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/SuperPaymasterABI.md +3 -0
- package/docs/api/@aastar/core/variables/SuperPaymasterArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/TEST_ACCOUNT_ADDRESSES.md +11 -0
- package/docs/api/@aastar/core/variables/TEST_ACCOUNT_POOL_SIZE.md +5 -0
- package/docs/api/@aastar/core/variables/TEST_COMMUNITIES.md +19 -0
- package/docs/api/@aastar/core/variables/TEST_TOKEN_ADDRESSES.md +19 -0
- package/docs/api/@aastar/core/variables/TOKEN_ADDRESSES.md +11 -0
- package/docs/api/@aastar/core/variables/V2_SUMMARY.md +39 -0
- package/docs/api/@aastar/core/variables/XPNTS_FACTORY_ADDRESS.md +3 -0
- package/docs/api/@aastar/core/variables/xPNTsFactoryABI.md +3 -0
- package/docs/api/@aastar/core/variables/xPNTsFactoryArtifact.md +13 -0
- package/docs/api/@aastar/core/variables/xPNTsTokenABI.md +3 -0
- package/docs/api/@aastar/core/variables/xPNTsTokenArtifact.md +13 -0
- package/docs/api/@aastar/paymaster/README.md +23 -0
- package/docs/api/@aastar/paymaster/classes/PaymasterClient.md +388 -0
- package/docs/api/@aastar/paymaster/classes/PaymasterOperator.md +451 -0
- package/docs/api/@aastar/paymaster/classes/SuperPaymasterAdminClient.md +189 -0
- package/docs/api/@aastar/paymaster/classes/SuperPaymasterClient.md +55 -0
- package/docs/api/@aastar/paymaster/functions/buildPaymasterData.md +34 -0
- package/docs/api/@aastar/paymaster/functions/buildSuperPaymasterData.md +30 -0
- package/docs/api/@aastar/paymaster/functions/checkEligibility.md +28 -0
- package/docs/api/@aastar/paymaster/functions/formatUserOpV07.md +15 -0
- package/docs/api/@aastar/paymaster/functions/getPaymasterV4Middleware.md +32 -0
- package/docs/api/@aastar/paymaster/functions/getSuperPaymasterMiddleware.md +32 -0
- package/docs/api/@aastar/paymaster/functions/getUserOpHashV07.md +21 -0
- package/docs/api/@aastar/paymaster/type-aliases/GaslessReadinessReport.md +55 -0
- package/docs/api/@aastar/paymaster/type-aliases/GaslessTransactionConfig.md +59 -0
- package/docs/api/@aastar/paymaster/type-aliases/PaymasterConfig.md +43 -0
- package/docs/api/@aastar/paymaster/type-aliases/PaymasterV4MiddlewareConfig.md +35 -0
- package/docs/api/@aastar/tokens/README.md +3 -0
- package/docs/api/@aastar/tokens/classes/FinanceClient.md +10385 -0
- package/docs/api/README.md +6 -0
- package/docs/examples/community-flow.md +28 -0
- package/docs/examples/enduser-flow.md +24 -0
- package/docs/examples/index.md +18 -0
- package/docs/examples/multi-chain.md +31 -0
- package/docs/examples/operator-flow.md +28 -0
- package/docs/guide/CLI_GUIDE.md +65 -0
- package/docs/guide/DOCUMENTATION_PLAN.md +455 -0
- package/docs/guide/Security-solution.md +106 -0
- package/docs/guide/TEST_COMMANDS.md +320 -0
- package/docs/guide/getting-started.md +133 -0
- package/docs/guide/installation.md +40 -0
- package/docs/guide/paper-data-collection.md +69 -0
- package/docs/guide/quick-start.md +52 -0
- package/docs/guide/task_breakdown.md +121 -0
- package/docs/old-solution.md +1078 -0
- package/docs/paper-data-collection.md +69 -0
- package/docs/technical_plan.md +510 -0
- package/docs/zh/examples/community-flow.md +38 -0
- package/docs/zh/examples/complete-workflow.md +10 -0
- package/docs/zh/examples/enduser-flow.md +33 -0
- package/docs/zh/examples/index.md +18 -0
- package/docs/zh/examples/multi-chain.md +46 -0
- package/docs/zh/examples/operator-flow.md +37 -0
- package/docs/zh/guide/CLI_GUIDE.md +48 -0
- package/docs/zh/guide/DOCUMENTATION_PLAN.md +455 -0
- package/docs/zh/guide/Plan.md +266 -0
- package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +51 -0
- package/docs/zh/guide/Security-solution.md +106 -0
- package/docs/zh/guide/TEST_COMMANDS.md +125 -0
- package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +72 -0
- package/docs/zh/guide/concepts/account-abstraction.md +95 -0
- package/docs/zh/guide/concepts/rainbow-bridge.md +68 -0
- package/docs/zh/guide/concepts/reputation.md +95 -0
- package/docs/zh/guide/concepts/superpaymaster.md +141 -0
- package/docs/zh/guide/getting-started.md +133 -0
- package/docs/zh/guide/installation.md +107 -0
- package/docs/zh/guide/old-solution.md +1078 -0
- package/docs/zh/guide/paper-data-collection.md +69 -0
- package/docs/zh/guide/quick-start.md +134 -0
- package/docs/zh/guide/sdk-readme.md +253 -0
- package/docs/zh/guide/task_breakdown.md +76 -0
- package/docs/zh/guide/technical_plan.md +510 -0
- package/docs/zh/guide/use-cases/community-management.md +141 -0
- package/docs/zh/guide/use-cases/gasless-transactions.md +71 -0
- package/docs/zh/guide/use-cases/operator-staking.md +84 -0
- package/docs/zh/guide/use-cases/yop.md +72 -0
- package/env.template +30 -0
- package/examples/l1-api-demo.ts +273 -0
- package/examples/l2-clients-demo.ts +135 -0
- package/examples/l3-community-launch.ts +49 -0
- package/examples/l3-user-onboarding.ts +56 -0
- package/examples/prepare-gasless.ts +89 -0
- package/examples/sdk-demo/DEVELOPER_GUIDE.md +159 -0
- package/examples/sdk-demo/README.md +30 -0
- package/examples/sdk-demo/usage.ts +137 -0
- package/examples/simple-gasless-demo.ts +109 -0
- package/examples/simple-superpaymaster-demo.ts +96 -0
- package/ext/aastar-shared-config/.env.example +6 -0
- package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +257 -0
- package/ext/aastar-shared-config/AGENTS.md +21 -0
- package/ext/aastar-shared-config/CHANGELOG.md +99 -0
- package/ext/aastar-shared-config/LICENSE +21 -0
- package/ext/aastar-shared-config/QUICK_START.md +215 -0
- package/ext/aastar-shared-config/README.md +412 -0
- package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +273 -0
- package/ext/aastar-shared-config/check-locker-status.mjs +7 -0
- package/ext/aastar-shared-config/favicon.ico +0 -0
- package/ext/aastar-shared-config/generate-comparison-table.sh +67 -0
- package/ext/aastar-shared-config/package.json +46 -0
- package/ext/aastar-shared-config/pnpm-lock.yaml +1182 -0
- package/ext/aastar-shared-config/src/abis/BLSAggregator.json +1 -0
- package/ext/aastar-shared-config/src/abis/DVTValidator.json +1 -0
- package/ext/aastar-shared-config/src/abis/GToken.json +1 -0
- package/ext/aastar-shared-config/src/abis/GTokenStaking.json +1 -0
- package/ext/aastar-shared-config/src/abis/MySBT.json +1 -0
- package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +1 -0
- package/ext/aastar-shared-config/src/abis/PaymasterV4.json +1098 -0
- package/ext/aastar-shared-config/src/abis/Registry.json +1 -0
- package/ext/aastar-shared-config/src/abis/SimpleAccount.json +557 -0
- package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +87 -0
- package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +1 -0
- package/ext/aastar-shared-config/src/abis/index.ts +45 -0
- package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +1 -0
- package/ext/aastar-shared-config/src/abis/xPNTsToken.json +1 -0
- package/ext/aastar-shared-config/src/branding.ts +32 -0
- package/ext/aastar-shared-config/src/communities.ts +93 -0
- package/ext/aastar-shared-config/src/constants.ts +67 -0
- package/ext/aastar-shared-config/src/contract-addresses.ts +95 -0
- package/ext/aastar-shared-config/src/contract-versions.ts +374 -0
- package/ext/aastar-shared-config/src/contracts.ts +414 -0
- package/ext/aastar-shared-config/src/index.ts +14 -0
- package/ext/aastar-shared-config/src/networks.ts +117 -0
- package/ext/aastar-shared-config/sync-abis.sh +92 -0
- package/ext/aastar-shared-config/sync-versions.mjs +150 -0
- package/ext/aastar-shared-config/tsconfig.json +18 -0
- package/ext/aastar-shared-config/tsup.config.ts +10 -0
- package/ext/aastar-shared-config/verify-all.sh +207 -0
- package/ext/aastar-shared-config/verify-contracts.sh +85 -0
- package/ext/aastar-shared-config/verify-mysbt-v243.mjs +27 -0
- package/ext/aastar-shared-config/verify-onchain-versions.mjs +93 -0
- package/l4-setup.sh +1 -0
- package/lib/SHARED_CONFIG_REFERENCE.md +133 -0
- package/lib/shared-config/.env.example +6 -0
- package/lib/shared-config/.github/workflows/check-secrets.yml +257 -0
- package/lib/shared-config/AGENTS.md +21 -0
- package/lib/shared-config/CHANGELOG.md +99 -0
- package/lib/shared-config/LICENSE +21 -0
- package/lib/shared-config/QUICK_START.md +215 -0
- package/lib/shared-config/README.md +412 -0
- package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +273 -0
- package/lib/shared-config/check-locker-status.mjs +7 -0
- package/lib/shared-config/favicon.ico +0 -0
- package/lib/shared-config/generate-comparison-table.sh +67 -0
- package/lib/shared-config/package.json +46 -0
- package/lib/shared-config/pnpm-lock.yaml +1182 -0
- package/lib/shared-config/src/abis/BLSAggregator.json +1 -0
- package/lib/shared-config/src/abis/DVTValidator.json +1 -0
- package/lib/shared-config/src/abis/GToken.json +1 -0
- package/lib/shared-config/src/abis/GTokenStaking.json +1 -0
- package/lib/shared-config/src/abis/MySBT.json +1 -0
- package/lib/shared-config/src/abis/PaymasterFactory.json +1 -0
- package/lib/shared-config/src/abis/PaymasterV4.json +1098 -0
- package/lib/shared-config/src/abis/Registry.json +1 -0
- package/lib/shared-config/src/abis/SimpleAccount.json +557 -0
- package/lib/shared-config/src/abis/SimpleAccountFactory.json +87 -0
- package/lib/shared-config/src/abis/SuperPaymasterV2.json +1 -0
- package/lib/shared-config/src/abis/index.ts +45 -0
- package/lib/shared-config/src/abis/xPNTsFactory.json +1 -0
- package/lib/shared-config/src/abis/xPNTsToken.json +1 -0
- package/lib/shared-config/src/branding.ts +32 -0
- package/lib/shared-config/src/communities.ts +93 -0
- package/lib/shared-config/src/constants.ts +67 -0
- package/lib/shared-config/src/contract-addresses.ts +95 -0
- package/lib/shared-config/src/contract-versions.ts +374 -0
- package/lib/shared-config/src/contracts.ts +414 -0
- package/lib/shared-config/src/index.ts +14 -0
- package/lib/shared-config/src/networks.ts +117 -0
- package/lib/shared-config/sync-abis.sh +92 -0
- package/lib/shared-config/sync-versions.mjs +150 -0
- package/lib/shared-config/tsconfig.json +18 -0
- package/lib/shared-config/tsup.config.ts +10 -0
- package/lib/shared-config/verify-all.sh +207 -0
- package/lib/shared-config/verify-contracts.sh +85 -0
- package/lib/shared-config/verify-mysbt-v243.mjs +27 -0
- package/lib/shared-config/verify-onchain-versions.mjs +93 -0
- package/package.json +60 -38
- package/packages/account/__tests__/index.test.ts +9 -0
- package/packages/account/node_modules/.bin/tsc +21 -0
- package/packages/account/node_modules/.bin/tsserver +21 -0
- package/packages/account/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/account/package.json +21 -0
- package/packages/account/src/accounts/simple.ts +84 -0
- package/packages/account/src/eoa.ts +31 -0
- package/packages/account/src/index.ts +61 -0
- package/packages/account/tsconfig.json +12 -0
- package/packages/analytics/README.md +68 -0
- package/packages/analytics/__tests__/index.test.ts +25 -0
- package/packages/analytics/data/attribution_dataset.csv +29 -0
- package/packages/analytics/data/complete_dataset.csv +29 -0
- package/packages/analytics/data/eth_price_cache.json +4 -0
- package/packages/analytics/data/full_dataset.csv +11 -0
- package/packages/analytics/data/full_dataset.json +134 -0
- package/packages/analytics/data/parsed_transactions.csv +29 -0
- package/packages/analytics/node_modules/.bin/tsc +21 -0
- package/packages/analytics/node_modules/.bin/tsserver +21 -0
- package/packages/analytics/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/analytics/package.json +25 -0
- package/packages/analytics/reports/full/attribution_analysis_20260119.md +42 -0
- package/packages/analytics/reports/full/attribution_analysis_fresh_20260119.md +67 -0
- package/packages/analytics/reports/full/competitive_analysis_20260119.md +103 -0
- package/packages/analytics/reports/full/comprehensive_analysis_20260119.md +107 -0
- package/packages/analytics/reports/full/comprehensive_analysis_v4_1_20260119.md +74 -0
- package/packages/analytics/reports/full/economic_audit_v4_2_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_3_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_4_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_5_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_6_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_final_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_final_v2_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_final_v3_20260119.md +74 -0
- package/packages/analytics/reports/full/profit_audit_v4_final_v4_20260119.md +75 -0
- package/packages/analytics/reports/full/profit_audit_v4_final_v5_20260119.md +76 -0
- package/packages/analytics/reports/full/two_layer_analysis_20260119.md +81 -0
- package/packages/analytics/reports/full/two_layer_analysis_academic_20260119.md +81 -0
- package/packages/analytics/reports/full/two_layer_analysis_dynamic_20260119.md +81 -0
- package/packages/analytics/reports/full/two_layer_analysis_final_20260119.md +81 -0
- package/packages/analytics/reports/full/two_layer_analysis_final_fixed_20260119.md +81 -0
- package/packages/analytics/reports/full/two_layer_analysis_fixed_20260119.md +52 -0
- package/packages/analytics/reports/full/two_layer_analysis_normalized_20260119.md +81 -0
- package/packages/analytics/reports/full/tx_0xc30cfcbb.md +39 -0
- package/packages/analytics/src/analyzers/AttributionAnalyzer.ts +124 -0
- package/packages/analytics/src/analyzers/ComparisonAnalyzer.ts +89 -0
- package/packages/analytics/src/analyzers/TransactionAnalyzer.ts +111 -0
- package/packages/analytics/src/analyzers/TrendAnalyzer.ts +107 -0
- package/packages/analytics/src/cli-analyze-tx.ts +45 -0
- package/packages/analytics/src/cli.ts +39 -0
- package/packages/analytics/src/core/BenchmarkLoader.ts +163 -0
- package/packages/analytics/src/core/CostCalculator.ts +202 -0
- package/packages/analytics/src/core/DataCollector.ts +245 -0
- package/packages/analytics/src/gas-analyzer-v4.ts +118 -0
- package/packages/analytics/src/gas-analyzer.ts +184 -0
- package/packages/analytics/src/index.ts +145 -0
- package/packages/analytics/src/test-logparser.ts +63 -0
- package/packages/analytics/src/utils/EventDecoder.ts +152 -0
- package/packages/analytics/src/utils/LogParser.ts +220 -0
- package/packages/analytics/src/utils/PriceOracle.ts +117 -0
- package/packages/analytics/test/AttributionAnalyzer.test.ts +42 -0
- package/packages/analytics/test/CostCalculator.test.ts +75 -0
- package/packages/analytics/tsconfig.json +12 -0
- package/packages/community/__tests__/index.test.ts +9 -0
- package/packages/community/node_modules/.bin/tsc +21 -0
- package/packages/community/node_modules/.bin/tsserver +21 -0
- package/packages/community/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/community/package.json +27 -0
- package/packages/community/src/index.ts +326 -0
- package/packages/community/tsconfig.json +8 -0
- package/packages/core/__tests__/actions/account-comprehensive.test.ts +92 -0
- package/packages/core/__tests__/actions/aggregator.test.ts +62 -0
- package/packages/core/__tests__/actions/comprehensive-batch1.test.ts +86 -0
- package/packages/core/__tests__/actions/comprehensive-batch2.test.ts +39 -0
- package/packages/core/__tests__/actions/comprehensive-batch3.test.ts +35 -0
- package/packages/core/__tests__/actions/comprehensive-error.test.ts +115 -0
- package/packages/core/__tests__/actions/dvt.test.ts +39 -0
- package/packages/core/__tests__/actions/edge-cases.test.ts +39 -0
- package/packages/core/__tests__/actions/error-paths.test.ts +82 -0
- package/packages/core/__tests__/actions/factory.test.ts +81 -0
- package/packages/core/__tests__/actions/faucet.test.ts +131 -0
- package/packages/core/__tests__/actions/paymaster.test.ts +116 -0
- package/packages/core/__tests__/actions/registry.test.ts +81 -0
- package/packages/core/__tests__/actions/reputation.test.ts +43 -0
- package/packages/core/__tests__/actions/sbt.test.ts +145 -0
- package/packages/core/__tests__/actions/staking.test.ts +30 -0
- package/packages/core/__tests__/actions/superPaymaster.test.ts +158 -0
- package/packages/core/__tests__/actions/tokens-extended.test.ts +18 -0
- package/packages/core/__tests__/actions/tokens.test.ts +122 -0
- package/packages/core/__tests__/clients.test.ts +77 -0
- package/packages/core/__tests__/contracts-config.test.ts +69 -0
- package/packages/core/__tests__/index.test.ts +9 -0
- package/packages/core/__tests__/mocks/client.ts +40 -0
- package/packages/core/node_modules/.bin/tsc +21 -0
- package/packages/core/node_modules/.bin/tsserver +21 -0
- package/packages/core/node_modules/.bin/tsx +21 -0
- package/packages/core/node_modules/.bin/vite +21 -0
- package/packages/core/node_modules/.bin/vitest +21 -0
- package/packages/core/node_modules/.bin/yaml +21 -0
- package/packages/core/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/core/package.json +25 -0
- package/packages/core/src/abis/BLSAggregator.json +686 -0
- package/packages/core/src/abis/BLSValidator.json +42 -0
- package/packages/core/src/abis/DVTValidator.json +368 -0
- package/packages/core/src/abis/Eip7702Support.json +24 -0
- package/packages/core/src/abis/EntryPoint.json +1382 -0
- package/packages/core/src/abis/GToken.json +513 -0
- package/packages/core/src/abis/GTokenStaking.json +949 -0
- package/packages/core/src/abis/LegacyAccount.json +625 -0
- package/packages/core/src/abis/MySBT.json +1518 -0
- package/packages/core/src/abis/Paymaster.json +1143 -0
- package/packages/core/src/abis/PaymasterFactory.json +640 -0
- package/packages/core/src/abis/Registry.json +1942 -0
- package/packages/core/src/abis/ReputationSystem.json +699 -0
- package/packages/core/src/abis/SenderCreator.json +99 -0
- package/packages/core/src/abis/Simple7702Account.json +395 -0
- package/packages/core/src/abis/SimpleAccount.json +560 -0
- package/packages/core/src/abis/SimpleAccountFactory.json +111 -0
- package/packages/core/src/abis/SimpleAccountFactoryV08.json +87 -0
- package/packages/core/src/abis/SimpleAccountV08.json +557 -0
- package/packages/core/src/abis/SuperPaymaster.json +1781 -0
- package/packages/core/src/abis/UserOperationLib.json +57 -0
- package/packages/core/src/abis/aPNTs.json +1160 -0
- package/packages/core/src/abis/abi.config.json +24 -0
- package/packages/core/src/abis/index.ts +91 -0
- package/packages/core/src/abis/xPNTsFactory.json +718 -0
- package/packages/core/src/abis/xPNTsToken.json +1280 -0
- package/packages/core/src/actions/StateValidator.ts +253 -0
- package/packages/core/src/actions/account.ts +190 -0
- package/packages/core/src/actions/aggregator.ts +371 -0
- package/packages/core/src/actions/dvt.ts +269 -0
- package/packages/core/src/actions/entryPoint.ts +89 -0
- package/packages/core/src/actions/factory.ts +732 -0
- package/packages/core/src/actions/faucet.ts +280 -0
- package/packages/core/src/actions/index.ts +15 -0
- package/packages/core/src/actions/paymaster.ts +780 -0
- package/packages/core/src/actions/registry.ts +961 -0
- package/packages/core/src/actions/reputation.ts +668 -0
- package/packages/core/src/actions/sbt.ts +916 -0
- package/packages/core/src/actions/staking.ts +576 -0
- package/packages/core/src/actions/superPaymaster.ts +1093 -0
- package/packages/core/src/actions/tokens.ts +481 -0
- package/packages/core/src/branding.ts +32 -0
- package/packages/core/src/clients/BaseClient.ts +78 -0
- package/packages/core/src/clients/BundlerClient.ts +132 -0
- package/packages/core/src/clients/types.ts +69 -0
- package/packages/core/src/clients.ts +13 -0
- package/packages/core/src/communities.ts +93 -0
- package/packages/core/src/config/ContractConfigManager.ts +63 -0
- package/packages/core/src/constants.ts +114 -0
- package/packages/core/src/contract-addresses.ts +118 -0
- package/packages/core/src/contract-versions.ts +374 -0
- package/packages/core/src/contracts.ts +414 -0
- package/packages/core/src/crypto/blsSigner.ts +124 -0
- package/packages/core/src/errors/index.ts +173 -0
- package/packages/core/src/index.ts +23 -0
- package/packages/core/src/networks.ts +127 -0
- package/packages/core/src/requirementChecker.ts +225 -0
- package/packages/core/src/roles.ts +244 -0
- package/packages/core/src/utils.ts +23 -0
- package/packages/core/src/validators/index.ts +88 -0
- package/packages/core/tsconfig.json +13 -0
- package/packages/dapp/__tests__/index.test.ts +9 -0
- package/packages/dapp/node_modules/.bin/tsc +21 -0
- package/packages/dapp/node_modules/.bin/tsserver +21 -0
- package/packages/dapp/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/dapp/package.json +28 -0
- package/packages/dapp/src/index.ts +4 -0
- package/packages/dapp/src/ui/components/EvaluationPanel.tsx +40 -0
- package/packages/dapp/src/ui/hooks/useCreditScore.ts +44 -0
- package/packages/dapp/src/ui/hooks/useSuperPaymaster.ts +31 -0
- package/packages/dapp/src/ui/index.ts +22 -0
- package/packages/dapp/tsconfig.json +13 -0
- package/packages/enduser/__tests__/CommunityClient.test.ts +205 -0
- package/packages/enduser/__tests__/UserClient.test.ts +294 -0
- package/packages/enduser/__tests__/index.test.ts +16 -0
- package/packages/enduser/__tests__/mocks/client.ts +22 -0
- package/packages/enduser/node_modules/.bin/tsc +21 -0
- package/packages/enduser/node_modules/.bin/tsserver +21 -0
- package/packages/enduser/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/enduser/package.json +26 -0
- package/packages/enduser/src/CommunityClient.ts +235 -0
- package/packages/enduser/src/UserClient.ts +447 -0
- package/packages/enduser/src/index.ts +2 -0
- package/packages/enduser/src/testAccountManager.ts +374 -0
- package/packages/enduser/tsconfig.json +10 -0
- package/packages/identity/__tests__/index.test.ts +9 -0
- package/packages/identity/node_modules/.bin/tsc +21 -0
- package/packages/identity/node_modules/.bin/tsserver +21 -0
- package/packages/identity/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/identity/package.json +23 -0
- package/packages/identity/src/index.ts +114 -0
- package/packages/identity/src/mysbt.ts +48 -0
- package/packages/identity/tsconfig.json +12 -0
- package/packages/operator/__tests__/PaymasterOperatorClient.test.ts +258 -0
- package/packages/operator/__tests__/ProtocolClient.test.ts +135 -0
- package/packages/operator/__tests__/index.test.ts +16 -0
- package/packages/operator/__tests__/mocks/client.ts +22 -0
- package/packages/operator/node_modules/.bin/tsc +21 -0
- package/packages/operator/node_modules/.bin/tsserver +21 -0
- package/packages/operator/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/operator/package.json +26 -0
- package/packages/operator/src/PaymasterOperatorClient.ts +454 -0
- package/packages/operator/src/ProtocolClient.ts +154 -0
- package/packages/operator/src/index.ts +2 -0
- package/packages/operator/tsconfig.json +10 -0
- package/packages/patterns/node_modules/.bin/tsc +21 -0
- package/packages/patterns/node_modules/.bin/tsserver +21 -0
- package/packages/paymaster/__tests__/PaymasterOperator.test.ts +123 -0
- package/packages/paymaster/__tests__/index.test.ts +9 -0
- package/packages/paymaster/node_modules/.bin/tsc +21 -0
- package/packages/paymaster/node_modules/.bin/tsserver +21 -0
- package/packages/paymaster/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/paymaster/package.json +23 -0
- package/packages/paymaster/src/SuperPaymaster/index.ts +168 -0
- package/packages/paymaster/src/V4/BundlerCompat.ts +47 -0
- package/packages/paymaster/src/V4/PaymasterClient.ts +490 -0
- package/packages/paymaster/src/V4/PaymasterOperator.ts +282 -0
- package/packages/paymaster/src/V4/PaymasterUtils.ts +199 -0
- package/packages/paymaster/src/V4/SuperPaymasterClient.ts +129 -0
- package/packages/paymaster/src/index.ts +5 -0
- package/packages/paymaster/tsconfig.json +16 -0
- package/packages/sdk/README.md +171 -0
- package/packages/sdk/__tests__/index.test.ts +9 -0
- package/packages/sdk/aastar/package.json +21 -0
- package/packages/sdk/aastar/src/index.ts +3 -0
- package/packages/sdk/aastar/tsconfig.json +8 -0
- package/packages/sdk/node_modules/.bin/tsc +21 -0
- package/packages/sdk/node_modules/.bin/tsserver +21 -0
- package/packages/sdk/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/sdk/package.json +34 -0
- package/packages/sdk/src/clients/ExperimentClient.ts +80 -0
- package/packages/sdk/src/clients/admin.ts +56 -0
- package/packages/sdk/src/clients/community.ts +403 -0
- package/packages/sdk/src/clients/endUser.ts +428 -0
- package/packages/sdk/src/clients/operator.ts +280 -0
- package/packages/sdk/src/errors/decoder.ts +48 -0
- package/packages/sdk/src/index.ts +24 -0
- package/packages/sdk/src/utils/errorHandler.ts +167 -0
- package/packages/sdk/src/utils/funding.ts +280 -0
- package/packages/sdk/src/utils/keys.ts +159 -0
- package/packages/sdk/src/utils/roleData.ts +151 -0
- package/packages/sdk/src/utils/testScenarios.ts +128 -0
- package/packages/sdk/src/utils/userOp.ts +257 -0
- package/packages/sdk/tests/scenarios/01_onboard_community.ts +62 -0
- package/packages/sdk/tests/scenarios/02_onboard_operator.ts +109 -0
- package/packages/sdk/tests/scenarios/03_onboard_user.ts +53 -0
- package/packages/sdk/tests/scenarios/04_gasless_tx_flow.ts +68 -0
- package/packages/sdk/tests/scenarios/check_entrypoint.ts +19 -0
- package/packages/sdk/tests/scenarios/check_initialization.ts +65 -0
- package/packages/sdk/tests/scenarios/debug_addresses.ts +26 -0
- package/packages/sdk/tests/scenarios/diagnose_scenario4.ts +55 -0
- package/packages/sdk/tests/scenarios/setup.ts +33 -0
- package/packages/sdk/tests/scenarios/test_entrypoint_nonce.ts +46 -0
- package/packages/sdk/tsconfig.json +12 -0
- package/packages/tokens/__tests__/index.test.ts +9 -0
- package/packages/tokens/node_modules/.bin/tsc +21 -0
- package/packages/tokens/node_modules/.bin/tsserver +21 -0
- package/packages/tokens/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/packages/tokens/package.json +23 -0
- package/packages/tokens/src/index.ts +258 -0
- package/packages/tokens/tsconfig.json +12 -0
- package/pnpm-workspace.yaml +2 -0
- package/publish.sh +30 -0
- package/run_l4_gasless_regression.sh +109 -0
- package/run_sdk_regression.sh +232 -0
- package/scripts/00_utils.ts +59 -0
- package/scripts/00_verify_phase1.ts +130 -0
- package/scripts/01_1_prep_gtoken.ts +81 -0
- package/scripts/01_2_register_sbt.ts +88 -0
- package/scripts/01_3_prep_tokens_paymaster.ts +102 -0
- package/scripts/01_prepare_all.ts +271 -0
- package/scripts/02_test_eoa.ts +50 -0
- package/scripts/03_test_standard_aa.ts +173 -0
- package/scripts/04_0_check_deploy.ts +24 -0
- package/scripts/04_1_check_allowance.ts +44 -0
- package/scripts/04_2_construct_verify.ts +96 -0
- package/scripts/04_3_verify_estimate.ts +66 -0
- package/scripts/04_4_verify_pack.ts +74 -0
- package/scripts/04_test_paymaster_v4.ts +217 -0
- package/scripts/05_1_deposit.ts +48 -0
- package/scripts/05_test_superpaymaster.ts +380 -0
- package/scripts/06_local_test_v3_admin.ts +163 -0
- package/scripts/06_local_test_v3_execution.ts +132 -0
- package/scripts/06_local_test_v3_full.ts +490 -0
- package/scripts/06_local_test_v3_funding.ts +124 -0
- package/scripts/06_local_test_v3_reputation.ts +234 -0
- package/scripts/07_local_test_v3_audit.ts +181 -0
- package/scripts/08_local_test_registry_lifecycle.ts +382 -0
- package/scripts/09_local_test_community_lifecycle.ts +385 -0
- package/scripts/09_local_test_community_simple.ts +108 -0
- package/scripts/09_scenario_bread_independent.ts +247 -0
- package/scripts/10_scenario_super_shared.ts +196 -0
- package/scripts/10_test_protocol_admin_full.ts +173 -0
- package/scripts/11_scenario_hacker_defense.ts +104 -0
- package/scripts/11_test_core_flows_full.ts +279 -0
- package/scripts/12_test_slash_mechanism.ts +205 -0
- package/scripts/12_test_slash_queries.ts +83 -0
- package/scripts/12_test_staking_exit.ts +152 -0
- package/scripts/12_test_staking_slash.ts +301 -0
- package/scripts/12_test_tier2_slash.ts +139 -0
- package/scripts/13_test_sbt_burn_linkage.ts +266 -0
- package/scripts/14_test_credit_redesign.ts +266 -0
- package/scripts/15_test_bls_full.ts +148 -0
- package/scripts/15_test_dvt_bls_full.ts +140 -0
- package/scripts/17_test_cross_role_collaboration.ts +95 -0
- package/scripts/18_sdk_e2e_verification.ts +67 -0
- package/scripts/18_test_dvt_sdk_flow.ts +138 -0
- package/scripts/18_test_lifecycle_completion.ts +144 -0
- package/scripts/19_sdk_experiment_runner.ts +207 -0
- package/scripts/19_sdk_experiment_runner.ts.backup +391 -0
- package/scripts/20_sdk_full_capability.ts +95 -0
- package/scripts/20_test_superpaymaster_new_apis.ts +193 -0
- package/scripts/21_test_paymasterv4_complete.ts +341 -0
- package/scripts/22_test_bls_signing.ts +260 -0
- package/scripts/23_test_middleware.ts +197 -0
- package/scripts/98_edge_reentrancy.ts +85 -0
- package/scripts/99_bug_hunting_fast.ts +99 -0
- package/scripts/analyze_abi_coverage.ts +169 -0
- package/scripts/analyze_missing_functions.ts +136 -0
- package/scripts/canary-bundler.ts +47 -0
- package/scripts/check-admin.ts +95 -0
- package/scripts/check-chainlink.ts +28 -0
- package/scripts/check-jason-status.ts +85 -0
- package/scripts/check-roles.ts +36 -0
- package/scripts/clear-nonce.ts +47 -0
- package/scripts/collect_industry_baseline.ts +236 -0
- package/scripts/complete-jack-superpaymaster.ts +171 -0
- package/scripts/complete_env_config.ts +97 -0
- package/scripts/deploy-sync.ts +104 -0
- package/scripts/deploy_and_init_v3.sh +134 -0
- package/scripts/deploy_anvil_accounts.ts +144 -0
- package/scripts/deploy_jason_pm.ts +114 -0
- package/scripts/deploy_paymaster_v4.ts +139 -0
- package/scripts/deploy_test_accounts.ts +401 -0
- package/scripts/deprecated/check_aa_entrypoint.ts +29 -0
- package/scripts/deprecated/check_paymaster_deposits.ts +45 -0
- package/scripts/deprecated/debug_aoa_function.ts +28 -0
- package/scripts/deprecated/debug_aoa_issue.ts +16 -0
- package/scripts/deprecated/debug_pimlico_aa23.ts +40 -0
- package/scripts/deprecated/debug_summary.ts +34 -0
- package/scripts/deprecated/deploy_v07_aa.ts +99 -0
- package/scripts/deprecated/fix_all_issues.ts +61 -0
- package/scripts/deprecated/fund_bpnts.ts +52 -0
- package/scripts/deprecated/get_factory_addresses.ts +28 -0
- package/scripts/deprecated/recheck_pim.ts +34 -0
- package/scripts/dev_tools/extract_abis.sh +151 -0
- package/scripts/dev_tools/extract_addresses_to_env.sh +67 -0
- package/scripts/dev_tools/final_safe_harmonize.py +77 -0
- package/scripts/dev_tools/safe_harmonize.py +107 -0
- package/scripts/dev_tools/surgical_harmonize.py +83 -0
- package/scripts/experiment/stage3/SETUP_GUIDE.md +258 -0
- package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +78 -0
- package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +96 -0
- package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +112 -0
- package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +84 -0
- package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +104 -0
- package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +86 -0
- package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +89 -0
- package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +83 -0
- package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +61 -0
- package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +104 -0
- package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +60 -0
- package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +100 -0
- package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +149 -0
- package/scripts/experiment/stage3/archived_scripts/README.md +58 -0
- package/scripts/experiment/stage3/archived_scripts/check_roles.ts +29 -0
- package/scripts/experiment/stage3/archived_scripts/decode_error.ts +23 -0
- package/scripts/experiment/stage3/archived_scripts/fund_user.ts +51 -0
- package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +3 -0
- package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +4 -0
- package/scripts/experiment/stage3/archived_scripts/setup.ts +105 -0
- package/scripts/experiment/stage3/archived_scripts/test_key.ts +4 -0
- package/scripts/experiment/stage3/archived_scripts/verify_state.ts +59 -0
- package/scripts/experiment/stage3/refactored/00_token_distribution.ts +46 -0
- package/scripts/experiment/stage3/refactored/02_operator_setup.ts +65 -0
- package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +68 -0
- package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +63 -0
- package/scripts/experiment/stage3/refactored/README.md +71 -0
- package/scripts/extract-docs.sh +72 -0
- package/scripts/fund-jack.ts +38 -0
- package/scripts/generate_env_from_deployment.ts +109 -0
- package/scripts/inspect-anni-token.ts +116 -0
- package/scripts/inspect-factory.ts +83 -0
- package/scripts/l4-debug-bob.ts +62 -0
- package/scripts/l4-paymasterv4-transfer-test.ts +220 -0
- package/scripts/l4-setup.ts +1347 -0
- package/scripts/l4-state.json +82 -0
- package/scripts/manual-update-price.ts +39 -0
- package/scripts/phase1_verify_contracts.ts +207 -0
- package/scripts/pre_test_sync.ts +83 -0
- package/scripts/prepare_sepolia_resources.ts +154 -0
- package/scripts/publish_all.sh +39 -0
- package/scripts/query-jack-token.ts +22 -0
- package/scripts/quick_setup.ts +124 -0
- package/scripts/quick_setup_account.ts +80 -0
- package/scripts/run_automated_experiment.sh +121 -0
- package/scripts/run_daily_experiment.ts +70 -0
- package/scripts/run_full_regression.sh +38 -0
- package/scripts/run_l4_gasless_regression.sh +32 -0
- package/scripts/run_sdk_experiment.sh +13 -0
- package/scripts/run_sdk_regression-v2.sh +38 -0
- package/scripts/sdk_regression_v2.ts +148 -0
- package/scripts/security_audit.sh +172 -0
- package/scripts/setup-bbq-community.ts +187 -0
- package/scripts/setup-dancing-community.ts +223 -0
- package/scripts/setup_test_accounts.ts +88 -0
- package/scripts/setup_test_environment.ts +147 -0
- package/scripts/sync_anvil_config.cjs +44 -0
- package/scripts/sync_config_to_env.ts +88 -0
- package/scripts/sync_contract_addresses.ts +186 -0
- package/scripts/sync_sepolia_config.cjs +90 -0
- package/scripts/sync_sepolia_config.mjs +74 -0
- package/scripts/test-brown-v4-deploy.ts +90 -0
- package/scripts/test-faucet-and-gasless.ts +150 -0
- package/scripts/test-jack-gasless.ts +119 -0
- package/scripts/test-jack-registration.ts +133 -0
- package/scripts/test-jack-superpaymaster-api.ts +112 -0
- package/scripts/test-kms-gasless.ts +352 -0
- package/scripts/update-price-dvt.ts +53 -0
- package/scripts/update_env_from_config.ts +83 -0
- package/scripts/v2_regression/01_setup_and_fund.ts +1 -1
- package/scripts/v2_regression/02_operator_onboarding.ts +140 -14
- package/scripts/v2_regression/03_community_registry.ts +58 -24
- package/scripts/v2_regression/04_enduser_flow.ts +49 -16
- package/scripts/v2_regression/05_admin_audit.ts +1 -1
- package/scripts/v2_regression/README.md +161 -0
- package/scripts/verify-bob-token.ts +41 -0
- package/scripts/verify-tx-status.ts +81 -0
- package/scripts/verify_onchain_milestone.ts +114 -0
- package/scripts/verify_phase1.ts +66 -0
- package/scripts/verify_phase2.ts +66 -0
- package/sdk-abi-coverage.sh +1 -0
- package/sdk-build-and-test.sh +1 -0
- package/sdk-test-coverage.sh +1 -0
- package/sdk_experiment_data.csv +4 -0
- package/simple-test-paymaster.sh +2 -0
- package/simple-test-superpaymaster.sh +3 -0
- package/tests/check-aa-balance.ts +31 -0
- package/tests/l1-regression.test.ts +437 -0
- package/tests/l4-test-anni-gasless.ts +517 -0
- package/tests/l4-test-jason1-gasless.ts +158 -0
- package/tests/l4-test-jason2-gasless.ts +180 -0
- package/tests/l4-test-pmv4-deposit.ts +111 -0
- package/tests/l4-test-pmv4-gasless.ts +166 -0
- package/tests/l4-test-pmv4-submit.ts +223 -0
- package/tests/regression/README.md +168 -0
- package/tests/regression/config.ts +217 -0
- package/tests/regression/display-versions.ts +85 -0
- package/tests/regression/index.ts +67 -0
- package/tests/regression/l1-tests.ts +248 -0
- package/tests/regression/l2-tests.ts +227 -0
- package/tests/regression/l3-tests.ts +28 -0
- package/tests/regression/l4-comprehensive-gasless.ts +478 -0
- package/tests/regression/l4-gasless.ts +999 -0
- package/tests/regression/l4-reputation-tiers.ts +102 -0
- package/tests/regression/l4-runner.ts +52 -0
- package/tests/reports/phase1_contract_verification.md +45 -0
- package/tests/test-bundler-compat.ts +132 -0
- package/tests/test-candide-bundler.ts +117 -0
- package/tests/test-candide-paymaster.ts +101 -0
- package/tests/test-candide-sdk.ts +116 -0
- package/tests/test-candide-simple.ts +204 -0
- package/tests/test-pimlico-complete.ts +134 -0
- package/tests/utils/contractVerifier.ts +237 -0
- package/tests/utils/userOpHelper.ts +194 -0
- package/tsconfig.build.json +23 -0
- package/tsconfig.json +27 -0
- package/typedoc.json +25 -0
- package/update-version.sh +20 -0
- package/vitest.config.ts +17 -0
- package/dist/account/src/accounts/simple.d.ts +0 -18
- package/dist/account/src/accounts/simple.js +0 -49
- package/dist/account/src/eoa.d.ts +0 -10
- package/dist/account/src/eoa.js +0 -21
- package/dist/account/src/index.d.ts +0 -19
- package/dist/account/src/index.js +0 -49
- package/dist/core/src/abis/BLSAggregator.json +0 -686
- package/dist/core/src/abis/BLSValidator.json +0 -42
- package/dist/core/src/abis/DVTValidator.json +0 -368
- package/dist/core/src/abis/EntryPoint.json +0 -1382
- package/dist/core/src/abis/GToken.json +0 -513
- package/dist/core/src/abis/GTokenStaking.json +0 -949
- package/dist/core/src/abis/MySBT.json +0 -1518
- package/dist/core/src/abis/Paymaster.json +0 -1143
- package/dist/core/src/abis/PaymasterFactory.json +0 -640
- package/dist/core/src/abis/Registry.json +0 -1942
- package/dist/core/src/abis/ReputationSystem.json +0 -699
- package/dist/core/src/abis/SimpleAccount.json +0 -560
- package/dist/core/src/abis/SimpleAccountFactory.json +0 -111
- package/dist/core/src/abis/SuperPaymaster.json +0 -1781
- package/dist/core/src/abis/index.d.ts +0 -1126
- package/dist/core/src/abis/index.js +0 -91
- package/dist/core/src/abis/xPNTsFactory.json +0 -718
- package/dist/core/src/abis/xPNTsToken.json +0 -1280
- package/dist/core/src/actions/StateValidator.d.ts +0 -68
- package/dist/core/src/actions/StateValidator.js +0 -187
- package/dist/core/src/actions/account.d.ts +0 -55
- package/dist/core/src/actions/account.js +0 -133
- package/dist/core/src/actions/aggregator.d.ts +0 -17
- package/dist/core/src/actions/aggregator.js +0 -31
- package/dist/core/src/actions/dvt.d.ts +0 -30
- package/dist/core/src/actions/dvt.js +0 -41
- package/dist/core/src/actions/entryPoint.d.ts +0 -90
- package/dist/core/src/actions/entryPoint.js +0 -211
- package/dist/core/src/actions/factory.d.ts +0 -215
- package/dist/core/src/actions/factory.js +0 -442
- package/dist/core/src/actions/faucet.d.ts +0 -48
- package/dist/core/src/actions/faucet.js +0 -337
- package/dist/core/src/actions/gtokenExtended.d.ts +0 -39
- package/dist/core/src/actions/gtokenExtended.js +0 -115
- package/dist/core/src/actions/index.d.ts +0 -15
- package/dist/core/src/actions/index.js +0 -17
- package/dist/core/src/actions/paymasterV4.d.ts +0 -170
- package/dist/core/src/actions/paymasterV4.js +0 -334
- package/dist/core/src/actions/registry.d.ts +0 -246
- package/dist/core/src/actions/registry.js +0 -667
- package/dist/core/src/actions/reputation.d.ts +0 -129
- package/dist/core/src/actions/reputation.js +0 -281
- package/dist/core/src/actions/sbt.d.ts +0 -191
- package/dist/core/src/actions/sbt.js +0 -533
- package/dist/core/src/actions/staking.d.ts +0 -132
- package/dist/core/src/actions/staking.js +0 -330
- package/dist/core/src/actions/superPaymaster.d.ts +0 -237
- package/dist/core/src/actions/superPaymaster.js +0 -644
- package/dist/core/src/actions/tokens.d.ts +0 -229
- package/dist/core/src/actions/tokens.js +0 -415
- package/dist/core/src/branding.d.ts +0 -30
- package/dist/core/src/branding.js +0 -30
- package/dist/core/src/clients/BaseClient.d.ts +0 -25
- package/dist/core/src/clients/BaseClient.js +0 -66
- package/dist/core/src/clients/types.d.ts +0 -60
- package/dist/core/src/clients/types.js +0 -1
- package/dist/core/src/clients.d.ts +0 -5
- package/dist/core/src/clients.js +0 -11
- package/dist/core/src/communities.d.ts +0 -52
- package/dist/core/src/communities.js +0 -73
- package/dist/core/src/config/ContractConfigManager.d.ts +0 -20
- package/dist/core/src/config/ContractConfigManager.js +0 -48
- package/dist/core/src/constants.d.ts +0 -88
- package/dist/core/src/constants.js +0 -125
- package/dist/core/src/contract-addresses.d.ts +0 -110
- package/dist/core/src/contract-addresses.js +0 -99
- package/dist/core/src/contracts.d.ts +0 -424
- package/dist/core/src/contracts.js +0 -343
- package/dist/core/src/crypto/blsSigner.d.ts +0 -64
- package/dist/core/src/crypto/blsSigner.js +0 -98
- package/dist/core/src/crypto/index.js +0 -1
- package/dist/core/src/index.d.ts +0 -21
- package/dist/core/src/index.js +0 -21
- package/dist/core/src/networks.d.ts +0 -127
- package/dist/core/src/networks.js +0 -118
- package/dist/core/src/requirementChecker.d.ts +0 -38
- package/dist/core/src/requirementChecker.js +0 -139
- package/dist/core/src/roles.d.ts +0 -204
- package/dist/core/src/roles.js +0 -211
- package/dist/core/src/utils/validation.d.ts +0 -24
- package/dist/core/src/utils/validation.js +0 -56
- package/dist/dapp/src/index.d.ts +0 -3
- package/dist/dapp/src/index.js +0 -3
- package/dist/dapp/src/ui/hooks/useCreditScore.d.ts +0 -13
- package/dist/dapp/src/ui/hooks/useCreditScore.js +0 -32
- package/dist/dapp/src/ui/hooks/useSuperPaymaster.d.ts +0 -8
- package/dist/dapp/src/ui/hooks/useSuperPaymaster.js +0 -23
- package/dist/dapp/src/ui/index.d.ts +0 -4
- package/dist/dapp/src/ui/index.js +0 -17
- package/dist/identity/src/index.d.ts +0 -46
- package/dist/identity/src/index.js +0 -94
- package/dist/identity/src/mysbt.d.ts +0 -13
- package/dist/identity/src/mysbt.js +0 -37
- package/dist/paymaster/src/SuperPaymaster/index.d.ts +0 -44
- package/dist/paymaster/src/SuperPaymaster/index.js +0 -133
- package/dist/paymaster/src/V4/PaymasterClient.d.ts +0 -79
- package/dist/paymaster/src/V4/PaymasterClient.js +0 -315
- package/dist/paymaster/src/V4/PaymasterOperator.d.ts +0 -41
- package/dist/paymaster/src/V4/PaymasterOperator.js +0 -241
- package/dist/paymaster/src/V4/PaymasterUtils.d.ts +0 -55
- package/dist/paymaster/src/V4/PaymasterUtils.js +0 -124
- package/dist/paymaster/src/V4/SuperPaymasterClient.d.ts +0 -21
- package/dist/paymaster/src/V4/SuperPaymasterClient.js +0 -73
- package/dist/paymaster/src/V4/index.js +0 -4
- package/dist/paymaster/src/index.d.ts +0 -2
- package/dist/paymaster/src/index.js +0 -4
- package/dist/sdk/src/clients/ExperimentClient.d.ts +0 -34
- package/dist/sdk/src/clients/ExperimentClient.js +0 -58
- package/dist/sdk/src/clients/ExperimentClient.test.d.ts +0 -1
- package/dist/sdk/src/clients/ExperimentClient.test.js +0 -53
- package/dist/sdk/src/clients/admin.d.ts +0 -57
- package/dist/sdk/src/clients/admin.js +0 -105
- package/dist/sdk/src/clients/admin.test.d.ts +0 -1
- package/dist/sdk/src/clients/admin.test.js +0 -79
- package/dist/sdk/src/clients/clients.test.d.ts +0 -1
- package/dist/sdk/src/clients/clients.test.js +0 -91
- package/dist/sdk/src/clients/community.d.ts +0 -48
- package/dist/sdk/src/clients/community.js +0 -244
- package/dist/sdk/src/clients/community.test.d.ts +0 -1
- package/dist/sdk/src/clients/community.test.js +0 -99
- package/dist/sdk/src/clients/endUser.d.ts +0 -95
- package/dist/sdk/src/clients/endUser.js +0 -388
- package/dist/sdk/src/clients/endUser.test.d.ts +0 -1
- package/dist/sdk/src/clients/endUser.test.js +0 -188
- package/dist/sdk/src/clients/operator.d.ts +0 -96
- package/dist/sdk/src/clients/operator.js +0 -247
- package/dist/sdk/src/clients/operator.test.d.ts +0 -1
- package/dist/sdk/src/clients/operator.test.js +0 -139
- package/dist/sdk/src/errors/AAStarError.d.ts +0 -26
- package/dist/sdk/src/errors/AAStarError.js +0 -32
- package/dist/sdk/src/errors/AAStarError.test.d.ts +0 -1
- package/dist/sdk/src/errors/AAStarError.test.js +0 -74
- package/dist/sdk/src/errors/decoder.d.ts +0 -1
- package/dist/sdk/src/errors/decoder.js +0 -83
- package/dist/sdk/src/errors/decoder.test.d.ts +0 -1
- package/dist/sdk/src/errors/decoder.test.js +0 -90
- package/dist/sdk/src/index.d.ts +0 -16
- package/dist/sdk/src/index.js +0 -20
- package/dist/sdk/src/node/index.d.ts +0 -7
- package/dist/sdk/src/node/index.js +0 -7
- package/dist/sdk/src/types/result.d.ts +0 -15
- package/dist/sdk/src/types/result.js +0 -23
- package/dist/sdk/src/utils/errorHandler.d.ts +0 -40
- package/dist/sdk/src/utils/errorHandler.js +0 -114
- package/dist/sdk/src/utils/errorHandler.test.d.ts +0 -1
- package/dist/sdk/src/utils/errorHandler.test.js +0 -89
- package/dist/sdk/src/utils/eventDecoder.d.ts +0 -7
- package/dist/sdk/src/utils/eventDecoder.js +0 -54
- package/dist/sdk/src/utils/eventDecoder.test.d.ts +0 -1
- package/dist/sdk/src/utils/eventDecoder.test.js +0 -48
- package/dist/sdk/src/utils/funding.d.ts +0 -115
- package/dist/sdk/src/utils/funding.js +0 -188
- package/dist/sdk/src/utils/funding.test.d.ts +0 -1
- package/dist/sdk/src/utils/funding.test.js +0 -105
- package/dist/sdk/src/utils/keys.d.ts +0 -73
- package/dist/sdk/src/utils/keys.js +0 -137
- package/dist/sdk/src/utils/keys.test.d.ts +0 -1
- package/dist/sdk/src/utils/keys.test.js +0 -81
- package/dist/sdk/src/utils/roleData.d.ts +0 -66
- package/dist/sdk/src/utils/roleData.js +0 -115
- package/dist/sdk/src/utils/roleData.test.d.ts +0 -1
- package/dist/sdk/src/utils/roleData.test.js +0 -74
- package/dist/sdk/src/utils/testScenarios.d.ts +0 -33
- package/dist/sdk/src/utils/testScenarios.js +0 -85
- package/dist/sdk/src/utils/testScenarios.test.d.ts +0 -1
- package/dist/sdk/src/utils/testScenarios.test.js +0 -68
- package/dist/sdk/src/utils/userOp.d.ts +0 -78
- package/dist/sdk/src/utils/userOp.js +0 -195
- package/dist/sdk/src/utils/userOp.test.d.ts +0 -1
- package/dist/sdk/src/utils/userOp.test.js +0 -152
- package/dist/tokens/src/index.d.ts +0 -56
- package/dist/tokens/src/index.js +0 -230
- package/examples/regression_test.d.ts +0 -2
- package/examples/regression_test.d.ts.map +0 -1
- package/examples/regression_test.js +0 -89
- package/examples/regression_test.js.map +0 -1
- /package/{dist/core/src/crypto/index.d.ts โ packages/core/src/crypto/index.ts} +0 -0
- /package/{dist/paymaster/src/V4/index.d.ts โ packages/paymaster/src/V4/index.ts} +0 -0
- /package/{examples โ packages/sdk/examples}/config.json +0 -0
- /package/{examples โ packages/sdk/examples}/regression_test.ts +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createWalletClient, http, parseEther } from 'viem';
|
|
2
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import { sepolia } from 'viem/chains';
|
|
4
|
+
import { CommunityClient } from '@aastar/sdk'; // Should be available now via re-export
|
|
5
|
+
import dotenv from 'dotenv';
|
|
6
|
+
|
|
7
|
+
dotenv.config();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* L3 Scenario: Community Launch
|
|
11
|
+
*
|
|
12
|
+
* Demonstrates how to create a new community using the CommunityClient.
|
|
13
|
+
*/
|
|
14
|
+
async function main() {
|
|
15
|
+
// 1. Setup User
|
|
16
|
+
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
17
|
+
const wallet = createWalletClient({
|
|
18
|
+
account,
|
|
19
|
+
chain: sepolia,
|
|
20
|
+
transport: http(process.env.RPC_URL)
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
console.log(`\n๐ Starting Community Launch for ${account.address}...`);
|
|
24
|
+
|
|
25
|
+
// 2. Initialize CommunityClient (New Architecture)
|
|
26
|
+
const communityClient = new CommunityClient(wallet as any, {
|
|
27
|
+
registryAddress: process.env.REGISTRY_ADDRESS as `0x${string}`,
|
|
28
|
+
xPNTsFactoryAddress: process.env.XPNTS_FACTORY_ADDRESS as `0x${string}`,
|
|
29
|
+
reputationAddress: process.env.REPUTATION_ADDRESS as `0x${string}`
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 3. Launch Community
|
|
33
|
+
console.log('\n๐๏ธ Launching Community "ExampleDAO"...');
|
|
34
|
+
|
|
35
|
+
// Note: Real deployment would require careful gas management if on mainnet
|
|
36
|
+
const result = await communityClient.deployCommunity({
|
|
37
|
+
name: 'ExampleDAO',
|
|
38
|
+
tokenName: 'ExampleToken',
|
|
39
|
+
tokenSymbol: 'EXT',
|
|
40
|
+
initialSupply: parseEther('1000000'),
|
|
41
|
+
minStake: parseEther('100')
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
console.log(` โ
Community Launched!`);
|
|
45
|
+
console.log(` - Community Address: ${result.communityAddress}`);
|
|
46
|
+
console.log(` - Token Address: ${result.tokenAddress}`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createWalletClient, http, parseEther } from 'viem';
|
|
2
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import { sepolia } from 'viem/chains';
|
|
4
|
+
import { UserClient } from '@aastar/sdk'; // Should be available now via re-export
|
|
5
|
+
import dotenv from 'dotenv';
|
|
6
|
+
|
|
7
|
+
dotenv.config();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* L3 Scenario: User Onboarding
|
|
11
|
+
*
|
|
12
|
+
* Demonstrates how a new user interacts with the system:
|
|
13
|
+
* 1. Checks credit score (SBT)
|
|
14
|
+
* 2. Mints an SBT if eligible
|
|
15
|
+
* 3. Claims initial reputation
|
|
16
|
+
*/
|
|
17
|
+
async function main() {
|
|
18
|
+
// 1. Setup User
|
|
19
|
+
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
|
20
|
+
const wallet = createWalletClient({
|
|
21
|
+
account,
|
|
22
|
+
chain: sepolia,
|
|
23
|
+
transport: http(process.env.RPC_URL)
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
console.log(`\n๐ Starting User Onboarding for ${account.address}...`);
|
|
27
|
+
|
|
28
|
+
// 2. Initialize UserClient (New Architecture)
|
|
29
|
+
// Note: In a real app, addresses would come from config or discovery
|
|
30
|
+
const userClient = new UserClient(wallet as any, {
|
|
31
|
+
registryAddress: process.env.REGISTRY_ADDRESS as `0x${string}`,
|
|
32
|
+
sbtAddress: process.env.SBT_ADDRESS as `0x${string}`,
|
|
33
|
+
reputationAddress: process.env.REPUTATION_ADDRESS as `0x${string}`
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// 3. Check SBT Status
|
|
37
|
+
console.log('\n๐ Checking SBT Status...');
|
|
38
|
+
const hasSBT = await userClient.hasSBT(account.address);
|
|
39
|
+
console.log(` - Has SBT: ${hasSBT}`);
|
|
40
|
+
|
|
41
|
+
if (!hasSBT) {
|
|
42
|
+
console.log(' - Minting SBT...');
|
|
43
|
+
const tx = await userClient.mintSBT();
|
|
44
|
+
console.log(` โ
SBT Minted! Tx: ${tx}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 4. Check Reputation
|
|
48
|
+
console.log('\nโญ Checking Reputation...');
|
|
49
|
+
const score = await userClient.getReputationScore(account.address);
|
|
50
|
+
// reputation score is bigint, convert to string for display
|
|
51
|
+
console.log(` - Current Score: ${score.toString()}`);
|
|
52
|
+
|
|
53
|
+
console.log('\nโ
User Onboarding Complete!');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createPublicClient, createWalletClient, http, parseEther, type Address } from 'viem';
|
|
2
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import { sepolia } from 'viem/chains';
|
|
4
|
+
import { PaymasterClient, PaymasterOperator } from '../packages/paymaster/src/V4/index.js';
|
|
5
|
+
import { loadNetworkConfig } from '../tests/regression/config.js';
|
|
6
|
+
import * as dotenv from 'dotenv';
|
|
7
|
+
|
|
8
|
+
dotenv.config({ path: '.env.sepolia' });
|
|
9
|
+
|
|
10
|
+
async function main() {
|
|
11
|
+
console.log('๐ ๏ธ Preparing Gasless Environment...');
|
|
12
|
+
|
|
13
|
+
// 0. Load Config & Operator Account (Anni)
|
|
14
|
+
const config = await loadNetworkConfig('sepolia');
|
|
15
|
+
const rpcUrl = process.env.RPC_URL || 'https://eth-sepolia.g.alchemy.com/v2/your-key';
|
|
16
|
+
const anniAccount = privateKeyToAccount(process.env.PRIVATE_KEY_ANNI as `0x${string}`);
|
|
17
|
+
const client = createPublicClient({ chain: sepolia, transport: http(rpcUrl) });
|
|
18
|
+
const operatorWallet = createWalletClient({ account: anniAccount, chain: sepolia, transport: http(rpcUrl) });
|
|
19
|
+
|
|
20
|
+
const APP_CONFIG = {
|
|
21
|
+
paymaster: '0x82862b7c3586372DF1c80Ac60adA57e530b0eB82' as Address, // Anni PM
|
|
22
|
+
gasToken: '0x424DA26B172994f98D761a999fa2FD744CaF812b' as Address, // dPNTs
|
|
23
|
+
aaAccount: '0xECD9C07f648B09CFb78906302822Ec52Ab87dd70' as Address, // Jason AA1
|
|
24
|
+
entryPoint: config.contracts.entryPoint as Address
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
console.log(`Operator: ${anniAccount.address}`);
|
|
28
|
+
console.log(`Paymaster: ${APP_CONFIG.paymaster}`);
|
|
29
|
+
console.log(`Target App User: ${APP_CONFIG.aaAccount}`);
|
|
30
|
+
|
|
31
|
+
// 1. Diagnose
|
|
32
|
+
console.log('\n๐ Check 1: Diagnosing SDK Readiness...');
|
|
33
|
+
const report = await PaymasterOperator.checkGaslessReadiness(
|
|
34
|
+
client,
|
|
35
|
+
APP_CONFIG.entryPoint,
|
|
36
|
+
APP_CONFIG.paymaster,
|
|
37
|
+
APP_CONFIG.aaAccount,
|
|
38
|
+
APP_CONFIG.gasToken
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
if (report.isReady) {
|
|
42
|
+
console.log('โ
Environment is READY. You can run the simple demo now!');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 2. Auto-Heal
|
|
47
|
+
console.log('โ ๏ธ Environment Not Ready. Fixing...');
|
|
48
|
+
console.log('Issues:', report.issues);
|
|
49
|
+
|
|
50
|
+
const steps = await PaymasterOperator.prepareGaslessEnvironment(
|
|
51
|
+
operatorWallet,
|
|
52
|
+
client,
|
|
53
|
+
APP_CONFIG.entryPoint,
|
|
54
|
+
APP_CONFIG.paymaster,
|
|
55
|
+
APP_CONFIG.gasToken,
|
|
56
|
+
{ tokenPriceUSD: 100000000n } // $1.00 USD
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
for (const s of steps) {
|
|
60
|
+
console.log(` ๐ Executing: ${s.step}...`);
|
|
61
|
+
console.log(` Hash: ${s.hash}`);
|
|
62
|
+
await client.waitForTransactionReceipt({ hash: s.hash as `0x${string}` });
|
|
63
|
+
console.log(' โ
Confirmed.');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 3. User Deposit Check (Optional Seeding)
|
|
67
|
+
const userDeposit = await PaymasterClient.getDepositedBalance(client, APP_CONFIG.paymaster, APP_CONFIG.aaAccount, APP_CONFIG.gasToken);
|
|
68
|
+
if (userDeposit < parseEther('50')) {
|
|
69
|
+
console.log(`\n๐ฆ Seeding User Deposit (Current: ${userDeposit})...`);
|
|
70
|
+
|
|
71
|
+
// Approve
|
|
72
|
+
const hashApprove = await PaymasterClient.approveGasToken(
|
|
73
|
+
operatorWallet,
|
|
74
|
+
APP_CONFIG.gasToken,
|
|
75
|
+
APP_CONFIG.paymaster,
|
|
76
|
+
parseEther('100')
|
|
77
|
+
);
|
|
78
|
+
await client.waitForTransactionReceipt({ hash: hashApprove });
|
|
79
|
+
|
|
80
|
+
// Deposit
|
|
81
|
+
const hashDep = await PaymasterClient.depositFor(operatorWallet, APP_CONFIG.paymaster, APP_CONFIG.aaAccount, APP_CONFIG.gasToken, parseEther('50'));
|
|
82
|
+
await client.waitForTransactionReceipt({ hash: hashDep as `0x${string}` });
|
|
83
|
+
console.log(' โ
Seeded 50 dPNTs.');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
console.log('\n๐ ALL SET! Run `npx tsx examples/simple-gasless-demo.ts` now.');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# AAStar SDK Developer Integration Guide (Bilingual)
|
|
2
|
+
# AAStar SDK ๅผๅ่
้ๆๆๅ (ไธญ่ฑๅ่ฏญ)
|
|
3
|
+
|
|
4
|
+
This guide provides a comprehensive "How-To" map for developers building on the AAStar ecosystem. We break down complex business scenes into intuitive SDK integration patterns.
|
|
5
|
+
|
|
6
|
+
ๆฌๆๅไธบๅบไบ AAStar ็ๆๆๅปบ็ๅผๅ่
ๆไพไบๅ
จ้ข็โๅฆไฝๅโๅฐๅพใๆไปฌๅฐๅคๆ็ไธๅกๅบๆฏๆ่งฃไธบ็ด่ง็ SDK ้ๆๆจกๅผใ
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ๐ Scene A: Registry & Identity ็ฎกๅฎถ๏ผ่บซไปฝไธ็ปไธๆณจๅ
|
|
11
|
+
*The orchestrator for all roles and permissions.*
|
|
12
|
+
*ๆๆ่ง่ฒๅๆ้็็ผๆๆ ธๅฟใ*
|
|
13
|
+
|
|
14
|
+
### 1. How to register a new Community? / ๅฆไฝๆณจๅไธไธชๆฐ็คพๅบ๏ผ
|
|
15
|
+
> **Story**: As a developer, I want to onboard a new DAO or project into the ecosystem.
|
|
16
|
+
> **่ฏๆฑ**: ไฝไธบไธไธชๅผๅ่
๏ผๆๅธๆๅฐไธไธชๆฐ็ DAO ๆ้กน็ฎๅผๅ
ฅ็ๆ็ณป็ปใ
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { RegistryClient } from '@aastar/registry';
|
|
20
|
+
|
|
21
|
+
// One-stop registration: Handles role binding and profile metadata
|
|
22
|
+
// ไธ็ซๅผๆณจๅ๏ผๅค็่ง่ฒ็ปๅฎๅไธชไบบ่ตๆๅ
ๆฐๆฎ
|
|
23
|
+
const tx = await RegistryClient.registerCommunity(walletClient, REGISTRY_ADDR, {
|
|
24
|
+
name: "My Awesome DAO",
|
|
25
|
+
ensName: "awesome.eth",
|
|
26
|
+
website: "https://awesome.dao",
|
|
27
|
+
description: "A community for builders",
|
|
28
|
+
logoURI: "ipfs://...",
|
|
29
|
+
stakeAmount: parseEther("100") // Required GToken stake
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. How to register an EndUser? / ๅฆไฝๆณจๅ็ป็ซฏ็จๆท๏ผ
|
|
34
|
+
> **Story**: I want to link a user to a specific community and mint their identity SBT.
|
|
35
|
+
> **่ฏๆฑ**: ๆๅธๆๅฐ็จๆท้พๆฅๅฐ็นๅฎ็คพๅบๅนถ้ธ้ ๅ
ถ่บซไปฝ SBTใ
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
const tx = await RegistryClient.registerEndUser(walletClient, REGISTRY_ADDR, {
|
|
39
|
+
account: userAddress,
|
|
40
|
+
community: communityAddress,
|
|
41
|
+
avatarURI: "ipfs://...",
|
|
42
|
+
ensName: "user.awesome.eth",
|
|
43
|
+
stakeAmount: 0n // Basic users might not need stake
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## โก Scene B: SuperPaymaster & Sponsorship ไธญ้ดไปถ๏ผๅ
Gas ่ตๅฉ
|
|
50
|
+
*The gasless experience for Smart Accounts.*
|
|
51
|
+
*ๆบ่ฝ่ดฆๆท็ๅ
Gas ไฝ้ชใ*
|
|
52
|
+
|
|
53
|
+
### 1. How to register a Paymaster Operator? / ๅฆไฝๆณจๅ Paymaster ่ฟ่ฅๅ๏ผ
|
|
54
|
+
> **Story**: I want to start a service that sponsors gas for users in exchange for fees.
|
|
55
|
+
> **่ฏๆฑ**: ๆๅธๆๅปบ็ซไธไธชๆๅก๏ผ้่ฟๆถๅ่ดน็จๆฅไธบ็จๆท่ตๅฉ Gasใ
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { RegistryClient, ROLES } from '@aastar/registry';
|
|
59
|
+
import { SuperPaymasterClient } from '@aastar/superpaymaster';
|
|
60
|
+
|
|
61
|
+
// 1. Bind Role in Registry / ๅจๆณจๅ่กจไธญ็ปๅฎ่ง่ฒ
|
|
62
|
+
await RegistryClient.registerRole(walletClient, REGISTRY_ADDR, ROLES.PAYMASTER_SUPER, operatorAddr, "0x");
|
|
63
|
+
|
|
64
|
+
// 2. Configure Operator Settings / ้
็ฝฎ่ฟ่ฅๅ่ฎพ็ฝฎ
|
|
65
|
+
await SuperPaymasterClient.configureOperator(walletClient, SUPER_PM_ADDR,
|
|
66
|
+
tokenAddr, // Allowed payment token (e.g., USDT)
|
|
67
|
+
treasuryAddr, // Where fees are sent
|
|
68
|
+
1000000n // Exchange rate (Token/ETH)
|
|
69
|
+
);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 2. How to sponsor a UserOperation in a DApp? / ๅฆไฝๅจ DApp ไธญ่ตๅฉ UserOp๏ผ
|
|
73
|
+
> **Story**: In my frontend, I want to generate the `paymasterAndData` for a gasless transaction.
|
|
74
|
+
> **่ฏๆฑ**: ๅจๆ็ๅ็ซฏ๏ผๆๅธๆไธบๅ
Gas ไบคๆ็ๆ `paymasterAndData`ใ
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { getPaymasterMiddleware } from '@aastar/superpaymaster';
|
|
78
|
+
|
|
79
|
+
const middleware = getPaymasterMiddleware({
|
|
80
|
+
paymasterAddress: SUPER_PM_ADDR,
|
|
81
|
+
operator: operatorAddress
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const { paymasterAndData } = await middleware.sponsorUserOperation({ userOperation });
|
|
85
|
+
// Now inject this into your UserOp before signing
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## ๐ซ Scene C: Tokens & Community Assets ่ตไบง๏ผSBT ไธไปฃๅธ
|
|
91
|
+
*Managing identity and incentivization.*
|
|
92
|
+
*็ฎก็่บซไปฝไธๆฟๅฑใ*
|
|
93
|
+
|
|
94
|
+
### 1. How to airdrop SBTs to eligible users? / ๅฆไฝ็ปๅ่ง็จๆท็ฉบๆ SBT๏ผ
|
|
95
|
+
> **Story**: I want to reward active contributors with a non-transferable badge.
|
|
96
|
+
> **่ฏๆฑ**: ๆๅธๆๅฅๅฑๆดป่ท่ดก็ฎ่
ไธไธชไธๅฏ่ฝฌ่ฎฉ็ๅ็ซ ใ
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import { TokensClient } from '@aastar/tokens';
|
|
100
|
+
|
|
101
|
+
// High-level: Check eligibility logic then mint
|
|
102
|
+
// ้ซ็บงๅฑ้ข๏ผๆฃๆฅๅ่ง้ป่พๅ้ธ้
|
|
103
|
+
if (isEligible) {
|
|
104
|
+
await TokensClient.mintSBT(walletClient, MY_SBT_ADDR, userAddress, {
|
|
105
|
+
role: ROLES.ENDUSER,
|
|
106
|
+
metadataURI: "ipfs://badge-data"
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 2. How to provide self-service SBT minting? / ๅฆไฝๆไพ่ชๅฉๅผ SBT ้ขๅ๏ผ
|
|
112
|
+
> **Story**: Users pay GTokens -> get xPNTs -> mint SBT automatically.
|
|
113
|
+
> **่ฏๆฑ**: ็จๆทๆฏไป GToken -> ่ทๅ xPNT -> ่ชๅจ้ธ้ SBTใ
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// Sequence / ๆต็จ:
|
|
117
|
+
// 1. Approve GToken / ๆๆ GToken
|
|
118
|
+
await ERC20Client.approve(walletClient, GTOKEN_ADDR, CONVERTER_ADDR, amount);
|
|
119
|
+
|
|
120
|
+
// 2. Wrap GToken to xPNTs / ๅฐ GToken ๅ
่ฃ
ไธบ xPNT
|
|
121
|
+
await FinanceClient.wrapGTokenToXPNTs(walletClient, CONVERTER_ADDR, GTOKEN_ADDR, amount);
|
|
122
|
+
|
|
123
|
+
// 3. Register Role (This triggers SBT minting in V3) / ๆณจๅ่ง่ฒ๏ผV3ไธญไผ่งฆๅ SBT ้ธ้ ๏ผ
|
|
124
|
+
await RegistryClient.registerEndUser(...);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## ๐ฐ Scene D: Finance & Staking ็ปๆต๏ผ่ดจๆผไธๆต่ฝฌ
|
|
130
|
+
*Security through economic alignment.*
|
|
131
|
+
*้่ฟ็ปๆตไธ่ดๆงไฟ้ๅฎๅ
จใ*
|
|
132
|
+
|
|
133
|
+
### 1. How to provide collateral for a Community? / ๅฆไฝไธบ็คพๅบ็ผด็บณ่ดจๆผ้๏ผ
|
|
134
|
+
> **Story**: A community owner needs to deposit GTokens to unlock high-tier features.
|
|
135
|
+
> **่ฏๆฑ**: ็คพๅบๆๆ่
้่ฆๅญๅ
ฅ GToken ไปฅ่งฃ้้ซ็บงๅ่ฝใ
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
import { FinanceClient } from '@aastar/finance';
|
|
139
|
+
|
|
140
|
+
// Using the 1363 "TransferAndCall" pattern for zero-approval UX
|
|
141
|
+
// ไฝฟ็จ 1363 "TransferAndCall" ๆจกๅผๅฎ็ฐ้ถๆๆไบคไบ
|
|
142
|
+
await FinanceClient.depositViaTransferAndCall(walletClient, GTOKEN_ADDR, REGISTRY_ADDR, amount);
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## ๐ Summary of 72 Scenarios / 72 ไธชๅบๆฏๆป็ป
|
|
148
|
+
While AAStar supports 72 discrete business scenarios (e.g., "KMS Migration", "Anode Penalties"), they all use the **Building Blocks** above.
|
|
149
|
+
AAStar ๆฏๆ 72 ไธช็ฆปๆฃไธๅกๅบๆฏ๏ผๅฆโKMS ่ฟ็งปโใโAnode ๆฉ็ฝโ๏ผ๏ผไฝๅฎไปฌ้ฝไฝฟ็จไบไธ่ฟฐ**ๆๅปบๅ**ใ
|
|
150
|
+
|
|
151
|
+
| Scene Category | Core SDK Module | Primary Client Action |
|
|
152
|
+
| :--- | :--- | :--- |
|
|
153
|
+
| **Governance** | `@aastar/registry` | `registerRole`, `createNewRole` |
|
|
154
|
+
| **Monetization** | `@aastar/superpaymaster` | `configureOperator`, `deposit` |
|
|
155
|
+
| **Loyalty** | `@aastar/tokens` | `mintXPNTs`, `isSBTActive` |
|
|
156
|
+
| **Collateral** | `@aastar/finance` | `stakeGToken`, `depositToEP` |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
*ๅฉๅ Stage 2 ็ป็ฎไธ Phase 1-3 ้กบๅฉๆจ่ฟใ*
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# AAStar SDK Usage Demo
|
|
2
|
+
|
|
3
|
+
This folder contains a comprehensive demonstration of the **AAStar SDK** modular architecture (v0.x - v1.0).
|
|
4
|
+
|
|
5
|
+
## ๐ Folder Structure
|
|
6
|
+
- `usage.ts`: The main demo script with detailed comments for each module.
|
|
7
|
+
- `DEVELOPER_GUIDE.md`: **[New]** Comprehensive "How-To" patterns for 72+ business scenarios (Bilingual).
|
|
8
|
+
|
|
9
|
+
## ๐ How to Use
|
|
10
|
+
This demo assumes you are in a TypeScript environment with the AAStar SDK installed (or referenced via workspace).
|
|
11
|
+
|
|
12
|
+
### Prerequisites
|
|
13
|
+
- Node.js (v18+)
|
|
14
|
+
- `pnpm` (Workspace managed)
|
|
15
|
+
|
|
16
|
+
### Usage Patterns
|
|
17
|
+
The demo covers:
|
|
18
|
+
1. **Core Layer**: Using standard Clients and ABIs.
|
|
19
|
+
2. **Identity & Roles**: Verifying roles via Registry and SBTs.
|
|
20
|
+
3. **Smart Account Middleware**: Integrating SuperPaymaster for gasless transactions.
|
|
21
|
+
4. **Asset Management**: Handling xPNTs and MySBT tokens.
|
|
22
|
+
5. **Finance & Staking**: Managing collateral and paymaster deposits.
|
|
23
|
+
|
|
24
|
+
## ๐ Key Concepts
|
|
25
|
+
- **Modular Imports**: Each feature is isolated in its own package (e.g., `@aastar/registry`).
|
|
26
|
+
- **One-Stop Helpers**: High-level static methods for complex flows like Community Registration.
|
|
27
|
+
- **Viem Powered**: Built on top of the performant and type-safe Viem library.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
*ๅฉๅ Stage 2 ็ป็ฎไธ Phase 1-3 ้กบๅฉๆจ่ฟใ*
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { createPublicClient, createWalletClient, http, parseEther, type Hex, type Address } from 'viem';
|
|
2
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
import { foundry } from 'viem/chains';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AAStar SDK Modular Usage Demo (v0.4.x - v1.0.x)
|
|
7
|
+
*
|
|
8
|
+
* This script demonstrates how to use the various modules of the AAStar SDK.
|
|
9
|
+
* The SDK is split into several packages to support different roles:
|
|
10
|
+
* - @aastar/core: Foundational clients and ABIs.
|
|
11
|
+
* - @aastar/superpaymaster: Smart Account middleware for gas sponsorship.
|
|
12
|
+
* - @aastar/finance: Staking, funding, and collateral management.
|
|
13
|
+
* - @aastar/registry: Identity, roles (SBT), and credit limit orchestration.
|
|
14
|
+
* - @aastar/tokens: ERC20 (xPNTs) and SBT (MySBT) asset management.
|
|
15
|
+
* - @aastar/aa: UserOperation construction and bundler helpers.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// 1. Import Clients from Modular Packages
|
|
19
|
+
import { createAAStarPublicClient } from '../../packages/core/src/index.ts';
|
|
20
|
+
import { SuperPaymasterClient } from '../../packages/superpaymaster/src/index.ts';
|
|
21
|
+
import { RegistryClient, ROLES } from '../../packages/registry/src/index.ts';
|
|
22
|
+
import { ERC20Client } from '../../packages/tokens/src/index.ts';
|
|
23
|
+
import { FinanceClient } from '../../packages/finance/src/index.ts';
|
|
24
|
+
import { UserOpClient } from '../../packages/aa/src/index.ts';
|
|
25
|
+
|
|
26
|
+
async function main() {
|
|
27
|
+
// Basic Configuration (Mocked/Env-based)
|
|
28
|
+
const RPC_URL = "http://127.0.0.1:8545";
|
|
29
|
+
const REGISTRY_ADDR = "0x..." as Address;
|
|
30
|
+
const SUPER_PM_ADDR = "0x..." as Address;
|
|
31
|
+
const XPNTs_TOKEN = "0x..." as Address;
|
|
32
|
+
const PRIVATE_KEY = "0x..." as Hex;
|
|
33
|
+
|
|
34
|
+
// --- Foundational Layer (@aastar/core) ---
|
|
35
|
+
// Use standard utility clients for consistent blockchain interaction.
|
|
36
|
+
const publicClient = createAAStarPublicClient({ chain: foundry, rpcUrl: RPC_URL });
|
|
37
|
+
const account = privateKeyToAccount(PRIVATE_KEY);
|
|
38
|
+
const walletClient = createWalletClient({
|
|
39
|
+
account,
|
|
40
|
+
chain: foundry,
|
|
41
|
+
transport: http(RPC_URL)
|
|
42
|
+
});
|
|
43
|
+
console.log(`Wallet Client initialized for: ${walletClient.account.address}`);
|
|
44
|
+
|
|
45
|
+
console.log("--- 1. Identity & Roles (@aastar/registry) ---");
|
|
46
|
+
const regClient = new RegistryClient(publicClient, REGISTRY_ADDR);
|
|
47
|
+
|
|
48
|
+
// Check if the current user has the ENDUSER role (Identity verification via SBT)
|
|
49
|
+
const isUser = await regClient.hasRole(ROLES.ENDUSER, account.address);
|
|
50
|
+
console.log(`User has Identity SBT: ${isUser}`);
|
|
51
|
+
|
|
52
|
+
// High-level "One-stop" registration for a Community (v1.0.x feature)
|
|
53
|
+
// This handles staking + metadata encoding + role binding in one call.
|
|
54
|
+
/*
|
|
55
|
+
const hash = await RegistryClient.registerCommunity(walletClient, REGISTRY_ADDR, {
|
|
56
|
+
name: "My Community",
|
|
57
|
+
ensName: "my.mycelium.eth",
|
|
58
|
+
website: "https://mycelium.xyz",
|
|
59
|
+
description: "A decentralized research hub",
|
|
60
|
+
logoURI: "ipfs://...",
|
|
61
|
+
stakeAmount: parseEther("100")
|
|
62
|
+
});
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
console.log("\n--- 2. Sponsorship Middleware (@aastar/superpaymaster) ---");
|
|
66
|
+
const pmClient = new SuperPaymasterClient(publicClient, SUPER_PM_ADDR);
|
|
67
|
+
|
|
68
|
+
// Get Operator configuration for the current admin
|
|
69
|
+
const opData = await pmClient.getOperator(account.address);
|
|
70
|
+
// opData returns: [xPNTsToken, isConfigured, isPaused, treasury, rate, balance, ...]
|
|
71
|
+
console.log(`Operator Configured: ${opData[1]}, aPNTs Balance: ${opData[5]}`);
|
|
72
|
+
|
|
73
|
+
// Usage in a Smart Account (e.g. Kernel/SimpleAccount)
|
|
74
|
+
// The middleware automatically calculates paymasterData based on our Hybrid model.
|
|
75
|
+
/*
|
|
76
|
+
const saMiddleware = pmClient.getPaymasterMiddleware(account.address);
|
|
77
|
+
const userOp = await createMyUserOp({ ... });
|
|
78
|
+
const sponsoredUserOp = await saMiddleware(userOp);
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
console.log("\n--- 3. Asset Management (@aastar/tokens) ---");
|
|
82
|
+
// Interface for interacting with Community Assets (ERC20/SBT)
|
|
83
|
+
const xPNTsBalance = await ERC20Client.balanceOf(publicClient, XPNTs_TOKEN, account.address);
|
|
84
|
+
console.log(`xPNTs Asset Balance: ${xPNTsBalance}`);
|
|
85
|
+
|
|
86
|
+
console.log("\n--- 4. Protocol Finance (@aastar/finance) ---");
|
|
87
|
+
// Handle Staking and Collateral Deposits
|
|
88
|
+
// Supports "Push" pattern (transferAndCall) for better UX/Gas in v1.0
|
|
89
|
+
/*
|
|
90
|
+
const depositTx = await FinanceClient.operatorNotifyDeposit(walletClient, SUPER_PM_ADDR, parseEther("50"));
|
|
91
|
+
console.log(`Deposited 50 Tokens to Paymaster: ${depositTx}`);
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
console.log("\n--- 5. UserOperation Helpers (@aastar/aa) ---");
|
|
95
|
+
// Standardized helpers for estimating and sending UserOps via Bundlers
|
|
96
|
+
// const receipt = await UserOpClient.sendUserOp(BUNDLER_URL, signedUserOp, ENTRYPOINT_ADDR);
|
|
97
|
+
|
|
98
|
+
console.log("\n--- 6. Frontend Integration (@aastar/react) ---");
|
|
99
|
+
// [UI Context]: How to use in a React Component
|
|
100
|
+
/*
|
|
101
|
+
import { useSuperPaymaster, useCreditScore, EvaluationPanel } from '@aastar/react';
|
|
102
|
+
|
|
103
|
+
function MyDApp() {
|
|
104
|
+
const { creditLimit } = useCreditScore({
|
|
105
|
+
chain: sepolia,
|
|
106
|
+
registryAddress: REGISTRY_ADDR,
|
|
107
|
+
userAddress: account.address
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const { generatePaymasterAndData } = useSuperPaymaster({
|
|
111
|
+
paymasterAddress: SUPER_PM_ADDR,
|
|
112
|
+
operator: account.address
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div>
|
|
117
|
+
<EvaluationPanel
|
|
118
|
+
paymasterConfig={{ paymasterAddress: SUPER_PM_ADDR, operator: account.address }}
|
|
119
|
+
userAddress={account.address}
|
|
120
|
+
chain={sepolia}
|
|
121
|
+
registryAddress={REGISTRY_ADDR}
|
|
122
|
+
/>
|
|
123
|
+
<button onClick={async () => {
|
|
124
|
+
const pnd = await generatePaymasterAndData(myUserOp);
|
|
125
|
+
// send userOp with sponsored pnd...
|
|
126
|
+
}}>
|
|
127
|
+
Sponsored Transfer (Credit: {formatEther(creditLimit ?? 0n)})
|
|
128
|
+
</button>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
console.log("\nโ
Demo finished. Individual module documentation can be found in packages/*/README.md");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
main().catch(console.error);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createPublicClient, createWalletClient, http, encodeFunctionData, parseEther, formatEther, createClient } from 'viem';
|
|
2
|
+
import { bundlerActions } from 'viem/account-abstraction';
|
|
3
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
4
|
+
import { sepolia } from 'viem/chains';
|
|
5
|
+
import { PaymasterClient } from '../packages/paymaster/src/V4/index.js';
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { loadNetworkConfig } from '../tests/regression/config.js';
|
|
9
|
+
// dotenv loaded by loadNetworkConfig
|
|
10
|
+
|
|
11
|
+
// ...
|
|
12
|
+
async function main() {
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const networkArgIndex = args.indexOf('--network');
|
|
15
|
+
const networkName = (networkArgIndex >= 0 ? args[networkArgIndex + 1] : 'sepolia') as any;
|
|
16
|
+
const config = await loadNetworkConfig(networkName);
|
|
17
|
+
|
|
18
|
+
const statePath = path.resolve(process.cwd(), 'scripts/l4-state.json');
|
|
19
|
+
let aaAddress = '0xECD9C07f648B09CFb78906302822Ec52Ab87dd70';
|
|
20
|
+
let pmAddress = '0x82862b7c3586372DF1c80Ac60adA57e530b0eB82';
|
|
21
|
+
|
|
22
|
+
if (fs.existsSync(statePath)) {
|
|
23
|
+
const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
|
|
24
|
+
aaAddress = state.aaAccounts?.[0]?.address || aaAddress;
|
|
25
|
+
pmAddress = state.operators?.jason?.paymasterV4 || pmAddress;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const APP_CONFIG = {
|
|
29
|
+
rpcUrl: process.env.RPC_URL || 'https://eth-sepolia.g.alchemy.com/v2/your-key',
|
|
30
|
+
bundlerUrl: config.bundlerUrl!,
|
|
31
|
+
entryPoint: config.contracts.entryPoint,
|
|
32
|
+
paymaster: pmAddress,
|
|
33
|
+
gasToken: config.contracts.aPNTs,
|
|
34
|
+
aaAccount: aaAddress
|
|
35
|
+
};
|
|
36
|
+
console.log('๐ Developers only need these few lines:');
|
|
37
|
+
|
|
38
|
+
// 1. Setup Client & Wallet
|
|
39
|
+
const account = privateKeyToAccount(process.env.PRIVATE_KEY_JASON as `0x${string}`);
|
|
40
|
+
const wallet = createWalletClient({ account, chain: config.chain, transport: http(APP_CONFIG.rpcUrl) });
|
|
41
|
+
const client = createPublicClient({ chain: config.chain, transport: http(APP_CONFIG.rpcUrl) });
|
|
42
|
+
|
|
43
|
+
// 2. Define Your Action (e.g. Transfer Token)
|
|
44
|
+
// ๐ก New Semantic Helpers: No more raw ABI encoding!
|
|
45
|
+
|
|
46
|
+
// A. Inner Action: Transfer 0.01 dPNTs to Owner
|
|
47
|
+
const innerCall = PaymasterClient.encodeTokenTransfer(account.address, parseEther('0.01'));
|
|
48
|
+
|
|
49
|
+
// B. Outer Action: Execute via AA (SimpleAccount.execute)
|
|
50
|
+
const callData = PaymasterClient.encodeExecution(
|
|
51
|
+
APP_CONFIG.gasToken as `0x${string}`,
|
|
52
|
+
0n,
|
|
53
|
+
innerCall
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// 3. โจ ONE-LINER SUBMISSION โจ
|
|
57
|
+
// (Auto: Gas Estimation, 1.2x Efficiency Guard, Signing, Submission)
|
|
58
|
+
const txHash = await PaymasterClient.submitGaslessUserOperation(
|
|
59
|
+
client,
|
|
60
|
+
wallet,
|
|
61
|
+
APP_CONFIG.aaAccount as `0x${string}`,
|
|
62
|
+
APP_CONFIG.entryPoint as `0x${string}`,
|
|
63
|
+
APP_CONFIG.paymaster as `0x${string}`,
|
|
64
|
+
APP_CONFIG.gasToken as `0x${string}`,
|
|
65
|
+
APP_CONFIG.bundlerUrl,
|
|
66
|
+
callData
|
|
67
|
+
// Gas prices auto-fetched from network if not specified
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
// 4. Wait for Execution (Optional but recommended for confirmation)
|
|
71
|
+
console.log(`\nโณ Waiting for execution...`);
|
|
72
|
+
const bundlerClient = createClient({
|
|
73
|
+
chain: config.chain,
|
|
74
|
+
transport: http(APP_CONFIG.bundlerUrl)
|
|
75
|
+
}).extend(bundlerActions);
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
const receipt = await bundlerClient.waitForUserOperationReceipt({
|
|
79
|
+
hash: txHash,
|
|
80
|
+
timeout: 60000 // Increase timeout to 60s
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
console.log(`\n๐ Done! Transaction Hash: ${receipt.receipt.transactionHash}`);
|
|
84
|
+
console.log(`๐ Tracking: https://sepolia.etherscan.io/tx/${receipt.receipt.transactionHash}`);
|
|
85
|
+
|
|
86
|
+
// 5. Decode Protocol Fee (for User Visibility)
|
|
87
|
+
const feeInfo = PaymasterClient.getFeeFromReceipt(receipt.receipt, APP_CONFIG.paymaster as `0x${string}`);
|
|
88
|
+
if (feeInfo) {
|
|
89
|
+
console.log(`\n๐งพ [Instant Bill] Cost: ${formatEther(feeInfo.tokenCost)} dPNTs`);
|
|
90
|
+
console.log(` (Sponsored ETH: ${formatEther(feeInfo.actualGasCostWei)} ETH)`);
|
|
91
|
+
} else {
|
|
92
|
+
console.log('\nโ ๏ธ Could not decode fee from logs.');
|
|
93
|
+
}
|
|
94
|
+
} catch (error: any) {
|
|
95
|
+
if (error.name === 'TimeoutError' || error.message?.includes('timed out')) {
|
|
96
|
+
console.log(`\nโ ๏ธ Polling Timeout: The UserOperation was submitted but the receipt is not yet available.`);
|
|
97
|
+
console.log(`๐ก UserOp Hash: ${txHash}`);
|
|
98
|
+
console.log(`๐ You can check the status later at: https://sepolia.etherscan.io/tx/${txHash}`);
|
|
99
|
+
console.log(` or via Bundler Explorer using the hash above.`);
|
|
100
|
+
} else {
|
|
101
|
+
console.error('\nโ Error waiting for receipt:', error.shortMessage || error.message);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
main().catch(e => {
|
|
107
|
+
console.error(e);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
});
|