diff --git a/docs/filters.rst b/docs/filters.rst new file mode 100644 index 0000000..91beb82 --- /dev/null +++ b/docs/filters.rst @@ -0,0 +1,4 @@ +Filtering +========= + +TODO diff --git a/docs/index.rst b/docs/index.rst index 987081d..a762ef1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,15 +15,16 @@ Contents quickstart overview conventions - api - api.eth - api.db - api.shh - api.personal - api.version - api.txpool - api.miner - api.admin + web3 + web3.eth + web3.db + web3.shh + web3.personal + web3.version + web3.txpool + web3.miner + web3.admin + filters Indices and tables diff --git a/docs/api.admin.rst b/docs/web3.admin.rst similarity index 100% rename from docs/api.admin.rst rename to docs/web3.admin.rst diff --git a/docs/api.db.rst b/docs/web3.db.rst similarity index 100% rename from docs/api.db.rst rename to docs/web3.db.rst diff --git a/docs/api.eth.rst b/docs/web3.eth.rst similarity index 87% rename from docs/api.eth.rst rename to docs/web3.eth.rst index ad09603..8811efd 100644 --- a/docs/api.eth.rst +++ b/docs/web3.eth.rst @@ -515,3 +515,73 @@ with the filtering API. >>> web3.eth.filter({'fromBlock': 1000000, 'toBlock': 1000100, 'address': '0x6c8f2a135f6ed072de4503bd7c4999a1a17f824b'}) + +.. py:method:: Eth.getFilterChanges(self, filter_id) + + * Delegates to ``eth_getFilterChanges`` RPC Method. + + Returns all new entries which occurred since the last call to this method + for the given ``filter_id`` + + .. code-block:: python + + >>> filter = web3.eth.filter() + >>> web3.eth.getFilterChanges(filter.filter_id) + [ + { + 'address': '0xdc3a9db694bcdd55ebae4a89b22ac6d12b3f0c24', + 'blockHash': '0xb72256286ca528e09022ffd408856a73ef90e7216ac560187c6e43b4c4efd2f0', + 'blockNumber': 2217196, + 'data': '0x0000000000000000000000000000000000000000000000000000000000000001', + 'logIndex': 0, + 'topics': ['0xe65b00b698ba37c614af350761c735c5f4a82b4ab365a1f1022d49d9dfc8e930', + '0x000000000000000000000000754c50465885f1ed1fa1a55b95ee8ecf3f1f4324', + '0x296c7fb6ccafa3e689950b947c2895b07357c95b066d5cdccd58c301f41359a3'], + 'transactionHash': '0xfe1289fd3915794b99702202f65eea2e424b2f083a12749d29b4dd51f6dce40d', + 'transactionIndex': 1, + }, + ... + ] + + +.. py:method:: Eth.getFilterLogs(self, filter_id) + + * Delegates to ``eth_getFilterLogs`` RPC Method. + + Returns all entries for the given ``filter_id`` + + .. code-block:: python + + >>> filter = web3.eth.filter() + >>> web3.eth.getFilterLogs(filter.filter_id) + [ + { + 'address': '0xdc3a9db694bcdd55ebae4a89b22ac6d12b3f0c24', + 'blockHash': '0xb72256286ca528e09022ffd408856a73ef90e7216ac560187c6e43b4c4efd2f0', + 'blockNumber': 2217196, + 'data': '0x0000000000000000000000000000000000000000000000000000000000000001', + 'logIndex': 0, + 'topics': ['0xe65b00b698ba37c614af350761c735c5f4a82b4ab365a1f1022d49d9dfc8e930', + '0x000000000000000000000000754c50465885f1ed1fa1a55b95ee8ecf3f1f4324', + '0x296c7fb6ccafa3e689950b947c2895b07357c95b066d5cdccd58c301f41359a3'], + 'transactionHash': '0xfe1289fd3915794b99702202f65eea2e424b2f083a12749d29b4dd51f6dce40d', + 'transactionIndex': 1, + }, + ... + ] + + +.. py:method:: Eth.uninstallFilter(self, filter_id) + + * Delegates to ``eth_uninstallFilter`` RPC Method. + + Uninstalls the filter specified by the given ``filter_id``. Returns + boolean as to whether the filter was successfully uninstalled. + + .. code-block:: python + + >>> filter = web3.eth.filter() + >>> web3.eth.uninstallFilter(filter.filter_id) + True + >>> web3.eth.uninstallFilter(filter.filter_id) + False # already uninstalled. diff --git a/docs/api.rst b/docs/web3.main.rst similarity index 92% rename from docs/api.rst rename to docs/web3.main.rst index 33a405d..8ac404e 100644 --- a/docs/api.rst +++ b/docs/web3.main.rst @@ -3,6 +3,9 @@ Web3 API .. contents:: :local: +.. py:module:: web3 +.. py:currentmodule:: web3 + .. py:class:: Web3(provider) @@ -119,35 +122,35 @@ Each ``web3`` instance also exposes these namespaced APIs. .. py:attribute:: Web3.eth - See :doc:`./api.eth` + See :doc:`./web3.eth` .. py:attribute:: Web3.db - See :doc:`./api.db` + See :doc:`./web3.db` .. py:attribute:: Web3.shh - See :doc:`./api.shh` + See :doc:`./web3.shh` .. py:attribute:: Web3.personal - See :doc:`./api.personal` + See :doc:`./web3.personal` .. py:attribute:: Web3.version - See :doc:`./api.version` + See :doc:`./web3.version` .. py:attribute:: Web3.txpool - See :doc:`./api.txpool` + See :doc:`./web3.txpool` .. py:attribute:: Web3.miner - See :doc:`./api.miner` + See :doc:`./web3.miner` .. py:attribute:: Web3.admin - See :doc:`./api.admin` + See :doc:`./web3.admin` .. _EIP55: https://github.com/ethereum/EIPs/issues/55 diff --git a/docs/api.miner.rst b/docs/web3.miner.rst similarity index 100% rename from docs/api.miner.rst rename to docs/web3.miner.rst diff --git a/docs/api.personal.rst b/docs/web3.personal.rst similarity index 100% rename from docs/api.personal.rst rename to docs/web3.personal.rst diff --git a/docs/api.shh.rst b/docs/web3.shh.rst similarity index 100% rename from docs/api.shh.rst rename to docs/web3.shh.rst diff --git a/docs/api.txpool.rst b/docs/web3.txpool.rst similarity index 100% rename from docs/api.txpool.rst rename to docs/web3.txpool.rst diff --git a/docs/api.version.rst b/docs/web3.version.rst similarity index 100% rename from docs/api.version.rst rename to docs/web3.version.rst