@aastar/sdk 0.14.0 → 0.16.6
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/.eslintrc.cjs +30 -0
- package/.gitmodules +9 -0
- package/README.md +299 -0
- 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/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 +1 -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_Change_Tracking_Workflow.md +41 -0
- package/docs/ABI_MAINTENANCE_PLAN.md +132 -0
- package/docs/API_REFERENCE.md +956 -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/Faucet_Gasless_Plan.md +56 -0
- package/docs/L2_BUSINESS_CLIENTS_PLAN.md +394 -0
- package/docs/L4_Manual_Test_CheatSheet.md +215 -0
- package/docs/Plan.md +266 -0
- package/docs/Regression_Testing_Guide.md +70 -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 +663 -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.md +235 -0
- package/docs/api/@aastar/analytics.md +219 -0
- package/docs/api/@aastar/core.md +26830 -0
- package/docs/api/@aastar/dapp.md +130 -0
- package/docs/api/@aastar/identity.md +482 -0
- package/docs/api/@aastar/paymaster.md +1387 -0
- package/docs/api/@aastar/sdk/README.md +155 -0
- package/docs/api/@aastar/sdk/node.md +4044 -0
- package/docs/api/@aastar/tokens.md +1971 -0
- package/docs/api/README.md +10 -0
- package/docs/changelog.md +99 -0
- package/docs/examples/README.md +18 -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/concepts/account-abstraction.md +95 -0
- package/docs/guide/concepts/rainbow-bridge.md +68 -0
- package/docs/guide/concepts/reputation.md +95 -0
- package/docs/guide/concepts/superpaymaster.md +141 -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/guide/use-cases/community-management.md +141 -0
- package/docs/guide/use-cases/gasless-transactions.md +71 -0
- package/docs/guide/use-cases/operator-staking.md +84 -0
- package/docs/guide/use-cases/yop.md +72 -0
- package/docs/old-solution.md +1078 -0
- package/docs/paper-data-collection.md +69 -0
- package/docs/refactor/2026-01-13-221242-trae-refactor.md +224 -0
- package/docs/refactor/2026-01-13-audit-analysis.md +96 -0
- package/docs/refactor/2026-01-13-audit-report-v0.16.2.md +76 -0
- package/docs/refactor/2026-01-13-audit-report-v0.17.0.md +74 -0
- package/docs/refactor/2026-01-13-cursor-refactor.md +511 -0
- package/docs/refactor/2026-01-13-refactor-plan.md +88 -0
- package/docs/refactor/2026-01-13-refactor-response-plan.md +77 -0
- package/docs/refactor/2026-01-13-refactor-review.md +39 -0
- package/docs/refactor/2026-01-13-sdk-enhancement-plan.md +120 -0
- package/docs/refactor/2026-01-14-audit-response.md +242 -0
- package/docs/refactor/2026-01-14-audit-summary.md +133 -0
- package/docs/refactor/cursor-2026-01-13-14-00-audit-report.md +267 -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 +32 -0
- package/examples/l1-api-demo.ts +184 -0
- package/examples/l2-clients-demo.ts +138 -0
- package/examples/l3-user-onboarding.ts +74 -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 +80 -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 +11 -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 +58 -22
- package/packages/account/package.json +23 -0
- package/packages/account/src/accounts/simple.test.ts +93 -0
- package/packages/account/src/accounts/simple.ts +84 -0
- package/packages/account/src/eoa.test.ts +37 -0
- package/packages/account/src/eoa.ts +33 -0
- package/packages/account/src/index.test.ts +34 -0
- package/packages/account/src/index.ts +61 -0
- package/packages/account/tsconfig.json +11 -0
- package/packages/analytics/package.json +28 -0
- package/packages/analytics/src/index.ts +145 -0
- package/packages/analytics/tsconfig.json +11 -0
- package/packages/core/package.json +32 -0
- package/packages/core/scripts/audit-abi-coverage.ts +165 -0
- package/packages/core/scripts/debug-regex.ts +36 -0
- package/packages/core/src/abis/.abi-hashes.json +26 -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/abi.config.json +24 -0
- package/packages/core/src/abis/index.ts +104 -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.test.ts +175 -0
- package/packages/core/src/actions/StateValidator.ts +253 -0
- package/packages/core/src/actions/account.test.ts +155 -0
- package/packages/core/src/actions/account.ts +179 -0
- package/packages/core/src/actions/aggregator.test.ts +88 -0
- package/packages/core/src/actions/aggregator.ts +41 -0
- package/packages/core/src/actions/dvt.test.ts +124 -0
- package/packages/core/src/actions/dvt.ts +53 -0
- package/packages/core/src/actions/entryPoint.test.ts +176 -0
- package/packages/core/src/actions/entryPoint.ts +266 -0
- package/packages/core/src/actions/factory.test.ts +250 -0
- package/packages/core/src/actions/factory.ts +613 -0
- package/packages/core/src/actions/faucet.test.ts +202 -0
- package/packages/core/src/actions/faucet.ts +421 -0
- package/packages/core/src/actions/gtokenExtended.test.ts +162 -0
- package/packages/core/src/actions/gtokenExtended.ts +153 -0
- package/packages/core/src/actions/index.ts +18 -0
- package/packages/core/src/actions/paymasterV4.test.ts +209 -0
- package/packages/core/src/actions/paymasterV4.ts +455 -0
- package/packages/core/src/actions/registry.test.ts +443 -0
- package/packages/core/src/actions/registry.ts +860 -0
- package/packages/core/src/actions/reputation.test.ts +225 -0
- package/packages/core/src/actions/reputation.ts +378 -0
- package/packages/core/src/actions/sbt.test.ts +322 -0
- package/packages/core/src/actions/sbt.ts +681 -0
- package/packages/core/src/actions/staking.test.ts +273 -0
- package/packages/core/src/actions/staking.ts +421 -0
- package/packages/core/src/actions/superPaymaster.test.ts +356 -0
- package/packages/core/src/actions/superPaymaster.ts +828 -0
- package/packages/core/src/actions/tokens.test.ts +60 -0
- package/packages/core/src/actions/tokens.ts +527 -0
- package/packages/core/src/actions/validators.test.ts +239 -0
- package/packages/core/src/actions/validators.ts +590 -0
- package/packages/core/src/branding.ts +32 -0
- package/packages/core/src/clients/BaseClient.ts +78 -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 +145 -0
- package/packages/core/src/contract-addresses.ts +125 -0
- package/packages/core/src/contracts.test.ts +58 -0
- package/packages/core/src/contracts.ts +414 -0
- package/packages/core/src/crypto/blsSigner.ts +124 -0
- package/packages/core/src/crypto/index.ts +1 -0
- package/packages/core/src/index.ts +22 -0
- package/packages/core/src/networks.ts +127 -0
- package/packages/core/src/requirementChecker.test.ts +71 -0
- package/packages/core/src/requirementChecker.ts +187 -0
- package/packages/core/src/roles.test.ts +34 -0
- package/packages/core/src/roles.ts +255 -0
- package/packages/core/src/utils/validation.test.ts +50 -0
- package/packages/core/src/utils/validation.ts +66 -0
- package/packages/core/src/utils.ts +23 -0
- package/packages/core/tsconfig.json +12 -0
- package/packages/core/vitest.config.ts +14 -0
- package/packages/dapp/package.json +30 -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 +12 -0
- package/packages/identity/package.json +25 -0
- package/packages/identity/src/index.ts +114 -0
- package/packages/identity/src/mysbt.ts +48 -0
- package/packages/identity/tsconfig.json +11 -0
- package/packages/paymaster/package.json +25 -0
- package/packages/paymaster/src/SuperPaymaster/index.ts +168 -0
- package/packages/paymaster/src/V4/PaymasterClient.test.ts +114 -0
- package/packages/paymaster/src/V4/PaymasterClient.ts +385 -0
- package/packages/paymaster/src/V4/PaymasterOperator.test.ts +80 -0
- package/packages/paymaster/src/V4/PaymasterOperator.ts +282 -0
- package/packages/paymaster/src/V4/PaymasterUtils.test.ts +54 -0
- package/packages/paymaster/src/V4/PaymasterUtils.ts +185 -0
- package/packages/paymaster/src/V4/SuperPaymasterClient.test.ts +79 -0
- package/packages/paymaster/src/V4/SuperPaymasterClient.ts +123 -0
- package/packages/paymaster/src/V4/index.ts +4 -0
- package/packages/paymaster/src/index.ts +5 -0
- package/packages/paymaster/tsconfig.json +11 -0
- package/packages/sdk/README.md +150 -0
- package/packages/sdk/aastar/package.json +21 -0
- package/packages/sdk/aastar/src/index.ts +3 -0
- package/packages/sdk/aastar/tsconfig.json +7 -0
- package/packages/sdk/coverage_output.txt +393 -0
- package/packages/sdk/coverage_output_final.txt +739 -0
- package/packages/sdk/coverage_output_final_v2.txt +722 -0
- package/packages/sdk/coverage_output_final_v3.txt +722 -0
- package/packages/sdk/examples/config.json +1 -0
- package/packages/sdk/examples/regression_test.ts +106 -0
- package/packages/sdk/package.json +44 -0
- package/packages/sdk/src/clients/ExperimentClient.test.ts +65 -0
- package/packages/sdk/src/clients/ExperimentClient.ts +80 -0
- package/packages/sdk/src/clients/admin.test.ts +98 -0
- package/packages/sdk/src/clients/admin.ts +154 -0
- package/packages/sdk/src/clients/clients.test.ts +104 -0
- package/packages/sdk/src/clients/community.test.ts +118 -0
- package/packages/sdk/src/clients/community.ts +337 -0
- package/packages/sdk/src/clients/endUser.test.ts +221 -0
- package/packages/sdk/src/clients/endUser.ts +551 -0
- package/packages/sdk/src/clients/operator.test.ts +162 -0
- package/packages/sdk/src/clients/operator.ts +355 -0
- package/packages/sdk/src/errors/AAStarError.test.ts +92 -0
- package/packages/sdk/src/errors/AAStarError.ts +70 -0
- package/packages/sdk/src/errors/decoder.test.ts +107 -0
- package/packages/sdk/src/errors/decoder.ts +91 -0
- package/packages/sdk/src/index.ts +23 -0
- package/packages/sdk/src/node/index.ts +8 -0
- package/packages/sdk/src/types/result.ts +29 -0
- package/packages/sdk/src/utils/errorHandler.test.ts +102 -0
- package/packages/sdk/src/utils/errorHandler.ts +167 -0
- package/packages/sdk/src/utils/eventDecoder.test.ts +56 -0
- package/packages/sdk/src/utils/eventDecoder.ts +66 -0
- package/packages/sdk/src/utils/funding.test.ts +117 -0
- package/packages/sdk/src/utils/funding.ts +280 -0
- package/packages/sdk/src/utils/keys.test.ts +105 -0
- package/packages/sdk/src/utils/keys.ts +174 -0
- package/packages/sdk/src/utils/roleData.test.ts +85 -0
- package/packages/sdk/src/utils/roleData.ts +140 -0
- package/packages/sdk/src/utils/testScenarios.test.ts +79 -0
- package/packages/sdk/src/utils/testScenarios.ts +128 -0
- package/packages/sdk/src/utils/userOp.test.ts +190 -0
- package/packages/sdk/src/utils/userOp.ts +265 -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 +11 -0
- package/packages/tokens/package.json +25 -0
- package/packages/tokens/src/index.ts +273 -0
- package/packages/tokens/tsconfig.json +11 -0
- package/pnpm-workspace.yaml +2 -0
- package/run_l4_gasless_regression.sh +79 -0
- package/run_sdk_regression.sh +238 -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 +222 -0
- package/scripts/02_test_eoa.ts +53 -0
- package/scripts/03_test_standard_aa.ts +68 -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 +60 -0
- package/scripts/05_1_deposit.ts +48 -0
- package/scripts/05_test_superpaymaster.ts +58 -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 +157 -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 +114 -0
- package/scripts/19_sdk_experiment_runner.ts.backup +391 -0
- package/scripts/20_sdk_full_capability.ts +93 -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/check-admin.ts +95 -0
- package/scripts/check-jason-status.ts +184 -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/debug-addr.ts +43 -0
- package/scripts/debug-community-registration.ts +92 -0
- package/scripts/debug-deploy-v4.ts +116 -0
- package/scripts/debug-paymaster.ts +127 -0
- package/scripts/debug-register-role.ts +101 -0
- package/scripts/debug-version.ts +71 -0
- package/scripts/debug_account_c.ts +43 -0
- package/scripts/debug_bls.ts +58 -0
- package/scripts/debug_config_v036.ts +13 -0
- package/scripts/debug_contracts.ts +2 -0
- package/scripts/debug_env.ts +69 -0
- package/scripts/debug_find_paymaster.ts +98 -0
- package/scripts/debug_isolated_registration.ts +256 -0
- package/scripts/debug_paymaster_config.ts +19 -0
- package/scripts/debug_pim_addr.ts +23 -0
- package/scripts/debug_pm_status.ts +51 -0
- package/scripts/debug_registry.ts +39 -0
- package/scripts/debug_registry_setup.ts +129 -0
- package/scripts/debug_sanity.ts +32 -0
- package/scripts/debug_shared_config.ts +10 -0
- package/scripts/debug_token_compat.ts +51 -0
- package/scripts/debug_tokens.ts +41 -0
- package/scripts/debug_vcheck.ts +33 -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_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 +141 -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-paymasterv4-transfer-test.ts +228 -0
- package/scripts/l4-setup.ts +453 -0
- package/scripts/l4-state.json +80 -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_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 +162 -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 +170 -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 +138 -0
- package/scripts/test_groups.ts +138 -0
- package/scripts/test_multi_community_anvil.ts +276 -0
- package/scripts/test_new_sdk_apis_sepolia.ts +193 -0
- package/scripts/test_sdk_join_idempotent.ts +233 -0
- package/scripts/test_simple_sepolia.ts +44 -0
- package/scripts/update_env_from_config.ts +83 -0
- package/scripts/v2_regression/00_validate_env.ts +101 -0
- package/scripts/v2_regression/01_setup_and_fund.ts +132 -0
- package/scripts/v2_regression/02_operator_onboarding.ts +174 -0
- package/scripts/v2_regression/03_community_registry.ts +139 -0
- package/scripts/v2_regression/04_enduser_flow.ts +141 -0
- package/scripts/v2_regression/05_admin_audit.ts +157 -0
- package/scripts/v2_regression/README.md +161 -0
- package/scripts/validate_env.ts +112 -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_experiment_data.csv +4 -0
- package/simple-test-paymaster.sh +2 -0
- package/simple-test-superpaymaster.sh +1 -0
- package/tests/l1-regression.test.ts +458 -0
- package/tests/l4-test-anni-gasless.ts +105 -0
- package/tests/l4-test-jason1-gasless.ts +150 -0
- package/tests/l4-test-jason2-gasless.ts +174 -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 +215 -0
- package/tests/regression/display-versions.ts +85 -0
- package/tests/regression/index.ts +67 -0
- package/tests/regression/l1-tests.ts +267 -0
- package/tests/regression/l2-tests.ts +171 -0
- package/tests/regression/l3-tests.ts +125 -0
- package/tests/regression/l4-gasless.ts +897 -0
- package/tests/regression/l4-runner.ts +52 -0
- package/tests/reports/phase1_contract_verification.md +45 -0
- package/tests/utils/contractVerifier.ts +237 -0
- package/tests/utils/userOpHelper.ts +194 -0
- package/tsconfig.json +41 -0
- package/typedoc.json +59 -0
- package/vitest.config.ts +16 -0
- package/dist/clients/admin.d.ts +0 -12
- package/dist/clients/admin.d.ts.map +0 -1
- package/dist/clients/admin.js +0 -20
- package/dist/clients/admin.js.map +0 -1
- package/dist/clients/community.d.ts +0 -12
- package/dist/clients/community.d.ts.map +0 -1
- package/dist/clients/community.js +0 -18
- package/dist/clients/community.js.map +0 -1
- package/dist/clients/endUser.d.ts +0 -12
- package/dist/clients/endUser.d.ts.map +0 -1
- package/dist/clients/endUser.js +0 -20
- package/dist/clients/endUser.js.map +0 -1
- package/dist/clients/operator.d.ts +0 -18
- package/dist/clients/operator.d.ts.map +0 -1
- package/dist/clients/operator.js +0 -65
- package/dist/clients/operator.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: '@typescript-eslint/parser',
|
|
4
|
+
parserOptions: {
|
|
5
|
+
ecmaVersion: 2022,
|
|
6
|
+
sourceType: 'module',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['@typescript-eslint'],
|
|
9
|
+
extends: [
|
|
10
|
+
'eslint:recommended',
|
|
11
|
+
'plugin:@typescript-eslint/recommended',
|
|
12
|
+
],
|
|
13
|
+
rules: {
|
|
14
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
15
|
+
'@typescript-eslint/no-unused-vars': ['warn', {
|
|
16
|
+
argsIgnorePattern: '^_',
|
|
17
|
+
varsIgnorePattern: '^_'
|
|
18
|
+
}],
|
|
19
|
+
'no-console': ['warn', { allow: ['warn', 'error', 'log'] }],
|
|
20
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
21
|
+
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
22
|
+
},
|
|
23
|
+
ignorePatterns: [
|
|
24
|
+
'dist/',
|
|
25
|
+
'node_modules/',
|
|
26
|
+
'*.js',
|
|
27
|
+
'*.d.ts',
|
|
28
|
+
'coverage/',
|
|
29
|
+
],
|
|
30
|
+
};
|
package/.gitmodules
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
[submodule "ext/aastar-shared-config"]
|
|
2
|
+
path = ext/aastar-shared-config
|
|
3
|
+
url = https://github.com/AAStarCommunity/aastar-shared-config
|
|
4
|
+
[submodule "ext/permissionless.js"]
|
|
5
|
+
path = ext/permissionless.js
|
|
6
|
+
url = https://github.com/pimlicolabs/permissionless.js
|
|
7
|
+
[submodule "lib/shared-config"]
|
|
8
|
+
path = lib/shared-config
|
|
9
|
+
url = https://github.com/AAStarCommunity/aastar-shared-config.git
|
package/README.md
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# AAStar SDK
|
|
2
|
+
**AAStar: Empower Community, Simplify Development**
|
|
3
|
+
<p align="left">
|
|
4
|
+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" style="display:inline-block; margin-right: 10px;" />
|
|
5
|
+
<img src="https://img.shields.io/badge/TypeScript-5.0-blue" alt="TypeScript" style="display:inline-block; margin-right: 10px;" />
|
|
6
|
+
<img src="https://img.shields.io/badge/Status-0.16.6-green" alt="Status" style="display:inline-block;" />
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
**Comprehensive Account Abstraction Infrastructure SDK - Mycelium Network Cornerstone**
|
|
10
|
+
**完整的账户抽象基础设施 SDK - Mycelium 网络基石**
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 📚 Contents / 目录
|
|
15
|
+
|
|
16
|
+
- [AAStar SDK](#aastar-sdk)
|
|
17
|
+
- [📚 Contents / 目录](#-contents--目录)
|
|
18
|
+
- [Introduction / 简介](#introduction--简介)
|
|
19
|
+
- [Core Features / 核心特性](#core-features--核心特性)
|
|
20
|
+
- [SDK v2 Architecture / 架构设计](#sdk-v2-architecture--架构设计)
|
|
21
|
+
- [Installation / 安装](#installation--安装)
|
|
22
|
+
- [Quick Start / 快速开始](#quick-start--快速开始)
|
|
23
|
+
- [End User Gasless Transaction / 终端用户 Gasless 流程](#end-user-gasless-transaction--终端用户-gasless-流程)
|
|
24
|
+
- [Testing Commands / 测试命令](#testing-commands--测试命令)
|
|
25
|
+
- [SDK Regression (Using SDK Clients)](#sdk-regression-using-sdk-clients)
|
|
26
|
+
- [ABI Alignment \& Coverage](#abi-alignment--coverage)
|
|
27
|
+
- [Full Protocol Regression (Anvil Dedicated)](#full-protocol-regression-anvil-dedicated)
|
|
28
|
+
- [Development Guides / 开发指南](#development-guides--开发指南)
|
|
29
|
+
- [ABI Maintenance / ABI 维护](#abi-maintenance--abi-维护)
|
|
30
|
+
- [Node.js Usage / Node.js 使用](#nodejs-usage--nodejs-使用)
|
|
31
|
+
- [Development Workflow / 开发者工作流](#development-workflow--开发者工作流)
|
|
32
|
+
- [Step 1: Modify Contracts / 修改合约](#step-1-modify-contracts--修改合约)
|
|
33
|
+
- [Step 2: Local Build \& Deploy (Anvil) / 本地构建与部署](#step-2-local-build--deploy-anvil--本地构建与部署)
|
|
34
|
+
- [Step 3: Run Local Tests / 运行本地测试](#step-3-run-local-tests--运行本地测试)
|
|
35
|
+
- [Step 4: Deploy to Sepolia / 部署至 Sepolia](#step-4-deploy-to-sepolia--部署至-sepolia)
|
|
36
|
+
- [Step 5: Verify on Sepolia / Sepolia 验证](#step-5-verify-on-sepolia--sepolia-验证)
|
|
37
|
+
- [Academic Research / 学术研究](#academic-research--学术研究)
|
|
38
|
+
- [API Documentation / API 文档](#api-documentation--api-文档)
|
|
39
|
+
- [📚 Complete API Reference](#-complete-api-reference)
|
|
40
|
+
- [📊 Documentation Coverage](#-documentation-coverage)
|
|
41
|
+
- [🔍 Key API Highlights](#-key-api-highlights)
|
|
42
|
+
- [Core Package (`@aastar/core`)](#core-package-aastarcore)
|
|
43
|
+
- [Account Package (`@aastar/account`)](#account-package-aastaraccount)
|
|
44
|
+
- [Paymaster Package (`@aastar/paymaster`)](#paymaster-package-aastarpaymaster)
|
|
45
|
+
- [Tokens Package (`@aastar/tokens`)](#tokens-package-aastartokens)
|
|
46
|
+
- [📝 Documentation Features](#-documentation-features)
|
|
47
|
+
- [🚀 Generate Documentation](#-generate-documentation)
|
|
48
|
+
- [Support / 支援](#support--支援)
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Introduction / 简介
|
|
53
|
+
|
|
54
|
+
**AAStar SDK** is a high-integration toolkit for the Mycelium network. We've refactored 17 fragmented modules into 7 professional core packages, providing a unified, high-performance, and easy-to-maintain development experience.
|
|
55
|
+
|
|
56
|
+
**AAStar SDK** 是 Mycelium 网络的高集成度开发工具包。我们将原有的 17 个碎片化模块重构为 7 个专业核心包,旨在提供统一、高性能且易于维护的开发体验。
|
|
57
|
+
|
|
58
|
+
### Core Features / 核心特性
|
|
59
|
+
|
|
60
|
+
- ✅ **Role-Based Clients**: Specific APIs for End Users, Communities, Operators, and Admins. (**角色化客户端**)
|
|
61
|
+
- ✅ **Infrastructure Ready**: Deep integration with SuperPaymaster and EOA Bridge. (**基础设施就绪**)
|
|
62
|
+
- ✅ **Seamless User Experience**: Gasless transactions via community credit system. (**无感交互体验**)
|
|
63
|
+
- ✅ **DVT Security Module**: Decentralized verification and aggregate signatures. (**DVT 安全模块**)
|
|
64
|
+
- ✅ **Scientific Reproducibility**: Version-locked for academic research. (**科学可复现**)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## SDK v2 Architecture / 架构设计
|
|
69
|
+
|
|
70
|
+
AAStar SDK v2 采用 **「装饰器 (Actions-Decorator)」** 模式。它将低层次的合约交互与高层次的业务逻辑解耦,为生态系统中的四种角色提供专属的 Client 封装。
|
|
71
|
+
|
|
72
|
+
| Client / 客户端 | Targeted Developer / 目标开发者 | Core Responsibility / 核心职责 |
|
|
73
|
+
| :--- | :--- | :--- |
|
|
74
|
+
| **`EndUserClient`** | dApp Developer | Gasless UX, Smart Account management, Credit queries |
|
|
75
|
+
| **`CommunityClient`** | Community/DAO Admin | Auto-onboarding, xPNTs deployment, SBT & Reputation |
|
|
76
|
+
| **`OperatorClient`** | Node/Operator | SuperPaymaster registration, Staking, Pool management |
|
|
77
|
+
| **`AdminClient`** | Protocol Admin | DVT aggregations, Slashing, Global parameters |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Installation / 安装
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pnpm install @aastar/sdk @aastar/core viem
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Quick Start / 快速开始
|
|
90
|
+
### End User Gasless Transaction / 终端用户 Gasless 流程
|
|
91
|
+
|
|
92
|
+
Recommended way using the new **PaymasterClient** API (Semantic Helpers):
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { PaymasterClient } from '@aastar/sdk';
|
|
96
|
+
|
|
97
|
+
// 1. Build CallData (e.g., Transfer Token)
|
|
98
|
+
const callData = PaymasterClient.encodeExecution(
|
|
99
|
+
tokenAddress,
|
|
100
|
+
0n,
|
|
101
|
+
PaymasterClient.encodeTokenTransfer(recipient, amount)
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// 2. Submit (Auto Gas Estimation & Signing)
|
|
105
|
+
const hash = await PaymasterClient.submitGaslessUserOperation(
|
|
106
|
+
client,
|
|
107
|
+
wallet,
|
|
108
|
+
aaAccount,
|
|
109
|
+
entryPoint,
|
|
110
|
+
paymasterAddress,
|
|
111
|
+
gasTokenAddress,
|
|
112
|
+
bundlerUrl,
|
|
113
|
+
callData
|
|
114
|
+
);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Testing Commands / 测试命令
|
|
120
|
+
|
|
121
|
+
### SDK Regression (Using SDK Clients)
|
|
122
|
+
```bash
|
|
123
|
+
pnpm run test:full_sdk
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### ABI Alignment & Coverage
|
|
127
|
+
```bash
|
|
128
|
+
# Audit ABI alignment between Registry.json and core/actions
|
|
129
|
+
pnpm run audit:abi
|
|
130
|
+
|
|
131
|
+
# Run unit tests with coverage report
|
|
132
|
+
pnpm run test:coverage
|
|
133
|
+
# or for specific packages
|
|
134
|
+
pnpm exec vitest run packages --coverage
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Full Protocol Regression (Anvil Dedicated)
|
|
139
|
+
```bash
|
|
140
|
+
pnpm run test:full_anvil
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Development Guides / 开发指南
|
|
146
|
+
|
|
147
|
+
### ABI Maintenance / ABI 维护
|
|
148
|
+
- [ABI Maintenance Plan](./docs/ABI_MAINTENANCE_PLAN.md) - 合约 ABI 自动同步和维护策略
|
|
149
|
+
- [ABI Change Tracking Workflow](./docs/ABI_Change_Tracking_Workflow.md) - ABI 变动追踪与 SDK 自动化审计流程
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### Node.js Usage / Node.js 使用
|
|
154
|
+
For server-side or CLI tools needing direct private key management (e.g., `KeyManager`), use the Node-specific export:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { KeyManager } from '@aastar/sdk/node';
|
|
158
|
+
|
|
159
|
+
// Generate or load keys securely
|
|
160
|
+
const key = KeyManager.loadFromEnv('PRIVATE_KEY');
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Development Workflow / 开发者工作流
|
|
166
|
+
|
|
167
|
+
A step-by-step guide for contributors from contract modification to Sepolia deployment.
|
|
168
|
+
|
|
169
|
+
### Step 1: Modify Contracts / 修改合约
|
|
170
|
+
Edit Solidity files in `superpaymaster/contracts/src`.
|
|
171
|
+
```bash
|
|
172
|
+
cd projects/SuperPaymaster
|
|
173
|
+
# Edit .sol files...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Step 2: Local Build & Deploy (Anvil) / 本地构建与部署
|
|
177
|
+
Auto-start Anvil, compile contracts, deploy, and sync config to SDK.
|
|
178
|
+
```bash
|
|
179
|
+
cd projects/aastar-sdk
|
|
180
|
+
# Runs Anvil + Deploy + Sync .env.anvil
|
|
181
|
+
./run_full_regression.sh --env anvil
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Step 3: Run Local Tests / 运行本地测试
|
|
185
|
+
Validate your changes with the full regression suite.
|
|
186
|
+
```bash
|
|
187
|
+
# Run all SDK & Protocol tests
|
|
188
|
+
./run_sdk_regression.sh
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Step 4: Deploy to Sepolia / 部署至 Sepolia
|
|
192
|
+
1. Configure `aastar-sdk/.env.sepolia` with `ADMIN_KEY` and `SEPOLIA_RPC_URL`.
|
|
193
|
+
2. Run the deployment script (with resume capability).
|
|
194
|
+
```bash
|
|
195
|
+
cd projects/SuperPaymaster/contracts
|
|
196
|
+
# Deploy Core + Modules
|
|
197
|
+
export $(grep -v '^#' ../../aastar-sdk/.env.sepolia | xargs) && \
|
|
198
|
+
export PRIVATE_KEY=$ADMIN_KEY && \
|
|
199
|
+
forge script script/DeployV3FullSepolia.s.sol \
|
|
200
|
+
--rpc-url $SEPOLIA_RPC_URL \
|
|
201
|
+
--broadcast --verify --slow --resume
|
|
202
|
+
```
|
|
203
|
+
3. Update `aastar-sdk/.env.sepolia` with new contract addresses from `script/v3/config.json`.
|
|
204
|
+
|
|
205
|
+
### Step 5: Verify on Sepolia / Sepolia 验证
|
|
206
|
+
Run the regression suite against the live testnet.
|
|
207
|
+
```bash
|
|
208
|
+
cd projects/aastar-sdk
|
|
209
|
+
./run_full_regression.sh --env sepolia
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Academic Research / 学术研究
|
|
216
|
+
|
|
217
|
+
The SDK supports doctoral data collection for the SuperPaymaster paper. Official experiment logger is available at `scripts/19_sdk_experiment_runner.ts`.
|
|
218
|
+
|
|
219
|
+
本 SDK 支撑了 SuperPaymaster 论文的博士实验数据采集。官方实验记录器位于 `scripts/19_sdk_experiment_runner.ts`。
|
|
220
|
+
|
|
221
|
+
- [Stage 3 Scenario Experiment Plan](./docs/STAGE_3_SCENARIO_EXP_PLAN.md)
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## API Documentation / API 文档
|
|
226
|
+
|
|
227
|
+
### 📚 Complete API Reference
|
|
228
|
+
|
|
229
|
+
The SDK provides comprehensive TypeDoc-generated API documentation for all packages:
|
|
230
|
+
|
|
231
|
+
- **📖 [Full API Documentation](./docs/api/)** - Complete reference for all packages
|
|
232
|
+
- **🌐 [Online Documentation](https://docs.aastar.io)** - Hosted documentation site
|
|
233
|
+
|
|
234
|
+
### 📊 Documentation Coverage
|
|
235
|
+
|
|
236
|
+
| Package | Classes | Functions | Interfaces | Types | Total APIs |
|
|
237
|
+
|---------|---------|-----------|------------|-------|------------|
|
|
238
|
+
| **[@aastar/core](./docs/api/@aastar/core/)** | 7 | 51 | 14 | 20 | **92+** |
|
|
239
|
+
| **[@aastar/account](./docs/api/@aastar/account/)** | 1 | 4 | 2 | 2 | **9** |
|
|
240
|
+
| **[@aastar/paymaster](./docs/api/@aastar/paymaster/)** | 4 | 7 | 4 | 4 | **19** |
|
|
241
|
+
| **[@aastar/tokens](./docs/api/@aastar/tokens/)** | 1 | 15+ | - | - | **16+** |
|
|
242
|
+
| **Total** | **13** | **77+** | **20+** | **26+** | **136+** |
|
|
243
|
+
|
|
244
|
+
### 🔍 Key API Highlights
|
|
245
|
+
|
|
246
|
+
#### Core Package (`@aastar/core`)
|
|
247
|
+
- **Configuration Management**: `ContractConfigManager`, `getNetwork()`, `getRpcUrl()`
|
|
248
|
+
- **Role System**: 7 role constants with complete requirements and permissions
|
|
249
|
+
- **Actions**: Registry, Staking, SBT, SuperPaymaster, Token, EntryPoint actions
|
|
250
|
+
- **Validation**: `RequirementChecker`, `StateValidator`, `AAStarValidationError`
|
|
251
|
+
- **Client Base**: `BaseClient` with full viem integration
|
|
252
|
+
|
|
253
|
+
#### Account Package (`@aastar/account`)
|
|
254
|
+
- **User Operations**: `UserOpClient` for AA account management
|
|
255
|
+
- **Account Creation**: `createEOAWalletClient()`, `toSimpleSmartAccount()`
|
|
256
|
+
- **Utilities**: `getUserOpHash()`, `packUserOpLimits()`
|
|
257
|
+
|
|
258
|
+
#### Paymaster Package (`@aastar/paymaster`)
|
|
259
|
+
- **Clients**: `PaymasterClient`, `SuperPaymasterClient`, `SuperPaymasterAdminClient`, `PaymasterOperator`
|
|
260
|
+
- **Middleware**: `getPaymasterV4Middleware()`, `getSuperPaymasterMiddleware()`
|
|
261
|
+
- **Utilities**: `checkEligibility()`, `buildPaymasterData()`, `buildSuperPaymasterData()`
|
|
262
|
+
|
|
263
|
+
#### Tokens Package (`@aastar/tokens`)
|
|
264
|
+
- **Finance Client**: `FinanceClient` with 15+ token operation methods
|
|
265
|
+
- **GToken Operations**: Balance queries, staking, unstaking, rewards
|
|
266
|
+
- **aPNTs Operations**: Minting, burning, wrapping, balance management
|
|
267
|
+
- **Tokenomics**: `getTokenomicsOverview()`, `getCirculatingSupply()`
|
|
268
|
+
|
|
269
|
+
### 📝 Documentation Features
|
|
270
|
+
|
|
271
|
+
✅ **Zero Warnings**: Clean documentation generation with no TypeDoc warnings
|
|
272
|
+
✅ **100% Accuracy**: All API docs verified against source code
|
|
273
|
+
✅ **Complete Coverage**: All exported APIs documented with types, parameters, and examples
|
|
274
|
+
✅ **Rich Metadata**: JSDoc comments, usage examples, and source code links
|
|
275
|
+
✅ **Auto-Generated**: Synchronized with latest codebase via `pnpm run docs:generate`
|
|
276
|
+
|
|
277
|
+
### 🚀 Generate Documentation
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Generate API documentation
|
|
281
|
+
pnpm run docs:generate
|
|
282
|
+
|
|
283
|
+
# Sync to documentation repository
|
|
284
|
+
pnpm run docs:sync
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## Support / 支援
|
|
290
|
+
|
|
291
|
+
**⭐ If you find this project helpful, please consider giving us a star on GitHub!**
|
|
292
|
+
**如果您觉得这个项目有帮助,请在 GitHub 上给我们一个 Star!**
|
|
293
|
+
|
|
294
|
+
[](https://github.com/AAStarCommunity/aastar-sdk)
|
|
295
|
+
|
|
296
|
+
- **Documentation**: [docs.aastar.io](https://docs.aastar.io)
|
|
297
|
+
- **GitHub**: [AAStarCommunity/aastar-sdk](https://github.com/AAStarCommunity/aastar-sdk)
|
|
298
|
+
|
|
299
|
+
MIT © AAStar Community
|