secretkeylabs / sats-connect

Sats connect is a simple javascript library that connects apps to Bitcoin wallets
https://www.npmjs.com/package/sats-connect
107 stars 40 forks source link

How to get balance on Xverse wallet #12

Closed 0xleopard closed 7 months ago

0xleopard commented 1 year ago

I tried to find getbalance on Xverse wallet, and unable to get the API yet.

Is there any documentation or demo available?

yknl commented 1 year ago

Once you have the address you can use any Bitcoin API to get the balance. For example: https://mempool.space/docs/api/rest

thekoenekamp commented 6 months ago

@yknl @victorkirov, I'm keen to know if there are plans to directly integrate a feature within Sats Connect for fetching user BTC & STX balances. Is this on your roadmap? Also, is mempool.space still the recommended option? Your insights on this would be greatly appreciated. Thank you sers!

FYI, I've noticed that all the Discord links in the documentation and on the website appear to be broken. Is there an active Discord community for Sats Connect (or Xverse) where one could join for more in-depth discussions and updates?

Additionally, I've spotted a small typo in the documentation on the page for "Selecting a provider with getProviderById" in here:

It currently reads: const response = providerObject.reauest('getInfo', null);

But it should be corrected to: const response = providerObject.request('getInfo', null);

Hope this helps improve the documentation for everyone!

victorkirov commented 6 months ago

@thekoenekamp We are doing a revamp of sats-connect and it would be possible to add those as convenience methods. I'll let our product team know as it has been asked for before. Thanks also for the documentation note, we'll get that updated 👍

For now, the easiest way is to use mempool.space. You can use the https://mempool.space/api/address/

endpoint and get the balance from the response.

For Discord, we closed all comms in the server as there were a lot of scammers around and we wanted to remove that form of access for them. We still have one channel open for developers but you have to be invited to join. Send me a DM @varak87 and I'll set you up.