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 (
development and production).
- Expose corresponding React hooks/wrappers following current
sdk/loading/error conventions.
- 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.ts
packages/citizen-sdk/src/constants.ts
packages/citizen-sdk/src/types.ts
packages/react-hooks/src/citizen-sdk/wagmi-identity-sdk.ts
- Reference-only:
5. Definition of Done + How to test
DoD:
Verification commands:
yarn workspace @goodsdks/citizen-sdk build
yarn workspace @goodsdks/citizen-sdk test
yarn workspace @goodsdks/citizen-sdk test:connected
yarn workspace @goodsdks/react-hooks build
yarn turbo run build --filter=apps/demo-identity-app
yarn 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.
1. Summary
Build wallet-link support into
@goodsdks/citizen-sdkso apps can connect/disconnect different wallets to a whitelisted root identity using typed SDK APIs, then consume it from@goodsdks/react-hooksand a minimal demo integration.2. Desired behavior
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.developmentandproduction).sdk/loading/errorconventions.3. Scope
In scope:
packages/citizen-sdkpackages/react-hooksapps/demo-identity-app4. 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.tsreference-assets/connect-a-wallet-example5. Definition of Done + How to test
DoD:
IdentityV4 Contractsemantics.developmentandproductionbehavior, including XDC production mapping if missing.connectAccount/disconnectAccountonly.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 lintManual QA: