Skip to content

Add cross-border NGN → USDC payment corridor #28

Description

@MJ-RWA

Complexity: High — 200 pts

Summary

One of Stellar's primary use cases is cross-border payments. This issue builds a "Send Money" flow targeting the NGN → USDC corridor — a key route for Nigerian users. It shows the live NGN/USD rate, calculates how much USDC the recipient gets, and executes everything in one Stellar path payment.

Files to Create/Modify

  • Create: src/lib/forex.ts
  • Create: src/pages/CorridorPage.tsx
  • Modify: src/App.tsx — add /send-money route
  • Modify: src/pages/DashboardPage.tsx — add "Send Money" quick action button

Implementation Notes

forex.ts

export async function getXlmNgnRate(): Promise<number | null>
export function calculateUsdcOutput(ngnAmount, xlmNgnRate, xlmUsdcRate): { xlmNeeded, usdcOut, effectiveRate }

Use CoinGecko's free /simple/price?ids=stellar&vs_currencies=ngn,usd endpoint (no key needed) for the NGN/XLM rate.

CorridorPage layout

You send (NGN equivalent): [50,000] NGN
≈ 28.5 XLM needed · Rate: 1 USD = 1,580 NGN
Recipient receives: ≈ $31.64 USDC
To: [G... address]   [Send Money]
  • NGN input drives live calculation using getSwapQuote (XLM→USDC on-chain rate) multiplied by the live NGN/XLM rate
  • Builds a single pathPaymentStrictSend operation (source XLM → destination USDC)
  • Confirmation screen before signing shows: amount sent, amount received, exchange rate, network fee

Acceptance Criteria

  • NGN input triggers live calculation of XLM and USDC amounts
  • Uses CoinGecko or equivalent for live NGN/XLM rate (no API key required)
  • Uses Horizon strictSendPaths for on-chain XLM/USDC rate
  • Confirmation screen required before Freighter signing
  • Single pathPaymentStrictSend transaction (not two separate ops)
  • Success screen shows USDC received by recipient
  • Works on Stellar mainnet

Screen Recording Requirements

  1. Open Send Money, enter 50,000 NGN
  2. Live FX rate loads — XLM needed and USDC output shown
  3. Enter recipient Stellar address
  4. Confirmation screen shows full breakdown
  5. Sign with Freighter → payment executes in under 5 seconds
  6. Recipient's USDC balance increased on Stellar Expert

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions