-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
GoodBounties - RareSignificant effort requiredSignificant effort required
Description
1. Summary
Build wallet-link support into @goodsdks/citizen-sdk so apps can connect/disconnect different wallets to a whitelisted root identity using typed SDK APIs, then consume it from @goodsdks/react-hooks and a minimal demo integration.
2. Desired behavior
- Add typed wallet-link methods to citizen SDK (no UI logic in SDK):
- Connect account
- Disconnect account
- Resolve whitelist root
- Check whether an address is connected (including per-chain status checks)
- Use latest local identity contract reference semantics from
temp-examples/contract-latest.sol(IdentityV3):connectAccount(address)is callable by a whitelisted root identity.disconnectAccount(address)callable by root or connected account.connectedAccounts(address)used for direct status lookup.
- Keep env/network behavior consistent with existing SDK patterns (
developmentandproduction). - Expose corresponding React hooks/wrappers following current
sdk/loading/errorconventions. - Add new demo-widget flow to demonstrate new SDK APIs (minimal, non-production UI accepted).
- Include readme's with clear and straightforward examples
- Support native/custodial wallet flows where transaction signing can be handled internally (no explicit end-user signature step required in the default wallet UX).
- Add a default security messaging flow before connect/disconnect actions; wallet integrators may explicitly disable this messaging for a more non-intrusive flow.
3. Scope
In scope:
packages/citizen-sdk- Add wallet-link API surface in SDK class/module(s)
- Extend ABI/constants/types/barrel exports
- Keep error handling aligned with current SDK style
packages/react-hooks- Add/update hook wrappers for new wallet-link APIs
- Export from existing barrels
apps/demo-identity-app- Demonstrate connect/disconnect/status usage
- Tests/docs
- Extend connected-account test coverage and update SDK docs/README references
4. Starting points
packages/citizen-sdk/src/sdks/viem-identity-sdk.tspackages/citizen-sdk/src/constants.tspackages/citizen-sdk/src/types.tspackages/react-hooks/src/citizen-sdk/wagmi-identity-sdk.ts- Reference-only:
- IdentityV4
reference-assets/connect-a-wallet-example- Demo-App
5. Definition of Done + How to test
DoD:
- Citizen SDK exposes typed wallet-link API for connect/disconnect/root lookup/connected-status.
- ABI/constants include required wallet-link methods and align with
IdentityV4 Contractsemantics. - Network config supports intended
developmentandproductionbehavior, including XDC production mapping if missing. - React hooks expose wallet-link support using existing hook conventions.
- Public exports are available via package barrel files.
- Security consideration documented and implemented: end-user flow uses
connectAccount/disconnectAccountonly. - Native/custodial wallet flow is supported without requiring explicit user signature prompts for transaction signing.
- A default security messaging flow exists for wallet-link actions, with a documented opt-out toggle that wallet integrators can disable.
- Tests cover at least one write-path + status/root resolution path.
- Docs updated for external integrators.
- Includes a demonstrable flow by extending the demo-identity-app with a new widget.
Verification commands:
yarn workspace @goodsdks/citizen-sdk buildyarn workspace @goodsdks/citizen-sdk testyarn workspace @goodsdks/citizen-sdk test:connectedyarn workspace @goodsdks/react-hooks buildyarn turbo run build --filter=apps/demo-identity-appyarn lint
Manual QA:
- Connect a whitelisted root wallet in demo app.
- Connect a secondary wallet using new SDK method.
- Confirm on-chain root resolution for secondary wallet.
- Verify connected-status checks (single-chain and per-chain read flow).
- Disconnect and verify status/root behavior is updated correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
GoodBounties - RareSignificant effort requiredSignificant effort required
Type
Projects
Status
In Review