Skip to content

Add Buy G$ widget package with Onramper embed, SDK flow wiring, and QA fixtures#98

Draft
sirpy with Copilot wants to merge 2 commits into
mainfrom
copilot/convert-buy-g-to-goodwidget
Draft

Add Buy G$ widget package with Onramper embed, SDK flow wiring, and QA fixtures#98
sirpy with Copilot wants to merge 2 commits into
mainfrom
copilot/convert-buy-g-to-goodwidget

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This PR implements the planned “Buy G$” GoodWidget by introducing a dedicated widget package that embeds Onramper and wires the BuyGD SDK lifecycle into the GoodWidget runtime model. It covers the required widget states and adds deterministic Storybook/Playwright fixtures for review.

  • Widget package: @goodwidget/buy-gd-widget

    • Added a new publishable widget package under packages/buy-gd-widget.
    • Introduced runtime contract types for Buy G$ state/action modeling (idle, loading, onramper, transaction_pending, success, error, no_wallet).
    • Exposed integration metadata and custom-element entrypoints (element, register) for host embedding.
  • Buy flow integration

    • Added BuyGdWidget container + BuyGdView state UI composition.
    • Embedded Onramper via iframe with configurable query params (apiKey, default fiat/crypto, theme, allowed cryptos).
    • Wired wallet context from GoodWidgetProvider and BuyGD transaction lifecycle via @gooddollar/web3sdk-v2 (useBuyGd) and @usedapp/core provider boundary.
    • Added pending/success/error transitions with retry/refresh paths and host callbacks (onBuySuccess, onBuyError).
  • Storybook QA fixtures

    • Added deterministic fixture states for all required runtime states.
    • Added QA/BuyGdWidget/Runtime Fixtures stories, including mock-driven states and injected-wallet manual path.
  • Playwright smoke coverage

    • Added tests/widgets/buy-gd-widget/states.spec.ts covering all required states and screenshot outputs under tests/widgets/buy-gd-widget/test-results.
<BuyGdWidget
  provider={provider}
  onramperApiKey={apiKey}
  onramperOnlyCryptos="USDC,cUSD"
  onramperDefaultFiat="USD"
  onramperDefaultCrypto="cUSD"
/>

Copilot AI linked an issue Jul 16, 2026 that may be closed by this pull request
21 tasks
Co-authored-by: sirpy <671095+sirpy@users.noreply.github.com>
Copilot AI changed the title [WIP] Convert buy G$ feature into a GoodWidget Add Buy G$ widget package with Onramper embed, SDK flow wiring, and QA fixtures Jul 16, 2026
Copilot finished work on behalf of sirpy July 16, 2026 11:53
Copilot AI requested a review from sirpy July 16, 2026 11:53
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] Convert buy G$ to a GoodWidget

2 participants