spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
432 stars 343 forks source link

check balance for some specific btc address #175

Closed Gholbigrinn closed 2 years ago

Gholbigrinn commented 2 years ago

How can I interact with electrum servers? As example I want to check balance for some specific btc address, can you bring example how can I do it by using python? I understand that I need to send "blockchain.scripthash.get_balance" command to server, but how can i do it?

SomberNight commented 2 years ago

There is a minimal example using the aiorpcx library here in said lib's repo: https://github.com/kyuupichan/aiorpcX/blob/e55950fed903b63e82b87c7b6ca93ab50e18ce08/examples/client_rs.py

For concrete usage of protocol methods, see interface.py in electrum: https://github.com/spesmilo/electrum/blob/6a34d93ce2388feeae320ab1c614bc48ad2d4b31/electrum/interface.py