|
|
@ -67,22 +67,19 @@ class Wallet(object):
|
|
|
|
addresses[_addr['address_index']] = _addr['address']
|
|
|
|
addresses[_addr['address_index']] = _addr['address']
|
|
|
|
return addresses
|
|
|
|
return addresses
|
|
|
|
|
|
|
|
|
|
|
|
def get_address(self, account):
|
|
|
|
def get_address(self, account, address_indices=[]):
|
|
|
|
qdata = {'account_index': account}
|
|
|
|
qdata = {'account_index': account, 'address_index': address_indices}
|
|
|
|
_addresses = self.make_wallet_rpc('get_address', qdata)
|
|
|
|
_addresses = self.make_wallet_rpc('get_address', qdata)
|
|
|
|
if 'address' in _addresses:
|
|
|
|
return _addresses
|
|
|
|
return _addresses['address']
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def new_address(self, account, label=None):
|
|
|
|
def new_address(self, account, label=None):
|
|
|
|
data = {'account_index': account, 'label': label}
|
|
|
|
data = {'account_index': account, 'label': label}
|
|
|
|
_address = self.make_wallet_rpc('create_address', data)
|
|
|
|
_address = self.make_wallet_rpc('create_address', data)
|
|
|
|
return (_address['address_index'], _address['address'])
|
|
|
|
return (_address['address_index'], _address['address'])
|
|
|
|
|
|
|
|
|
|
|
|
def transfers(self, address_indices=[], _in=True, _out=True):
|
|
|
|
def transfers(self, account_index=0, address_indices=[], _in=True, _out=True):
|
|
|
|
data = {
|
|
|
|
data = {
|
|
|
|
'account_index': config.WALLET_ACCOUNT,
|
|
|
|
'account_index': account_index,
|
|
|
|
'subaddr_indices': address_indices,
|
|
|
|
'subaddr_indices': address_indices,
|
|
|
|
'in': _in,
|
|
|
|
'in': _in,
|
|
|
|
'out': _out
|
|
|
|
'out': _out
|
|
|
|