Update info
This commit is contained in:
parent
097107f3de
commit
5e96380d7b
4
LICENSE
4
LICENSE
|
@ -1,7 +1,7 @@
|
||||||
BSD 3-Clause License
|
BSD 3-Clause License
|
||||||
|
|
||||||
Copyright (c) 2017 Michał Sałaban.
|
Copyright (c) 2017 Michał Sałaban
|
||||||
Copyright (c) 2016 The MoneroPy Developers.
|
Copyright (c) 2016 The MoneroPy Developers
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
Python Monero module
|
Python Monero module
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
A comprehensive Python module for handling Monero cryptocurrency.
|
||||||
|
|
||||||
|
THIS CODE IS UNDER INTENSIVE DEVELOPMENT. Do not rely on the API, it may change.
|
||||||
|
|
||||||
Copyrights
|
Copyrights
|
||||||
----------
|
----------
|
||||||
|
|
||||||
Released under the BSD 3-Clause License. See [LICENSE](LICENSE).
|
Released under the BSD 3-Clause License. See [LICENSE](LICENSE).
|
||||||
|
|
||||||
(c) 2017 Michał Sałaban <michal@salaban.info>
|
(c) 2017 Michał Sałaban <michal@salaban.info>
|
||||||
(c) 2016 The MoneroPy Developers
|
(c) 2016 The MoneroPy Developers (monero/base58.py taken from [MoneroPy](https://github.com/bigreddmachine/MoneroPy))
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Address(object):
|
||||||
raise ValueError("Invalid checksum")
|
raise ValueError("Invalid checksum")
|
||||||
if self._decoded[0] not in self._valid_netbytes:
|
if self._decoded[0] not in self._valid_netbytes:
|
||||||
raise ValueError("Invalid address netbyte {nb}. Allowed values are: {allowed}".format(
|
raise ValueError("Invalid address netbyte {nb}. Allowed values are: {allowed}".format(
|
||||||
nb=hexlify(bytes(self._decoded[0])),
|
nb=self._decoded[0],
|
||||||
allowed=", ".join(map(lambda b: '%02x' % b, self._valid_netbytes))))
|
allowed=", ".join(map(lambda b: '%02x' % b, self._valid_netbytes))))
|
||||||
|
|
||||||
def is_testnet(self):
|
def is_testnet(self):
|
||||||
|
|
|
@ -7,7 +7,7 @@ import requests
|
||||||
|
|
||||||
from .. import exceptions
|
from .. import exceptions
|
||||||
from ..account import Account
|
from ..account import Account
|
||||||
from ..address import address
|
from ..address import address, Address
|
||||||
from ..numbers import from_atomic, to_atomic
|
from ..numbers import from_atomic, to_atomic
|
||||||
|
|
||||||
_log = logging.getLogger(__name__)
|
_log = logging.getLogger(__name__)
|
||||||
|
@ -46,7 +46,7 @@ class JSONRPC(object):
|
||||||
return [Address(_addresses['address'])]
|
return [Address(_addresses['address'])]
|
||||||
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
|
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
|
||||||
for _addr in _addresses['addresses']:
|
for _addr in _addresses['addresses']:
|
||||||
addresses[_addr['address_index']] = Address(_addr['address'])
|
addresses[_addr['address_index']] = address(_addr['address'])
|
||||||
return addresses
|
return addresses
|
||||||
|
|
||||||
def get_balance(self, account=0):
|
def get_balance(self, account=0):
|
||||||
|
@ -75,7 +75,6 @@ class JSONRPC(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
def transfer(self, destinations, priority, mixin, unlock_time, account=0):
|
def transfer(self, destinations, priority, mixin, unlock_time, account=0):
|
||||||
print(destinations)
|
|
||||||
data = {
|
data = {
|
||||||
'account_index': account,
|
'account_index': account,
|
||||||
'destinations': list(map(
|
'destinations': list(map(
|
||||||
|
@ -130,7 +129,6 @@ class JSONRPC(object):
|
||||||
|
|
||||||
if 'error' in result:
|
if 'error' in result:
|
||||||
err = result['error']
|
err = result['error']
|
||||||
# TODO: resolve code, raise exception
|
|
||||||
_log.error(u"JSON RPC error:\n{result}".format(result=_ppresult))
|
_log.error(u"JSON RPC error:\n{result}".format(result=_ppresult))
|
||||||
if err['code'] in _err2exc:
|
if err['code'] in _err2exc:
|
||||||
raise _err2exc[err['code']](err['message'])
|
raise _err2exc[err['code']](err['message'])
|
||||||
|
|
Loading…
Reference in New Issue