feat: implement issues #878 #879 #880 #881 — rounds, milestones, refe… - #950
Merged
Kingsman-99 merged 2 commits intoSep 28, 2026
Merged
Conversation
…lit#880 Stellar-split#881 — rounds, milestones, referrals, error taxonomy ## Issue Stellar-split#881 — Typed error taxonomy - Added RoundNotEndedError, WrongMilestoneError, NothingToClaimError - Added InvoiceExpiredError, PayerNotWhitelistedError, ContributionCapExceededError - Added PaymentCooldownActiveError (with retryAfter: Date field) - Added ContractFrozenError, InvoiceFullyFundedError - Added isRetryable(error) utility — true for transient RPC errors, false for contract logic errors - All new errors extend StellarSplitError with typed code, context and raw fields - Exported all new classes and guards from src/index.ts ## Issue Stellar-split#878 — closeRound and getRoundInfo - Added closeRound(invoiceId): Promise<RoundCloseResult> wrapping close_round entry point - Added getRoundInfo(invoiceId): Promise<RoundInfo> returning current round state - RoundCloseResult includes totalRaised, hardCap, overflow, refunds: PayerRefund[] - PayerRefund includes payer, amountKept, amountRefunded - Throws RoundNotEndedError when round_end timestamp has not passed - Tests: close after round end, close before end throws, getRoundInfo success/not-found ## Issue Stellar-split#879 — Milestone management - Added completeMilestone(invoiceId, index): Promise<MilestoneResult> - Added getActiveMilestone(invoiceId): Promise<Milestone | null> - Added getMilestones(invoiceId): Promise<Milestone[]> - MilestoneResult includes index, amountReleased, nextMilestoneIndex?, txHash - Milestone includes index, description, targetAmount, fundedAmount, status - Throws WrongMilestoneError when index is not the active milestone - Tests: complete active milestone, wrong index throws, get all states ## Issue Stellar-split#880 — Referral rewards - Added claimReferralRewards(): Promise<ReferralClaimResult> - Added getReferralBalance(address?): Promise<bigint> (defaults to connected wallet) - Added payWithReferral(invoiceId, amount, referrer): Promise<ReferralPayResult> - Validates referrer as a valid Stellar G-address (throws ValidationError if invalid) - Throws NothingToClaimError when referral balance is zero - Tests: pay with referrer, balance check, claim, claim zero throws, invalid address throws
|
@cephas360 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
…rrals, error taxonomy
Issue #881 — Typed error taxonomy
Issue #878 — closeRound and getRoundInfo
Issue #879 — Milestone management
Issue #880 — Referral rewards
closes #878
closes #879
closes #880
closes #881