@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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type Address, type Hex, type PublicClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* ERC-4337 v0.7 Packed UserOperation structure.
|
|
4
|
+
*/
|
|
5
|
+
export interface PackedUserOperation {
|
|
6
|
+
sender: Address;
|
|
7
|
+
nonce: Hex;
|
|
8
|
+
initCode: Hex;
|
|
9
|
+
callData: Hex;
|
|
10
|
+
accountGasLimits: Hex;
|
|
11
|
+
preVerificationGas: Hex;
|
|
12
|
+
gasFees: Hex;
|
|
13
|
+
paymasterAndData: Hex;
|
|
14
|
+
signature: Hex;
|
|
15
|
+
}
|
|
16
|
+
export interface UserOpGasParams {
|
|
17
|
+
verificationGasLimit: bigint;
|
|
18
|
+
callGasLimit: bigint;
|
|
19
|
+
preVerificationGas: bigint;
|
|
20
|
+
maxPriorityFeePerGas: bigint;
|
|
21
|
+
maxFeePerGas: bigint;
|
|
22
|
+
}
|
|
23
|
+
export interface PaymasterGasParams {
|
|
24
|
+
paymasterGasLimit: bigint;
|
|
25
|
+
paymasterPostOpGasLimit: bigint;
|
|
26
|
+
}
|
|
27
|
+
export declare class UserOperationBuilder {
|
|
28
|
+
/**
|
|
29
|
+
* Packs verificationGasLimit and callGasLimit into a bytes32 Hex string.
|
|
30
|
+
*/
|
|
31
|
+
static packAccountGasLimits(verificationGasLimit: bigint, callGasLimit: bigint): Hex;
|
|
32
|
+
/**
|
|
33
|
+
* Packs maxPriorityFeePerGas and maxFeePerGas into a bytes32 Hex string.
|
|
34
|
+
*/
|
|
35
|
+
static packGasFees(maxPriorityFeePerGas: bigint, maxFeePerGas: bigint): Hex;
|
|
36
|
+
/**
|
|
37
|
+
* Packs Paymaster parameters into the v0.7 paymasterAndData format.
|
|
38
|
+
*/
|
|
39
|
+
static packPaymasterAndData(paymaster: Address, paymasterGasLimit: bigint, paymasterPostOpGasLimit: bigint, paymasterData?: Hex): Hex;
|
|
40
|
+
/**
|
|
41
|
+
* Pack PaymasterV4 Deposit-Only paymasterAndData
|
|
42
|
+
*
|
|
43
|
+
* v0.7 EntryPoint packs: [paymaster(20)][verificationGas(16)][postOpGas(16)][paymasterData]
|
|
44
|
+
* Contract extracts token at offset 52 = paymasterData[0:20]
|
|
45
|
+
*
|
|
46
|
+
* So paymasterData format must be: [token(20)][validUntil(6)][validAfter(6)]
|
|
47
|
+
*
|
|
48
|
+
* @param paymaster - Paymaster address (20 bytes)
|
|
49
|
+
* @param paymentToken - ERC20 token address (20 bytes, FIRST in paymasterData!)
|
|
50
|
+
* @param validUntil - Validity end timestamp (6 bytes)
|
|
51
|
+
* @param validAfter - Validity start timestamp (6 bytes)
|
|
52
|
+
*/
|
|
53
|
+
static packPaymasterV4DepositData(paymaster: Address, paymasterVerificationGasLimit: bigint, paymasterPostOpGasLimit: bigint, paymentToken: Address, validUntil: bigint, validAfter: bigint): Hex;
|
|
54
|
+
/**
|
|
55
|
+
* Computes the UserOperation hash for signing.
|
|
56
|
+
*/
|
|
57
|
+
static getUserOpHash({ userOp, entryPoint, chainId, publicClient }: {
|
|
58
|
+
userOp: PackedUserOperation;
|
|
59
|
+
entryPoint: Address;
|
|
60
|
+
chainId: number;
|
|
61
|
+
publicClient: PublicClient;
|
|
62
|
+
}): Promise<Hex>;
|
|
63
|
+
/**
|
|
64
|
+
* Formats a PackedUserOperation into a JSON-RPC compatible object with hex-encoded strings.
|
|
65
|
+
*/
|
|
66
|
+
static jsonifyUserOp(userOp: any): any;
|
|
67
|
+
/**
|
|
68
|
+
* Converts a PackedUserOperation to the Alchemy-specific v0.7 JSON format.
|
|
69
|
+
* @param userOp - The packed UserOperation
|
|
70
|
+
* @param options - Optional configuration
|
|
71
|
+
* @param options.paymasterVerificationGasLimit - Gas limit for paymaster verification (default: 200000)
|
|
72
|
+
* @param options.paymasterPostOpGasLimit - Gas limit for paymaster postOp (default: 200000)
|
|
73
|
+
*/
|
|
74
|
+
static toAlchemyUserOperation(userOp: any, options?: {
|
|
75
|
+
paymasterVerificationGasLimit?: bigint;
|
|
76
|
+
paymasterPostOpGasLimit?: bigint;
|
|
77
|
+
}): any;
|
|
78
|
+
}
|
|
@@ -1,92 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ERC-4337 v0.7 Packed UserOperation structure.
|
|
5
|
-
*/
|
|
6
|
-
export interface PackedUserOperation {
|
|
7
|
-
sender: Address;
|
|
8
|
-
nonce: Hex;
|
|
9
|
-
initCode: Hex;
|
|
10
|
-
callData: Hex;
|
|
11
|
-
accountGasLimits: Hex; // bytes32 (packed verificationGasLimit and callGasLimit)
|
|
12
|
-
preVerificationGas: Hex;
|
|
13
|
-
gasFees: Hex; // bytes32 (packed maxPriorityFeePerGas and maxFeePerGas)
|
|
14
|
-
paymasterAndData: Hex;
|
|
15
|
-
signature: Hex;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface UserOpGasParams {
|
|
19
|
-
verificationGasLimit: bigint;
|
|
20
|
-
callGasLimit: bigint;
|
|
21
|
-
preVerificationGas: bigint;
|
|
22
|
-
maxPriorityFeePerGas: bigint;
|
|
23
|
-
maxFeePerGas: bigint;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface PaymasterGasParams {
|
|
27
|
-
paymasterGasLimit: bigint;
|
|
28
|
-
paymasterPostOpGasLimit: bigint;
|
|
29
|
-
}
|
|
30
|
-
|
|
1
|
+
import { concat, pad } from 'viem';
|
|
31
2
|
export class UserOperationBuilder {
|
|
32
3
|
/**
|
|
33
4
|
* Packs verificationGasLimit and callGasLimit into a bytes32 Hex string.
|
|
34
5
|
*/
|
|
35
|
-
static packAccountGasLimits(verificationGasLimit
|
|
6
|
+
static packAccountGasLimits(verificationGasLimit, callGasLimit) {
|
|
36
7
|
return concat([
|
|
37
8
|
pad(`0x${verificationGasLimit.toString(16)}`, { dir: 'left', size: 16 }),
|
|
38
9
|
pad(`0x${callGasLimit.toString(16)}`, { dir: 'left', size: 16 })
|
|
39
|
-
])
|
|
10
|
+
]);
|
|
40
11
|
}
|
|
41
|
-
|
|
42
12
|
/**
|
|
43
13
|
* Packs maxPriorityFeePerGas and maxFeePerGas into a bytes32 Hex string.
|
|
44
14
|
*/
|
|
45
|
-
static packGasFees(maxPriorityFeePerGas
|
|
15
|
+
static packGasFees(maxPriorityFeePerGas, maxFeePerGas) {
|
|
46
16
|
return concat([
|
|
47
17
|
pad(`0x${maxPriorityFeePerGas.toString(16)}`, { dir: 'left', size: 16 }),
|
|
48
18
|
pad(`0x${maxFeePerGas.toString(16)}`, { dir: 'left', size: 16 })
|
|
49
|
-
])
|
|
19
|
+
]);
|
|
50
20
|
}
|
|
51
|
-
|
|
52
21
|
/**
|
|
53
22
|
* Packs Paymaster parameters into the v0.7 paymasterAndData format.
|
|
54
23
|
*/
|
|
55
|
-
static packPaymasterAndData(
|
|
56
|
-
paymaster: Address,
|
|
57
|
-
paymasterGasLimit: bigint,
|
|
58
|
-
paymasterPostOpGasLimit: bigint,
|
|
59
|
-
paymasterData: Hex = '0x'
|
|
60
|
-
): Hex {
|
|
24
|
+
static packPaymasterAndData(paymaster, paymasterGasLimit, paymasterPostOpGasLimit, paymasterData = '0x') {
|
|
61
25
|
return concat([
|
|
62
26
|
paymaster,
|
|
63
27
|
pad(`0x${paymasterGasLimit.toString(16)}`, { dir: 'left', size: 16 }),
|
|
64
28
|
pad(`0x${paymasterPostOpGasLimit.toString(16)}`, { dir: 'left', size: 16 }),
|
|
65
29
|
paymasterData
|
|
66
|
-
])
|
|
30
|
+
]);
|
|
67
31
|
}
|
|
68
|
-
|
|
69
32
|
/**
|
|
70
33
|
* Pack PaymasterV4 Deposit-Only paymasterAndData
|
|
71
|
-
*
|
|
34
|
+
*
|
|
72
35
|
* v0.7 EntryPoint packs: [paymaster(20)][verificationGas(16)][postOpGas(16)][paymasterData]
|
|
73
36
|
* Contract extracts token at offset 52 = paymasterData[0:20]
|
|
74
|
-
*
|
|
37
|
+
*
|
|
75
38
|
* So paymasterData format must be: [token(20)][validUntil(6)][validAfter(6)]
|
|
76
|
-
*
|
|
39
|
+
*
|
|
77
40
|
* @param paymaster - Paymaster address (20 bytes)
|
|
78
41
|
* @param paymentToken - ERC20 token address (20 bytes, FIRST in paymasterData!)
|
|
79
42
|
* @param validUntil - Validity end timestamp (6 bytes)
|
|
80
43
|
* @param validAfter - Validity start timestamp (6 bytes)
|
|
81
44
|
*/
|
|
82
|
-
static packPaymasterV4DepositData(
|
|
83
|
-
paymaster: Address,
|
|
84
|
-
paymasterVerificationGasLimit: bigint,
|
|
85
|
-
paymasterPostOpGasLimit: bigint,
|
|
86
|
-
paymentToken: Address,
|
|
87
|
-
validUntil: bigint,
|
|
88
|
-
validAfter: bigint
|
|
89
|
-
): Hex {
|
|
45
|
+
static packPaymasterV4DepositData(paymaster, paymasterVerificationGasLimit, paymasterPostOpGasLimit, paymentToken, validUntil, validAfter) {
|
|
90
46
|
return concat([
|
|
91
47
|
paymaster,
|
|
92
48
|
pad(`0x${paymasterVerificationGasLimit.toString(16)}`, { dir: 'left', size: 16 }),
|
|
@@ -94,57 +50,45 @@ export class UserOperationBuilder {
|
|
|
94
50
|
paymentToken,
|
|
95
51
|
pad(`0x${validUntil.toString(16)}`, { dir: 'left', size: 6 }),
|
|
96
52
|
pad(`0x${validAfter.toString(16)}`, { dir: 'left', size: 6 })
|
|
97
|
-
])
|
|
53
|
+
]);
|
|
98
54
|
}
|
|
99
|
-
|
|
100
55
|
/**
|
|
101
56
|
* Computes the UserOperation hash for signing.
|
|
102
57
|
*/
|
|
103
|
-
static async getUserOpHash({
|
|
104
|
-
|
|
105
|
-
entryPoint,
|
|
106
|
-
chainId,
|
|
107
|
-
publicClient
|
|
108
|
-
}: {
|
|
109
|
-
userOp: PackedUserOperation;
|
|
110
|
-
entryPoint: Address;
|
|
111
|
-
chainId: number;
|
|
112
|
-
publicClient: PublicClient;
|
|
113
|
-
}): Promise<Hex> {
|
|
114
|
-
return await (publicClient as any).readContract({
|
|
58
|
+
static async getUserOpHash({ userOp, entryPoint, chainId, publicClient }) {
|
|
59
|
+
return await publicClient.readContract({
|
|
115
60
|
address: entryPoint,
|
|
116
61
|
abi: [{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
62
|
+
type: 'function',
|
|
63
|
+
name: 'getUserOpHash',
|
|
64
|
+
inputs: [{
|
|
65
|
+
type: 'tuple',
|
|
66
|
+
components: [
|
|
67
|
+
{ name: 'sender', type: 'address' },
|
|
68
|
+
{ name: 'nonce', type: 'uint256' },
|
|
69
|
+
{ name: 'initCode', type: 'bytes' },
|
|
70
|
+
{ name: 'callData', type: 'bytes' },
|
|
71
|
+
{ name: 'accountGasLimits', type: 'bytes32' },
|
|
72
|
+
{ name: 'preVerificationGas', type: 'uint256' },
|
|
73
|
+
{ name: 'gasFees', type: 'bytes32' },
|
|
74
|
+
{ name: 'paymasterAndData', type: 'bytes' },
|
|
75
|
+
{ name: 'signature', type: 'bytes' }
|
|
76
|
+
]
|
|
77
|
+
}],
|
|
78
|
+
outputs: [{ type: 'bytes32' }],
|
|
79
|
+
stateMutability: 'view'
|
|
132
80
|
}],
|
|
133
|
-
outputs: [{ type: 'bytes32' }],
|
|
134
|
-
stateMutability: 'view'
|
|
135
|
-
}],
|
|
136
81
|
functionName: 'getUserOpHash',
|
|
137
82
|
args: [userOp]
|
|
138
|
-
})
|
|
83
|
+
});
|
|
139
84
|
}
|
|
140
|
-
|
|
141
85
|
/**
|
|
142
86
|
* Formats a PackedUserOperation into a JSON-RPC compatible object with hex-encoded strings.
|
|
143
87
|
*/
|
|
144
|
-
static jsonifyUserOp(userOp
|
|
88
|
+
static jsonifyUserOp(userOp) {
|
|
145
89
|
// Strict allowlist for ERC-4337 v0.7 PackedUserOperation
|
|
146
90
|
// Alchemy rejects requests with unknown fields.
|
|
147
|
-
const result
|
|
91
|
+
const result = {
|
|
148
92
|
sender: userOp.sender,
|
|
149
93
|
nonce: userOp.nonce,
|
|
150
94
|
initCode: userOp.initCode,
|
|
@@ -155,34 +99,31 @@ export class UserOperationBuilder {
|
|
|
155
99
|
paymasterAndData: userOp.paymasterAndData,
|
|
156
100
|
signature: userOp.signature
|
|
157
101
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
102
|
+
const toCompactHex = (val) => {
|
|
103
|
+
if (typeof val === 'bigint')
|
|
104
|
+
return `0x${val.toString(16)}`;
|
|
105
|
+
if (typeof val === 'number')
|
|
106
|
+
return `0x${val.toString(16)}`;
|
|
107
|
+
if (typeof val === 'string') {
|
|
108
|
+
// Remove leading zeros if present (but keep 0x)
|
|
109
|
+
if (val === '0x')
|
|
110
|
+
return '0x'; // invalid quantity? Should be 0x0?
|
|
111
|
+
// JSON-RPC Quantity: 0x0
|
|
112
|
+
if (val === '0x0')
|
|
113
|
+
return '0x0';
|
|
114
|
+
return val.replace(/^0x0+(?!$)/, '0x');
|
|
115
|
+
}
|
|
116
|
+
return val;
|
|
170
117
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
118
|
result.nonce = toCompactHex(result.nonce);
|
|
174
119
|
result.preVerificationGas = toCompactHex(result.preVerificationGas);
|
|
175
|
-
|
|
176
120
|
// Note: Alchemy usually accepts non-padded Quantities for nonce/preVerificationGas.
|
|
177
121
|
// But let's verify if strict padding is required by using viem's pad
|
|
178
|
-
|
|
179
122
|
// Alchemy v0.7 Validator seems to reject PADDED Quantities (leads to 'Invalid fields').
|
|
180
123
|
// It accepts COMPACT HEX (e.g. 0x1 instead of 0x0...01).
|
|
181
124
|
// Viem toHex produces compact hex.
|
|
182
|
-
|
|
183
125
|
return result;
|
|
184
126
|
}
|
|
185
|
-
|
|
186
127
|
/**
|
|
187
128
|
* Converts a PackedUserOperation to the Alchemy-specific v0.7 JSON format.
|
|
188
129
|
* @param userOp - The packed UserOperation
|
|
@@ -190,57 +131,46 @@ export class UserOperationBuilder {
|
|
|
190
131
|
* @param options.paymasterVerificationGasLimit - Gas limit for paymaster verification (default: 200000)
|
|
191
132
|
* @param options.paymasterPostOpGasLimit - Gas limit for paymaster postOp (default: 200000)
|
|
192
133
|
*/
|
|
193
|
-
static toAlchemyUserOperation(userOp
|
|
194
|
-
|
|
195
|
-
paymasterPostOpGasLimit?: bigint;
|
|
196
|
-
}): any {
|
|
197
|
-
const result: any = {
|
|
134
|
+
static toAlchemyUserOperation(userOp, options) {
|
|
135
|
+
const result = {
|
|
198
136
|
sender: userOp.sender,
|
|
199
137
|
nonce: userOp.nonce,
|
|
200
138
|
callData: userOp.callData,
|
|
201
139
|
signature: userOp.signature
|
|
202
140
|
};
|
|
203
|
-
|
|
204
141
|
// 1. Unpack accountGasLimits: [verificationGasLimit(16)][callGasLimit(16)]
|
|
205
142
|
if (userOp.accountGasLimits && userOp.accountGasLimits !== '0x') {
|
|
206
143
|
const val = userOp.accountGasLimits.toString().startsWith('0x') ? userOp.accountGasLimits.slice(2) : userOp.accountGasLimits;
|
|
207
144
|
const padded = val.padStart(64, '0');
|
|
208
145
|
const verificationGasLimit = BigInt('0x' + padded.slice(0, 32));
|
|
209
146
|
const callGasLimit = BigInt('0x' + padded.slice(32, 64));
|
|
210
|
-
|
|
211
147
|
result.verificationGasLimit = `0x${verificationGasLimit.toString(16)}`;
|
|
212
148
|
result.callGasLimit = `0x${callGasLimit.toString(16)}`;
|
|
213
149
|
}
|
|
214
|
-
|
|
215
150
|
// 2. Unpack gasFees: [maxPriorityFee(16)][maxFee(16)]
|
|
216
151
|
if (userOp.gasFees && userOp.gasFees !== '0x') {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
result.maxFeePerGas = `0x${maxFeePerGas.toString(16)}`;
|
|
152
|
+
const val = userOp.gasFees.toString().startsWith('0x') ? userOp.gasFees.slice(2) : userOp.gasFees;
|
|
153
|
+
const padded = val.padStart(64, '0');
|
|
154
|
+
const maxPriorityFeePerGas = BigInt('0x' + padded.slice(0, 32));
|
|
155
|
+
const maxFeePerGas = BigInt('0x' + padded.slice(32, 64));
|
|
156
|
+
result.maxPriorityFeePerGas = `0x${maxPriorityFeePerGas.toString(16)}`;
|
|
157
|
+
result.maxFeePerGas = `0x${maxFeePerGas.toString(16)}`;
|
|
224
158
|
}
|
|
225
|
-
|
|
226
159
|
// 3. PreVerificationGas (Direct copy but ensure hex)
|
|
227
160
|
if (userOp.preVerificationGas) {
|
|
228
|
-
|
|
161
|
+
result.preVerificationGas = `0x${BigInt(userOp.preVerificationGas).toString(16)}`;
|
|
229
162
|
}
|
|
230
|
-
|
|
231
163
|
// 4. Unpack initCode -> factory + factoryData
|
|
232
164
|
if (userOp.initCode && userOp.initCode !== '0x') {
|
|
233
165
|
const initCode = userOp.initCode.toString();
|
|
234
166
|
result.factory = initCode.slice(0, 42); // First 20 bytes
|
|
235
167
|
result.factoryData = '0x' + initCode.slice(42);
|
|
236
168
|
}
|
|
237
|
-
|
|
238
169
|
// 5. Unpack paymasterAndData -> paymaster + gas limits + paymasterData
|
|
239
170
|
// Full format: [paymaster(20)][verificationGas(16)][postOpGas(16)][paymasterData]
|
|
240
171
|
// paymasterData = [token(20)][validUntil(6)][validAfter(6)] = 32 bytes
|
|
241
172
|
if (userOp.paymasterAndData && userOp.paymasterAndData !== '0x') {
|
|
242
173
|
const pmd = userOp.paymasterAndData.toString().startsWith('0x') ? userOp.paymasterAndData.slice(2) : userOp.paymasterAndData;
|
|
243
|
-
|
|
244
174
|
// Check if we have full format with gas limits (at least 20+16+16 = 52 bytes = 104 hex chars)
|
|
245
175
|
if (pmd.length >= 104) {
|
|
246
176
|
// Full v0.7 packed format
|
|
@@ -250,7 +180,8 @@ export class UserOperationBuilder {
|
|
|
250
180
|
result.paymasterVerificationGasLimit = `0x${vGas.toString(16)}`;
|
|
251
181
|
result.paymasterPostOpGasLimit = `0x${pGas.toString(16)}`;
|
|
252
182
|
result.paymasterData = '0x' + pmd.slice(104); // bytes 52+ (token + timestamps)
|
|
253
|
-
}
|
|
183
|
+
}
|
|
184
|
+
else if (pmd.length >= 40) {
|
|
254
185
|
// Fallback: assume 52-byte format without gas limits (old format)
|
|
255
186
|
result.paymaster = '0x' + pmd.slice(0, 40);
|
|
256
187
|
result.paymasterData = '0x' + pmd.slice(40);
|
|
@@ -259,7 +190,6 @@ export class UserOperationBuilder {
|
|
|
259
190
|
result.paymasterPostOpGasLimit = `0x${(options?.paymasterPostOpGasLimit || defaultGasLimit).toString(16)}`;
|
|
260
191
|
}
|
|
261
192
|
}
|
|
262
|
-
|
|
263
193
|
return result;
|
|
264
194
|
}
|
|
265
195
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,180 +1,142 @@
|
|
|
1
|
-
import { describe, it, expect
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { UserOperationBuilder } from './userOp.js';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { concat } from 'viem';
|
|
5
4
|
describe('UserOperationBuilder', () => {
|
|
6
|
-
const MOCK_ADDR = '0x1111111111111111111111111111111111111111'
|
|
7
|
-
const MOCK_PM = '0x2222222222222222222222222222222222222222'
|
|
8
|
-
const MOCK_TOKEN = '0x3333333333333333333333333333333333333333'
|
|
9
|
-
|
|
5
|
+
const MOCK_ADDR = '0x1111111111111111111111111111111111111111';
|
|
6
|
+
const MOCK_PM = '0x2222222222222222222222222222222222222222';
|
|
7
|
+
const MOCK_TOKEN = '0x3333333333333333333333333333333333333333';
|
|
10
8
|
describe('Gas Packing', () => {
|
|
11
9
|
it('should pack account gas limits', () => {
|
|
12
10
|
const packed = UserOperationBuilder.packAccountGasLimits(100000n, 200000n);
|
|
13
11
|
expect(packed).toBeDefined();
|
|
14
12
|
expect(packed.length).toBeGreaterThan(2);
|
|
15
13
|
});
|
|
16
|
-
|
|
17
14
|
it('should pack gas fees', () => {
|
|
18
15
|
const packed = UserOperationBuilder.packGasFees(1000000000n, 2000000000n);
|
|
19
16
|
expect(packed).toBeDefined();
|
|
20
17
|
expect(packed.length).toBeGreaterThan(2);
|
|
21
18
|
});
|
|
22
|
-
|
|
23
19
|
it('should pack paymaster and data', () => {
|
|
24
|
-
const packed = UserOperationBuilder.packPaymasterAndData(
|
|
25
|
-
MOCK_PM,
|
|
26
|
-
250000n,
|
|
27
|
-
50000n,
|
|
28
|
-
'0x1234' as Hex
|
|
29
|
-
);
|
|
20
|
+
const packed = UserOperationBuilder.packPaymasterAndData(MOCK_PM, 250000n, 50000n, '0x1234');
|
|
30
21
|
expect(packed).toBeDefined();
|
|
31
22
|
expect(packed.startsWith(MOCK_PM.toLowerCase())).toBe(true);
|
|
32
23
|
});
|
|
33
|
-
|
|
34
24
|
it('should pack PaymasterV4 deposit data', () => {
|
|
35
25
|
const validUntil = BigInt(Math.floor(Date.now() / 1000) + 3600);
|
|
36
26
|
const validAfter = BigInt(Math.floor(Date.now() / 1000));
|
|
37
|
-
|
|
38
|
-
const packed = UserOperationBuilder.packPaymasterV4DepositData(
|
|
39
|
-
MOCK_PM,
|
|
40
|
-
250000n,
|
|
41
|
-
50000n,
|
|
42
|
-
MOCK_TOKEN,
|
|
43
|
-
validUntil,
|
|
44
|
-
validAfter
|
|
45
|
-
);
|
|
27
|
+
const packed = UserOperationBuilder.packPaymasterV4DepositData(MOCK_PM, 250000n, 50000n, MOCK_TOKEN, validUntil, validAfter);
|
|
46
28
|
expect(packed).toBeDefined();
|
|
47
29
|
expect(packed.length).toBeGreaterThan(100);
|
|
48
30
|
});
|
|
49
31
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
32
|
describe('UserOp Formatting', () => {
|
|
53
33
|
it('should jsonify UserOp', () => {
|
|
54
34
|
const userOp = {
|
|
55
35
|
sender: MOCK_ADDR,
|
|
56
36
|
nonce: 0n,
|
|
57
|
-
initCode: '0x'
|
|
58
|
-
callData: '0x'
|
|
37
|
+
initCode: '0x',
|
|
38
|
+
callData: '0x',
|
|
59
39
|
accountGasLimits: UserOperationBuilder.packAccountGasLimits(100000n, 200000n),
|
|
60
40
|
preVerificationGas: 50000n,
|
|
61
41
|
gasFees: UserOperationBuilder.packGasFees(1000000000n, 2000000000n),
|
|
62
|
-
paymasterAndData: '0x'
|
|
63
|
-
signature: '0x'
|
|
42
|
+
paymasterAndData: '0x',
|
|
43
|
+
signature: '0x'
|
|
64
44
|
};
|
|
65
|
-
|
|
66
45
|
const jsonified = UserOperationBuilder.jsonifyUserOp(userOp);
|
|
67
46
|
expect(jsonified).toBeDefined();
|
|
68
47
|
expect(jsonified.sender).toBe(MOCK_ADDR);
|
|
69
48
|
});
|
|
70
|
-
|
|
71
49
|
it('should convert to Alchemy format', () => {
|
|
72
50
|
const userOp = {
|
|
73
51
|
sender: MOCK_ADDR,
|
|
74
|
-
nonce: '0x0'
|
|
75
|
-
initCode: '0x'
|
|
76
|
-
callData: '0x'
|
|
52
|
+
nonce: '0x0',
|
|
53
|
+
initCode: '0x',
|
|
54
|
+
callData: '0x',
|
|
77
55
|
accountGasLimits: UserOperationBuilder.packAccountGasLimits(100000n, 200000n),
|
|
78
|
-
preVerificationGas: '0xc350'
|
|
56
|
+
preVerificationGas: '0xc350',
|
|
79
57
|
gasFees: UserOperationBuilder.packGasFees(1000000000n, 2000000000n),
|
|
80
|
-
paymasterAndData: '0x'
|
|
81
|
-
signature: '0x'
|
|
58
|
+
paymasterAndData: '0x', // no paymaster
|
|
59
|
+
signature: '0x'
|
|
82
60
|
};
|
|
83
|
-
|
|
84
61
|
const alchemy = UserOperationBuilder.toAlchemyUserOperation(userOp);
|
|
85
62
|
expect(alchemy).toBeDefined();
|
|
86
63
|
expect(alchemy.sender).toBe(MOCK_ADDR);
|
|
87
64
|
expect(alchemy.verificationGasLimit).toBeDefined();
|
|
88
65
|
expect(alchemy.callGasLimit).toBeDefined();
|
|
89
66
|
});
|
|
90
|
-
|
|
91
67
|
it('should unpack paymaster and data (full v0.7 format)', () => {
|
|
92
|
-
const pmData = UserOperationBuilder.packPaymasterAndData(
|
|
93
|
-
|
|
94
|
-
300000n,
|
|
95
|
-
100000n,
|
|
96
|
-
'0x12345678' as Hex
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
const userOp = {
|
|
68
|
+
const pmData = UserOperationBuilder.packPaymasterAndData(MOCK_PM, 300000n, 100000n, '0x12345678');
|
|
69
|
+
const userOp = {
|
|
100
70
|
sender: MOCK_ADDR,
|
|
101
|
-
nonce: '0x0'
|
|
102
|
-
initCode: '0x'
|
|
103
|
-
callData: '0x'
|
|
104
|
-
accountGasLimits: '0x'
|
|
105
|
-
preVerificationGas: '0x0'
|
|
106
|
-
gasFees: '0x'
|
|
71
|
+
nonce: '0x0',
|
|
72
|
+
initCode: '0x',
|
|
73
|
+
callData: '0x',
|
|
74
|
+
accountGasLimits: '0x',
|
|
75
|
+
preVerificationGas: '0x0',
|
|
76
|
+
gasFees: '0x',
|
|
107
77
|
paymasterAndData: pmData,
|
|
108
|
-
signature: '0x'
|
|
78
|
+
signature: '0x'
|
|
109
79
|
};
|
|
110
|
-
|
|
111
80
|
const alchemy = UserOperationBuilder.toAlchemyUserOperation(userOp);
|
|
112
81
|
expect(alchemy.paymaster).toBe(MOCK_PM);
|
|
113
82
|
expect(alchemy.paymasterVerificationGasLimit).toBeDefined();
|
|
114
83
|
expect(alchemy.paymasterPostOpGasLimit).toBeDefined();
|
|
115
84
|
expect(alchemy.paymasterData).toBe('0x12345678');
|
|
116
85
|
});
|
|
117
|
-
|
|
118
86
|
it('should unpack paymaster and data (legacy format fallback)', () => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
87
|
+
// Not enough bytes for Gas Limits, treated as paymaster + data
|
|
88
|
+
const legacyPmData = concat([MOCK_PM, '0xabcdef']);
|
|
122
89
|
const userOp = {
|
|
123
90
|
sender: MOCK_ADDR,
|
|
124
|
-
nonce: '0x0'
|
|
125
|
-
initCode: '0x'
|
|
126
|
-
callData: '0x'
|
|
127
|
-
accountGasLimits: '0x'
|
|
128
|
-
preVerificationGas: '0x0'
|
|
129
|
-
gasFees: '0x'
|
|
91
|
+
nonce: '0x0',
|
|
92
|
+
initCode: '0x',
|
|
93
|
+
callData: '0x',
|
|
94
|
+
accountGasLimits: '0x',
|
|
95
|
+
preVerificationGas: '0x0',
|
|
96
|
+
gasFees: '0x',
|
|
130
97
|
paymasterAndData: legacyPmData,
|
|
131
|
-
signature: '0x'
|
|
98
|
+
signature: '0x'
|
|
132
99
|
};
|
|
133
|
-
|
|
134
100
|
const alchemy = UserOperationBuilder.toAlchemyUserOperation(userOp);
|
|
135
101
|
expect(alchemy.paymaster).toBe(MOCK_PM);
|
|
136
102
|
expect(alchemy.paymasterData).toBe('0xabcdef');
|
|
137
103
|
expect(alchemy.paymasterVerificationGasLimit).toBeDefined(); // defaults
|
|
138
104
|
});
|
|
139
|
-
|
|
140
105
|
it('should unpack initCode into factory and factoryData', () => {
|
|
141
106
|
const factory = MOCK_ADDR;
|
|
142
|
-
const factoryData = '0xdeadbeef'
|
|
143
|
-
const initCode = concat([factory, factoryData])
|
|
144
|
-
|
|
107
|
+
const factoryData = '0xdeadbeef';
|
|
108
|
+
const initCode = concat([factory, factoryData]);
|
|
145
109
|
const userOp = {
|
|
146
110
|
sender: MOCK_ADDR,
|
|
147
|
-
nonce: '0x0'
|
|
111
|
+
nonce: '0x0',
|
|
148
112
|
initCode: initCode,
|
|
149
|
-
callData: '0x'
|
|
150
|
-
accountGasLimits: '0x'
|
|
151
|
-
preVerificationGas: '0x0'
|
|
152
|
-
gasFees: '0x'
|
|
153
|
-
paymasterAndData: '0x'
|
|
154
|
-
signature: '0x'
|
|
113
|
+
callData: '0x',
|
|
114
|
+
accountGasLimits: '0x',
|
|
115
|
+
preVerificationGas: '0x0',
|
|
116
|
+
gasFees: '0x',
|
|
117
|
+
paymasterAndData: '0x',
|
|
118
|
+
signature: '0x'
|
|
155
119
|
};
|
|
156
|
-
|
|
157
120
|
const alchemy = UserOperationBuilder.toAlchemyUserOperation(userOp);
|
|
158
121
|
expect(alchemy.factory.toLowerCase()).toBe(factory.toLowerCase());
|
|
159
122
|
expect(alchemy.factoryData).toBe(factoryData);
|
|
160
123
|
});
|
|
161
124
|
it('should jsonify various types', () => {
|
|
162
|
-
|
|
125
|
+
const userOp = {
|
|
163
126
|
sender: MOCK_ADDR,
|
|
164
127
|
nonce: 123, // number
|
|
165
|
-
initCode: '0x'
|
|
166
|
-
callData: '0x'
|
|
167
|
-
accountGasLimits: '0x'
|
|
168
|
-
preVerificationGas: '0x10'
|
|
169
|
-
gasFees: '0x'
|
|
170
|
-
paymasterAndData: '0x'
|
|
171
|
-
signature: '0x'
|
|
128
|
+
initCode: '0x',
|
|
129
|
+
callData: '0x',
|
|
130
|
+
accountGasLimits: '0x',
|
|
131
|
+
preVerificationGas: '0x10', // string
|
|
132
|
+
gasFees: '0x',
|
|
133
|
+
paymasterAndData: '0x',
|
|
134
|
+
signature: '0x'
|
|
172
135
|
};
|
|
173
136
|
const json = UserOperationBuilder.jsonifyUserOp(userOp);
|
|
174
137
|
expect(json.nonce).toBe('0x7b');
|
|
175
138
|
expect(json.preVerificationGas).toBe('0x10');
|
|
176
139
|
});
|
|
177
|
-
|
|
178
140
|
it('should handle leading zeros in string quantities for Alchemy', () => {
|
|
179
141
|
const userOp = {
|
|
180
142
|
sender: MOCK_ADDR,
|
|
@@ -182,9 +144,9 @@ describe('UserOperationBuilder', () => {
|
|
|
182
144
|
preVerificationGas: '0x0', // valid zero
|
|
183
145
|
// ... others
|
|
184
146
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
147
|
+
const json = UserOperationBuilder.jsonifyUserOp(userOp);
|
|
148
|
+
expect(json.nonce).toBe('0x1'); // compact
|
|
149
|
+
expect(json.preVerificationGas).toBe('0x0');
|
|
188
150
|
});
|
|
189
151
|
});
|
|
190
152
|
});
|