Skip to content

Add support for minting additional fiat currencies (GBP, CHF, etc.) #449

@slekrem

Description

@slekrem

Feature Request

Current State

Currently, cashu.me supports the following fiat currencies with cent-based amounts:

  • USD (1.00 USD = 100 amount)
  • EUR (1.00 EUR = 100 amount)

This is implemented in:

  • src/stores/mints.ts:233-241 - activeUnitCurrencyMultiplyer getter
  • src/stores/ui.ts:93-114 - formatCurrency function

Proposed Enhancement

Add support for additional fiat currencies that use similar cent-based denomination systems, such as:

  • GBP (British Pound Sterling) - 1.00 GBP = 100 pence
  • CHF (Swiss Franc) - 1.00 CHF = 100 rappen/centimes
  • CAD (Canadian Dollar) - 1.00 CAD = 100 cents
  • AUD (Australian Dollar) - 1.00 AUD = 100 cents
  • JPY (Japanese Yen) - no subdivisions (multiplier = 1)
  • And potentially others

Implementation Requirements

  1. Update activeUnitCurrencyMultiplyer in src/stores/mints.ts to include new currencies
  2. Update formatCurrency in src/stores/ui.ts to handle new currencies
  3. Update unitTickerShortMap in src/stores/ui.ts for currency symbols/abbreviations
  4. Update activeUnitLabel getter in src/stores/mints.ts for display labels
  5. Ensure compatibility with Intl.NumberFormat for all supported currencies
  6. Add appropriate currency symbols and formatting

Benefits

  • Broader international support
  • Better user experience for non-USD/EUR users
  • Consistency with existing fiat currency implementation pattern

Notes

  • Different currencies have different subdivision systems (most use 100, but JPY has none)
  • ISO 4217 currency codes should be used for consistency
  • Currency formatting should respect locale-specific conventions via Intl.NumberFormat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions