Skip to content

feat: add Horizon payment, asset, liquidity pool, and offer inspection examples - #151

Merged
Dantama022 merged 1 commit into
Dantama022:mainfrom
Sabira2003:feat/horizon-inspection-examples-62-65
Jul 30, 2026
Merged

feat: add Horizon payment, asset, liquidity pool, and offer inspection examples#151
Dantama022 merged 1 commit into
Dantama022:mainfrom
Sabira2003:feat/horizon-inspection-examples-62-65

Conversation

@Sabira2003

Copy link
Copy Markdown
Contributor

Summary

This PR adds four runnable Horizon inspection examples using the Stellar JavaScript SDK.

Payment History Inspection

  • Retrieves recent payment records for a configurable Stellar account
  • Supports configurable payment-history limits
  • Identifies incoming, outgoing, self, and related payments
  • Displays native XLM and issued assets correctly
  • Displays amounts, source and destination accounts, counterparties, transaction hashes, ledger sequences, and timestamps
  • Handles accounts with no payment history gracefully
  • Explains payment records compared with generic Horizon operations

Asset Discovery and Search

  • Queries Horizon’s assets endpoint
  • Supports filtering by asset code
  • Displays asset code, issuer, asset type, holder-account statistics, balances, claimable balances, liquidity-pool holdings, and contract holdings where available
  • Distinguishes assets sharing the same code but issued by different accounts
  • Supports configurable result limits
  • Handles searches with no matching assets gracefully
  • Explains why asset code and issuer are both required to identify an issued asset

Liquidity Pool Inspection

  • Browses available Horizon liquidity pools
  • Supports lookup by liquidity pool ID
  • Displays participating assets and reserve balances
  • Displays total pool shares, fee basis points, participating accounts, and ledger metadata
  • Supports configurable result limits
  • Handles malformed and unknown pool IDs safely
  • Explains liquidity pool IDs and pool-share ownership

Offer Book Inspection

  • Queries active Horizon offers
  • Supports optional selling and buying asset filters
  • Supports native XLM and issued asset filters
  • Displays offer ID, seller, selling asset, buying asset, amount, price, approximate buying total, and last-modified ledger
  • Produces summary statistics for returned offers
  • Supports configurable result limits
  • Handles invalid filters and empty results gracefully
  • Explains the difference between offers, order books, completed trades, and liquidity pools

Runner and Documentation

  • Registers all four examples in the interactive runner
  • Adds parameter prompts for each example
  • Updates the README example catalog
  • Adds README execution and configuration instructions

Validation

  • 5 focused test suites passed
  • 95 tests passed
  • ESLint passed for all added and modified files
  • Isolated strict TypeScript validation passed for the four examples, runner registration, and tests
  • git diff --check passed

The repository-wide TypeScript command continues to report pre-existing errors in unrelated Soroban examples and utility files. None of those errors reference files changed in this PR.

Closes #87
Closes #90
Closes #91
Closes #92

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@Sabira2003 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

@Dantama022
Dantama022 merged commit 99235b1 into Dantama022:main Jul 30, 2026
0 of 3 checks passed
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