feat: implement member contribution modal (Closes #12) - #15
Open
danielalanbates wants to merge 1 commit into
Open
feat: implement member contribution modal (Closes #12)#15danielalanbates wants to merge 1 commit into
danielalanbates wants to merge 1 commit into
Conversation
Adds src/components/groups/contribute-modal.tsx implementing the full member contribution flow against TreasuryContract.contribute(): - Amount input validated against group.rules.minContribution - Period selector auto-populated from current cycle, editable - Wallet USDC balance displayed before submission (via SAC balance sim) - Builds a real Soroban transaction, prepares (sim + auth footprint), signs via useWallet().signTransaction, submits with SorobanRpc.Server.sendTransaction, then polls getTransaction - Handles all states: idle / signing / pending / success / error - Shows tx hash with Stellar Expert explorer link on success - Invalidates groups / group / contributions React Query keys on success Closes coopfinance#12
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.
Closes #12
Adds
src/components/groups/contribute-modal.tsx— the full member contribution flow againstTreasuryContract.contribute(member, amount, period).What
group.rules.minContributioncreatedAt+contributionPeriodDays), editablebalance(Address)simulation; configurable viaNEXT_PUBLIC_USDC_CONTRACT_IDorusdcContractIdprop)TransactionBuilder→server.prepareTransaction(auth/footprint) →useWallet().signTransaction→server.sendTransaction→ pollserver.getTransactionuntilSUCCESS/FAILED/timeoutidle / signing / pending / success / errorwith spinners and inline errors["groups"],["group", id],["contributions", id]React Query keys so balances & history refreshNotes
useWallet,server,networkPassphrase,parseAmount,formatAmount,simulateContractCallhelpers — no new infra.any.This PR was created with the assistance of Claude Sonnet 4.5 by Anthropic. Happy to make any adjustments!