Conversation
|
@miguelnietoa is attempting to deploy a commit to the Trustless Work Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughAdds an UpdateRoiDialog component, new APIs and hook to fetch and submit ROI percentage updates, a dropdown UI for ROI actions, and wiring through ROI table/view/hooks to open the dialog and refresh campaign data after a signed transaction. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Dialog as UpdateRoiDialog
participant Hook as useUpdateRoiPercentage
participant API as campaigns.api
participant Wallet as WalletContext
participant Backend as Soroban
participant Cache as ReactQuery
User->>Dialog: open(dialog for vault)
Dialog->>API: getRoiPercentage(contractId, publicKey)
API-->>Dialog: { roiPercentage }
User->>Dialog: submit new ROI%
Dialog->>Hook: execute(contractId, newROI)
Hook->>Wallet: ensure wallet & get publicKey
Hook->>API: updateRoiPorcentage({contractId, newROI, publicKey})
API-->>Hook: { unsignedXdr }
Hook->>Wallet: signTransaction(unsignedXdr)
Wallet-->>Hook: signedXdr
Hook->>Backend: submitAndExtractAddress(signedXdr)
Backend-->>Hook: tx result
Hook->>Cache: invalidate("campaigns")
Cache-->>Hook: refetch complete
Hook-->>Dialog: onSuccess
Dialog->>User: show success toast & close
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add UpdateRoiDialog component with form to modify vault ROI percentage. Integrate dialog into RoiView with new state management in useRoi hook. Add dropdown menu to roi-table-row with actions for managing loans, uploading funds, and updating ROI. Implement useUpdateRoiPercentage hook for transaction signing and submission. Add getRoiPercentage and updateRoiPorcentage API endpoints.
43290ce to
91bb87a
Compare
Summary by CodeRabbit
New Features
Improvements
UI Components
Documentation