Skip to content

feat: implement issues #878 #879 #880 #881 — rounds, milestones, refe… - #950

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
cephas360:feat/issues-878-879-880-881
Sep 28, 2026
Merged

Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
cephas360:feat/issues-878-879-880-881

Conversation

@cephas360

Copy link
Copy Markdown

…rrals, error taxonomy

Issue #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 #878 — closeRound and getRoundInfo

  • Added closeRound(invoiceId): Promise wrapping close_round entry point
  • Added getRoundInfo(invoiceId): Promise 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 #879 — Milestone management

  • Added completeMilestone(invoiceId, index): Promise
  • 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 #880 — Referral rewards

  • Added claimReferralRewards(): Promise
  • Added getReferralBalance(address?): Promise (defaults to connected wallet)
  • Added payWithReferral(invoiceId, amount, referrer): Promise
  • 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

closes #878
closes #879
closes #880
closes #881

…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
@drips-wave

drips-wave Bot commented Sep 26, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Kingsman-99
Kingsman-99 merged commit 9e9b8b0 into Stellar-split:main Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants