Skip to content

feat: implement getEscrowBalance function#93

Open
yunus-dev-codecrafter wants to merge 1 commit intoamina69:mainfrom
yunus-dev-codecrafter:feature/escrow-balance
Open

feat: implement getEscrowBalance function#93
yunus-dev-codecrafter wants to merge 1 commit intoamina69:mainfrom
yunus-dev-codecrafter:feature/escrow-balance

Conversation

@yunus-dev-codecrafter
Copy link
Copy Markdown

closes #83

Quality Checks
✅ All 87 unit tests passing
✅ TypeScript compilation successful
✅ ESLint validation passed
✅ Type safety verified
Implements the escrow balance fetching feature for the escrow lifecycle epic.

Changes:

  • Add getEscrowBalance() function to accept accountId and horizonUrl
  • Validate accountId with isValidPublicKey()
  • Fetch account from Horizon API
  • Extract native (XLM) balance from balances array
  • Return BalanceInfo: {accountId, balance, lastModifiedLedger}
  • Throw EscrowNotFoundError on 404, ValidationError on invalid input
  • Add comprehensive unit tests covering:
    • Funded account with native balance
    • Account with zero balance
    • Account not found (404) error
    • Invalid public key validation
    • Other Horizon errors
    • Network failures
  • Export new function from SDK index

Labels: escrow, network, sdk
Size: XS (~2-4 hours)

Implements the escrow balance fetching feature for the escrow lifecycle epic.

Changes:
- Add getEscrowBalance() function to accept accountId and horizonUrl
- Validate accountId with isValidPublicKey()
- Fetch account from Horizon API
- Extract native (XLM) balance from balances array
- Return BalanceInfo: {accountId, balance, lastModifiedLedger}
- Throw EscrowNotFoundError on 404, ValidationError on invalid input
- Add comprehensive unit tests covering:
  - Funded account with native balance
  - Account with zero balance
  - Account not found (404) error
  - Invalid public key validation
  - Other Horizon errors
  - Network failures
- Export new function from SDK index

Labels: escrow, network, sdk
Size: XS (~2-4 hours)
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Mar 27, 2026

@yunus-dev-codecrafter 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

@amina69
Copy link
Copy Markdown
Owner

amina69 commented Mar 27, 2026

@yunus-dev-codecrafter read the contributing .md before starting please, you are making pr to the wrong branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDK · Escrow lifecycle] Implement getEscrowBalance()

2 participants