Skip to content

feat: add shared multi-currency pricing - #456

Merged
Luluameh merged 1 commit into
LightForgeHub:mainfrom
anthonia01-dev:feature/multi-currency-exchange-455
Aug 24, 2026
Merged

feat: add shared multi-currency pricing#456
Luluameh merged 1 commit into
LightForgeHub:mainfrom
anthonia01-dev:feature/multi-currency-exchange-455

Conversation

@anthonia01-dev

Copy link
Copy Markdown
Contributor

Multi-Currency Exchange Rate Conversion & Live Wallet Switcher

Related Issue

Closes #455

Overview

This pull request adds multi-currency display support for SkillSphere session prices and wallet balances.

Users can now switch between XLM, USD, EUR, GBP, and JPY from the navigation bar. The selected currency is shared across the application, so changing the currency updates expert cards, expert detail pages, wallet balances, and booking modals consistently.

Exchange rates are retrieved from CoinGecko’s public API using the current Stellar Lumens price and refreshed automatically every 60 seconds.

Changes Made

Shared Currency State

  • Added a shared CurrencyProvider around the application.
  • Updated useCurrency to consume the shared context.
  • Ensured all components use the same selected currency and exchange rates.
  • Prevented each component from maintaining an independent currency selection.
  • Added a clear error when useCurrency is used outside the provider.

Live Exchange Rate Conversion

  • Reused the existing CoinGecko exchange rate endpoint:
    • USD
    • EUR
    • GBP
    • JPY
  • Preserved the existing loading and stale-rate fallback behavior.
  • Rates continue refreshing every 60 seconds.
  • XLM remains the canonical transaction currency.
  • Fiat values are display-only equivalents and do not change transaction amounts.

Navigation Currency Switcher

  • Added a currency selector to the active desktop navigation bar.
  • Added a currency selector to the mobile navigation menu.
  • Supported currencies:
    • XLM
    • USD
    • EUR
    • GBP
    • JPY
  • Updated wallet balance display to use the selected currency.
  • Maintained the underlying XLM balance as the source value.

Expert Cards

Expert cards now display the hourly rate in the selected currency.

When a fiat currency is selected, the original XLM price remains visible alongside the converted value. Per-minute pricing is also converted using the same live exchange rate.

Example:

$25.40 / hr
12.5000 XLM/hr
$0.42 / min

Expert Details

The expert details view now follows the global currency selection and displays:

  • The selected currency’s hourly rate.
  • The original XLM hourly rate as a reference.
  • Consistent formatting for fiat and XLM values.

Booking Modal

Booking session modals now update when the user changes currency.

The reservation fee and booking confirmation display:

  • The selected display currency.
  • The original XLM amount alongside fiat values.
  • The same converted value throughout the booking flow.

Transaction-related amounts remain based on the original XLM value.

Formatting Behavior

  • XLM values use four decimal places.
  • USD, EUR, and GBP values use two decimal places.
  • JPY values are rounded to whole numbers.
  • Fiat symbols are displayed using the appropriate currency symbol:
    • $ for USD
    • for EUR
    • £ for GBP
    • ¥ for JPY
  • If exchange rates are unavailable, the UI falls back to displaying the original XLM amount.

Validation

Successful Checks

  • npm install
  • npm run build
  • VS Code diagnostics for all modified files
  • git diff --check

The production build completed successfully and generated all application routes.

Existing Repository Issues

npm run lint still reports pre-existing errors in unrelated files, including API routes, dashboard components, admin components, and session components.

The files changed in this pull request do not introduce new lint errors. Existing image optimization warnings remain in the expert card and expert details components.

Scope

This change only affects price and balance presentation. It does not modify:

  • Stellar transaction logic.
  • Wallet transaction amounts.
  • Smart contract behavior.
  • Escrow calculations.
  • Token swap functionality.
  • Backend persistence.
  • User account balances.

All payments continue to use XLM regardless of the selected display currency.

Closes #455

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@anthonia01-dev is attempting to deploy a commit to the luluameh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 516777ff-9e4b-4b03-a18f-4d74c09da4e7


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Luluameh
Luluameh merged commit 8fc6dd0 into LightForgeHub:main Aug 24, 2026
2 of 3 checks passed
@Luluameh

Copy link
Copy Markdown
Contributor

LGTM

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.

Multi-Currency Exchange Rate Conversion & Live Wallet Switcher

2 participants