Post
Topic
Board Development & Technical Discussion
Re: Can someone make a testnet BTC exe?
by
coinvader
on 22/03/2024, 10:05:26 UTC
I've got that wallet. I'm looking to separate the price of the testnet coins
Okay, so the actual use-case is to use a separate fiat-value which most wallets do is just stamp the value of mainnet to testnet.
(which is reasonable considering testnet has no "real" price)

Without questioning the rationale to that (I saw your other posts), it's quite doable by dirty-editing the price ticker APIs set by your favorite wallet.

For example, in Electrum's "exchange_rate.py" script; editing any USD price class to an API that supports testnet should show you the testnet price when that ticker is selected.
For example; from Bitpay's mainnet API to coinpaprika's testnet API:
Code:
class BitPay(ExchangeBase):

    async def get_rates(self, ccy):
        json = await self.get_json('api.coinpaprika.com', '/v1/tickers/tbtc-bitcoin-testnet')
        return {'USD': to_decimal(json['quotes']['USD']['price'])}

Then, by selecting Bitpay in the GUI's menu: "Tools->Preferences->Fiat", Fiat Currency: "USD" Source: "Bitpay"
It will show testnet price based from coinpaprika's API (link) instead (but will also apply to mainnet):


If you really want it, edit the mentioned code and compile it yourself: github.com/spesmilo/electrum/blob/master/README.md#creating-binaries
I run Electrum from source to test it as quickly as possible BTW, so I don't have a compiled binary.

This is genius i didnt know coinpaprika had tBTC price from altquick.com thats what tBTC community needs.