|
|
|
@ -72,11 +72,21 @@ class Wallet(object):
|
|
|
|
|
if addr_indices:
|
|
|
|
|
qdata['address_index'] = addr_indices
|
|
|
|
|
_addresses = self.make_wallet_rpc('get_address', qdata)
|
|
|
|
|
if 'message' in _addresses:
|
|
|
|
|
return None
|
|
|
|
|
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
|
|
|
|
|
for _addr in _addresses['addresses']:
|
|
|
|
|
addresses[_addr['address_index']] = _addr['address']
|
|
|
|
|
return addresses
|
|
|
|
|
|
|
|
|
|
def get_address(self, account):
|
|
|
|
|
qdata = {'account_index': account}
|
|
|
|
|
_addresses = self.make_wallet_rpc('get_address', qdata)
|
|
|
|
|
if 'address' in _addresses:
|
|
|
|
|
return _addresses['address']
|
|
|
|
|
else:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
def new_address(self, account, label=None):
|
|
|
|
|
data = {'account_index': account, 'label': label}
|
|
|
|
|
_address = self.make_wallet_rpc('create_address', data)
|
|
|
|
|