Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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']
Beispiel #4
0
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
Beispiel #5
0
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']
Beispiel #6
0
def register() -> str:
    result = rpc_client.call_method('createAddress')
    return result['address']
Beispiel #7
0
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
Beispiel #8
0
def get_wallet_balance(address: str) -> Dict[str, int]:
    result = rpc_client.call_method('getBalance', {'address': address})
    return result
Beispiel #9
0
def getSpendKey(from_address: str) -> str:
    payload = {'address': from_address}
    result = rpc_client.call_method('getSpendKeys', payload=payload)
    return result['spendSecretKey']