feat(yield): draft UI to show + claim saving-circle yield - #184
Draft
BreadrichEngels wants to merge 5 commits into
Draft
feat(yield): draft UI to show + claim saving-circle yield#184BreadrichEngels wants to merge 5 commits into
BreadrichEngels wants to merge 5 commits into
Conversation
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>
✅ Deploy Preview for app-stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft UI surfacing the sDAI-yield feature in Stacks. Pairs with the contract work in BreadchainCoop/saving-circles#189 (draft PR saving-circles#190).
What's here
lib/abis/yield-saving-circles.ts— ABI fragment for the new contract functions (claim,claimYield,withdrawStakedPrincipal,setClaimTiming,claimableYield) + aClaimTimingenum. Regenerate from the compiled artifact once deployed.lib/constants.ts+lib/env.ts—NEXT_PUBLIC_YIELD_SAVING_CIRCLES_CONTRACT_ADDRESS, optional/defaulted so nothing breaks pre-deploy.hooks/use-yield-saving-circles-tx.ts— sponsored-tx hook, mirrorsuseSavingCirclesTx.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; returnsnullwhen there's no yield contract.overview.tsx— mounts<YieldPanel>on the circle screen.Intentionally scoped out (kept minimal per AGENTS/CLAUDE guidance)
claim(id, keepStaked)) andwithdrawStakedPrincipalUI — the panel currently demonstrates the yield read +claimYield. Happy to extend once the contract API settles.Depends on