nimiq / electrum-client

API to interact with ElectrumX servers from browsers
14 stars 9 forks source link

awaiting blockchainScripthash_getBalanceBatch hangs when an empty array is passed #3

Closed Darkster1 closed 2 years ago

Darkster1 commented 2 years ago

When for some reason an empty array (with(out) scripthashes) is passed to getBalanceBatch it keeps 'waiting' until the script gets interrupted, no error is thrown it's just waiting. I'm trying to prevent that anyways but sometimes the code makes it through to the await getBalanceBatch call.

sisou commented 2 years ago

Hi! Are you sure you are in the right repo? We don't have a getBalanceBatch method, only getBalance for a single address: https://github.com/nimiq/electrum-client/blob/fb674cc40b85beb878540709beefa26e3cd99dcd/electrum-client/ElectrumClient.ts#L82

Darkster1 commented 2 years ago

I might be mistaken but I have electrum-client and electrum-client-js installed but the require loads "electrum-client" maybe there's another with the same name then, if yours doesn't have such functions (getBalanceBatch and scripthashDetailsBatch) I guess I made a mistake, sorry will recheck the module.

sisou commented 2 years ago

electrum-client package is this: https://www.npmjs.com/package/electrum-client

This here is @nimiq/electrum-client, but it's not even on npm :D