SDK Stage 3 API Implementation Analysis
Date: 2026-02-05 Reference Plan: SDK_STAGE3_PLAN.md
1. Executive Summary
Based on the inspection of the SDK codebase (packages/enduser, packages/operator, packages/core), the current SDK implementation achieves High Alignment with the Stage 3 Plan from functionality and business scenario dimensions.
All Critical Paths (Community Creation, Operator Onboarding, User Registration, Gasless Execution) are implemented. Some method names differ from the plan but fulfill the required business logic.
2. Detailed Comparison
2.1 Core Actions (Layer 1)
| Plan Item | Implementation Status | SDK Method / Location | Notes |
|---|---|---|---|
| RegistryActions | ✅ Implemented | packages/core/src/actions/registry.ts | Complete coverage of Role/Config/Access logic. |
registerCommunity | ✅ Implemented | registerRoleSelf (Generic) | Handled via CommunityClient.setupCommunity. |
joinCommunity | ✅ Implemented | registerRoleSelf (Generic) | Handled via UserClient.registerAsEndUser. |
getCommunityInfo | ✅ Implemented | getRoleConfig / roleConfigs | Returns detailed config struct. |
| SuperPaymasterActions | ✅ Implemented | packages/core/src/actions/superPaymaster.ts | Referenced by OperatorClient. |
| GTokenStakingActions | ✅ Implemented | packages/core/src/actions/staking.ts | lockStake, unlockAndTransfer confirmed. |
| PaymasterFactoryActions | ✅ Implemented | packages/core/src/actions/factory.ts | Used in PaymasterOperatorClient. |
2.2 Business Clients (Layer 2)
CommunityClient
| Plan Item | Implementation | Status |
|---|---|---|
onboardCommunity() | setupCommunity({...}) | ✅ Matches (Renamed) |
getCommunityInfo() | getRoleConfig (via Actions) | ⚠️ Partial (Client helper missing, uses Action) |
deployXPNTs() | createCommunityToken({...}) | ✅ Matches |
OperatorClient
| Plan Item | Implementation | Status |
|---|---|---|
setupNode() | registerAsSuperPaymasterOperator | ✅ Specific Implementation |
depositCollateral() | depositCollateral | ✅ Matches |
getOperatorStatus() | getOperatorDetails | ✅ Matches |
EndUserClient
| Plan Item | Implementation | Status |
|---|---|---|
joinAndActivate() | registerAsEndUser({...}) | ✅ Matches |
deploySmartAccount() | Missing in UserClient | ⚠️ Gap: Logic exists in Factory Actions, not wrapped in UserClient. |
executeGasless() | executeGasless({...}) | ✅ Matches (Logic for V4 & SuperPaymaster) |
3. Gap Analysis & Recommendations
Smart Account Deployment: The
UserClientassumes an existing account address. For a complete "Onboarding" flow, a static helper or aUserFactoryClientmight be needed to deploy the abstract account before theUserClientcan be fully instantiated (orUserClientshould support a "deploy on first tx" mode).- Recommendation: Add a static
deployAccounthelper or ensure documentation covers usingSimpleAccountFactorybeforeUserClient.
- Recommendation: Add a static
Naming Consistency:
setupCommunityvsonboardCommunity. The currentsetupnaming is clearer as it implies multiple steps (Register + Token).registerAsEndUseris precise.
4. Conclusion
The SDK API is Stage 3 Ready for detailed regression testing. The business logic coverage allows for the execution of all 4 key scenarios defined in the plan. The identified gaps (Account Deployment wrapper) are minor convenience issues rather than blocking functional missing defects.
