Skip to content

Stellar integration ​

All Stellar access lives in server/src/stellar/.

ModuleExports
client.jshorizon, networkPassphrase, platformKeypair(), accountExists(), submitTransaction(), wrapHorizonError(), explorer URL helpers
wallet.jsgenerateKeypair(), fundTestnetAccount(), getXlmBalance(), getPaymentHistory()
payments.jssendXlm()
escrow.jscreateEscrowKeypair(), lockEscrow(), releaseEscrow(), refundEscrow(), findEscrowTransactions(), ESCROW_MEMOS

Networks ​

STELLAR_NETWORKPassphraseExplorer
testnetNetworks.TESTNETstellar.expert/explorer/testnet
publicNetworks.PUBLICstellar.expert/explorer/public

Set HORIZON_URL to a Horizon instance for the same network.

Error mapping ​

wrapHorizonError converts SDK errors into AppErrors:

Horizon responseResult
Transaction rejected with extras.result_codes502 STELLAR_TX_FAILED, with result codes in details
Anything else (timeouts, network errors, 5xx)503 HORIZON_UNAVAILABLE

This distinction matters: services only roll back state on STELLAR_TX_FAILED, where the ledger definitively did not change. See reconciliation.

Fees and timeouts ​

  • Every transaction uses BASE_FEE (100 stroops per operation).
  • Every transaction has a 60-second timeout, which bounds how long an uncertain outcome can remain uncertain.

Balances ​

getXlmBalance computes spendable XLM as:

minimum   = (2 + subentry_count + num_sponsoring − num_sponsored) × 0.5 XLM
available = balance − minimum − selling_liabilities − 0.01 XLM

Unfunded accounts return { funded: false, balance: '0', available: '0' } instead of throwing.

Nexlm is a peer-to-peer facilitator and never holds customer Naira.