Skip to content

Goodsdks migration setup#9

Merged
L03TJ3 merged 3 commits into
copilot/sub-pr-6from
goodsdks-migration-setup
Apr 30, 2026
Merged

Goodsdks migration setup#9
L03TJ3 merged 3 commits into
copilot/sub-pr-6from
goodsdks-migration-setup

Conversation

@L03TJ3
Copy link
Copy Markdown
Contributor

@L03TJ3 L03TJ3 commented Apr 28, 2026

Summary

Sets up the @goodwidget/citizen-claim-widget migration scaffolding, aligned with GoodSDKs#42.

GoodSDKs#42 adds a capability manifest (citizenSdkCapabilities) to @goodsdks/citizen-sdk that formally documents what the SDK can do — runtime needs, supported chains, and the full set of read/write operations. This PR wires GoodWidget up to that capability model by introducing the new packages/citizen-claim-widget package.


Changes — packages/citizen-claim-widget

A new package that bridges @goodsdks/citizen-sdk into the GoodWidget architecture. It contains only migration piping for now (no UI) and is the target for the future full citizen-claim widget.

adapterContract.ts — TypeScript types defining the widget's state machine and host API:

  • CitizenClaimWidgetStatus — all possible widget states: loading, not_connected, not_whitelisted, eligible, already_claimed, claiming, success, error
  • CitizenClaimWidgetAdapterState / CitizenClaimWidgetAdapterActions — the shape any SDK adapter must satisfy
  • CitizenClaimWidgetProps — host-facing props: provider, environment, clientFactory, onClaimSuccess, onClaimError
  • Supporting detail types for success/error callback payloads

integration.ts — Links the widget to the SDK capability manifest from GoodSDKs#42:

  • Selects the SDK operations this widget uses: whitelistStatus, claimStatus, claimEntitlement, startVerification, claim
  • Declares supported chains (Fuse 122, Celo 42220, XDC 50)
  • References citizenSdkCapabilities by name so future tooling can validate the integration against the SDK

index.ts — Re-exports both the integration descriptor and all adapter contract types.


Relationship to GoodSDKs#42

GoodSDKs#42 This PR
Adds SdkCapabilitySummary / SdkCapabilityOperation types Implicitly consumed via the citizenClaimIntegration shape
Exports citizenSdkCapabilities manifest Referenced by name in integration.ts (capabilitySource: 'citizenSdkCapabilities')
Read operations: whitelistStatus, identityExpiry, claimStatus, claimEntitlement Widget selects the subset it needs in uses
Write operations: startVerification, claim Included in uses
Chains: Fuse, Celo, XDC Mirrored as chain IDs in chains

The existing @goodwidget/claim-widget (theme/demo widget) is not changed by this migration.

@github-project-automation github-project-automation Bot moved this to Ready-For-Assignment in GoodBounties Apr 28, 2026
@L03TJ3
Copy link
Copy Markdown
Contributor Author

L03TJ3 commented Apr 28, 2026

@copilot can you review and match it against the GoodSDKs related pull-request: GoodDollar/GoodSDKs#42

and update this pull-request description with a clear and concise explanation what the changes propose

@L03TJ3 L03TJ3 changed the base branch from main to copilot/sub-pr-6 April 28, 2026 09:18
Copy link
Copy Markdown

Copilot AI commented Apr 28, 2026

@copilot can you review and match it against the GoodSDKs related pull-request: GoodDollar/GoodSDKs#42

and update this pull-request description with a clear and concise expl...

Done. The PR description has been updated to focus only on the GoodSDKs migration changes (packages/citizen-claim-widget), with a clear table showing how this PR maps to GoodSDKs#42. The storybook/UI changes are intentionally omitted since those are already covered by PR #8.

@L03TJ3 L03TJ3 moved this from Ready-For-Assignment to In Review in GoodBounties Apr 29, 2026
@L03TJ3 L03TJ3 merged commit f8d5422 into copilot/sub-pr-6 Apr 30, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Review to Deploy and Verify in GoodBounties Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Deploy and Verify

Development

Successfully merging this pull request may close these issues.

2 participants