Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix getUnspentsForAddresses in BlockchairApi
When we pass an array of addresses we make a single call to the blockchair API with a comma separated list of addresses. The response includes the list of all utxos for every address in the list. Example response ``` "utxo": [ { "block_id": 838353, "transaction_hash": "19a2e26860981413ceab82052738386d72d530333b3a7e0237518e242c65524d", "index": 0, "value": 42000, "address": "34EaQXdjELqWrTFxJWFgmVmF91kPhdP4us" }, { "block_id": 838353, "transaction_hash": "19a2e26860981413ceab82052738386d72d530333b3a7e0237518e242c65524d", "index": 1, "value": 657269, "address": "bc1qv669qw5tzxsue5qrl36ygqnaahm98n9t68hdz577cz2r8eldyj3q6d90c4" } ] ``` However, with the code as it is now, for every address we map all the utxos in the response to the address. In the above example we will have a return value of an array of size 4 instead of the expected size 2. Associated unspents to addresses it doesnt belong to. Ticket: BTC-1084 TICKET: BTC-1084
- Loading branch information