def get_all_balances_all() -> Dict[str, Dict]: walletCall = rpc_client.call_method('getAddresses') wallets = [] ## new array for address in walletCall['addresses']: wallet = rpc_client.call_method('getBalance', {'address': address}) wallets.append({ 'address': address, 'unlocked': wallet['availableBalance'], 'locked': wallet['lockedAmount'] }) return wallets
def register() -> str: result = rpc_client.call_method('createAddress') reg_address = {} reg_address['address'] = result['address'] reg_address['privateSpendKey'] = getSpendKey(result['address']) # print('Wallet register: '+reg_address['address']+'=>privateSpendKey: '+reg_address['privateSpendKey']) return reg_address
def send_transactionall(from_address: str, to_address) -> str: payload = { 'addresses': [from_address], 'transfers': to_address, 'fee': config.tx_fee, 'anonymity': config.wallet.mixin } result = rpc_client.call_method('sendTransaction', payload=payload) return result['transactionHash']
def get_some_balances(wallet_addresses: List[str]) -> Dict[str, Dict]: wallets = [] ## new array for address in wallet_addresses: wallet = rpc_client.call_method('getBalance', {'address': address}) wallets.append({ 'address': address, 'unlocked': wallet['availableBalance'], 'locked': wallet['lockedAmount'] }) return wallets
def send_transaction(from_address: str, to_address: str, amount: int) -> str: payload = { 'addresses': [from_address], 'transfers': [{ "amount": amount, "address": to_address }], 'fee': config.tx_fee, 'anonymity': 0 } result = rpc_client.call_method('sendTransaction', payload=payload) return result['transactionHash']
def register() -> str: result = rpc_client.call_method('createAddress') return result['address']
def get_all_balances(wallet_addresses: List[str]) -> Dict[str, Dict]: wallets = {} for address in wallet_addresses: wallet = rpc_client.call_method('getBalance', {'address': address}) wallets[address] = wallet return wallets
def get_wallet_balance(address: str) -> Dict[str, int]: result = rpc_client.call_method('getBalance', {'address': address}) return result
def getSpendKey(from_address: str) -> str: payload = {'address': from_address} result = rpc_client.call_method('getSpendKeys', payload=payload) return result['spendSecretKey']