Skip to content

Add packages/savings-sdk and packages/savings-widget - #20

Closed
sirpy with Copilot wants to merge 3 commits into
mainfrom
copilot/build-savings-widget-package
Closed

Add packages/savings-sdk and packages/savings-widget#20
sirpy with Copilot wants to merge 3 commits into
mainfrom
copilot/build-savings-widget-package

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor

Implements the GoodDollar savings/staking widget from scratch in GoodWidget, reimagining the reference Lit webcomponent as a React mini-app using local @goodwidget/ui primitives and a new viem-based SDK package.

packages/savings-sdk (@goodwidget/savings-sdk)

Thin viem wrapper for the GoodDollar staking contract on Celo mainnet (0x799a23dA264A157Db6F9c02BE62F82CE8d602A45, chain id 42220). Requires viem ≥2 as a peer.

  • GooddollarSavingsSDKgetGlobalStats(), getUserStats(), stake(), unstake(), claimReward() (all with optional onHash callback)
  • GlobalStats / UserStats types
  • formatG$ / parseG$ formatting utilities

packages/savings-widget (@goodwidget/savings-widget)

  • SavingsWidget — root component; wraps GoodWidgetProvider and accepts the standard provider, config, themeOverrides, defaultTheme props
  • useSavingsSDK — bridges the EIP-1193 provider from useWallet() into viem PublicClient + WalletClient; polls every 30 s
  • SavingsInner — Stake/Unstake tab UI with amount input (MAX button, balance display, inline validation), unclaimed rewards + Claim row, staking stats card, and Toast feedback for every async state transition
  • SavingsWidgetElement / gw-savings — Shadow DOM custom element and auto-register entry points
// React
<SavingsWidget provider={window.ethereum} defaultTheme="light" />

// Plain HTML
import '@goodwidget/savings-widget/register'
// <gw-savings></gw-savings>

All styled components use createComponent() with unique name values, making every surface overridable via themeOverrides. No direct tamagui imports in the widget layer — all primitives come through @goodwidget/ui.

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@sirpy Unfortunately, I hit an error while trying to use the custom Copilot setup steps configured for this repository and had to close this PR. The error I am seeing is:

no `copilot-setup-steps` job found in your `copilot-setup-steps.yml` workflow file. Please ensure you have a single job named `copilot-setup-steps`. For more details, see https://gh.io/copilot/actions-setup-steps

Once you or someone with the necessary access fixes the problem, please unassign and then reassign issue #0 to me and I'll retry. Thanks!

@github-project-automation github-project-automation Bot moved this to Ready-For-Assignment in GoodBounties May 4, 2026
Copilot AI changed the title [WIP] Build packages/savings-widget for SDK integration and UI mapping Add packages/savings-sdk and packages/savings-widget May 4, 2026
Copilot finished work on behalf of sirpy May 4, 2026 12:16
Copilot AI requested a review from sirpy May 4, 2026 12:16
@sirpy sirpy closed this May 4, 2026
@sirpy
sirpy deleted the copilot/build-savings-widget-package branch May 4, 2026 14:08
@L03TJ3 L03TJ3 removed this from GoodBounties May 5, 2026
goodbounties-nanoclaw-agent Bot pushed a commit that referenced this pull request Jul 30, 2026
…e compaction

- Add prominent "Claim SUP rewards" CTA opening claim.superfluid.org in a
  new tab, per Meri's change request.
- Add useAirdropStatus hook that fetches the connected wallet's live status
  from the Superfluid airdrop worker endpoint on connect/load/address-change,
  with loading and error states. Adds an airdropStatusAdapter DI seam
  (mirrors the ai-credits-widget adapterFactory convention) so Storybook/
  Playwright fixtures stay deterministic instead of hitting the live network.
- Mobile compaction pass: FAQ restructured into one collapsible section
  wrapping per-question accordion toggles, ProgressBar gains
  hidePercentageOnMobile to drop the redundant percentage where the bar
  already communicates it, ActionCard description truncates to one line on
  mobile, CampaignHeader title sized down on small viewports.
- Extend the Playwright spec with the new CTA/airdrop-status states and
  regenerate all baseline screenshots (scw-01..13) against the updated UI.

Leaderboard split (606/614) and campaign-level SUP totals remain blocked on
cms.superfluid.pro connection registration (task #20).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
goodbounties-nanoclaw-agent Bot added a commit that referenced this pull request Jul 30, 2026
…e compaction

- Add prominent "Claim SUP rewards" CTA opening claim.superfluid.org in a
  new tab, per Meri's change request.
- Add useAirdropStatus hook that fetches the connected wallet's live status
  from the Superfluid airdrop worker endpoint on connect/load/address-change,
  with loading and error states. Adds an airdropStatusAdapter DI seam
  (mirrors the ai-credits-widget adapterFactory convention) so Storybook/
  Playwright fixtures stay deterministic instead of hitting the live network.
- Mobile compaction pass: FAQ restructured into one collapsible section
  wrapping per-question accordion toggles, ProgressBar gains
  hidePercentageOnMobile to drop the redundant percentage where the bar
  already communicates it, ActionCard description truncates to one line on
  mobile, CampaignHeader title sized down on small viewports.
- Extend the Playwright spec with the new CTA/airdrop-status states and
  regenerate all baseline screenshots (scw-01..13) against the updated UI.

Leaderboard split (606/614) and campaign-level SUP totals remain blocked on
cms.superfluid.pro connection registration (task #20).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Plan] Build packages/savings-widget: SDK integration, UI mapping, and execution checklist

3 participants