Ejemplo n.º 1
0
def sendmanyjson(model, data):
    sendmany_entries = []
    for entry in json.loads(data):
        _asset = asset(model, entry['moniker'])
        _amount = assetamount(_asset, entry['amount'])
        _coloraddress = coloraddress(model, _asset, entry['coloraddress'])
        _address = coloraddress_to_bitcoinaddress(_coloraddress)
        sendmany_entries.append((_asset, _address, _amount))
    return sendmany_entries
Ejemplo n.º 2
0
def _sanitize_csv_input(model, csvvalues, row):
    if len(csvvalues) != 3: # must have three entries
        msg = ("CSV entry must have three values 'moniker,address,amount'. "
               "Row %s has %s values!")
        raise InvalidInput(msg % (row, len(csvvalues)))
    _moniker, _coloraddress, _amount = csvvalues
    _asset = asset(model, _moniker)
    _coloraddress = coloraddress(model, _asset, _coloraddress)
    _amount = assetamount(_asset, _amount)
    _address = coloraddress_to_bitcoinaddress(_coloraddress)
    return _asset, _address, _amount