Exemplo n.º 1
0
def send_new_message(message, publickey):
    data = {"app": "messagingapp", "command": "newmessage", "message": message}
    send(Wallet_Import(0, 0),
         Wallet_Import(0, 1),
         publickey,
         data=data,
         amount=0)
def send_message(message, to_user):
    my_public_key = Wallet_Import(0, 0)
    my_private_key = Wallet_Import(0, 1)

    if isinstance(message, str):
        send(my_public_key=my_public_key,
             my_private_key=my_private_key,
             to_user=to_user,
             data=message,
             amount=1)
    else:
        print("This is not text message.")
Exemplo n.º 3
0
def send_coin(coin_amount, to_user):
    my_public_key = Wallet_Import(0,0)
    my_private_key = Wallet_Import(0,1)
    if not isinstance(coin_amount, float):
        print("This is not float coin amount.")
        return None

    if coin_amount < 0:
        print("This is negative coin amount.")
        return None

    send(my_public_key = my_public_key, my_private_key = my_private_key, to_user = to_user, amount = coin_amount)
def send_coin(coin_amount, to_user):
    my_public_key = Wallet_Import(0, 0)
    my_private_key = Wallet_Import(0, 1)
    if isinstance(int(coin_amount), int) or isinstance(float(coin_amount),
                                                       float):
        print("sendcoin" + str(coin_amount))
        send(my_public_key=my_public_key,
             my_private_key=my_private_key,
             to_user=to_user,
             amount=coin_amount)
    else:
        print("This is not integer coin amount.")
Exemplo n.º 5
0
def add_new_user_request(publickey):
    key = the_keys()["1"]

    data = {
        "app": "messagingapp",
        "command": "addnewuser",
        "n": key["n"],
        "e": key["e"]
    }
    send(Wallet_Import(0, 0),
         Wallet_Import(0, 1),
         publickey,
         data=data,
         amount=0)

    create_new_user("unknow", publickey, 0, 0)