diff --git a/docs/source/backends.rst b/docs/source/backends.rst index 7aea55f..f6ec1f8 100644 --- a/docs/source/backends.rst +++ b/docs/source/backends.rst @@ -24,5 +24,5 @@ the official `Wallet RPC`_ documentation. API reference ------------- -.. automodule:: monero.backends +.. automodule:: monero.backends.jsonrpc :members: diff --git a/monero/backends/jsonrpc.py b/monero/backends/jsonrpc.py index bfbe406..7cb8a9a 100644 --- a/monero/backends/jsonrpc.py +++ b/monero/backends/jsonrpc.py @@ -16,6 +16,14 @@ _log = logging.getLogger(__name__) class JSONRPCDaemon(object): + """ + JSON RPC backend for Monero daemon + + :param protocol: `http` or `https` + :param host: host name or IP + :param port: port number + :param path: path for JSON RPC requests (should not be changed) + """ def __init__(self, protocol='http', host='127.0.0.1', port=18081, path='/json_rpc'): self.url = '{protocol}://{host}:{port}'.format( protocol=protocol, @@ -99,6 +107,16 @@ class JSONRPCDaemon(object): class JSONRPCWallet(object): + """ + JSON RPC backend for Monero wallet (``monero-wallet-rpc``) + + :param protocol: `http` or `https` + :param host: host name or IP + :param port: port number + :param path: path for JSON RPC requests (should not be changed) + :param user: username to authenticate with over RPC + :param password: password to authenticate with over RPC + """ _master_address = None _addresses = None diff --git a/monero/transaction.py b/monero/transaction.py index 6bdff53..64bdecc 100644 --- a/monero/transaction.py +++ b/monero/transaction.py @@ -3,6 +3,13 @@ from .address import address from .numbers import PaymentID class Payment(object): + """ + A payment base class, representing payment not associated with any + :class:`Account `. + + This class is not intended to be turned into objects by the user, + it is used by backends. + """ payment_id = None amount = None timestamp = None @@ -28,14 +35,29 @@ class Payment(object): class IncomingPayment(Payment): + """ + An incoming payment (one that increases the balance of an + :class:`Account `) + """ _reprstr = "in: {} @ {} {:.12f} id={}" class OutgoingPayment(Payment): + """ + An outgoing payment (one that decreases the balance of an + :class:`Account `) + """ _reprstr = "out: {} @ {} {:.12f} id={}" class Transaction(object): + """ + A Monero transaction. Identified by `hash`, it can be a part of a block of some `height` + or not yet mined (`height` is `None` then). + + This class is not intended to be turned into objects by the user, + it is used by backends. + """ hash = None fee = None height = None @@ -62,6 +84,13 @@ else: class PaymentManager(object): + """ + A payment query manager, handling either incoming or outgoing payments of + an :class:`Account `. + + This class is not intended to be turned into objects by the user, + it is used by backends. + """ account_idx = 0 backend = None @@ -76,6 +105,12 @@ class PaymentManager(object): class PaymentFilter(object): + """ + A helper class that filters payments retrieved by the backend. + + This class is not intended to be turned into objects by the user, + it is used by backends. + """ def __init__(self, **filterparams): self.min_height = filterparams.pop('min_height', None) self.max_height = filterparams.pop('max_height', None)