feat: add KRW (Korean Won) currency support via Upbit API#215
feat: add KRW (Korean Won) currency support via Upbit API#215a1denvalu3 merged 2 commits intocashubtc:mainfrom
Conversation
|
Tested on Bitconize POS machine it self. Input, Payment, Receipt , Printing works well |
| /** Get the API URL for the current currency. Uses Upbit for KRW, Coinbase for others. */ | ||
| fun getPriceApiUrl(): String { | ||
| return if (currentCurrency == CURRENCY_KRW) { | ||
| "https://api.upbit.com/v1/ticker?markets=KRW-BTC" | ||
| } else { | ||
| "https://api.coinbase.com/v2/prices/BTC-$currentCurrency/spot" | ||
| } |
There was a problem hiding this comment.
I think we need to do this differently: we need a map from currency to api endpoint because we might add other currencies in the future only supported on their esoteric exchanges.
There was a problem hiding this comment.
Refactored to use a map-based config instead of if-else branching.
getPriceApiUrl()→ looks upCUSTOM_APIS["KRW"]→ returns Upbit URL- HTTP GET → receives JSON response
parsePriceResponse(response)→ looks upCUSTOM_APIS["KRW"].parsePrice→ extractstrade_price
If the currency is not in CUSTOM_APIS, both steps fall back to Coinbase defaults.
…c logic from BitcoinPriceWorker
|
Thank you! Will do some testing soon |
|
And Coinbase JPY rate seems Broken. but coinmarketcap shows |
|
Yes i've noticed that we need to fix the JPY. Probably get it from somewhere else since the coinbase api is broken? |
|
Maybe coingecko fit for numo |
* feat: add KRW (Korean Won) currency support via Upbit API * refactor: use map-based price API config to decouple exchange specific logic from BitcoinPriceWorker
Add Korean Won (KRW) as a supported fiat currency, using Upbit API for BTC-KRW price data.
Changes