Skip to content

feat: Setup Horizon API Client with reqwest#22

Merged
ayshadogo merged 2 commits intoDfunder:mainfrom
Oluwaseyi89:feature/Setup-Horizon-API-Client-with-reqwest
Mar 5, 2026
Merged

feat: Setup Horizon API Client with reqwest#22
ayshadogo merged 2 commits intoDfunder:mainfrom
Oluwaseyi89:feature/Setup-Horizon-API-Client-with-reqwest

Conversation

@Oluwaseyi89
Copy link
Contributor

Description

This PR implements a typed Horizon API client using reqwest to query the Stellar network. The client provides methods for fetching account details, transactions, payments, and individual transaction data with proper error handling.

Changes Made

  • Added reqwest, serde, serde_json, tokio, and thiserror to dependencies
  • Created src/horizon/client.rs with HorizonClient struct and implementation
  • Added src/horizon/mod.rs to expose the module
  • Defined comprehensive response structs with serde::Deserialize
  • Implemented custom HorizonError enum for typed error handling
  • Added convenience constructor for public testnet access

Implemented Methods

  • get_account(address: &str) -> Result<AccountResponse, HorizonError>
  • get_transactions(address: &str, cursor: Option<&str>) -> Result<TransactionPage, HorizonError>
  • get_payments(address: &str, cursor: Option<&str>) -> Result<PaymentPage, HorizonError>
  • get_transaction(hash: &str) -> Result<TransactionDetail, HorizonError>

Acceptance Criteria Met

  • Horizon client can fetch account details
  • Horizon client can fetch transactions
  • Errors are properly typed and handled

Closes #8

@ayshadogo
Copy link
Contributor

@Oluwaseyi89 please resolve conflicts

@Oluwaseyi89
Copy link
Contributor Author

@ayshadogo conflict has been resolved and all checks have passed. Please attend to the PR.

@ayshadogo ayshadogo merged commit 6f22a6c into Dfunder:main Mar 5, 2026
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

Development

Successfully merging this pull request may close these issues.

Setup Horizon API Client with reqwest

2 participants