fix(client): wire InvestorDashboard to wallet and on-chain claims - #220
Closed
shinzoxD wants to merge 1 commit into
Closed
fix(client): wire InvestorDashboard to wallet and on-chain claims#220shinzoxD wants to merge 1 commit into
shinzoxD wants to merge 1 commit into
Conversation
Replace the hardcoded GDF4...M9XZ wallet and MOCK_INVESTMENTS portfolio with useWallet() plus an event-scan hook, and add useClaimRefund / useClaimReturn so claims invoke claim_refund / claim_return. Closes Cylo-Traders#140
Author
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.
Summary
InvestorDashboardPageno longer hardcodesGDF4...M9XZor rendersMOCK_INVESTMENTS. The page reads the connected wallet fromuseWallet(), loads that address's contributions from ProductionEscrowContract event history, and sends refund/return claims through new contract mutation hooks.Closes #140
Changes
useClaimRefund()/useClaimReturn()inuseEscrowMutations.ts, callingclaim_refund/claim_returnviainvokeContractWriteand invalidating campaign, contribution, and portfolio queries on success.useInvestorPortfolio()which scansContribReceived/RefundClaimed/ReturnClaimedevents (same event-log approach asuseAdminCampaigns) and hydrates each row withget_campaign+get_contribution.InvestorDashboardPageto the connected wallet: disconnected users see a connect CTA; connected users see their real portfolio. Claim buttons call the mutation hooks, not the in-memory mock helpers.MOCK_INVESTMENTSfixtures ininvestorService.tsunused by pages/components (still referenced only by the excluded legacy test file)./dashboard/investorto the real page.Tests
mutateAsyncon the new hooks; mockclaimRefund/claimReturnandMath.randomtx hashes are not used.invokeContractWritewithclaim_refund/claim_returnand do not return fabricated0xhashes.GrantFox payout wallet:
GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH