extension icon indicating copy to clipboard operation
extension copied to clipboard

feat: bitcoin client

Open fbwoolf opened this issue 1 year ago • 4 comments

Try out this version of the Hiro Wallet - download extension builds.

DRAFT

This PR proposes changes to introduce a BitcoinClient and refactors the existing code related to apiClients and useApi to use a new StacksClient. To achieve this separation, I the query folder now contains a bitcoin and stacks folder.

Screen Shot 2022-08-29 at 1 42 11 PM

In addition, there is code here testing the Blockdaemon api service, so those changes (adding pkgs, etc) can ignore and/or removed if we end up going with the discovered free http api (which is what I ended up working with for this draft).

cc/ @kyranjamie @fbwoolf

fbwoolf avatar Aug 26 '22 19:08 fbwoolf

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
stacks-wallet-web ✅ Ready (Inspect) Visit Preview Sep 29, 2022 at 4:46PM (UTC)

vercel[bot] avatar Aug 26 '22 19:08 vercel[bot]

I'd avoid using the word data alone like this (just about anything can be classed as "data").

The query naming was really just to specify we're consuming the data via react-query. Isn't that how we're still doing it, even with separate stx/btc auto generated clients?

kyranjamie avatar Aug 29 '22 10:08 kyranjamie

I'd avoid using the word data alone like this (just about anything can be classed as "data").

The query naming was really just to specify we're consuming the data via react-query. Isn't that how we're still doing it, even with separate stx/btc auto generated clients?

Yep, that is a good point. I can change it back to query at the top level. Will do today.

fbwoolf avatar Aug 29 '22 12:08 fbwoolf

just a heads up, i've recently been playing around with the blockdaemon service too, and their TS library installs a large amount of dependencies that could be of concern, esp if you're only using the library for data fetching.

aulneau avatar Aug 30 '22 14:08 aulneau

@kyranjamie can you circle back and check this for the network naming changes? Took me a sec to get your point, but ended up using DefaultNetworkConfigurationsAvailableInWallet and NetworkModes to distinguish the two ...let me know if that makes more sense to you, or not? Also, I ended up using whenChainId and just removing the added whenNetwork.

fbwoolf avatar Sep 28 '22 18:09 fbwoolf