Ejemplo n.º 1
0
def do_transfer(args):
    '''Implements the "transfer" subcommand by calling the client class.'''
    keyfileFrom = _get_keyfile(args.customerNameFrom)
    keyfileTo = _get_pubkeyfile(args.customerNameTo)

    clientFrom = CrowdFundingClient(baseUrl=DEFAULT_URL, keyFile=keyfileFrom)

    response = clientFrom.transfer(args.value, keyfileTo)
    print("Response: {}".format(response))
Ejemplo n.º 2
0
def do_withdraw(args):
    '''Implements the "withdraw" subcommand by calling the client class.'''
    keyfile = _get_keyfile(args.customerName)

    client = CrowdFundingClient(baseUrl=DEFAULT_URL, keyFile=keyfile)

    response = client.withdraw(args.value)

    print("Response: {}".format(response))
Ejemplo n.º 3
0
def do_createcampaign(args):
    '''Implements the "createcampaign" subcommand by calling the client class.'''
    keyfile = _get_keyfile(args.crowdfundingName)

    client = CrowdFundingClient(baseUrl=DEFAULT_URL, keyFile=keyfile)

    response = client.createcampaign(args.value)

    print("Response: {}".format(response))
Ejemplo n.º 4
0
def do_balance(args):
    '''Implements the "balance" subcommand by calling the client class.'''
    keyfile = _get_keyfile(args.customerName)

    client = CrowdFundingClient(baseUrl=DEFAULT_URL, keyFile=keyfile)

    data = client.balance()

    if data is not None:
        print("\n{} has a net balance of = {}\n".format(args.customerName,
                                                        data.decode()))
    else:
        raise Exception("Data not found: {}".format(args.customerName))