@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
|
@@ -1,663 +0,0 @@
|
|
|
1
|
-
# SuperPaymaster Gasless Test Guide
|
|
2
|
-
|
|
3
|
-
[中文版入口](#SuperPaymaster-无感交易测试指南-中文版) | [English Version](#superpaymaster-gasless-test-guide)
|
|
4
|
-
|
|
5
|
-
> For external testers to run a gasless UserOperation on Sepolia.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Pre-configured Test Accounts
|
|
10
|
-
|
|
11
|
-
Test accounts are dynamically configured via `l4-setup.ts` and stored in `scripts/l4-state.json`.
|
|
12
|
-
|
|
13
|
-
Key test personas:
|
|
14
|
-
- **Jason**: Uses PaymasterV4, Token: aPNTs
|
|
15
|
-
- **Bob**: Uses PaymasterV4, Token: bPNTs
|
|
16
|
-
- **Anni**: Uses SuperPaymaster, Token: dPNTs
|
|
17
|
-
- **Charlie**: Uses PaymasterV4, Token: cPNTs
|
|
18
|
-
|
|
19
|
-
Run `pnpm tsx scripts/l4-setup.ts` to view current addresses and status.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## SDK Readiness & Preparation (NEW)
|
|
24
|
-
|
|
25
|
-
The SDK now provides a "One-Click" readiness check to avoid common Bundler rejections.
|
|
26
|
-
|
|
27
|
-
### 1. Check Readiness (Diagnostic)
|
|
28
|
-
Check if the Paymaster is staked, price is set, and user has deposit.
|
|
29
|
-
|
|
30
|
-
```typescript
|
|
31
|
-
import { PaymasterOperator } from '@aastar/paymaster';
|
|
32
|
-
|
|
33
|
-
const report = await PaymasterOperator.checkGaslessReadiness(
|
|
34
|
-
publicClient,
|
|
35
|
-
entryPoint,
|
|
36
|
-
paymasterAddress,
|
|
37
|
-
userAA,
|
|
38
|
-
tokenAddress
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
if (!report.isReady) {
|
|
42
|
-
console.error("Issues found:", report.issues);
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### 2. Auto-Prepare (Operator Only)
|
|
47
|
-
Automatically fix missing stake, deposit, or prices.
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
const steps = await PaymasterOperator.prepareGaslessEnvironment(
|
|
51
|
-
operatorWallet,
|
|
52
|
-
publicClient,
|
|
53
|
-
entryPoint,
|
|
54
|
-
paymasterAddress,
|
|
55
|
-
tokenAddress,
|
|
56
|
-
{
|
|
57
|
-
tokenPriceUSD: 100000000n, // $1.00 (8 decimals)
|
|
58
|
-
minStake: parseEther('0.05'), // Reduced from 0.2 ETH
|
|
59
|
-
minDeposit: parseEther('0.1') // Minimum deposit required
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
console.log("Steps taken:", steps);
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Price Management APIs (For Operators)
|
|
68
|
-
|
|
69
|
-
The SDK provides these APIs in `PaymasterV4Client`:
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
import { PaymasterOperator } from '@aastar/paymaster';
|
|
73
|
-
|
|
74
|
-
// Write APIs (owner/operator only)
|
|
75
|
-
await PaymasterOperator.updatePrice(walletClient, paymasterAddress);
|
|
76
|
-
await PaymasterOperator.setTokenPrice(walletClient, paymasterAddress, tokenAddress, priceUSD);
|
|
77
|
-
|
|
78
|
-
// Read APIs (anyone) - also available in PaymasterOperator for convenience
|
|
79
|
-
const { price, updatedAt } = await PaymasterOperator.getCachedPrice(publicClient, paymasterAddress);
|
|
80
|
-
const tokenPrice = await PaymasterOperator.getTokenPrice(publicClient, paymasterAddress, tokenAddress);
|
|
81
|
-
|
|
82
|
-
// 4. Instant Bill (via TxHash) - No scanning required
|
|
83
|
-
const fee = await PaymasterClient.getTransactionFee(publicClient, txHash, paymasterAddress);
|
|
84
|
-
console.log(`Cost: ${fee.tokenCost} dPNTs`);
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Zero-Friction Workflow (Simplified)
|
|
90
|
-
|
|
91
|
-
For a streamlined experience, we provide ready-to-use scripts for both **Admin** (Environment Setup) and **Developer** (Transaction Submission).
|
|
92
|
-
|
|
93
|
-
### 1. Admin / DevOps: One-Click Preparation
|
|
94
|
-
Ensure the Paymaster environment is fully ready (Staked, Funded, Priced).
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# Checks 7+ readiness criteria and fixes them automatically
|
|
98
|
-
npx tsx examples/prepare-gasless.ts
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**What it does:**
|
|
102
|
-
- Checks EntryPoint Stake & Deposit
|
|
103
|
-
- verifying Oracle ETH/USD price
|
|
104
|
-
- Checks Token Support & Price
|
|
105
|
-
- Auto-seeds user deposit if low
|
|
106
|
-
|
|
107
|
-
### 2. App Developer: One-Liner Submission (Code Walkthrough)
|
|
108
|
-
|
|
109
|
-
To understand how to integrate Gasless features into your app, look at `examples/simple-gasless-demo.ts`. This script demonstrates the "Zero-Friction" Developer Experience (DX).
|
|
110
|
-
|
|
111
|
-
**Reference Script**: [`examples/simple-gasless-demo.ts`](../examples/simple-gasless-demo.ts)
|
|
112
|
-
|
|
113
|
-
#### Step 1: Setup Client & Wallet
|
|
114
|
-
Standard `viem` setup. You need a `WalletClient` (to sign the UserOp) and a `PublicClient` (to read data).
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
// 1. Setup Clients
|
|
118
|
-
const wallet = createWalletClient({ account, chain: sepolia, transport: http(rpcUrl) });
|
|
119
|
-
const client = createPublicClient({ chain: sepolia, transport: http(rpcUrl) });
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
#### Step 2: Define "User Intent" (CallData)
|
|
123
|
-
Instead of dealing with raw ABI encoding, use the SDK's semantic builders.
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
// 2A. Inner Action: Transfer 0.01 dPNTs
|
|
127
|
-
const innerCall = PaymasterClient.encodeTokenTransfer(recipient, parseEther('0.01'));
|
|
128
|
-
|
|
129
|
-
// 2B. Outer Action: Execute via AA
|
|
130
|
-
const callData = PaymasterClient.encodeExecution(
|
|
131
|
-
tokenAddress,
|
|
132
|
-
0n,
|
|
133
|
-
innerCall
|
|
134
|
-
);
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
#### Step 3: ✨ The Magic Line (Submission) ✨
|
|
138
|
-
This is the core of the SDK. The `submitGaslessUserOperation` function handles all the complexity of Account Abstraction:
|
|
139
|
-
1. **Gas Estimation**: Automatically calls the Bundler to estimate usage.
|
|
140
|
-
2. **Dynamic Gas Pricing**: Fetches current network gas prices and applies 1.5x buffer for volatility (no hardcoded values).
|
|
141
|
-
3. **Efficiency Guard**: Applies optimized gas limits (no buffer for verification, 1.1x for execution) to pass strict Bundler rules.
|
|
142
|
-
4. **Data Encoding**: Packs the Paymaster data (time validity, deposit info).
|
|
143
|
-
5. **Signing**: Signs the UserOp with the user's private key (v0.7 compliant).
|
|
144
|
-
6. **Submission**: Sends the packet to the Bundler.
|
|
145
|
-
|
|
146
|
-
```typescript
|
|
147
|
-
// 3. Submit Gasless UserOp (One-Liner)
|
|
148
|
-
// No need to specify gas prices - SDK auto-fetches from network!
|
|
149
|
-
const userOpHash = await PaymasterClient.submitGaslessUserOperation(
|
|
150
|
-
client, // Public Client for reads
|
|
151
|
-
wallet, // Wallet Client for signing
|
|
152
|
-
aaAccountAddress, // The User's AA Wallet Address
|
|
153
|
-
entryPointAddress, // Global EntryPoint
|
|
154
|
-
paymasterAddress, // The Paymaster paying the fees
|
|
155
|
-
tokenAddress, // The Token the user is "spending" (conceptually)
|
|
156
|
-
bundlerUrl, // Where to send the UserOp
|
|
157
|
-
callData // The action from Step 2
|
|
158
|
-
// Optional: Pass custom gas prices via options if needed
|
|
159
|
-
);
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
#### Step 4: Wait for Receipt
|
|
163
|
-
The `userOpHash` is just a tracking ID. You must wait for the Bundler to bundle it into a real Ethereum Transaction.
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
// 4. Wait for Execution
|
|
167
|
-
const receipt = await bundlerClient.waitForUserOperationReceipt({
|
|
168
|
-
hash: userOpHash
|
|
169
|
-
});
|
|
170
|
-
console.log(`mined in tx: ${receipt.receipt.transactionHash}`);
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
#### Step 5: Instant Bill (Get Cost)
|
|
174
|
-
Since the fee is deducted from an internal Paymaster balance (not an external ERC-20 transfer), users might wonder "How much did I pay?".
|
|
175
|
-
The `getTransactionFee` helper instantly decodes the `PostOpProcessed` log from the receipt to give you the exact cost.
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
// 5. Instant Bill (No scanning required)
|
|
179
|
-
const feeInfo = PaymasterClient.getFeeFromReceipt(receipt.receipt, paymasterAddress);
|
|
180
|
-
console.log(`[Instant Bill] Cost: ${formatEther(feeInfo.tokenCost)} dPNTs`);
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## Advanced: Remote Signing (KMS / MPC)
|
|
188
|
-
|
|
189
|
-
If your AA Account's private key is stored in a KMS (AWS, Google) or MPC Node, you cannot export it. **Good news**: The SDK is compatible with any signer.
|
|
190
|
-
|
|
191
|
-
**How to integrate:**
|
|
192
|
-
1. Create a custom `viem` Account that calls your KMS.
|
|
193
|
-
2. Pass this account to `createWalletClient`.
|
|
194
|
-
3. The SDK uses `wallet.account.signMessage(...)` internally.
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
// Example: Custom KMS Account
|
|
198
|
-
import { toAccount } from 'viem/accounts';
|
|
199
|
-
|
|
200
|
-
const kmsAccount = toAccount({
|
|
201
|
-
address: '0xYourAAAddress',
|
|
202
|
-
async signMessage({ message }) {
|
|
203
|
-
// 1. Send 'message.raw' (the UserOpHash) to your KMS API
|
|
204
|
-
const signature = await myKmsClient.sign(message.raw);
|
|
205
|
-
// 2. Return the signature
|
|
206
|
-
return signature;
|
|
207
|
-
},
|
|
208
|
-
// Implement other required methods (signTransaction, etc.) if needed
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
const wallet = createWalletClient({ account: kmsAccount, ... });
|
|
212
|
-
|
|
213
|
-
// Now just call the SDK as normal!
|
|
214
|
-
await PaymasterClient.submitGaslessUserOperation(..., wallet, ...);
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## SuperPaymaster Integration (Credit-Based Gasless)
|
|
222
|
-
|
|
223
|
-
SuperPaymaster allows users to pay gas using credits provided by an **Operator**. This model is ideal for ecosystem projects where a central entity (the Operator) sponsors transactions for its users.
|
|
224
|
-
|
|
225
|
-
### 1. The SuperPaymaster Flow
|
|
226
|
-
1. **Operator Config**: An Operator (e.g., Anni) configures a credit line in the SuperPaymaster contract.
|
|
227
|
-
2. **User Action**: A user (UserOp Sender) initiates a transaction.
|
|
228
|
-
3. **Submission**: The app submits the UserOp specifying the `operator` address.
|
|
229
|
-
4. **Execution**: SuperPaymaster verifies the Operator's credit and sponsors the gas.
|
|
230
|
-
|
|
231
|
-
### 2. Developer Workflow
|
|
232
|
-
|
|
233
|
-
We provide a dedicated `SuperPaymasterClient` that abstracts gas estimation and operator data packing.
|
|
234
|
-
|
|
235
|
-
**Reference Script**: [`examples/simple-superpaymaster-demo.ts`](../examples/simple-superpaymaster-demo.ts)
|
|
236
|
-
|
|
237
|
-
#### Step 1: Configure App & Operator
|
|
238
|
-
You need the **User's** account (Signer) and the **Operator's** address.
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
import { SuperPaymasterClient } from '@aastar/paymaster';
|
|
242
|
-
|
|
243
|
-
const APP_CONFIG = {
|
|
244
|
-
superPaymaster: '0x...', // Contract Address
|
|
245
|
-
operator: '0x...', // Operator Address (Provider)
|
|
246
|
-
token: '0x...' // Logic Token (optional context)
|
|
247
|
-
};
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
#### Step 2: Submit with Dynamic Gas Tuning
|
|
251
|
-
The `SuperPaymasterClient.submitGaslessTransaction` method automatically:
|
|
252
|
-
- **Estimates Gas**: Queries the Bundler.
|
|
253
|
-
- **Tunes Limits**: Adjusts `verificationGasLimit` to satisfy Bundler efficiency rules (> 0.4 ratio) while ensuring safe execution for Paymaster logic.
|
|
254
|
-
- **Packs Data**: Encodes the Operator address into the `paymasterAndData` field.
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
const userOpHash = await SuperPaymasterClient.submitGaslessTransaction(
|
|
258
|
-
client, // Public Client
|
|
259
|
-
wallet, // Wallet (Signer - Local or KMS)
|
|
260
|
-
userAA, // User's AA Address
|
|
261
|
-
entryPoint, // EntryPoint Address
|
|
262
|
-
bundlerUrl, // Bundler RPC
|
|
263
|
-
{
|
|
264
|
-
token: APP_CONFIG.token,
|
|
265
|
-
recipient: recipientAddress,
|
|
266
|
-
amount: parseEther('1'),
|
|
267
|
-
operator: APP_CONFIG.operator,
|
|
268
|
-
paymasterAddress: APP_CONFIG.superPaymaster
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### 3. Using KMS / MPC Signers
|
|
274
|
-
Just like the standard Paymaster usage, `SuperPaymasterClient` supports any `viem` Wallet Client.
|
|
275
|
-
|
|
276
|
-
If your User keys are in a KMS (AWS, Google, Fireblocks):
|
|
277
|
-
1. Create a custom `viem` Account that forwards `signMessage` calls to your KMS.
|
|
278
|
-
2. Pass this account to `createWalletClient`.
|
|
279
|
-
3. Pass the `wallet` to `SuperPaymasterClient`.
|
|
280
|
-
|
|
281
|
-
*(See "Advanced: Remote Signing" section above for code example).*
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## Automated Faucet & Verification Script (New)
|
|
291
|
-
|
|
292
|
-
We have implemented a **SepoliaFaucetAPI** that automates the tedious setup process for new test accounts (Funding ETH, Registering EndUser, Minting Tokens, Depositing to Paymaster).
|
|
293
|
-
|
|
294
|
-
### Verification Script
|
|
295
|
-
Run the following script to create a fresh AA account, fund it, and execute a gasless transaction immediately:
|
|
296
|
-
|
|
297
|
-
```bash
|
|
298
|
-
npx tsx scripts/test-faucet-and-gasless.ts
|
|
299
|
-
```
|
|
300
|
-
这个脚本
|
|
301
|
-
test-faucet-and-gasless.ts
|
|
302
|
-
实际上是一个端到端的全链路集成测试。它的核心任务是验证在没有 ETH 的情况下,一个新用户如何通过我们的 SDK 和 SuperPaymaster 体系从“零”开始变成一个“可用”的社区成员。
|
|
303
|
-
|
|
304
|
-
以下是该脚本工作的详细步骤描述:
|
|
305
|
-
|
|
306
|
-
1. 身份初始化
|
|
307
|
-
新用户生成:脚本会随机生成一个 privateKey,代表一个全新的用户 EOA。
|
|
308
|
-
AA 地址预测:利用 SDK 的 user.createSmartAccount 方法,根据 EOA 地址和 salt 预测出对应的智能账户地址(AA Address)。
|
|
309
|
-
2. AA 账户预部署(这是解决 AA13 报错的关键)
|
|
310
|
-
直接部署:脚本让 Supplier(资助者)发起一笔传统的 L1 交易,通过 Factory 为用户部署这个 AA 合约。
|
|
311
|
-
目的:确保后续的 Gasless UserOp 在仿真时面对的是一个“已存在”的合约,从而彻底避免 Bundler 对 initCode 仿真的不稳定性。
|
|
312
|
-
3. Faucet 准备阶段 (SepoliaFaucetAPI)
|
|
313
|
-
这一步是脚本最核心的业务逻辑,它模拟了“水龙头”或“新人礼包”的过程:
|
|
314
|
-
|
|
315
|
-
注入 ETH:Admin 向 AA 账户转入极小额的 ETH(约 0.02),用于支付非 Gasless 场景下的基础费用(如某些合约交互)。
|
|
316
|
-
赞助角色注册 (Spo Forces API):
|
|
317
|
-
问题:通常注册 ENDUSER 角色需要用户质押 0.5 GTokens,但新用户此时没有钱。
|
|
318
|
-
解决:Admin 调用 safeMintForRole。这是一种赞助模式,Admin 支付 GTokens 质押,直接将 ENDUSER 角色授予用户的 AA 账户。
|
|
319
|
-
注入 C-Points (aPNTs):Admin 直接给用户 AA 地址转入 1000 个 aPNTs 代币。这些代币是用户后面发起 Gasless 交易时扣除的“虚拟燃料”。
|
|
320
|
-
4. Gasless 交易测试 (SuperPaymasterClient)
|
|
321
|
-
一旦用户拥有了 ENDUSER 角色和 aPNTs,脚本就开始测试真正的无感交易:
|
|
322
|
-
|
|
323
|
-
提交 UserOp:用户发起一个“转账回 Admin”的请求(作为测试动作)。
|
|
324
|
-
SuperPaymaster 介入:
|
|
325
|
-
SuperPaymaster 检查该 AA 用户是否拥有 ENDUSER 角色。
|
|
326
|
-
它会检查 AA 用户账户里的 aPNTs 余额是否足够支付 Gas。
|
|
327
|
-
执行:支付中心(SuperPaymaster)会为这笔交易担保并支付 Sepolia 网络原生的 Gas 费,而用户的 AA 账户则扣除相应的 aPNTs。
|
|
328
|
-
总结
|
|
329
|
-
你描述得很准确:
|
|
330
|
-
|
|
331
|
-
随机生成/使用指定 A Account。
|
|
332
|
-
不转 GToken 质押金,而是由 Admin “带”他完成社区注册(Sponsor Stake)。
|
|
333
|
-
转入 aPNTs (C-Points) 供其消费。
|
|
334
|
-
发起 Gasless 交易,验证整个“免 Gas”链路在真实 Sepolia 网络上是连通的。
|
|
335
|
-
这个脚本成功运行,标志着我们的 SDK 在处理 v0.7 账户的赞助注册 + 燃料资助 + 无感交易这一套业务逻辑上已经完全成熟。
|
|
336
|
-
**What it does:**
|
|
337
|
-
1. **Identity**: Generates a random private key (Brand new user).
|
|
338
|
-
2. **Faucet**: Uses `SepoliaFaucetAPI.prepareTestAccount` to:
|
|
339
|
-
- Fund 0.02 ETH (if needed).
|
|
340
|
-
- Register `ENDUSER` role (attempts via Admin key; logs warning if no permission).
|
|
341
|
-
- Mint `cPNTs` tokens (for SuperPaymaster).
|
|
342
|
-
- Deposit tokens to Paymaster V4 (if needed).
|
|
343
|
-
3. **Action**: Calculates the AA address (undeployed).
|
|
344
|
-
4. **Submission**: Uses `SuperPaymasterClient` (with factory support) to deploy and execute a gasless transaction in one step.
|
|
345
|
-
|
|
346
|
-
> **Note**: Requires `PRIVATE_KEY` (Deployer) or `PRIVATE_KEY_ANNI` in `.env.sepolia` to have Admin/Minter privileges. If specific permissions fail (like GrantRole), the script attempts to proceed.
|
|
347
|
-
|
|
348
|
-
---
|
|
349
|
-
|
|
350
|
-
## 🛠️ Synergy: Faucet + KMS (Hardware/Cloud Wallets)
|
|
351
|
-
|
|
352
|
-
If you are using a **KMS-backed AA account** (where the private key never leaves AWS/Google/Fireblocks), you can still use the full power of the Faucet and Gasless SDK.
|
|
353
|
-
|
|
354
|
-
### 1. Setup is "Keyless"
|
|
355
|
-
The **Faucet Setup** phase (`SepoliaFaucetAPI.prepareTestAccount`) DOES NOT require your user's private key.
|
|
356
|
-
- It only needs your **AA Address**.
|
|
357
|
-
- The `Admin` (Anni/Deployer) uses *their* key to grant you roles and fund you tokens.
|
|
358
|
-
|
|
359
|
-
**Code Sample: Faucet Setup (One-Time)**
|
|
360
|
-
```typescript
|
|
361
|
-
import { SepoliaFaucetAPI } from '@aastar/core';
|
|
362
|
-
|
|
363
|
-
await SepoliaFaucetAPI.prepareTestAccount(
|
|
364
|
-
adminWallet, // WalletClient with Admin Key
|
|
365
|
-
publicClient,
|
|
366
|
-
{
|
|
367
|
-
targetAA: '0xYourUserAddress',
|
|
368
|
-
token: CORE_ADDRESSES.aPNTs,
|
|
369
|
-
registry: CORE_ADDRESSES.registry,
|
|
370
|
-
superPaymaster: CORE_ADDRESSES.superPaymaster,
|
|
371
|
-
ethAmount: parseEther('0.02')
|
|
372
|
-
}
|
|
373
|
-
);
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
**Workflow**:
|
|
377
|
-
1. Provide your KMS AA Address to the Admin.
|
|
378
|
-
2. Owner/Admin runs the Faucet script for your address.
|
|
379
|
-
3. Your account is now "Gasless Ready" (has ENDUSER role + aPNTs).
|
|
380
|
-
|
|
381
|
-
### 2. Signing is "KMS-native"
|
|
382
|
-
The **Execution** phase (`SuperPaymasterClient.submitGaslessTransaction`) requires a signature, but it accepts a standard `viem` Client.
|
|
383
|
-
- You can wrap your KMS API into a custom `viem` `Account`.
|
|
384
|
-
- The SDK will call your KMS to sign the `UserOpHash`.
|
|
385
|
-
|
|
386
|
-
**Code Sample: Remote Signer (KMS) Integration**
|
|
387
|
-
```typescript
|
|
388
|
-
import { http, createPublicClient } from 'viem';
|
|
389
|
-
import { toAccount } from 'viem/accounts';
|
|
390
|
-
import { createEndUserClient, CORE_ADDRESSES } from '@aastar/sdk';
|
|
391
|
-
|
|
392
|
-
// 1. Define your Remote Signer (KMS) Wrapper
|
|
393
|
-
const kmsAccount = toAccount({
|
|
394
|
-
address: '0xYourUserAAAddress',
|
|
395
|
-
async signMessage({ message }) {
|
|
396
|
-
// Implement your KMS call here (e.g., AWS KMS, Fireblocks)
|
|
397
|
-
// message.raw is the hash (UserOpHash) to sign
|
|
398
|
-
const sig = await remoteKmsSign(message.raw);
|
|
399
|
-
return sig;
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
// 2. Initialize SDK Client with Remote Account
|
|
404
|
-
const userClient = createEndUserClient({
|
|
405
|
-
transport: http(rpcUrl),
|
|
406
|
-
chain: sepolia,
|
|
407
|
-
account: kmsAccount,
|
|
408
|
-
addresses: {
|
|
409
|
-
registry: CORE_ADDRESSES.registry,
|
|
410
|
-
entryPoint: CORE_ADDRESSES.entryPoint
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
// 3. Execute Gasless Transaction
|
|
415
|
-
const result = await userClient.executeGasless({
|
|
416
|
-
target: '0xTargetContract',
|
|
417
|
-
data: '0xCallData',
|
|
418
|
-
operator: '0xPaymasterOperatorAddress'
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
console.log('UserOp Hash:', result.hash);
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
### 3. Combination Summary
|
|
425
|
-
| Phase | Requirement | Logic |
|
|
426
|
-
| :--- | :--- | :--- |
|
|
427
|
-
| **Preparation** | AA Address | **Keyless**: Admin sponsors your entry. |
|
|
428
|
-
| **Verification** | AA Address | **Public**: Check roles/balance via SDK. |
|
|
429
|
-
| **Execution** | KMS Signature | **Secure**: SDK requests signature from your KMS. |
|
|
430
|
-
|
|
431
|
-
> [!TIP]
|
|
432
|
-
> This separation allows developers to onboard "Air-Gapped" or "Enterprise" accounts into the SuperPaymaster ecosystem without ever touching their private keys.
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
---
|
|
436
|
-
|
|
437
|
-
## Appendix: Real Transaction Analysis
|
|
438
|
-
|
|
439
|
-
Below is an analysis of a fulfilled Gasless Transaction (executed via `l4-test-jason1-gasless.ts` on Sepolia).
|
|
440
|
-
|
|
441
|
-
**Transaction Hash**: `0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb`
|
|
442
|
-
**Etherscan Link**: [View on Sepolia Etherscan](https://sepolia.etherscan.io/tx/0xa3179a3464ac9d14681f051b9ea7f194834cfd9b65f6897415195a28656ce1cb)
|
|
443
|
-
|
|
444
|
-
### Data Breakdown
|
|
445
|
-
|
|
446
|
-
| Field | Value / Description | Interpretation |
|
|
447
|
-
| :--- | :--- | :--- |
|
|
448
|
-
| **Status** | `Success` | The transaction was mined and executed successfully. |
|
|
449
|
-
| **From** | `0x4a1627CACf9bFb16ed955738b9932d511644e489` (Bundler EOA) | The Bundler/Relayer that submitted the batch. This is NOT the user. |
|
|
450
|
-
| **To** | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` (EntryPoint v0.7) | The central EntryPoint contract that constructs and executes the AA call. |
|
|
451
|
-
| **Transaction Action** | Transfer 0.1 dPNTs | The verified "User Intent". The AA account successfully called the Token contract. |
|
|
452
|
-
| **ERC-20 Tokens** | `0xECD9C07f648B09CFb78906302822Ec52Ab87dd70` (Jason AA1) → `0xEcAACb915f7D92e9916f449F7ad42BD0408733c9` (Anni) | **The Core Action**: Jason AA1 transferred 0.1 dPNTs to Anni. |
|
|
453
|
-
| **Gas Usage** | `165,824` / `409,844` (40.46%) | The Paymaster sponsored the gas. The Bundler overestimated (Limit), but actual usage was fair. |
|
|
454
|
-
| **Internal Txns** | Transfer 0.0000189 ETH (Refund) | The **Paymaster** (via EntryPoint) refunding the Bundler for the ETH gas cost. |
|
|
455
|
-
| **Burnt Fees** | `0.00000000047...` ETH | The portion of the gas fee burnt by the network (EIP-1559). |
|
|
456
|
-
|
|
457
|
-
### Key Takeaways
|
|
458
|
-
1. **User Pays Zero ETH**: The `From` address (Bundler) paid the ETH gas. The Internal Transaction shows the Bundler getting reimbursed.
|
|
459
|
-
2. **User Spent dPNTs**: The `ERC-20 Token Transfer` shows the user moving `dPNTs`. This likely covers the service fee (gas + premium) in a real "Pay with Token" model, though in this "Gasless" mode, the dPNTs might just be the payload or a separate fee payment.
|
|
460
|
-
|
|
461
|
-
### Frequently Asked Questions (Analysis)
|
|
462
|
-
|
|
463
|
-
#### 1. Why is "From" the Bundler, not the User?
|
|
464
|
-
In Account Abstraction (ERC-4337), the User does not send the transaction directly.
|
|
465
|
-
- **The Envelope**: The Bundler (`0x4a16...`) sends the Ethereum Transaction to the `EntryPoint`. They pay the ETH gas.
|
|
466
|
-
- **The Letter**: The `EntryPoint` opens the envelope and executes your **UserOperation**.
|
|
467
|
-
- **The Result**: Etherscan shows the "Envelope" (Bundler -> EntryPoint) as the top-level transaction. Your action (Token Transfer) is an *Internal Transaction* or *Log Event* triggered inside.
|
|
468
|
-
|
|
469
|
-
#### 2. Where is the Gas Fee? "Value: 0 ETH"?
|
|
470
|
-
- The `Transaction Fee` shown on Etherscan (e.g., 0.000016 ETH) is paid by the **Bundler**.
|
|
471
|
-
- The **Paymaster** refunds the Bundler (visible in "Internal Transactions" as a transfer from Paymaster to Bundler).
|
|
472
|
-
- **Your Cost (in Tokens)**: Since this Paymaster uses a "Deposit Model", the fee is deducted from your internal balance within the Paymaster contract.
|
|
473
|
-
- **Visibility**: This deduction does NOT show up as an ERC-20 Transfer (because tokens didn't move wallets, only internal counters changed).
|
|
474
|
-
- **Verification**: Look at the **Logs** tab for the `PostOpProcessed` event. It explicitly lists `tokenCost` (the amount of dPNTs deducted).
|
|
475
|
-
|
|
476
|
-
#### 3. Why is there only one ERC-20 Transfer?
|
|
477
|
-
- The transfer you see (`0.1 dPNTs` from Jason to Anni) is your **Actual execution payload**.
|
|
478
|
-
- If the Paymaster used "Token Paymaster Mode 1" (pulling tokens from your wallet), you would see a second transfer for the fee.
|
|
479
|
-
|
|
480
|
-
#### 4. "I can't see the Deducted Amount!" (How to Read Logs)
|
|
481
|
-
You mentioned you couldn't find the deduction. It is in **Log Index 2** (on Etherscan Logs tab).
|
|
482
|
-
- **Event Signature (Topic 0)**: `0x62544d7f...` (`PostOpProcessed`).
|
|
483
|
-
- **Data Field**: Contains 3 values (32 bytes each).
|
|
484
|
-
1. **ActualGasCost (ETH)**: `0xc5ba77775be` -> `0.00001358 ETH` (The actual reimbursed amount).
|
|
485
|
-
2. **TokenCost (dPNTs)**: `0x99ffeb21efcb3b` -> `43346900000000000` (Raw Units).
|
|
486
|
-
- Assuming 18 decimals: **0.0433469 dPNTs**.
|
|
487
|
-
3. **ProtocolRevenue**: Same as above (no markup in this test).
|
|
488
|
-
|
|
489
|
-
**Summary**: Your deposit was deducted by **0.0433 dPNTs**.
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
# SuperPaymaster Gasless Test Guide (中文版)
|
|
494
|
-
|
|
495
|
-
> 本指南供外部测试人员在 Sepolia 测试网上运行 Gasless(无感)UserOperation 时参考。
|
|
496
|
-
|
|
497
|
-
---
|
|
498
|
-
|
|
499
|
-
## 预配置测试账户
|
|
500
|
-
|
|
501
|
-
测试账户通过 `l4-setup.ts` 动态配置,并存储在 `scripts/l4-state.json` 中。
|
|
502
|
-
|
|
503
|
-
关键测试角色:
|
|
504
|
-
- **Jason**: 使用 PaymasterV4, 代币: aPNTs
|
|
505
|
-
- **Bob**: 使用 PaymasterV4, 代币: bPNTs
|
|
506
|
-
- **Anni**: 使用 SuperPaymaster, 代币: dPNTs
|
|
507
|
-
- **Charlie**: 使用 PaymasterV4, 代币: cPNTs
|
|
508
|
-
|
|
509
|
-
运行 `pnpm tsx scripts/l4-setup.ts` 可以查看当前的地址和状态。
|
|
510
|
-
|
|
511
|
-
---
|
|
512
|
-
|
|
513
|
-
## SDK 就绪检查与准备
|
|
514
|
-
|
|
515
|
-
SDK 现在提供了“一键式”就绪检查,以避免常见的 Bundler 拒绝风险。
|
|
516
|
-
|
|
517
|
-
### 1. 检查就绪状态 (诊断)
|
|
518
|
-
检查 Paymaster 是否质押、价格是否设置以及用户是否有存款。
|
|
519
|
-
|
|
520
|
-
```typescript
|
|
521
|
-
import { PaymasterOperator } from '@aastar/paymaster';
|
|
522
|
-
|
|
523
|
-
const report = await PaymasterOperator.checkGaslessReadiness(
|
|
524
|
-
publicClient,
|
|
525
|
-
entryPoint,
|
|
526
|
-
paymasterAddress,
|
|
527
|
-
userAA,
|
|
528
|
-
tokenAddress
|
|
529
|
-
);
|
|
530
|
-
|
|
531
|
-
if (!report.isReady) {
|
|
532
|
-
console.error("发现问题:", report.issues);
|
|
533
|
-
}
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
### 2. 自动准备 (仅限运营商)
|
|
537
|
-
自动修复缺失的质押、存款或价格。
|
|
538
|
-
|
|
539
|
-
```typescript
|
|
540
|
-
const steps = await PaymasterOperator.prepareGaslessEnvironment(
|
|
541
|
-
operatorWallet,
|
|
542
|
-
publicClient,
|
|
543
|
-
entryPoint,
|
|
544
|
-
paymasterAddress,
|
|
545
|
-
tokenAddress,
|
|
546
|
-
{
|
|
547
|
-
tokenPriceUSD: 100000000n, // $1.00 (8 位小数)
|
|
548
|
-
minStake: parseEther('0.05'),
|
|
549
|
-
minDeposit: parseEther('0.1')
|
|
550
|
-
}
|
|
551
|
-
);
|
|
552
|
-
console.log("采取的步骤:", steps);
|
|
553
|
-
```
|
|
554
|
-
|
|
555
|
-
---
|
|
556
|
-
|
|
557
|
-
## 极简开发工作流
|
|
558
|
-
|
|
559
|
-
### 1. 开发者:单行代码提交 (API 详解)
|
|
560
|
-
|
|
561
|
-
参考脚本:[`examples/simple-gasless-demo.ts`](../examples/simple-gasless-demo.ts)
|
|
562
|
-
|
|
563
|
-
#### 第一步:设置客户端
|
|
564
|
-
```typescript
|
|
565
|
-
const wallet = createWalletClient({ account, chain: sepolia, transport: http(rpcUrl) });
|
|
566
|
-
const client = createPublicClient({ chain: sepolia, transport: http(rpcUrl) });
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
#### 第二步:定义“用户意图” (CallData)
|
|
570
|
-
```typescript
|
|
571
|
-
const innerCall = PaymasterClient.encodeTokenTransfer(recipient, parseEther('0.01'));
|
|
572
|
-
const callData = PaymasterClient.encodeExecution(tokenAddress, 0n, innerCall);
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
#### 第三步:✨ 核心提交接口 ✨
|
|
576
|
-
`submitGaslessUserOperation` 函数处理了 AA 的所有复杂性:自动估算 Gas、动态获取网络 Gas 价格、应用效率保护机制。
|
|
577
|
-
|
|
578
|
-
```typescript
|
|
579
|
-
const userOpHash = await PaymasterClient.submitGaslessUserOperation(
|
|
580
|
-
client, // 公共客户端
|
|
581
|
-
wallet, // 钱包客户端 (用于签名)
|
|
582
|
-
aaAccountAddress, // 用户的 AA 钱包地址
|
|
583
|
-
entryPointAddress, // 入口合约地址
|
|
584
|
-
paymasterAddress, // 支付中心地址
|
|
585
|
-
tokenAddress, // 用户支付的代币地址
|
|
586
|
-
bundlerUrl, // Bundler RPC 地址
|
|
587
|
-
callData // 业务操作数据
|
|
588
|
-
);
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
---
|
|
592
|
-
|
|
593
|
-
## 🛠️ 协同配合:水龙头 (Faucet) + KMS (硬件/云钱包)
|
|
594
|
-
|
|
595
|
-
如果你使用的是 **KMS 后端 AA 账户**(私钥不出 AWS/Google/Fireblocks),你仍然可以充分利用 Faucet 和 Gasless SDK。
|
|
596
|
-
|
|
597
|
-
### 1. 准备阶段是“无私钥”的
|
|
598
|
-
**Faucet 设置阶段** (`SepoliaFaucetAPI.prepareTestAccount`) **不需要**用户的私钥。
|
|
599
|
-
- 它只需要你的 **AA 地址**。
|
|
600
|
-
- 管理员 (Admin) 使用他们的密钥为你授予角色并资助代币。
|
|
601
|
-
|
|
602
|
-
**代码示例:水龙头准备 (一次性)**
|
|
603
|
-
```typescript
|
|
604
|
-
import { SepoliaFaucetAPI } from '@aastar/core';
|
|
605
|
-
|
|
606
|
-
await SepoliaFaucetAPI.prepareTestAccount(
|
|
607
|
-
adminWallet, // 管理员钱包
|
|
608
|
-
publicClient,
|
|
609
|
-
{
|
|
610
|
-
targetAA: '0xYourUserAddress',
|
|
611
|
-
token: CORE_ADDRESSES.aPNTs,
|
|
612
|
-
registry: CORE_ADDRESSES.registry,
|
|
613
|
-
superPaymaster: CORE_ADDRESSES.superPaymaster,
|
|
614
|
-
ethAmount: parseEther('0.02')
|
|
615
|
-
}
|
|
616
|
-
);
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
### 2. 签名阶段是“KMS 原生”的
|
|
620
|
-
**执行阶段** (`SuperPaymasterClient.submitGaslessTransaction`) 需要签名逻辑,但它兼容任何 `viem` Signer。
|
|
621
|
-
- 你可以将 KMS API 封装进自定义的 `viem` `Account` 即可。
|
|
622
|
-
|
|
623
|
-
**代码示例:远程签名者 (KMS) 包装**
|
|
624
|
-
```typescript
|
|
625
|
-
const kmsAccount = toAccount({
|
|
626
|
-
address: '0xYourUserAAAddress',
|
|
627
|
-
async signMessage({ message }) {
|
|
628
|
-
const sig = await remoteKmsSign(message.raw);
|
|
629
|
-
return sig;
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
|
|
633
|
-
const userClient = createEndUserClient({
|
|
634
|
-
transport: http(rpcUrl),
|
|
635
|
-
chain: sepolia,
|
|
636
|
-
account: kmsAccount,
|
|
637
|
-
...
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
const hash = await userClient.executeGasless({
|
|
641
|
-
target: '0xTargetContract',
|
|
642
|
-
data: '0xCallData',
|
|
643
|
-
operator: '0xPaymasterOperatorAddress'
|
|
644
|
-
});
|
|
645
|
-
```
|
|
646
|
-
|
|
647
|
-
---
|
|
648
|
-
|
|
649
|
-
## 自动化水龙头与验证脚本
|
|
650
|
-
|
|
651
|
-
运行以下脚本可以创建一个全新的 AA 账户,资助它,并立即执行无感交易验证:
|
|
652
|
-
|
|
653
|
-
```bash
|
|
654
|
-
npx tsx scripts/test-faucet-and-gasless.ts
|
|
655
|
-
```
|
|
656
|
-
|
|
657
|
-
**脚本功能:**
|
|
658
|
-
1. **身份**: 随机生成 EOA 密钥对。
|
|
659
|
-
2. **部署**: 通过传统交易预部署 AA 账户(提升 Bundler 模拟成功率)。
|
|
660
|
-
3. **Faucet**: 资助 0.02 ETH,使用 `safeMintForRole` 赞助 `ENDUSER` 角色(Admin 付质押金),并充值 aPNTs 燃料。
|
|
661
|
-
4. **提交**: 使用 `SuperPaymasterClient` 发起 Gasless 交易。
|
|
662
|
-
|
|
663
|
-
**结论**:该脚本成功运行,标志着 SDK 在处理 v0.7 账户的**赞助注册 + 燃料资助 + 无感交易**这一套业务逻辑上已经完全成熟。
|