(*args)
| 158 | |
| 159 | |
| 160 | def helloblock_unspent(*args): |
| 161 | addrs, network = parse_addr_args(*args) |
| 162 | if network == 'testnet': |
| 163 | url = 'https://testnet.helloblock.io/v1/addresses/%s/unspents?limit=500&offset=%s' |
| 164 | elif network == 'btc': |
| 165 | url = 'https://mainnet.helloblock.io/v1/addresses/%s/unspents?limit=500&offset=%s' |
| 166 | o = [] |
| 167 | for addr in addrs: |
| 168 | for offset in xrange(0, 10**9, 500): |
| 169 | res = make_request(url % (addr, offset)) |
| 170 | data = json.loads(res.decode("utf-8"))["data"] |
| 171 | if not len(data["unspents"]): |
| 172 | break |
| 173 | elif offset: |
| 174 | sys.stderr.write("Getting more unspents: %d\n" % offset) |
| 175 | for dat in data["unspents"]: |
| 176 | o.append({ |
| 177 | "output": dat["txHash"]+':'+str(dat["index"]), |
| 178 | "value": dat["value"], |
| 179 | }) |
| 180 | return o |
| 181 | |
| 182 | |
| 183 | unspent_getters = { |
nothing calls this directly
no test coverage detected