4 class UnspentOutputs(object):
7 def get_block_height(connection):
8 response = connection.request("/get-block-count")
10 resp_json = json.loads(response.text)
12 if resp_json['status'] == 'success':
13 return resp_json['data']['block_count'], 1
14 elif resp_json['status'] == 'fail':
15 return resp_json['msg'], -1
20 def list_UTXO(connection):
21 response = connection.request("/list-unspent-outputs")
23 resp_json = json.loads(response.text)
25 if resp_json['status'] == 'success':
26 return resp_json['data'], 1
27 elif resp_json['status'] == 'fail':
28 return resp_json['msg'], -1