Skip to content

Add CHF as fiat currency option - #238

Merged
tiero merged 4 commits into
masterfrom
copilot/add-chf-currency-fiat
Nov 26, 2025
Merged

tiero merged 4 commits into
masterfrom
copilot/add-chf-currency-fiat

Conversation

Copilot AI commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor

Adds Swiss Franc (CHF) as a selectable fiat currency alongside existing EUR and USD options.

Changes

  • Type definitions: Added CHF to Fiats and Unit enums
  • Price feed: Extended FiatPrices interface and getPriceFeed to fetch CHF rates from blockchain.info API
  • Currency conversion: Implemented fromCHF/toCHF functions in fiat provider with conditional logic in fromFiat/toFiat
  • Settings UI: Added CHF to currency selector dropdown
  • Tests: Updated mock API responses to include CHF data

The implementation follows the existing EUR/USD pattern:

// Conversion functions now handle three currencies
const fromFiat = (fiat = 0) => {
  if (config.fiat === Fiats.EUR) return fromEUR(fiat)
  if (config.fiat === Fiats.CHF) return fromCHF(fiat)
  return fromUSD(fiat)
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • blockchain.info
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Add CHF as currency fiat


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai

coderabbitai Bot commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Co-authored-by: tiero <3596602+tiero@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 21, 2025 •

Copy link
Copy Markdown

Deploying wallet-bitcoin with  Cloudflare Pages  Cloudflare Pages

Latest commit: d1c1531
Status: ✅  Deploy successful!
Preview URL: https://35e0e328.wallet-bitcoin.pages.dev
Branch Preview URL: https://copilot-add-chf-currency-fia.wallet-bitcoin.pages.dev

View logs

Copilot AI changed the title [WIP] Add CHF as a currency fiat Add CHF as fiat currency option Nov 21, 2025
Copilot AI requested a review from tiero November 21, 2025 23:36
Comment thread src/test/lib/fiat.test.ts Resolved
tiero and others added 2 commits November 22, 2025 00:37
Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com>
@tiero
tiero marked this pull request as ready for review November 24, 2025 18:22
@bordalix

Copy link
Copy Markdown
Collaborator

tACK

@tiero
tiero merged commit a00cb23 into master Nov 26, 2025
4 checks passed
@bordalix
bordalix deleted the copilot/add-chf-currency-fiat branch November 26, 2025 14:29
pietro909 pushed a commit to pietro909/wallet that referenced this pull request Dec 8, 2025
* Initial plan

* Add CHF as fiat currency option

Co-authored-by: tiero <3596602+tiero@users.noreply.github.com>

* Apply suggestion from @tiero

Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com>

---------

Signed-off-by: Marco Argentieri <3596602+tiero@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tiero <3596602+tiero@users.noreply.github.com>
Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
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.

3 participants