send_pls

Function

def send_pls(account, to_address, amount, attempts=18):
    tx = {
        'nonce': get_nonce(account.address),
        'from': account.address,
        'to': to_address,
        'value': to_token_decimals(amount, 18),
    }
    try:
        return broadcast_transaction(account, tx, False, attempts)
    except Exception as e:
        if error := interpret_exception_message(e):
            logging.error("{}. Could not send to {}".format(error, to_address))
        return False

Description

  • Create a transaction to send an amount of PLS to another address

  • Broadcast and return True/False