Skip to content

feat(yield): draft UI to show + claim saving-circle yield - #184

Draft
BreadrichEngels wants to merge 5 commits into
developmentfrom
feat/yield-ui
Draft

feat(yield): draft UI to show + claim saving-circle yield#184
BreadrichEngels wants to merge 5 commits into
developmentfrom
feat/yield-ui

Conversation

@BreadrichEngels

Copy link
Copy Markdown
Contributor

Draft UI surfacing the sDAI-yield feature in Stacks. Pairs with the contract work in BreadchainCoop/saving-circles#189 (draft PR saving-circles#190).

⚠️ Not built locally — the agent sandbox had no working pnpm/toolchain, so this hasn't passed pnpm lint / pnpm build. Opened as a draft so CI / Vercel preview type-checks it. Expect a fixup pass. The YieldSavingCircles contract isn't deployed yet, so this is a safe no-op in prod today (the panel renders nothing when NEXT_PUBLIC_YIELD_SAVING_CIRCLES_CONTRACT_ADDRESS is unset).

What's here

  • lib/abis/yield-saving-circles.ts — ABI fragment for the new contract functions (claim, claimYield, withdrawStakedPrincipal, setClaimTiming, claimableYield) + a ClaimTiming enum. Regenerate from the compiled artifact once deployed.
  • lib/constants.ts + lib/env.tsNEXT_PUBLIC_YIELD_SAVING_CIRCLES_CONTRACT_ADDRESS, optional/defaulted so nothing breaks pre-deploy.
  • hooks/use-yield-saving-circles-tx.ts — sponsored-tx hook, mirrors useSavingCirclesTx.
  • hooks/use-claimable-yield.ts — reads a member's accrued yield; disabled when no yield contract is configured.
  • components/yield-panel.tsx — shows "Yield earned: X BREAD" + a Claim yield button; returns null when there's no yield contract.
  • overview.tsx — mounts <YieldPanel> on the circle screen.

Intentionally scoped out (kept minimal per AGENTS/CLAUDE guidance)

  • The keep-staked vs. take choice on the round claim (claim(id, keepStaked)) and withdrawStakedPrincipal UI — the panel currently demonstrates the yield read + claimYield. Happy to extend once the contract API settles.
  • The claim-timing setup control in the create flow.

Depends on

  • saving-circles#190 landing + a deployment address for the env var.
  • The contract's yield-accounting still under review (shared-pool attribution, BREAD wrap) — see saving-circles#189.

Surfaces the sDAI-yield feature (saving-circles#189 / PR #190) in Stacks.
DRAFT — not built locally (no pnpm/toolchain in the agent sandbox); relying
on CI / Vercel preview to type-check.

- abis/yield-saving-circles.ts: ABI fragment for the new YieldSavingCircles
  functions (claim/claimYield/withdrawStakedPrincipal/setClaimTiming/
  claimableYield) + ClaimTiming enum.
- constants.ts + env.ts: NEXT_PUBLIC_YIELD_SAVING_CIRCLES_CONTRACT_ADDRESS
  (optional until the contract is deployed).
- hooks: useYieldSavingCirclesTx (sponsored tx) + useClaimableYield (read).
- components/yield-panel.tsx: shows a member's accrued yield + "Claim yield";
  renders nothing when no yield contract is configured (safe no-op today).
- overview.tsx: mount YieldPanel on the circle screen.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for app-stacks ready!

Name Link
🔨 Latest commit df68b0b
🔍 Latest deploy log https://app.netlify.com/projects/app-stacks/deploys/6a8439071f7e2800082cd8c4
😎 Deploy Preview https://deploy-preview-184--app-stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

BreadrichEngels and others added 4 commits August 17, 2026 23:29
Netlify build failed on eslint(prettier) errors and `tsc` flagged `0n`
BigInt literals under the project's TS target. Formatted the new files and
replaced `0n` with `BigInt(0)`. `pnpm lint` and `tsc --noEmit` now pass.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Adds a `stubAmount` prop to YieldPanel (renders mock data, no chain/login)
and a throwaway /yield-demo route so the panel can be eyeballed on the
Netlify preview without Privy sign-in. Revert both before merging.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
Per feedback, a standalone page didn't show the panel in context. Now the
YieldPanel is stubbed directly in overview.tsx so it renders on any real
stack screen (login not required to view a stack), and the throwaway
/yield-demo route is removed. Revert the stubAmount before merge.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
The prior commit missed this file (bracket path glob). Embeds the mock-yield
stub in overview.tsx so the panel renders on real stack screens. Revert
before merge.

Co-Authored-By: Claude Opus 4 (1M context) <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.

2 participants