Skip to content

feat: create reusable Stellar service for account and network operations#11

Merged
Iwueseiter merged 1 commit intoHubDApp:mainfrom
mayasimi:feature/stellar-service
Feb 25, 2026
Merged

feat: create reusable Stellar service for account and network operations#11
Iwueseiter merged 1 commit intoHubDApp:mainfrom
mayasimi:feature/stellar-service

Conversation

@mayasimi
Copy link
Contributor

@mayasimi mayasimi commented Feb 24, 2026

reslove #6
Description
This PR introduces a centralized stellarService to handle all communication with the Stellar network. This ensures consistent API usage, robust error handling, and a cleaner separation of concerns for Stellar-related logic.

Key Changes
New Service Module: Created

services/stellar/stellar.service.ts
providing a unified interface for Stellar operations.
Horizon Integration: Configured the service to use the Stellar Testnet Horizon endpoint and network passphrase.
Core Methods:

getAccount(publicKey)
: Fetches full account details from the network.

getBalances(publicKey)
: Specifically retrieves and formats account balances.

getTransactions(publicKey, limit)
: Fetches recent transaction history (default limit: 10).
Error Handling: Implemented specialized error messages, including specific handling for 404 (unfunded) accounts on Testnet.
Dependency Update: Added stellar-sdk to

package.json
.
Verification Results
Network Connectivity: Verified connection to https://horizon-testnet.stellar.org.
Linting: Confirmed npm run lint passes with no errors.
Build: Confirmed npm run build completes successfully with the new service integrated.
close #6

@Iwueseiter Iwueseiter merged commit dd7ecbc into HubDApp:main Feb 25, 2026
1 check 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.

Create reusable Stellar service for account and network operations

2 participants