@aastar/sdk 0.16.6 → 0.16.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -245
- package/dist/account/src/accounts/simple.d.ts +18 -0
- package/{packages/account/src/accounts/simple.ts → dist/account/src/accounts/simple.js} +12 -47
- package/dist/account/src/eoa.d.ts +10 -0
- package/dist/account/src/eoa.js +21 -0
- package/dist/account/src/index.d.ts +19 -0
- package/dist/account/src/index.js +49 -0
- package/dist/core/src/abis/BLSAggregator.json +686 -0
- package/dist/core/src/abis/BLSValidator.json +42 -0
- package/dist/core/src/abis/DVTValidator.json +368 -0
- package/dist/core/src/abis/EntryPoint.json +1382 -0
- package/dist/core/src/abis/GToken.json +513 -0
- package/dist/core/src/abis/GTokenStaking.json +949 -0
- package/dist/core/src/abis/MySBT.json +1518 -0
- package/dist/core/src/abis/Paymaster.json +1143 -0
- package/dist/core/src/abis/PaymasterFactory.json +640 -0
- package/dist/core/src/abis/Registry.json +1942 -0
- package/dist/core/src/abis/ReputationSystem.json +699 -0
- package/dist/core/src/abis/SimpleAccount.json +560 -0
- package/dist/core/src/abis/SimpleAccountFactory.json +111 -0
- package/dist/core/src/abis/SuperPaymaster.json +1781 -0
- package/dist/core/src/abis/index.d.ts +1126 -0
- package/{packages/core/src/abis/index.ts → dist/core/src/abis/index.js} +7 -20
- package/dist/core/src/abis/xPNTsFactory.json +718 -0
- package/dist/core/src/abis/xPNTsToken.json +1280 -0
- package/dist/core/src/actions/StateValidator.d.ts +68 -0
- package/{packages/core/src/actions/StateValidator.ts → dist/core/src/actions/StateValidator.js} +68 -134
- package/dist/core/src/actions/account.d.ts +55 -0
- package/dist/core/src/actions/account.js +133 -0
- package/dist/core/src/actions/aggregator.d.ts +17 -0
- package/dist/core/src/actions/aggregator.js +31 -0
- package/dist/core/src/actions/dvt.d.ts +30 -0
- package/dist/core/src/actions/dvt.js +41 -0
- package/dist/core/src/actions/entryPoint.d.ts +90 -0
- package/dist/core/src/actions/entryPoint.js +211 -0
- package/dist/core/src/actions/factory.d.ts +215 -0
- package/dist/core/src/actions/factory.js +442 -0
- package/dist/core/src/actions/faucet.d.ts +48 -0
- package/{packages/core/src/actions/faucet.ts → dist/core/src/actions/faucet.js} +58 -142
- package/dist/core/src/actions/gtokenExtended.d.ts +39 -0
- package/dist/core/src/actions/gtokenExtended.js +115 -0
- package/dist/core/src/actions/index.d.ts +15 -0
- package/{packages/core/src/actions/index.ts → dist/core/src/actions/index.js} +0 -1
- package/dist/core/src/actions/paymasterV4.d.ts +170 -0
- package/dist/core/src/actions/paymasterV4.js +334 -0
- package/dist/core/src/actions/registry.d.ts +246 -0
- package/dist/core/src/actions/registry.js +667 -0
- package/dist/core/src/actions/reputation.d.ts +129 -0
- package/dist/core/src/actions/reputation.js +281 -0
- package/dist/core/src/actions/sbt.d.ts +191 -0
- package/dist/core/src/actions/sbt.js +533 -0
- package/dist/core/src/actions/staking.d.ts +132 -0
- package/{packages/core/src/actions/staking.ts → dist/core/src/actions/staking.js} +83 -174
- package/dist/core/src/actions/superPaymaster.d.ts +237 -0
- package/dist/core/src/actions/superPaymaster.js +644 -0
- package/dist/core/src/actions/tokens.d.ts +229 -0
- package/dist/core/src/actions/tokens.js +415 -0
- package/dist/core/src/branding.d.ts +30 -0
- package/dist/core/src/branding.js +30 -0
- package/dist/core/src/clients/BaseClient.d.ts +25 -0
- package/{packages/core/src/clients/BaseClient.ts → dist/core/src/clients/BaseClient.js} +16 -28
- package/{packages/core/src/clients/types.ts → dist/core/src/clients/types.d.ts} +0 -9
- package/dist/core/src/clients/types.js +1 -0
- package/dist/core/src/clients.d.ts +5 -0
- package/dist/core/src/clients.js +11 -0
- package/dist/core/src/communities.d.ts +52 -0
- package/dist/core/src/communities.js +73 -0
- package/dist/core/src/config/ContractConfigManager.d.ts +20 -0
- package/{packages/core/src/config/ContractConfigManager.ts → dist/core/src/config/ContractConfigManager.js} +8 -23
- package/dist/core/src/constants.d.ts +88 -0
- package/dist/core/src/constants.js +125 -0
- package/dist/core/src/contract-addresses.d.ts +110 -0
- package/dist/core/src/contract-addresses.js +99 -0
- package/dist/core/src/contracts.d.ts +424 -0
- package/dist/core/src/contracts.js +343 -0
- package/dist/core/src/crypto/blsSigner.d.ts +64 -0
- package/{packages/core/src/crypto/blsSigner.ts → dist/core/src/crypto/blsSigner.js} +23 -49
- package/dist/core/src/crypto/index.js +1 -0
- package/dist/core/src/index.d.ts +21 -0
- package/{packages/core/src/index.ts → dist/core/src/index.js} +0 -1
- package/dist/core/src/networks.d.ts +127 -0
- package/{lib/shared-config/src/networks.ts → dist/core/src/networks.js} +34 -33
- package/dist/core/src/requirementChecker.d.ts +38 -0
- package/{packages/core/src/requirementChecker.ts → dist/core/src/requirementChecker.js} +26 -74
- package/dist/core/src/roles.d.ts +204 -0
- package/{packages/core/src/roles.ts → dist/core/src/roles.js} +23 -67
- package/dist/core/src/utils/validation.d.ts +24 -0
- package/{packages/core/src/utils/validation.ts → dist/core/src/utils/validation.js} +6 -16
- package/{packages/dapp/src/index.ts → dist/dapp/src/index.d.ts} +0 -1
- package/dist/dapp/src/index.js +3 -0
- package/dist/dapp/src/ui/hooks/useCreditScore.d.ts +13 -0
- package/{packages/dapp/src/ui/hooks/useCreditScore.ts → dist/dapp/src/ui/hooks/useCreditScore.js} +11 -23
- package/dist/dapp/src/ui/hooks/useSuperPaymaster.d.ts +8 -0
- package/{packages/dapp/src/ui/hooks/useSuperPaymaster.ts → dist/dapp/src/ui/hooks/useSuperPaymaster.js} +9 -17
- package/dist/dapp/src/ui/index.d.ts +4 -0
- package/{packages/dapp/src/ui/index.ts → dist/dapp/src/ui/index.js} +3 -8
- package/dist/identity/src/index.d.ts +46 -0
- package/{packages/identity/src/index.ts → dist/identity/src/index.js} +21 -41
- package/dist/identity/src/mysbt.d.ts +13 -0
- package/{packages/identity/src/mysbt.ts → dist/identity/src/mysbt.js} +9 -20
- package/dist/paymaster/src/SuperPaymaster/index.d.ts +44 -0
- package/{packages/paymaster/src/SuperPaymaster/index.ts → dist/paymaster/src/SuperPaymaster/index.js} +27 -62
- package/dist/paymaster/src/V4/PaymasterClient.d.ts +79 -0
- package/{packages/paymaster/src/V4/PaymasterClient.ts → dist/paymaster/src/V4/PaymasterClient.js} +63 -133
- package/dist/paymaster/src/V4/PaymasterOperator.d.ts +41 -0
- package/{packages/paymaster/src/V4/PaymasterOperator.ts → dist/paymaster/src/V4/PaymasterOperator.js} +66 -107
- package/dist/paymaster/src/V4/PaymasterUtils.d.ts +55 -0
- package/{packages/paymaster/src/V4/PaymasterUtils.ts → dist/paymaster/src/V4/PaymasterUtils.js} +19 -80
- package/dist/paymaster/src/V4/SuperPaymasterClient.d.ts +21 -0
- package/{packages/paymaster/src/V4/SuperPaymasterClient.ts → dist/paymaster/src/V4/SuperPaymasterClient.js} +18 -68
- package/dist/paymaster/src/V4/index.js +4 -0
- package/dist/paymaster/src/index.d.ts +2 -0
- package/{packages/paymaster/src/index.ts → dist/paymaster/src/index.js} +0 -1
- package/dist/sdk/src/clients/ExperimentClient.d.ts +34 -0
- package/{packages/sdk/src/clients/ExperimentClient.ts → dist/sdk/src/clients/ExperimentClient.js} +11 -33
- package/dist/sdk/src/clients/ExperimentClient.test.d.ts +1 -0
- package/{packages/sdk/src/clients/ExperimentClient.test.ts → dist/sdk/src/clients/ExperimentClient.test.js} +4 -16
- package/dist/sdk/src/clients/admin.d.ts +57 -0
- package/dist/sdk/src/clients/admin.js +105 -0
- package/dist/sdk/src/clients/admin.test.d.ts +1 -0
- package/{packages/sdk/src/clients/admin.test.ts → dist/sdk/src/clients/admin.test.js} +18 -37
- package/dist/sdk/src/clients/clients.test.d.ts +1 -0
- package/{packages/sdk/src/clients/clients.test.ts → dist/sdk/src/clients/clients.test.js} +22 -35
- package/dist/sdk/src/clients/community.d.ts +48 -0
- package/{packages/sdk/src/clients/community.ts → dist/sdk/src/clients/community.js} +63 -156
- package/dist/sdk/src/clients/community.test.d.ts +1 -0
- package/dist/sdk/src/clients/community.test.js +99 -0
- package/dist/sdk/src/clients/endUser.d.ts +95 -0
- package/dist/sdk/src/clients/endUser.js +388 -0
- package/dist/sdk/src/clients/endUser.test.d.ts +1 -0
- package/dist/sdk/src/clients/endUser.test.js +188 -0
- package/dist/sdk/src/clients/operator.d.ts +96 -0
- package/{packages/sdk/src/clients/operator.ts → dist/sdk/src/clients/operator.js} +70 -178
- package/dist/sdk/src/clients/operator.test.d.ts +1 -0
- package/dist/sdk/src/clients/operator.test.js +139 -0
- package/dist/sdk/src/errors/AAStarError.d.ts +26 -0
- package/dist/sdk/src/errors/AAStarError.js +32 -0
- package/dist/sdk/src/errors/AAStarError.test.d.ts +1 -0
- package/{packages/sdk/src/errors/AAStarError.test.ts → dist/sdk/src/errors/AAStarError.test.js} +0 -18
- package/dist/sdk/src/errors/decoder.d.ts +1 -0
- package/{packages/sdk/src/errors/decoder.ts → dist/sdk/src/errors/decoder.js} +20 -28
- package/dist/sdk/src/errors/decoder.test.d.ts +1 -0
- package/{packages/sdk/src/errors/decoder.test.ts → dist/sdk/src/errors/decoder.test.js} +10 -27
- package/dist/sdk/src/index.d.ts +16 -0
- package/{packages/sdk/src/index.ts → dist/sdk/src/index.js} +0 -3
- package/{packages/sdk/src/node/index.ts → dist/sdk/src/node/index.d.ts} +0 -1
- package/dist/sdk/src/node/index.js +7 -0
- package/dist/sdk/src/types/result.d.ts +15 -0
- package/{packages/sdk/src/types/result.ts → dist/sdk/src/types/result.js} +5 -11
- package/dist/sdk/src/utils/errorHandler.d.ts +40 -0
- package/{packages/sdk/src/utils/errorHandler.ts → dist/sdk/src/utils/errorHandler.js} +22 -75
- package/dist/sdk/src/utils/errorHandler.test.d.ts +1 -0
- package/{packages/sdk/src/utils/errorHandler.test.ts → dist/sdk/src/utils/errorHandler.test.js} +1 -14
- package/dist/sdk/src/utils/eventDecoder.d.ts +7 -0
- package/{packages/sdk/src/utils/eventDecoder.ts → dist/sdk/src/utils/eventDecoder.js} +14 -26
- package/dist/sdk/src/utils/eventDecoder.test.d.ts +1 -0
- package/{packages/sdk/src/utils/eventDecoder.test.ts → dist/sdk/src/utils/eventDecoder.test.js} +10 -18
- package/dist/sdk/src/utils/funding.d.ts +115 -0
- package/{packages/sdk/src/utils/funding.ts → dist/sdk/src/utils/funding.js} +27 -119
- package/dist/sdk/src/utils/funding.test.d.ts +1 -0
- package/{packages/sdk/src/utils/funding.test.ts → dist/sdk/src/utils/funding.test.js} +18 -30
- package/dist/sdk/src/utils/keys.d.ts +73 -0
- package/{packages/sdk/src/utils/keys.ts → dist/sdk/src/utils/keys.js} +17 -54
- package/dist/sdk/src/utils/keys.test.d.ts +1 -0
- package/{packages/sdk/src/utils/keys.test.ts → dist/sdk/src/utils/keys.test.js} +13 -37
- package/dist/sdk/src/utils/roleData.d.ts +66 -0
- package/{packages/sdk/src/utils/roleData.ts → dist/sdk/src/utils/roleData.js} +28 -53
- package/dist/sdk/src/utils/roleData.test.d.ts +1 -0
- package/{packages/sdk/src/utils/roleData.test.ts → dist/sdk/src/utils/roleData.test.js} +2 -13
- package/dist/sdk/src/utils/testScenarios.d.ts +33 -0
- package/dist/sdk/src/utils/testScenarios.js +85 -0
- package/dist/sdk/src/utils/testScenarios.test.d.ts +1 -0
- package/{packages/sdk/src/utils/testScenarios.test.ts → dist/sdk/src/utils/testScenarios.test.js} +19 -30
- package/dist/sdk/src/utils/userOp.d.ts +78 -0
- package/{packages/sdk/src/utils/userOp.ts → dist/sdk/src/utils/userOp.js} +61 -131
- package/dist/sdk/src/utils/userOp.test.d.ts +1 -0
- package/{packages/sdk/src/utils/userOp.test.ts → dist/sdk/src/utils/userOp.test.js} +55 -93
- package/dist/tokens/src/index.d.ts +56 -0
- package/{packages/tokens/src/index.ts → dist/tokens/src/index.js} +52 -95
- package/examples/regression_test.d.ts +2 -0
- package/examples/regression_test.d.ts.map +1 -0
- package/examples/regression_test.js +89 -0
- package/examples/regression_test.js.map +1 -0
- package/package.json +40 -58
- package/scripts/v2_regression/01_setup_and_fund.ts +1 -1
- package/scripts/v2_regression/02_operator_onboarding.ts +1 -1
- package/scripts/v2_regression/03_community_registry.ts +1 -1
- package/scripts/v2_regression/04_enduser_flow.ts +1 -1
- package/scripts/v2_regression/05_admin_audit.ts +1 -1
- package/.eslintrc.cjs +0 -30
- package/.gitmodules +0 -9
- package/aastar-sdk.code-workspace +0 -14
- package/abis/BLSAggregator.json +0 -572
- package/abis/BLSValidator.json +0 -39
- package/abis/DVTValidator.json +0 -383
- package/abis/Eip7702Support.json +0 -24
- package/abis/EntryPoint.json +0 -1379
- package/abis/GToken.json +0 -510
- package/abis/GTokenStaking.json +0 -918
- package/abis/LegacyAccount.json +0 -625
- package/abis/MySBT.json +0 -1547
- package/abis/Paymaster.json +0 -1192
- package/abis/PaymasterFactory.json +0 -637
- package/abis/PaymasterV4_2.json +0 -1193
- package/abis/Registry.json +0 -1677
- package/abis/ReputationSystem.json +0 -659
- package/abis/SenderCreator.json +0 -99
- package/abis/Simple7702Account.json +0 -395
- package/abis/SimpleAccount.json +0 -625
- package/abis/SimpleAccountFactory.json +0 -108
- package/abis/SimpleAccountFactoryV08.json +0 -87
- package/abis/SimpleAccountV08.json +0 -557
- package/abis/SuperPaymaster.json +0 -1568
- package/abis/UserOperationLib.json +0 -57
- package/abis/aPNTs.json +0 -1160
- package/abis/xPNTsFactory.json +0 -715
- package/abis/xPNTsToken.json +0 -1160
- package/config/networks/README.md +0 -54
- package/config/networks/mainnet.env.example +0 -39
- package/config/networks/optimism-sepolia.env.example +0 -35
- package/config/networks/optimism.env.example +0 -36
- package/config/networks/sepolia.env.example +0 -36
- package/config.anvil.json +0 -1
- package/config.sepolia.json +0 -1
- package/config.test.json +0 -27
- package/data/experiment_data.csv +0 -36
- package/data/industry_baseline_2025-12-23.json +0 -154
- package/data/industry_baseline_latest.json +0 -154
- package/docs/ABI_Change_Tracking_Workflow.md +0 -41
- package/docs/ABI_MAINTENANCE_PLAN.md +0 -132
- package/docs/API_REFERENCE.md +0 -956
- package/docs/Configuration_Sync.md +0 -47
- package/docs/DAO_Mining_Distribution_Plan.md +0 -522
- package/docs/DEMO_REFACTOR_PLAN.md +0 -289
- package/docs/DOCUMENTATION_PLAN.md +0 -455
- package/docs/ENV_SEPOLIA_UPDATE.md +0 -68
- package/docs/Faucet_Gasless_Plan.md +0 -56
- package/docs/L2_BUSINESS_CLIENTS_PLAN.md +0 -394
- package/docs/L4_Manual_Test_CheatSheet.md +0 -215
- package/docs/Plan.md +0 -266
- package/docs/Regression_Testing_Guide.md +0 -70
- package/docs/SDK_ABI_COVERAGE.md +0 -839
- package/docs/SDK_COVERAGE_STRATEGY.md +0 -397
- package/docs/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/SDK_REGRESSION_AND_API_PLAN.md +0 -98
- package/docs/SDK_STAGE3_PLAN.md +0 -151
- package/docs/SEPOLIA_ENV_REFERENCE.md +0 -51
- package/docs/STAGE3.md +0 -191
- package/docs/Script_Comparison_Report.md +0 -91
- package/docs/Sepolia_Latest_Deployment.md +0 -117
- package/docs/TESTER_GUIDE_GASLESS.md +0 -663
- package/docs/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/TODO_SDK_COVERAGE.md +0 -55
- package/docs/USER_CASE_DESIGN.md +0 -110
- package/docs/Verifier_L4_Gasless_Plan.md +0 -454
- package/docs/api/@aastar/account.md +0 -235
- package/docs/api/@aastar/analytics.md +0 -219
- package/docs/api/@aastar/core.md +0 -26830
- package/docs/api/@aastar/dapp.md +0 -130
- package/docs/api/@aastar/identity.md +0 -482
- package/docs/api/@aastar/paymaster.md +0 -1387
- package/docs/api/@aastar/sdk/README.md +0 -155
- package/docs/api/@aastar/sdk/node.md +0 -4044
- package/docs/api/@aastar/tokens.md +0 -1971
- package/docs/api/README.md +0 -10
- package/docs/changelog.md +0 -99
- package/docs/examples/README.md +0 -18
- package/docs/examples/community-flow.md +0 -28
- package/docs/examples/enduser-flow.md +0 -24
- package/docs/examples/index.md +0 -18
- package/docs/examples/multi-chain.md +0 -31
- package/docs/examples/operator-flow.md +0 -28
- package/docs/guide/CLI_GUIDE.md +0 -65
- package/docs/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/guide/Security-solution.md +0 -106
- package/docs/guide/TEST_COMMANDS.md +0 -320
- package/docs/guide/concepts/account-abstraction.md +0 -95
- package/docs/guide/concepts/rainbow-bridge.md +0 -68
- package/docs/guide/concepts/reputation.md +0 -95
- package/docs/guide/concepts/superpaymaster.md +0 -141
- package/docs/guide/getting-started.md +0 -133
- package/docs/guide/installation.md +0 -40
- package/docs/guide/paper-data-collection.md +0 -69
- package/docs/guide/quick-start.md +0 -52
- package/docs/guide/task_breakdown.md +0 -121
- package/docs/guide/use-cases/community-management.md +0 -141
- package/docs/guide/use-cases/gasless-transactions.md +0 -71
- package/docs/guide/use-cases/operator-staking.md +0 -84
- package/docs/guide/use-cases/yop.md +0 -72
- package/docs/old-solution.md +0 -1078
- package/docs/paper-data-collection.md +0 -69
- package/docs/refactor/2026-01-13-221242-trae-refactor.md +0 -224
- package/docs/refactor/2026-01-13-audit-analysis.md +0 -96
- package/docs/refactor/2026-01-13-audit-report-v0.16.2.md +0 -76
- package/docs/refactor/2026-01-13-audit-report-v0.17.0.md +0 -74
- package/docs/refactor/2026-01-13-cursor-refactor.md +0 -511
- package/docs/refactor/2026-01-13-refactor-plan.md +0 -88
- package/docs/refactor/2026-01-13-refactor-response-plan.md +0 -77
- package/docs/refactor/2026-01-13-refactor-review.md +0 -39
- package/docs/refactor/2026-01-13-sdk-enhancement-plan.md +0 -120
- package/docs/refactor/2026-01-14-audit-response.md +0 -242
- package/docs/refactor/2026-01-14-audit-summary.md +0 -133
- package/docs/refactor/cursor-2026-01-13-14-00-audit-report.md +0 -267
- package/docs/technical_plan.md +0 -510
- package/docs/zh/examples/community-flow.md +0 -38
- package/docs/zh/examples/complete-workflow.md +0 -10
- package/docs/zh/examples/enduser-flow.md +0 -33
- package/docs/zh/examples/index.md +0 -18
- package/docs/zh/examples/multi-chain.md +0 -46
- package/docs/zh/examples/operator-flow.md +0 -37
- package/docs/zh/guide/CLI_GUIDE.md +0 -48
- package/docs/zh/guide/DOCUMENTATION_PLAN.md +0 -455
- package/docs/zh/guide/Plan.md +0 -266
- package/docs/zh/guide/SDK_Optimization_Evaluation_Plan.md +0 -51
- package/docs/zh/guide/Security-solution.md +0 -106
- package/docs/zh/guide/TEST_COMMANDS.md +0 -125
- package/docs/zh/guide/TEST_COVERAGE_MATRIX.md +0 -72
- package/docs/zh/guide/concepts/account-abstraction.md +0 -95
- package/docs/zh/guide/concepts/rainbow-bridge.md +0 -68
- package/docs/zh/guide/concepts/reputation.md +0 -95
- package/docs/zh/guide/concepts/superpaymaster.md +0 -141
- package/docs/zh/guide/getting-started.md +0 -133
- package/docs/zh/guide/installation.md +0 -107
- package/docs/zh/guide/old-solution.md +0 -1078
- package/docs/zh/guide/paper-data-collection.md +0 -69
- package/docs/zh/guide/quick-start.md +0 -134
- package/docs/zh/guide/sdk-readme.md +0 -253
- package/docs/zh/guide/task_breakdown.md +0 -76
- package/docs/zh/guide/technical_plan.md +0 -510
- package/docs/zh/guide/use-cases/community-management.md +0 -141
- package/docs/zh/guide/use-cases/gasless-transactions.md +0 -71
- package/docs/zh/guide/use-cases/operator-staking.md +0 -84
- package/docs/zh/guide/use-cases/yop.md +0 -72
- package/env.template +0 -32
- package/examples/l1-api-demo.ts +0 -184
- package/examples/l2-clients-demo.ts +0 -138
- package/examples/l3-user-onboarding.ts +0 -74
- package/examples/prepare-gasless.ts +0 -89
- package/examples/sdk-demo/DEVELOPER_GUIDE.md +0 -159
- package/examples/sdk-demo/README.md +0 -30
- package/examples/sdk-demo/usage.ts +0 -137
- package/examples/simple-gasless-demo.ts +0 -80
- package/examples/simple-superpaymaster-demo.ts +0 -96
- package/ext/aastar-shared-config/.env.example +0 -6
- package/ext/aastar-shared-config/.github/workflows/check-secrets.yml +0 -257
- package/ext/aastar-shared-config/AGENTS.md +0 -21
- package/ext/aastar-shared-config/CHANGELOG.md +0 -99
- package/ext/aastar-shared-config/LICENSE +0 -21
- package/ext/aastar-shared-config/QUICK_START.md +0 -215
- package/ext/aastar-shared-config/README.md +0 -412
- package/ext/aastar-shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/ext/aastar-shared-config/check-locker-status.mjs +0 -7
- package/ext/aastar-shared-config/favicon.ico +0 -0
- package/ext/aastar-shared-config/generate-comparison-table.sh +0 -67
- package/ext/aastar-shared-config/package.json +0 -46
- package/ext/aastar-shared-config/pnpm-lock.yaml +0 -1182
- package/ext/aastar-shared-config/src/abis/BLSAggregator.json +0 -1
- package/ext/aastar-shared-config/src/abis/DVTValidator.json +0 -1
- package/ext/aastar-shared-config/src/abis/GToken.json +0 -1
- package/ext/aastar-shared-config/src/abis/GTokenStaking.json +0 -1
- package/ext/aastar-shared-config/src/abis/MySBT.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/PaymasterV4.json +0 -1098
- package/ext/aastar-shared-config/src/abis/Registry.json +0 -1
- package/ext/aastar-shared-config/src/abis/SimpleAccount.json +0 -557
- package/ext/aastar-shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/ext/aastar-shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/ext/aastar-shared-config/src/abis/index.ts +0 -45
- package/ext/aastar-shared-config/src/abis/xPNTsFactory.json +0 -1
- package/ext/aastar-shared-config/src/abis/xPNTsToken.json +0 -1
- package/ext/aastar-shared-config/src/branding.ts +0 -32
- package/ext/aastar-shared-config/src/communities.ts +0 -93
- package/ext/aastar-shared-config/src/constants.ts +0 -67
- package/ext/aastar-shared-config/src/contract-addresses.ts +0 -95
- package/ext/aastar-shared-config/src/contract-versions.ts +0 -374
- package/ext/aastar-shared-config/src/contracts.ts +0 -414
- package/ext/aastar-shared-config/src/index.ts +0 -14
- package/ext/aastar-shared-config/src/networks.ts +0 -117
- package/ext/aastar-shared-config/sync-abis.sh +0 -92
- package/ext/aastar-shared-config/sync-versions.mjs +0 -150
- package/ext/aastar-shared-config/tsconfig.json +0 -18
- package/ext/aastar-shared-config/tsup.config.ts +0 -10
- package/ext/aastar-shared-config/verify-all.sh +0 -207
- package/ext/aastar-shared-config/verify-contracts.sh +0 -85
- package/ext/aastar-shared-config/verify-mysbt-v243.mjs +0 -27
- package/ext/aastar-shared-config/verify-onchain-versions.mjs +0 -93
- package/l4-setup.sh +0 -11
- package/lib/SHARED_CONFIG_REFERENCE.md +0 -133
- package/lib/shared-config/.env.example +0 -6
- package/lib/shared-config/.github/workflows/check-secrets.yml +0 -257
- package/lib/shared-config/AGENTS.md +0 -21
- package/lib/shared-config/CHANGELOG.md +0 -99
- package/lib/shared-config/LICENSE +0 -21
- package/lib/shared-config/QUICK_START.md +0 -215
- package/lib/shared-config/README.md +0 -412
- package/lib/shared-config/SHARED_CONFIG_SUMMARY.md +0 -273
- package/lib/shared-config/check-locker-status.mjs +0 -7
- package/lib/shared-config/favicon.ico +0 -0
- package/lib/shared-config/generate-comparison-table.sh +0 -67
- package/lib/shared-config/package.json +0 -46
- package/lib/shared-config/pnpm-lock.yaml +0 -1182
- package/lib/shared-config/src/abis/BLSAggregator.json +0 -1
- package/lib/shared-config/src/abis/DVTValidator.json +0 -1
- package/lib/shared-config/src/abis/GToken.json +0 -1
- package/lib/shared-config/src/abis/GTokenStaking.json +0 -1
- package/lib/shared-config/src/abis/MySBT.json +0 -1
- package/lib/shared-config/src/abis/PaymasterFactory.json +0 -1
- package/lib/shared-config/src/abis/PaymasterV4.json +0 -1098
- package/lib/shared-config/src/abis/Registry.json +0 -1
- package/lib/shared-config/src/abis/SimpleAccount.json +0 -557
- package/lib/shared-config/src/abis/SimpleAccountFactory.json +0 -87
- package/lib/shared-config/src/abis/SuperPaymasterV2.json +0 -1
- package/lib/shared-config/src/abis/index.ts +0 -45
- package/lib/shared-config/src/abis/xPNTsFactory.json +0 -1
- package/lib/shared-config/src/abis/xPNTsToken.json +0 -1
- package/lib/shared-config/src/branding.ts +0 -32
- package/lib/shared-config/src/communities.ts +0 -93
- package/lib/shared-config/src/constants.ts +0 -67
- package/lib/shared-config/src/contract-addresses.ts +0 -95
- package/lib/shared-config/src/contract-versions.ts +0 -374
- package/lib/shared-config/src/contracts.ts +0 -414
- package/lib/shared-config/src/index.ts +0 -14
- package/lib/shared-config/sync-abis.sh +0 -92
- package/lib/shared-config/sync-versions.mjs +0 -150
- package/lib/shared-config/tsconfig.json +0 -18
- package/lib/shared-config/tsup.config.ts +0 -10
- package/lib/shared-config/verify-all.sh +0 -207
- package/lib/shared-config/verify-contracts.sh +0 -85
- package/lib/shared-config/verify-mysbt-v243.mjs +0 -27
- package/lib/shared-config/verify-onchain-versions.mjs +0 -93
- package/packages/account/package.json +0 -23
- package/packages/account/src/accounts/simple.test.ts +0 -93
- package/packages/account/src/eoa.test.ts +0 -37
- package/packages/account/src/eoa.ts +0 -33
- package/packages/account/src/index.test.ts +0 -34
- package/packages/account/src/index.ts +0 -61
- package/packages/account/tsconfig.json +0 -11
- package/packages/analytics/package.json +0 -28
- package/packages/analytics/src/index.ts +0 -145
- package/packages/analytics/tsconfig.json +0 -11
- package/packages/core/package.json +0 -32
- package/packages/core/scripts/audit-abi-coverage.ts +0 -165
- package/packages/core/scripts/debug-regex.ts +0 -36
- package/packages/core/src/abis/.abi-hashes.json +0 -26
- package/packages/core/src/abis/BLSAggregator.json +0 -686
- package/packages/core/src/abis/BLSValidator.json +0 -42
- package/packages/core/src/abis/DVTValidator.json +0 -368
- package/packages/core/src/abis/Eip7702Support.json +0 -24
- package/packages/core/src/abis/EntryPoint.json +0 -1382
- package/packages/core/src/abis/GToken.json +0 -513
- package/packages/core/src/abis/GTokenStaking.json +0 -949
- package/packages/core/src/abis/LegacyAccount.json +0 -625
- package/packages/core/src/abis/MySBT.json +0 -1518
- package/packages/core/src/abis/Paymaster.json +0 -1143
- package/packages/core/src/abis/PaymasterFactory.json +0 -640
- package/packages/core/src/abis/Registry.json +0 -1942
- package/packages/core/src/abis/ReputationSystem.json +0 -699
- package/packages/core/src/abis/SenderCreator.json +0 -99
- package/packages/core/src/abis/Simple7702Account.json +0 -395
- package/packages/core/src/abis/SimpleAccount.json +0 -560
- package/packages/core/src/abis/SimpleAccountFactory.json +0 -111
- package/packages/core/src/abis/SimpleAccountFactoryV08.json +0 -87
- package/packages/core/src/abis/SimpleAccountV08.json +0 -557
- package/packages/core/src/abis/SuperPaymaster.json +0 -1781
- package/packages/core/src/abis/UserOperationLib.json +0 -57
- package/packages/core/src/abis/abi.config.json +0 -24
- package/packages/core/src/abis/xPNTsFactory.json +0 -718
- package/packages/core/src/abis/xPNTsToken.json +0 -1280
- package/packages/core/src/actions/StateValidator.test.ts +0 -175
- package/packages/core/src/actions/account.test.ts +0 -155
- package/packages/core/src/actions/account.ts +0 -179
- package/packages/core/src/actions/aggregator.test.ts +0 -88
- package/packages/core/src/actions/aggregator.ts +0 -41
- package/packages/core/src/actions/dvt.test.ts +0 -124
- package/packages/core/src/actions/dvt.ts +0 -53
- package/packages/core/src/actions/entryPoint.test.ts +0 -176
- package/packages/core/src/actions/entryPoint.ts +0 -266
- package/packages/core/src/actions/factory.test.ts +0 -250
- package/packages/core/src/actions/factory.ts +0 -613
- package/packages/core/src/actions/faucet.test.ts +0 -202
- package/packages/core/src/actions/gtokenExtended.test.ts +0 -162
- package/packages/core/src/actions/gtokenExtended.ts +0 -153
- package/packages/core/src/actions/paymasterV4.test.ts +0 -209
- package/packages/core/src/actions/paymasterV4.ts +0 -455
- package/packages/core/src/actions/registry.test.ts +0 -443
- package/packages/core/src/actions/registry.ts +0 -860
- package/packages/core/src/actions/reputation.test.ts +0 -225
- package/packages/core/src/actions/reputation.ts +0 -378
- package/packages/core/src/actions/sbt.test.ts +0 -322
- package/packages/core/src/actions/sbt.ts +0 -681
- package/packages/core/src/actions/staking.test.ts +0 -273
- package/packages/core/src/actions/superPaymaster.test.ts +0 -356
- package/packages/core/src/actions/superPaymaster.ts +0 -828
- package/packages/core/src/actions/tokens.test.ts +0 -60
- package/packages/core/src/actions/tokens.ts +0 -527
- package/packages/core/src/actions/validators.test.ts +0 -239
- package/packages/core/src/actions/validators.ts +0 -590
- package/packages/core/src/branding.ts +0 -32
- package/packages/core/src/clients.ts +0 -13
- package/packages/core/src/communities.ts +0 -93
- package/packages/core/src/constants.ts +0 -145
- package/packages/core/src/contract-addresses.ts +0 -125
- package/packages/core/src/contracts.test.ts +0 -58
- package/packages/core/src/contracts.ts +0 -414
- package/packages/core/src/networks.ts +0 -127
- package/packages/core/src/requirementChecker.test.ts +0 -71
- package/packages/core/src/roles.test.ts +0 -34
- package/packages/core/src/utils/validation.test.ts +0 -50
- package/packages/core/src/utils.ts +0 -23
- package/packages/core/tsconfig.json +0 -12
- package/packages/core/vitest.config.ts +0 -14
- package/packages/dapp/package.json +0 -30
- package/packages/dapp/src/ui/components/EvaluationPanel.tsx +0 -40
- package/packages/dapp/tsconfig.json +0 -12
- package/packages/identity/package.json +0 -25
- package/packages/identity/tsconfig.json +0 -11
- package/packages/paymaster/package.json +0 -25
- package/packages/paymaster/src/V4/PaymasterClient.test.ts +0 -114
- package/packages/paymaster/src/V4/PaymasterOperator.test.ts +0 -80
- package/packages/paymaster/src/V4/PaymasterUtils.test.ts +0 -54
- package/packages/paymaster/src/V4/SuperPaymasterClient.test.ts +0 -79
- package/packages/paymaster/tsconfig.json +0 -11
- package/packages/sdk/README.md +0 -150
- package/packages/sdk/aastar/package.json +0 -21
- package/packages/sdk/aastar/src/index.ts +0 -3
- package/packages/sdk/aastar/tsconfig.json +0 -7
- package/packages/sdk/coverage_output.txt +0 -393
- package/packages/sdk/coverage_output_final.txt +0 -739
- package/packages/sdk/coverage_output_final_v2.txt +0 -722
- package/packages/sdk/coverage_output_final_v3.txt +0 -722
- package/packages/sdk/package.json +0 -44
- package/packages/sdk/src/clients/admin.ts +0 -154
- package/packages/sdk/src/clients/community.test.ts +0 -118
- package/packages/sdk/src/clients/endUser.test.ts +0 -221
- package/packages/sdk/src/clients/endUser.ts +0 -551
- package/packages/sdk/src/clients/operator.test.ts +0 -162
- package/packages/sdk/src/errors/AAStarError.ts +0 -70
- package/packages/sdk/src/utils/testScenarios.ts +0 -128
- package/packages/sdk/tests/scenarios/01_onboard_community.ts +0 -62
- package/packages/sdk/tests/scenarios/02_onboard_operator.ts +0 -109
- package/packages/sdk/tests/scenarios/03_onboard_user.ts +0 -53
- package/packages/sdk/tests/scenarios/04_gasless_tx_flow.ts +0 -68
- package/packages/sdk/tests/scenarios/check_entrypoint.ts +0 -19
- package/packages/sdk/tests/scenarios/check_initialization.ts +0 -65
- package/packages/sdk/tests/scenarios/debug_addresses.ts +0 -26
- package/packages/sdk/tests/scenarios/diagnose_scenario4.ts +0 -55
- package/packages/sdk/tests/scenarios/setup.ts +0 -33
- package/packages/sdk/tests/scenarios/test_entrypoint_nonce.ts +0 -46
- package/packages/sdk/tsconfig.json +0 -11
- package/packages/tokens/package.json +0 -25
- package/packages/tokens/tsconfig.json +0 -11
- package/pnpm-workspace.yaml +0 -2
- package/run_l4_gasless_regression.sh +0 -79
- package/run_sdk_regression.sh +0 -238
- package/scripts/00_utils.ts +0 -59
- package/scripts/00_verify_phase1.ts +0 -130
- package/scripts/01_1_prep_gtoken.ts +0 -81
- package/scripts/01_2_register_sbt.ts +0 -88
- package/scripts/01_3_prep_tokens_paymaster.ts +0 -102
- package/scripts/01_prepare_all.ts +0 -222
- package/scripts/02_test_eoa.ts +0 -53
- package/scripts/03_test_standard_aa.ts +0 -68
- package/scripts/04_0_check_deploy.ts +0 -24
- package/scripts/04_1_check_allowance.ts +0 -44
- package/scripts/04_2_construct_verify.ts +0 -96
- package/scripts/04_3_verify_estimate.ts +0 -66
- package/scripts/04_4_verify_pack.ts +0 -74
- package/scripts/04_test_paymaster_v4.ts +0 -60
- package/scripts/05_1_deposit.ts +0 -48
- package/scripts/05_test_superpaymaster.ts +0 -58
- package/scripts/06_local_test_v3_admin.ts +0 -163
- package/scripts/06_local_test_v3_execution.ts +0 -132
- package/scripts/06_local_test_v3_full.ts +0 -490
- package/scripts/06_local_test_v3_funding.ts +0 -124
- package/scripts/06_local_test_v3_reputation.ts +0 -234
- package/scripts/07_local_test_v3_audit.ts +0 -181
- package/scripts/08_local_test_registry_lifecycle.ts +0 -382
- package/scripts/09_local_test_community_lifecycle.ts +0 -385
- package/scripts/09_local_test_community_simple.ts +0 -108
- package/scripts/09_scenario_bread_independent.ts +0 -247
- package/scripts/10_scenario_super_shared.ts +0 -196
- package/scripts/10_test_protocol_admin_full.ts +0 -173
- package/scripts/11_scenario_hacker_defense.ts +0 -104
- package/scripts/11_test_core_flows_full.ts +0 -157
- package/scripts/12_test_slash_mechanism.ts +0 -205
- package/scripts/12_test_slash_queries.ts +0 -83
- package/scripts/12_test_staking_exit.ts +0 -152
- package/scripts/12_test_staking_slash.ts +0 -301
- package/scripts/12_test_tier2_slash.ts +0 -139
- package/scripts/13_test_sbt_burn_linkage.ts +0 -266
- package/scripts/14_test_credit_redesign.ts +0 -266
- package/scripts/15_test_bls_full.ts +0 -148
- package/scripts/15_test_dvt_bls_full.ts +0 -140
- package/scripts/17_test_cross_role_collaboration.ts +0 -95
- package/scripts/18_sdk_e2e_verification.ts +0 -67
- package/scripts/18_test_dvt_sdk_flow.ts +0 -138
- package/scripts/18_test_lifecycle_completion.ts +0 -144
- package/scripts/19_sdk_experiment_runner.ts +0 -114
- package/scripts/19_sdk_experiment_runner.ts.backup +0 -391
- package/scripts/20_sdk_full_capability.ts +0 -93
- package/scripts/20_test_superpaymaster_new_apis.ts +0 -193
- package/scripts/21_test_paymasterv4_complete.ts +0 -341
- package/scripts/22_test_bls_signing.ts +0 -260
- package/scripts/23_test_middleware.ts +0 -197
- package/scripts/98_edge_reentrancy.ts +0 -85
- package/scripts/99_bug_hunting_fast.ts +0 -99
- package/scripts/analyze_abi_coverage.ts +0 -169
- package/scripts/check-admin.ts +0 -95
- package/scripts/check-jason-status.ts +0 -184
- package/scripts/check-roles.ts +0 -36
- package/scripts/clear-nonce.ts +0 -47
- package/scripts/collect_industry_baseline.ts +0 -236
- package/scripts/complete-jack-superpaymaster.ts +0 -171
- package/scripts/complete_env_config.ts +0 -97
- package/scripts/debug-addr.ts +0 -43
- package/scripts/debug-community-registration.ts +0 -92
- package/scripts/debug-deploy-v4.ts +0 -116
- package/scripts/debug-paymaster.ts +0 -127
- package/scripts/debug-register-role.ts +0 -101
- package/scripts/debug-version.ts +0 -71
- package/scripts/debug_account_c.ts +0 -43
- package/scripts/debug_bls.ts +0 -58
- package/scripts/debug_config_v036.ts +0 -13
- package/scripts/debug_contracts.ts +0 -2
- package/scripts/debug_env.ts +0 -69
- package/scripts/debug_find_paymaster.ts +0 -98
- package/scripts/debug_isolated_registration.ts +0 -256
- package/scripts/debug_paymaster_config.ts +0 -19
- package/scripts/debug_pim_addr.ts +0 -23
- package/scripts/debug_pm_status.ts +0 -51
- package/scripts/debug_registry.ts +0 -39
- package/scripts/debug_registry_setup.ts +0 -129
- package/scripts/debug_sanity.ts +0 -32
- package/scripts/debug_shared_config.ts +0 -10
- package/scripts/debug_token_compat.ts +0 -51
- package/scripts/debug_tokens.ts +0 -41
- package/scripts/debug_vcheck.ts +0 -33
- package/scripts/deploy-sync.ts +0 -104
- package/scripts/deploy_and_init_v3.sh +0 -134
- package/scripts/deploy_anvil_accounts.ts +0 -144
- package/scripts/deploy_paymaster_v4.ts +0 -139
- package/scripts/deploy_test_accounts.ts +0 -401
- package/scripts/deprecated/check_aa_entrypoint.ts +0 -29
- package/scripts/deprecated/check_paymaster_deposits.ts +0 -45
- package/scripts/deprecated/debug_aoa_function.ts +0 -28
- package/scripts/deprecated/debug_aoa_issue.ts +0 -16
- package/scripts/deprecated/debug_pimlico_aa23.ts +0 -40
- package/scripts/deprecated/debug_summary.ts +0 -34
- package/scripts/deprecated/deploy_v07_aa.ts +0 -99
- package/scripts/deprecated/fix_all_issues.ts +0 -61
- package/scripts/deprecated/fund_bpnts.ts +0 -52
- package/scripts/deprecated/get_factory_addresses.ts +0 -28
- package/scripts/deprecated/recheck_pim.ts +0 -34
- package/scripts/dev_tools/extract_abis.sh +0 -151
- package/scripts/dev_tools/extract_addresses_to_env.sh +0 -67
- package/scripts/dev_tools/final_safe_harmonize.py +0 -77
- package/scripts/dev_tools/safe_harmonize.py +0 -107
- package/scripts/dev_tools/surgical_harmonize.py +0 -83
- package/scripts/experiment/stage3/SETUP_GUIDE.md +0 -258
- package/scripts/experiment/stage3/archived_scripts/00_token_distribution.ts +0 -78
- package/scripts/experiment/stage3/archived_scripts/01_dao_launch.ts +0 -96
- package/scripts/experiment/stage3/archived_scripts/01b_bread_launch.ts +0 -112
- package/scripts/experiment/stage3/archived_scripts/02_operator_setup.ts +0 -84
- package/scripts/experiment/stage3/archived_scripts/02b_operator_b_setup.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/02c_finalize_operators.ts +0 -86
- package/scripts/experiment/stage3/archived_scripts/02d_operator_collateral.ts +0 -89
- package/scripts/experiment/stage3/archived_scripts/03_user_onboarding.ts +0 -83
- package/scripts/experiment/stage3/archived_scripts/03b_deploy_aa_account.ts +0 -61
- package/scripts/experiment/stage3/archived_scripts/03c_aa_onboarding.ts +0 -104
- package/scripts/experiment/stage3/archived_scripts/03d_mint_points.ts +0 -60
- package/scripts/experiment/stage3/archived_scripts/04_benchmarking.ts +0 -100
- package/scripts/experiment/stage3/archived_scripts/05_multi_op_setup.ts +0 -149
- package/scripts/experiment/stage3/archived_scripts/README.md +0 -58
- package/scripts/experiment/stage3/archived_scripts/check_roles.ts +0 -29
- package/scripts/experiment/stage3/archived_scripts/decode_error.ts +0 -23
- package/scripts/experiment/stage3/archived_scripts/fund_user.ts +0 -51
- package/scripts/experiment/stage3/archived_scripts/gen_b_key.ts +0 -3
- package/scripts/experiment/stage3/archived_scripts/gen_keys.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/setup.ts +0 -105
- package/scripts/experiment/stage3/archived_scripts/test_key.ts +0 -4
- package/scripts/experiment/stage3/archived_scripts/verify_state.ts +0 -59
- package/scripts/experiment/stage3/refactored/00_token_distribution.ts +0 -46
- package/scripts/experiment/stage3/refactored/02_operator_setup.ts +0 -65
- package/scripts/experiment/stage3/refactored/03_user_onboarding.ts +0 -68
- package/scripts/experiment/stage3/refactored/05_multi_op_setup.ts +0 -63
- package/scripts/experiment/stage3/refactored/README.md +0 -71
- package/scripts/extract-docs.sh +0 -141
- package/scripts/fund-jack.ts +0 -38
- package/scripts/generate_env_from_deployment.ts +0 -109
- package/scripts/inspect-anni-token.ts +0 -116
- package/scripts/inspect-factory.ts +0 -83
- package/scripts/l4-paymasterv4-transfer-test.ts +0 -228
- package/scripts/l4-setup.ts +0 -453
- package/scripts/l4-state.json +0 -80
- package/scripts/phase1_verify_contracts.ts +0 -207
- package/scripts/pre_test_sync.ts +0 -83
- package/scripts/prepare_sepolia_resources.ts +0 -154
- package/scripts/publish_all.sh +0 -39
- package/scripts/query-jack-token.ts +0 -22
- package/scripts/quick_setup.ts +0 -124
- package/scripts/quick_setup_account.ts +0 -80
- package/scripts/run_automated_experiment.sh +0 -121
- package/scripts/run_daily_experiment.ts +0 -70
- package/scripts/run_l4_gasless_regression.sh +0 -32
- package/scripts/run_sdk_experiment.sh +0 -13
- package/scripts/run_sdk_regression-v2.sh +0 -38
- package/scripts/sdk_regression_v2.ts +0 -162
- package/scripts/security_audit.sh +0 -172
- package/scripts/setup-bbq-community.ts +0 -187
- package/scripts/setup-dancing-community.ts +0 -223
- package/scripts/setup_test_accounts.ts +0 -88
- package/scripts/setup_test_environment.ts +0 -147
- package/scripts/sync_anvil_config.cjs +0 -44
- package/scripts/sync_config_to_env.ts +0 -88
- package/scripts/sync_contract_addresses.ts +0 -186
- package/scripts/sync_sepolia_config.cjs +0 -90
- package/scripts/sync_sepolia_config.mjs +0 -74
- package/scripts/test-brown-v4-deploy.ts +0 -90
- package/scripts/test-faucet-and-gasless.ts +0 -170
- package/scripts/test-jack-gasless.ts +0 -119
- package/scripts/test-jack-registration.ts +0 -133
- package/scripts/test-jack-superpaymaster-api.ts +0 -112
- package/scripts/test-kms-gasless.ts +0 -138
- package/scripts/test_groups.ts +0 -138
- package/scripts/test_multi_community_anvil.ts +0 -276
- package/scripts/test_new_sdk_apis_sepolia.ts +0 -193
- package/scripts/test_sdk_join_idempotent.ts +0 -233
- package/scripts/test_simple_sepolia.ts +0 -44
- package/scripts/update_env_from_config.ts +0 -83
- package/scripts/v2_regression/README.md +0 -161
- package/scripts/verify-tx-status.ts +0 -81
- package/scripts/verify_onchain_milestone.ts +0 -114
- package/scripts/verify_phase1.ts +0 -66
- package/scripts/verify_phase2.ts +0 -66
- package/sdk_experiment_data.csv +0 -4
- package/simple-test-paymaster.sh +0 -2
- package/simple-test-superpaymaster.sh +0 -1
- package/tests/l1-regression.test.ts +0 -458
- package/tests/l4-test-anni-gasless.ts +0 -105
- package/tests/l4-test-jason1-gasless.ts +0 -150
- package/tests/l4-test-jason2-gasless.ts +0 -174
- package/tests/l4-test-pmv4-deposit.ts +0 -111
- package/tests/l4-test-pmv4-gasless.ts +0 -166
- package/tests/l4-test-pmv4-submit.ts +0 -223
- package/tests/regression/README.md +0 -168
- package/tests/regression/config.ts +0 -215
- package/tests/regression/display-versions.ts +0 -85
- package/tests/regression/index.ts +0 -67
- package/tests/regression/l1-tests.ts +0 -267
- package/tests/regression/l2-tests.ts +0 -171
- package/tests/regression/l3-tests.ts +0 -125
- package/tests/regression/l4-gasless.ts +0 -897
- package/tests/regression/l4-runner.ts +0 -52
- package/tests/reports/phase1_contract_verification.md +0 -45
- package/tests/utils/contractVerifier.ts +0 -237
- package/tests/utils/userOpHelper.ts +0 -194
- package/tsconfig.json +0 -41
- package/typedoc.json +0 -59
- package/vitest.config.ts +0 -16
- /package/{packages/core/src/crypto/index.ts → dist/core/src/crypto/index.d.ts} +0 -0
- /package/{packages/paymaster/src/V4/index.ts → dist/paymaster/src/V4/index.d.ts} +0 -0
- /package/{packages/sdk/examples → examples}/config.json +0 -0
- /package/{packages/sdk/examples → examples}/regression_test.ts +0 -0
package/README.md
CHANGED
|
@@ -1,299 +1,150 @@
|
|
|
1
|
-
#
|
|
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 网络基石**
|
|
1
|
+
# AAstar SDK
|
|
11
2
|
|
|
12
|
-
|
|
3
|
+
The ultimate TypeScript SDK for the AAstar Protocol - a decentralized, community-driven Account Abstraction ecosystem.
|
|
4
|
+
AAstar 协议的终极 TypeScript SDK —— 构建去中心化、社区驱动的账户抽象生态系统。
|
|
13
5
|
|
|
14
|
-
|
|
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--支援)
|
|
6
|
+
[](https://www.npmjs.com/package/@aastar/sdk)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
49
8
|
|
|
50
9
|
---
|
|
51
10
|
|
|
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.
|
|
11
|
+
## 🌟 Introduction | 简介
|
|
55
12
|
|
|
56
|
-
|
|
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
|
-
---
|
|
13
|
+
AAstar SDK provides a complete suite of tools to interact with the AAstar Protocol. It is designed with a **"Pre-check first, Action second"** philosophy, helping developers build robust dApps with minimal errors.
|
|
67
14
|
|
|
68
|
-
|
|
15
|
+
AAstar SDK 提供了一套完整的工具集用于交互 AAstar 协议。它采用了 **"先检查,后执行"** 的设计理念,帮助开发者构建低错误率、健壮的去中心化应用。
|
|
69
16
|
|
|
70
|
-
|
|
17
|
+
### Core Modules | 核心模块
|
|
71
18
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
19
|
+
- **`@aastar/community`**: Launch & manage DAOs. (启动和管理 DAO)
|
|
20
|
+
- **`@aastar/operator`**: Run Paymasters & earn rewards. (运行 Paymaster 并赚取收益)
|
|
21
|
+
- **`@aastar/enduser`**: Join communities & enjoy gasless txs. (加入社区并享受免 Gas 交易)
|
|
22
|
+
- **`@aastar/analytics`**: Monitor ecosystem data. (监控生态系统数据)
|
|
23
|
+
- **`@aastar/tokens`**: GToken & XPNTs finance tools. (GToken 和 XPNTs 金融工具)
|
|
24
|
+
- **`@aastar/identity`**: Reputation & SBT management. (声誉和 SBT 管理)
|
|
25
|
+
- **`@aastar/account`**: Smart Account (ERC-4337) utilities. (智能账户工具)
|
|
78
26
|
|
|
79
27
|
---
|
|
80
28
|
|
|
81
|
-
## Installation
|
|
29
|
+
## 📦 Installation | 安装
|
|
82
30
|
|
|
83
31
|
```bash
|
|
84
|
-
pnpm
|
|
32
|
+
pnpm add @aastar/sdk viem
|
|
33
|
+
# or
|
|
34
|
+
npm install @aastar/sdk viem
|
|
85
35
|
```
|
|
86
36
|
|
|
87
37
|
---
|
|
88
38
|
|
|
89
|
-
##
|
|
90
|
-
### End User Gasless Transaction / 终端用户 Gasless 流程
|
|
39
|
+
## 🚀 Usage | 使用指南
|
|
91
40
|
|
|
92
|
-
|
|
41
|
+
### 1. Initialize Client | 初始化客户端
|
|
93
42
|
|
|
94
43
|
```typescript
|
|
95
|
-
import {
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
---
|
|
44
|
+
import { createPublicClient, createWalletClient, http } from 'viem';
|
|
45
|
+
import { sepolia } from 'viem/chains';
|
|
46
|
+
import { CommunityClient, OperatorClient } from '@aastar/sdk';
|
|
118
47
|
|
|
119
|
-
|
|
48
|
+
// 1. Setup VIEM clients
|
|
49
|
+
const publicClient = createPublicClient({ chain: sepolia, transport: http() });
|
|
50
|
+
const walletClient = createWalletClient({ chain: sepolia, transport: http() });
|
|
120
51
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
52
|
+
// 2. Initialize AAstar Clients
|
|
53
|
+
const communityClient = new CommunityClient(publicClient, walletClient);
|
|
54
|
+
const operatorClient = new OperatorClient(publicClient, walletClient);
|
|
124
55
|
```
|
|
125
56
|
|
|
126
|
-
###
|
|
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
|
-
```
|
|
57
|
+
### 2. "Pre-check" Pattern | "预检查" 模式
|
|
136
58
|
|
|
59
|
+
Avoid reverts and save gas by checking requirements off-chain first.
|
|
60
|
+
通过链下预检查避免交易回滚并节省 Gas。
|
|
137
61
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
62
|
+
```typescript
|
|
63
|
+
// ❌ Old Way (Prone to errors)
|
|
64
|
+
// await communityClient.launchCommunity(...);
|
|
65
|
+
|
|
66
|
+
// ✅ New AAstar Way
|
|
67
|
+
const check = await communityClient.checkLaunchRequirements(myAddress, parseEther("33"));
|
|
68
|
+
|
|
69
|
+
if (!check.hasEnoughGToken) {
|
|
70
|
+
console.error(`Missing Requirements: ${check.missingRequirements.join(', ')}`);
|
|
71
|
+
// Output: "Need 33 GT, have 10 GT"
|
|
72
|
+
} else {
|
|
73
|
+
// Safe to execute
|
|
74
|
+
await communityClient.launchCommunity({
|
|
75
|
+
name: "My DAO",
|
|
76
|
+
tokenSymbol: "MDAO"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
141
79
|
```
|
|
142
80
|
|
|
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
|
-
---
|
|
81
|
+
### 3. Key Scenarios | 核心场景
|
|
152
82
|
|
|
153
|
-
|
|
154
|
-
For server-side or CLI tools needing direct private key management (e.g., `KeyManager`), use the Node-specific export:
|
|
83
|
+
#### 🏛️ For Community Owners (社区创建者)
|
|
155
84
|
|
|
156
85
|
```typescript
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
86
|
+
// Configure SBT rules for your community
|
|
87
|
+
await communityClient.configureSBTRules({
|
|
88
|
+
communityId: myCommunityId,
|
|
89
|
+
rule: {
|
|
90
|
+
minScore: 100,
|
|
91
|
+
requiredTags: ["OG"]
|
|
92
|
+
}
|
|
93
|
+
});
|
|
161
94
|
```
|
|
162
95
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
## Development Workflow / 开发者工作流
|
|
166
|
-
|
|
167
|
-
A step-by-step guide for contributors from contract modification to Sepolia deployment.
|
|
96
|
+
#### ⚙️ For Operators (运营商)
|
|
168
97
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
98
|
+
```typescript
|
|
99
|
+
// Check if you are ready to be a Super Paymaster
|
|
100
|
+
const status = await operatorClient.checkResources(myAddress);
|
|
101
|
+
|
|
102
|
+
if (status.hasRole) {
|
|
103
|
+
await operatorClient.withdrawCollateral(parseEther("50"));
|
|
104
|
+
} else {
|
|
105
|
+
console.log(status.recommendations);
|
|
106
|
+
// "Fund aPNTs for collateral", "Stake GToken"
|
|
107
|
+
}
|
|
174
108
|
```
|
|
175
109
|
|
|
176
|
-
|
|
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
|
-
```
|
|
110
|
+
#### 📊 For Analysts (分析师)
|
|
183
111
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# Run all SDK & Protocol tests
|
|
188
|
-
./run_sdk_regression.sh
|
|
189
|
-
```
|
|
112
|
+
```typescript
|
|
113
|
+
import { AnalyticsClient } from '@aastar/sdk';
|
|
190
114
|
|
|
191
|
-
|
|
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`.
|
|
115
|
+
const analytics = new AnalyticsClient(publicClient);
|
|
204
116
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
cd projects/aastar-sdk
|
|
209
|
-
./run_full_regression.sh --env sepolia
|
|
117
|
+
// Get real-time GToken metrics
|
|
118
|
+
const metrics = await analytics.getSupplyMetrics();
|
|
119
|
+
console.log(`Deflation Rate: ${metrics.deflationRate}%`);
|
|
210
120
|
```
|
|
211
121
|
|
|
212
|
-
|
|
213
122
|
---
|
|
214
123
|
|
|
215
|
-
##
|
|
124
|
+
## 🔧 Architecture | 架构
|
|
216
125
|
|
|
217
|
-
|
|
126
|
+
AAstar SDK is built on top of **viem**, ensuring lightweight and type-safe interactions. It abstracts complex contract logic into intuitive business primitives.
|
|
218
127
|
|
|
219
|
-
|
|
128
|
+
AAstar SDK 基于 **viem** 构建,确保轻量级和类型安全的交互。它将复杂的合约逻辑抽象为直观的业务原语。
|
|
220
129
|
|
|
221
|
-
|
|
130
|
+
| Package | Functionality (功能) |
|
|
131
|
+
|---------|---------------------|
|
|
132
|
+
| `@aastar/core` | Shared logic, Roles, RequirementChecker |
|
|
133
|
+
| `@aastar/community` | DAO Registry, XPNTs issuance |
|
|
134
|
+
| `@aastar/operator` | Paymaster ops, Staking management |
|
|
135
|
+
| `@aastar/enduser` | User onboarding, SBT minting |
|
|
136
|
+
| `@aastar/tokens` | Finance, Tokenomics, Approval flows |
|
|
137
|
+
| `@aastar/identity` | Reputation, Credit limits, ZK Proofs |
|
|
222
138
|
|
|
223
139
|
---
|
|
224
140
|
|
|
225
|
-
##
|
|
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
|
|
141
|
+
## 🤝 Contributing | 贡献
|
|
252
142
|
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
```
|
|
143
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
144
|
+
欢迎贡献!更多详情请参考 [贡献指南](CONTRIBUTING.md)。
|
|
286
145
|
|
|
287
146
|
---
|
|
288
147
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
|
148
|
+
<p align="center">
|
|
149
|
+
Built with ❤️ by the AAstar Community
|
|
150
|
+
</p>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Address, type Hex, type LocalAccount } from 'viem';
|
|
2
|
+
export type SimpleSmartAccount = LocalAccount & {
|
|
3
|
+
signUserOperation: (userOp: any) => Promise<Hex>;
|
|
4
|
+
getInitCode: () => Promise<Hex>;
|
|
5
|
+
getDummySignature: () => Promise<Hex>;
|
|
6
|
+
entryPoint: Address;
|
|
7
|
+
};
|
|
8
|
+
export declare function toSimpleSmartAccount(parameters: {
|
|
9
|
+
client: any;
|
|
10
|
+
owner: LocalAccount;
|
|
11
|
+
factoryAddress: Address;
|
|
12
|
+
entryPoint: {
|
|
13
|
+
address: Address;
|
|
14
|
+
version: '0.6' | '0.7';
|
|
15
|
+
};
|
|
16
|
+
salt?: bigint;
|
|
17
|
+
index?: bigint;
|
|
18
|
+
}): Promise<SimpleSmartAccount>;
|
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Address,
|
|
3
|
-
type Hex,
|
|
4
|
-
type LocalAccount,
|
|
5
|
-
type SignableMessage,
|
|
6
|
-
type TypedDataDefinition,
|
|
7
|
-
type Hash,
|
|
8
|
-
concatHex,
|
|
9
|
-
encodeFunctionData,
|
|
10
|
-
keccak256,
|
|
11
|
-
} from 'viem';
|
|
1
|
+
import { concatHex, encodeFunctionData, } from 'viem';
|
|
12
2
|
import { SimpleAccountFactoryABI } from '@aastar/core';
|
|
13
3
|
import { getUserOpHash } from '../index.js';
|
|
14
|
-
|
|
15
|
-
export type SimpleSmartAccount = LocalAccount & {
|
|
16
|
-
signUserOperation: (userOp: any) => Promise<Hex>;
|
|
17
|
-
getInitCode: () => Promise<Hex>;
|
|
18
|
-
getDummySignature: () => Promise<Hex>;
|
|
19
|
-
entryPoint: Address;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export async function toSimpleSmartAccount(parameters: {
|
|
23
|
-
client: any;
|
|
24
|
-
owner: LocalAccount;
|
|
25
|
-
factoryAddress: Address;
|
|
26
|
-
entryPoint: { address: Address; version: '0.6' | '0.7' };
|
|
27
|
-
salt?: bigint;
|
|
28
|
-
index?: bigint;
|
|
29
|
-
}): Promise<SimpleSmartAccount> {
|
|
4
|
+
export async function toSimpleSmartAccount(parameters) {
|
|
30
5
|
const { client, owner, factoryAddress, entryPoint, index = 0n, salt = 0n } = parameters;
|
|
31
|
-
|
|
32
6
|
// Calculate initCode
|
|
33
7
|
const factoryData = encodeFunctionData({
|
|
34
8
|
abi: SimpleAccountFactoryABI,
|
|
@@ -36,49 +10,40 @@ export async function toSimpleSmartAccount(parameters: {
|
|
|
36
10
|
args: [owner.address, salt]
|
|
37
11
|
});
|
|
38
12
|
const initCode = concatHex([factoryAddress, factoryData]);
|
|
39
|
-
|
|
40
13
|
// Calculate counterfactual address
|
|
41
14
|
const address = await client.readContract({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
address: factoryAddress,
|
|
16
|
+
abi: SimpleAccountFactoryABI,
|
|
17
|
+
functionName: 'getAddress',
|
|
18
|
+
args: [owner.address, salt]
|
|
46
19
|
});
|
|
47
|
-
|
|
48
20
|
return {
|
|
49
21
|
address,
|
|
50
22
|
publicKey: owner.address,
|
|
51
|
-
source: 'custom',
|
|
23
|
+
source: 'custom',
|
|
52
24
|
type: 'local',
|
|
53
25
|
entryPoint: entryPoint.address,
|
|
54
|
-
|
|
55
|
-
async signMessage({ message }: { message: SignableMessage }): Promise<Hex> {
|
|
26
|
+
async signMessage({ message }) {
|
|
56
27
|
// validating signature for smart account usually involves EIP-1271,
|
|
57
28
|
// but here we just sign with owner for SimpleAccount which validates owner sig
|
|
58
29
|
return owner.signMessage({ message });
|
|
59
30
|
},
|
|
60
|
-
|
|
61
|
-
async signTypedData(typedData: TypedDataDefinition): Promise<Hex> {
|
|
31
|
+
async signTypedData(typedData) {
|
|
62
32
|
return owner.signTypedData(typedData);
|
|
63
33
|
},
|
|
64
|
-
|
|
65
|
-
async signTransaction(transaction: any): Promise<Hex> {
|
|
34
|
+
async signTransaction(transaction) {
|
|
66
35
|
throw new Error('Smart Accounts cannot sign transactions directly. Use UserOperations.');
|
|
67
36
|
},
|
|
68
|
-
|
|
69
|
-
async signUserOperation(userOp: any): Promise<Hex> {
|
|
37
|
+
async signUserOperation(userOp) {
|
|
70
38
|
const chainId = client.chain?.id || 31337; // Default to local anvil if not found
|
|
71
39
|
const hash = getUserOpHash(userOp, entryPoint.address, chainId);
|
|
72
40
|
return owner.signMessage({ message: { raw: hash } });
|
|
73
41
|
},
|
|
74
|
-
|
|
75
42
|
async getInitCode() {
|
|
76
43
|
return initCode;
|
|
77
44
|
},
|
|
78
|
-
|
|
79
45
|
async getDummySignature() {
|
|
80
46
|
return '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
|
|
81
47
|
}
|
|
82
|
-
|
|
83
|
-
} as any as SimpleSmartAccount;
|
|
48
|
+
};
|
|
84
49
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WalletClient, type Address, type Chain, type Transport, type Hash, type Hex } from 'viem';
|
|
2
|
+
export type EOAWalletClient = WalletClient & {
|
|
3
|
+
sendTransaction: (args: {
|
|
4
|
+
to: Address;
|
|
5
|
+
value?: bigint;
|
|
6
|
+
data?: Hex;
|
|
7
|
+
}) => Promise<Hash>;
|
|
8
|
+
getAddress: () => Address;
|
|
9
|
+
};
|
|
10
|
+
export declare const createEOAWalletClient: (privateKey: Hex, chain: Chain, transport?: Transport) => EOAWalletClient;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createWalletClient, http } from 'viem';
|
|
2
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
3
|
+
export const createEOAWalletClient = (privateKey, chain, transport = http()) => {
|
|
4
|
+
const account = privateKeyToAccount(privateKey);
|
|
5
|
+
const client = createWalletClient({
|
|
6
|
+
account,
|
|
7
|
+
chain,
|
|
8
|
+
transport
|
|
9
|
+
});
|
|
10
|
+
const baseSendTransaction = client.sendTransaction.bind(client);
|
|
11
|
+
return Object.assign(client, {
|
|
12
|
+
async sendTransaction(args) {
|
|
13
|
+
return baseSendTransaction({
|
|
14
|
+
...args,
|
|
15
|
+
account,
|
|
16
|
+
chain
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
getAddress: () => account.address
|
|
20
|
+
});
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Hex, type Address } from 'viem';
|
|
2
|
+
export * from './eoa.js';
|
|
3
|
+
export * from './accounts/simple.js';
|
|
4
|
+
/**
|
|
5
|
+
* Common Pack Logic for v0.7 UserOperations
|
|
6
|
+
*/
|
|
7
|
+
export declare function packUserOpLimits(high: bigint, low: bigint): Hex;
|
|
8
|
+
/**
|
|
9
|
+
* Local implementation of EntryPoint v0.7 getUserOpHash
|
|
10
|
+
*/
|
|
11
|
+
export declare function getUserOpHash(op: any, ep: Address, chainId: number): Hex;
|
|
12
|
+
/**
|
|
13
|
+
* UserOperation Client for handling high-level flows
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserOpClient {
|
|
16
|
+
static estimateGas(bundler: any, op: any, entryPoint: Address): Promise<any>;
|
|
17
|
+
static sendUserOp(bundler: any, op: any, entryPoint: Address): Promise<any>;
|
|
18
|
+
static getReceipt(bundler: any, hash: Hex): Promise<any>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { encodeAbiParameters, keccak256 } from 'viem';
|
|
2
|
+
export * from './eoa.js';
|
|
3
|
+
export * from './accounts/simple.js';
|
|
4
|
+
/**
|
|
5
|
+
* Common Pack Logic for v0.7 UserOperations
|
|
6
|
+
*/
|
|
7
|
+
export function packUserOpLimits(high, low) {
|
|
8
|
+
return `0x${((high << 128n) | low).toString(16).padStart(64, '0')}`;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Local implementation of EntryPoint v0.7 getUserOpHash
|
|
12
|
+
*/
|
|
13
|
+
export function getUserOpHash(op, ep, chainId) {
|
|
14
|
+
const packed = encodeAbiParameters([
|
|
15
|
+
{ type: 'address' }, { type: 'uint256' }, { type: 'bytes32' }, { type: 'bytes32' },
|
|
16
|
+
{ type: 'bytes32' }, { type: 'uint256' }, { type: 'bytes32' }, { type: 'bytes32' }
|
|
17
|
+
], [
|
|
18
|
+
op.sender, BigInt(op.nonce),
|
|
19
|
+
keccak256(op.initCode && op.initCode !== "0x" ? op.initCode : '0x'),
|
|
20
|
+
keccak256(op.callData),
|
|
21
|
+
op.accountGasLimits, BigInt(op.preVerificationGas), op.gasFees,
|
|
22
|
+
keccak256(op.paymasterAndData)
|
|
23
|
+
]);
|
|
24
|
+
const enc = encodeAbiParameters([{ type: 'bytes32' }, { type: 'address' }, { type: 'uint256' }], [keccak256(packed), ep, BigInt(chainId)]);
|
|
25
|
+
return keccak256(enc);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* UserOperation Client for handling high-level flows
|
|
29
|
+
*/
|
|
30
|
+
export class UserOpClient {
|
|
31
|
+
static async estimateGas(bundler, op, entryPoint) {
|
|
32
|
+
return bundler.request({
|
|
33
|
+
method: 'eth_estimateUserOperationGas',
|
|
34
|
+
params: [op, entryPoint]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
static async sendUserOp(bundler, op, entryPoint) {
|
|
38
|
+
return bundler.request({
|
|
39
|
+
method: 'eth_sendUserOperation',
|
|
40
|
+
params: [op, entryPoint]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
static async getReceipt(bundler, hash) {
|
|
44
|
+
return bundler.request({
|
|
45
|
+
method: 'eth_getUserOperationReceipt',
|
|
46
|
+
params: [hash]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|