diff --git a/docs/_static/css/dark.css b/docs/_static/css/dark.css new file mode 100644 index 0000000000..f9b4458988 --- /dev/null +++ b/docs/_static/css/dark.css @@ -0,0 +1,622 @@ +/* links */ + +a, +a:visited { + color: #aaddff; +} + + +/* code directives */ + +.method dt, +.class dt, +.data dt, +.attribute dt, +.function dt, +.classmethod dt, +.exception dt, +.descclassname, +.descname { + background-color: #2d2d2d !important; +} + +.rst-content dl:not(.docutils) dt { + color: #aaddff; + background-color: #2d2d2d; + border-top: solid 3px #525252; + border-left: solid 3px #525252; +} + +em.property { + color: #888888; +} + + +/* tables */ + +.rst-content table.docutils thead { + color: #ddd; +} + +.rst-content table.docutils td { + border: 0px; +} + +.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td { + background-color: #5a5a5a; +} + + +/* inlined code highlights */ + +.xref, +.py-meth, +.rst-content a code { + color: #aaddff !important; + font-weight: normal !important; +} + +.rst-content code { + color: #eee !important; + font-weight: normal !important; +} + +code.literal { + background-color: #2d2d2d !important; + border: 1px solid #6d6d6d !important; +} + +code.docutils.literal.notranslate { + color: #ddd; +} + + +/* notes, warnings, hints */ + +.hint .admonition-title { + background: #2aa87c !important; +} + +.warning .admonition-title { + background: #cc4444 !important; +} + +.admonition-title { + background: #3a7ca8 !important; +} + +.admonition, +.note { + background-color: #2d2d2d !important; +} + + +/* table of contents */ + +.wy-nav-content-wrap { + background-color: rgba(0, 0, 0, 0.6) !important; +} + +.sidebar { + background-color: #191919 !important; +} + +.sidebar-title { + background-color: #2b2b2b !important; +} + +.wy-menu-vertical a { + color: #ddd; +} + +.wy-menu-vertical code.docutils.literal.notranslate { + color: #404040; + background: none !important; + border: none !important; +} + +.wy-nav-content { + background: #3c3c3c; + color: #dddddd; +} + +.wy-menu-vertical li.on a, +.wy-menu-vertical li.current>a { + background: #a3a3a3; + border-bottom: 0px !important; + border-top: 0px !important; +} + +.wy-menu-vertical li.current { + background: #b3b3b3; +} + +.toc-backref { + color: grey !important; +} + +.highlight .hll { + background-color: #49483e +} + +.highlight { + background: #222; + color: #f8f8f2 +} + +.highlight .c { + color: #888 +} + + +/* Comment */ + +.highlight .err { + color: #960050; + background-color: #1e0010 +} + + +/* Error */ + +.highlight .k { + color: #66d9ef +} + + +/* Keyword */ + +.highlight .l { + color: #ae81ff +} + + +/* Literal */ + +.highlight .n { + color: #f8f8f2 +} + + +/* Name */ + +.highlight .o { + color: #f92672 +} + + +/* Operator */ + +.highlight .p { + color: #f8f8f2 +} + + +/* Punctuation */ + +.highlight .ch { + color: #888 +} + + +/* Comment.Hashbang */ + +.highlight .cm { + color: #888 +} + + +/* Comment.Multiline */ + +.highlight .cp { + color: #888 +} + + +/* Comment.Preproc */ + +.highlight .cpf { + color: #888 +} + + +/* Comment.PreprocFile */ + +.highlight .c1 { + color: #888 +} + + +/* Comment.Single */ + +.highlight .cs { + color: #888 +} + + +/* Comment.Special */ + +.highlight .gd { + color: #f92672 +} + + +/* Generic.Deleted */ + +.highlight .ge { + font-style: italic +} + + +/* Generic.Emph */ + +.highlight .gi { + color: #a6e22e +} + + +/* Generic.Inserted */ + +.highlight .gs { + font-weight: bold +} + + +/* Generic.Strong */ + +.highlight .gu { + color: #888 +} + + +/* Generic.Subheading */ + +.highlight .kc { + color: #66d9ef +} + + +/* Keyword.Constant */ + +.highlight .kd { + color: #66d9ef +} + + +/* Keyword.Declaration */ + +.highlight .kn { + color: #f92672 +} + + +/* Keyword.Namespace */ + +.highlight .kp { + color: #66d9ef +} + + +/* Keyword.Pseudo */ + +.highlight .kr { + color: #66d9ef +} + + +/* Keyword.Reserved */ + +.highlight .kt { + color: #66d9ef +} + + +/* Keyword.Type */ + +.highlight .ld { + color: #e6db74 +} + + +/* Literal.Date */ + +.highlight .m { + color: #ae81ff +} + + +/* Literal.Number */ + +.highlight .s { + color: #e6db74 +} + + +/* Literal.String */ + +.highlight .na { + color: #a6e22e +} + + +/* Name.Attribute */ + +.highlight .nb { + color: #f8f8f2 +} + + +/* Name.Builtin */ + +.highlight .nc { + color: #a6e22e +} + + +/* Name.Class */ + +.highlight .no { + color: #66d9ef +} + + +/* Name.Constant */ + +.highlight .nd { + color: #a6e22e +} + + +/* Name.Decorator */ + +.highlight .ni { + color: #f8f8f2 +} + + +/* Name.Entity */ + +.highlight .ne { + color: #a6e22e +} + + +/* Name.Exception */ + +.highlight .nf { + color: #a6e22e +} + + +/* Name.Function */ + +.highlight .nl { + color: #f8f8f2 +} + + +/* Name.Label */ + +.highlight .nn { + color: #f8f8f2 +} + + +/* Name.Namespace */ + +.highlight .nx { + color: #a6e22e +} + + +/* Name.Other */ + +.highlight .py { + color: #f8f8f2 +} + + +/* Name.Property */ + +.highlight .nt { + color: #f92672 +} + + +/* Name.Tag */ + +.highlight .nv { + color: #f8f8f2 +} + + +/* Name.Variable */ + +.highlight .ow { + color: #f92672 +} + + +/* Operator.Word */ + +.highlight .w { + color: #f8f8f2 +} + + +/* Text.Whitespace */ + +.highlight .mb { + color: #ae81ff +} + + +/* Literal.Number.Bin */ + +.highlight .mf { + color: #ae81ff +} + + +/* Literal.Number.Float */ + +.highlight .mh { + color: #ae81ff +} + + +/* Literal.Number.Hex */ + +.highlight .mi { + color: #ae81ff +} + + +/* Literal.Number.Integer */ + +.highlight .mo { + color: #ae81ff +} + + +/* Literal.Number.Oct */ + +.highlight .sa { + color: #e6db74 +} + + +/* Literal.String.Affix */ + +.highlight .sb { + color: #e6db74 +} + + +/* Literal.String.Backtick */ + +.highlight .sc { + color: #e6db74 +} + + +/* Literal.String.Char */ + +.highlight .dl { + color: #e6db74 +} + + +/* Literal.String.Delimiter */ + +.highlight .sd { + color: #e6db74 +} + + +/* Literal.String.Doc */ + +.highlight .s2 { + color: #e6db74 +} + + +/* Literal.String.Double */ + +.highlight .se { + color: #ae81ff +} + + +/* Literal.String.Escape */ + +.highlight .sh { + color: #e6db74 +} + + +/* Literal.String.Heredoc */ + +.highlight .si { + color: #e6db74 +} + + +/* Literal.String.Interpol */ + +.highlight .sx { + color: #e6db74 +} + + +/* Literal.String.Other */ + +.highlight .sr { + color: #e6db74 +} + + +/* Literal.String.Regex */ + +.highlight .s1 { + color: #e6db74 +} + + +/* Literal.String.Single */ + +.highlight .ss { + color: #e6db74 +} + + +/* Literal.String.Symbol */ + +.highlight .bp { + color: #f8f8f2 +} + + +/* Name.Builtin.Pseudo */ + +.highlight .fm { + color: #a6e22e +} + + +/* Name.Function.Magic */ + +.highlight .vc { + color: #f8f8f2 +} + + +/* Name.Variable.Class */ + +.highlight .vg { + color: #f8f8f2 +} + + +/* Name.Variable.Global */ + +.highlight .vi { + color: #f8f8f2 +} + + +/* Name.Variable.Instance */ + +.highlight .vm { + color: #f8f8f2 +} + + +/* Name.Variable.Magic */ + +.highlight .il { + color: #ae81ff +} + + +/* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_static/css/toggle.css b/docs/_static/css/toggle.css new file mode 100644 index 0000000000..ebbd0658a1 --- /dev/null +++ b/docs/_static/css/toggle.css @@ -0,0 +1,77 @@ +input[type=checkbox] { + visibility: hidden; + height: 0; + width: 0; + margin: 0; +} + +.rst-versions .rst-current-version { + padding: 10px; + display: flex; + justify-content: space-between; +} + +.rst-versions .rst-current-version .fa-book, +.rst-versions .rst-current-version .fa-v, +.rst-versions .rst-current-version .fa-caret-down { + height: 24px; + line-height: 24px; + vertical-align: middle; +} + +.rst-versions .rst-current-version .fa-element { + width: 80px; + text-align: center; +} + +.rst-versions .rst-current-version .fa-book { + text-align: left; +} + +.rst-versions .rst-current-version .fa-v { + color: #27AE60; + text-align: right; +} + +label { + margin: 0 auto; + display: inline-block; + justify-content: center; + align-items: right; + border-radius: 100px; + position: relative; + cursor: pointer; + text-indent: -9999px; + width: 50px; + height: 21px; + background: #000; +} + +label:after { + border-radius: 50%; + position: absolute; + content: ''; + background: #fff; + width: 15px; + height: 15px; + top: 3px; + left: 3px; + transition: ease-in-out 200ms; +} + +input:checked+label { + background: #3a7ca8; +} + +input:checked+label:after { + left: calc(100% - 5px); + transform: translateX(-100%); +} + +html.transition, +html.transition *, +html.transition *:before, +html.transition *:after { + transition: ease-in-out 200ms !important; + transition-delay: 0 !important; +} \ No newline at end of file diff --git a/docs/_static/js/toggle.js b/docs/_static/js/toggle.js new file mode 100644 index 0000000000..f46a3a6662 --- /dev/null +++ b/docs/_static/js/toggle.js @@ -0,0 +1,38 @@ +document.addEventListener('DOMContentLoaded', function() { + + function toggleCssMode(isDay) { + var mode = (isDay ? "Day" : "Night"); + localStorage.setItem("css-mode", mode); + + var daysheet = $('link[href="_static/pygments.css"]')[0].sheet; + daysheet.disabled = !isDay; + + var nightsheet = $('link[href="_static/css/dark.css"]')[0]; + if (!isDay && nightsheet === undefined) { + var element = document.createElement("link"); + element.setAttribute("rel", "stylesheet"); + element.setAttribute("type", "text/css"); + element.setAttribute("href", "_static/css/dark.css"); + document.getElementsByTagName("head")[0].appendChild(element); + return; + } + if (nightsheet !== undefined) { + nightsheet.sheet.disabled = isDay; + } + } + + var initial = localStorage.getItem("css-mode") != "Night"; + var checkbox = document.querySelector('input[name=mode]'); + + toggleCssMode(initial); + checkbox.checked = initial; + + checkbox.addEventListener('change', function() { + document.documentElement.classList.add('transition'); + window.setTimeout(() => { + document.documentElement.classList.remove('transition'); + }, 1000) + toggleCssMode(this.checked); + }) + +}); \ No newline at end of file diff --git a/docs/_templates/versions.html b/docs/_templates/versions.html new file mode 100644 index 0000000000..f680b6506d --- /dev/null +++ b/docs/_templates/versions.html @@ -0,0 +1,36 @@ +{# Add rst-badge after rst-versions for small badge style. #} +
+ + RTD + + + + + + + v: {{ current_version }} + + +
+
+
{{ _('Versions') }}
{% for slug, url in versions %} +
{{ slug }}
+ {% endfor %} +
+
+
{{ _('Downloads') }}
{% for type, url in downloads %} +
{{ type }}
+ {% endfor %} +
+
+ {# Translators: The phrase "Read the Docs" is not translated #} +
{{ _('On Read the Docs') }}
+
+ {{ _('Project Home') }} +
+
+ {{ _('Builds') }} +
+
+
+
\ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index ac51ca7688..ca8d8a4945 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -152,13 +152,14 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -def setup(app): - app.add_js_file("js/matomo.js") +html_css_files = ["css/toggle.css"] + +html_js_files = ["js/matomo.js", "js/toggle.js"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +html_extra_path = ["_static/css"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/docs/contracts.rst b/docs/contracts.rst index d052b52d41..87ceaf772f 100644 --- a/docs/contracts.rst +++ b/docs/contracts.rst @@ -249,7 +249,7 @@ Each Contract Factory exposes the following methods. with transaction details being passed into the end portion of the function call, and function arguments being passed into the first portion. - The ``block_identifier`` parameter is passed directly to the call at the end portion + The ``block_identifier`` parameter is passed directly to the call at the end portion of the function call. Returns the amount of gas consumed which can be used as a gas estimate for @@ -351,7 +351,7 @@ Each Contract Factory exposes the following methods. .. py:classmethod:: Contract.encodeABI(fn_name, args=None, kwargs=None, data=None) Encodes the arguments using the Ethereum ABI for the contract function that - matches the given `fn_name` and arguements `args`. The `data` parameter + matches the given ``fn_name`` and arguments ``args``. The ``data`` parameter defaults to the function selector. .. code-block:: python @@ -373,7 +373,7 @@ Each Contract Factory exposes the following methods. .. py:classmethod:: Contract.get_function_by_signature(signature) Searches for a distinct function with matching signature. Returns an instance of - :py:class:`ContractFunction` upon finding a match. Raises `ValueError` if no + :py:class:`ContractFunction` upon finding a match. Raises ``ValueError`` if no match is found. .. code-block:: python @@ -397,7 +397,7 @@ Each Contract Factory exposes the following methods. .. py:classmethod:: Contract.get_function_by_name(name) Searches for a distinct function with matching name. Returns an instance of - :py:class:`ContractFunction` upon finding a match. Raises `ValueError` if no + :py:class:`ContractFunction` upon finding a match. Raises ``ValueError`` if no match is found or if multiple matches are found. .. code-block:: python @@ -411,7 +411,7 @@ Each Contract Factory exposes the following methods. Searches for a distinct function with matching selector. The selector can be a hexadecimal string, bytes or int. Returns an instance of :py:class:`ContractFunction` upon finding a match. - Raises `ValueError` if no match is found. + Raises ``ValueError`` if no match is found. .. code-block:: python @@ -438,7 +438,7 @@ Each Contract Factory exposes the following methods. .. py:classmethod:: Contract.get_function_by_args(*args) Searches for a distinct function with matching args. Returns an instance of - :py:class:`ContractFunction` upon finding a match. Raises `ValueError` if no + :py:class:`ContractFunction` upon finding a match. Raises ``ValueError`` if no match is found or if multiple matches are found. .. code-block:: python @@ -448,16 +448,16 @@ Each Contract Factory exposes the following methods. .. note:: - `Contract` methods `all_functions`, `get_function_by_signature`, `find_functions_by_name`, - `get_function_by_name`, `get_function_by_selector`, `find_functions_by_args` and - `get_function_by_args` can only be used when abi is provided to the contract. + ``Contract`` methods ``all_functions``, ``get_function_by_signature``, ``find_functions_by_name``, + ``get_function_by_name``, ``get_function_by_selector``, ``find_functions_by_args`` and + ``get_function_by_args`` can only be used when abi is provided to the contract. .. note:: - `Web3.py` rejects the initialization of contracts that have more than one function + Web3.py rejects the initialization of contracts that have more than one function with the same selector or signature. - eg. `blockHashAddendsInexpansible(uint256)` and `blockHashAskewLimitary(uint256)` have the - same selector value equal to `0x00000000`. A contract containing both of these functions + eg. ``blockHashAddendsInexpansible(uint256)`` and ``blockHashAskewLimitary(uint256)`` have the + same selector value equal to ``0x00000000``. A contract containing both of these functions will be rejected. diff --git a/docs/ethpm.rst b/docs/ethpm.rst index 679103fcaf..ac616e0807 100644 --- a/docs/ethpm.rst +++ b/docs/ethpm.rst @@ -78,7 +78,7 @@ The ``Package`` class currently verifies the following things. LinkableContract ---------------- -`Py-EthPM` uses a custom subclass of ``Web3.contract.Contract`` to manage contract factories and instances which might require bytecode linking. To create a deployable contract factory, both the contract type's `abi` and `deployment_bytecode` must be available in the Package's manifest. +`Py-EthPM` uses a custom subclass of ``Web3.contract.Contract`` to manage contract factories and instances which might require bytecode linking. To create a deployable contract factory, both the contract type's ``abi`` and ``deployment_bytecode`` must be available in the Package's manifest. .. doctest:: @@ -132,7 +132,7 @@ Methods .. py:classmethod:: LinkableContract.link_bytecode(attr_dict) - This method returns a newly created contract factory with the applied link references defined in the `attr_dict`. This method expects `attr_dict` to be of the type ``Dict[`contract_name`: `address`]`` for all link references that are unlinked. + This method returns a newly created contract factory with the applied link references defined in the ``attr_dict``. This method expects ``attr_dict`` to be of the type ``Dict[`contract_name`: `address`]`` for all link references that are unlinked. URI Schemes and Backends ------------------------ @@ -236,13 +236,13 @@ way through the EIP process) - ``version``: The URI escaped version string, *should* conform to the `semver `__ version numbering specification. -i.e. +i.e. - ``ethpm://packages.zeppelinos.eth/owned@1.0.0`` - ``ethpm://0x808B53bF4D70A24bA5cb720D37A4835621A9df00:1/ethregistrar@1.0.0`` To specify a specific asset within a package, you can namespace the target asset. -i.e. +i.e. - ``ethpm://maker.snakecharmers.eth:1/dai-dai@1.0.0/sources/token.sol`` - ``ethpm://maker.snakecharmers.eth:1/dai-dai@1.0.0/contract_types/DSToken/abi`` - ``ethpm://maker.snakecharmers.eth:1/dai-dai@1.0.0/deployments/mainnet/dai`` @@ -391,7 +391,7 @@ To write a manifest to disk Writes the active manifest to disk. Will not overwrite an existing manifest with the same name and root directory. Defaults -- Writes manifest to current working directory (as returned by `os.getcwd()`) unless a ``Path`` is provided as manifest_root_dir. +- Writes manifest to current working directory (as returned by ``os.getcwd()``) unless a ``Path`` is provided as manifest_root_dir. - Writes manifest with a filename of ".json" unless desired manifest name (which must end in ".json") is provided as manifest_name. - Writes the minified manifest version to disk unless prettify is set to True @@ -553,7 +553,7 @@ To inline the source code directly in the manifest, use ``inline_source()`` or ` .. note:: - `owned_compiler_output.json` below is expected to be the standard-json output generated by the solidity compiler as described `here `. The output must contain the `abi` and `bytecode` objects from compilation. + ``owned_compiler_output.json`` below is expected to be the standard-json output generated by the solidity compiler as described `here `_. The output must contain the ``abi`` and ``bytecode`` objects from compilation. .. doctest:: diff --git a/docs/examples.rst b/docs/examples.rst index e6aa57fa8e..1b4553bb63 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -352,11 +352,11 @@ it as a ``Package`` instance. # Note. To use the web3.pm module, you will need to instantiate your w3 instance # with a web3 provider connected to the chain on which your registry lives. - + # The ethPM module is still experimental and subject to change, # so for now we need to enable it via a temporary flag. w3.enable_unstable_package_management_api() - + # Then we need to set the registry address that we want to use. # This should be an ENS address, but can also be a checksummed contract address. w3.pm.set_registry("ens.snakecharmers.eth") @@ -365,7 +365,7 @@ it as a ``Package`` instance. ens_package = w3.pm.get_package("ethregistrar", "1.0.1") -Now that we have a ``Package`` representation of our target ethPM package, we can generate contract factories +Now that we have a ``Package`` representation of our target ethPM package, we can generate contract factories and instances from this ``Package``. However, it's important to note that some packages might be missing the necessary contract assets needed to generate an instance or a factory. You can use the `ethPM explorer `__ to figure out the names of the contract types and deployments @@ -387,7 +387,7 @@ available within an ethPM package. # To create a contract factory from a contract type located in an ethPM package. registrar_factory = ens_package.get_contract_factory("BaseRegistrarImplementation") - + # Now you can treat registrar_factory like any other Web3 Contract factory to deploy new instances! # Note. This will deploy new instances to the chain of the connected provider (in this example, mainnet) registrar_factory.constructor(...).transact() @@ -433,8 +433,8 @@ In this guide we will interact with an existing token contract that we have already deployed to a local testing chain. This guide assumes: 1. An existing token contract at a known address. -1. Access to the proper ``ABI`` for the given contract. -1. A `~web3.main.Web3` instance connected to a provider with an unlocked account which can send transactions. +2. Access to the proper ``ABI`` for the given contract. +3. A ``web3.main.Web3`` instance connected to a provider with an unlocked account which can send transactions. Creating the contract factory diff --git a/docs/middleware.rst b/docs/middleware.rst index 639396ea2b..ab4337d9d7 100644 --- a/docs/middleware.rst +++ b/docs/middleware.rst @@ -20,7 +20,7 @@ Default Middleware Some middlewares are added by default if you do not supply any. The defaults are likely to change regularly, so this list may not include the latest version's defaults. -You can find the latest defaults in the constructor in `web3/manager.py` +You can find the latest defaults in the constructor in ``web3/manager.py`` AttributeDict ~~~~~~~~~~~~~~~~~~ @@ -68,10 +68,10 @@ HTTPRequestRetry .. py:method:: web3.middleware.http_retry_request_middleware This middleware is a default specifically for HTTPProvider that retries failed - requests that return the following errors: `ConnectionError`, `HTTPError`, `Timeout`, - `TooManyRedirects`. Additionally there is a whitelist that only allows certain + requests that return the following errors: ``ConnectionError``, ``HTTPError``, ``Timeout``, + ``TooManyRedirects``. Additionally there is a whitelist that only allows certain methods to be retried in order to not resend transactions, excluded methods are: - `eth_sendTransaction`, `personal_signAndSendTransaction`, `personal_sendTransaction`. + ``eth_sendTransaction``, ``personal_signAndSendTransaction``, ``personal_sendTransaction``. .. _Modifying_Middleware: diff --git a/docs/providers.rst b/docs/providers.rst index 94b493bd4d..9d3bec285a 100644 --- a/docs/providers.rst +++ b/docs/providers.rst @@ -96,11 +96,11 @@ succesful connection it can make: 1. The connection specified by an environment variable, see :ref:`provider_uri` 2. :class:`~web3.providers.ipc.IPCProvider`, which looks for several IPC file locations. - `IPCProvider` will not automatically detect a testnet connection, it is suggested that the - user instead uses a `w3` instance from `web3.auto.infura` (e.g. - `from web3.auto.infura.ropsten import w3`) if they want to auto-detect a testnet. + ``IPCProvider`` will not automatically detect a testnet connection, it is suggested that the + user instead uses a ``w3`` instance from ``web3.auto.infura`` (e.g. + ``from web3.auto.infura.ropsten import w3``) if they want to auto-detect a testnet. 3. :class:`~web3.providers.rpc.HTTPProvider`, which attempts to connect to "http://localhost:8545" -4. None - if no providers are successful, you can still use Web3 APIs +4. ``None`` - if no providers are successful, you can still use Web3 APIs that do not require a connection, like: - :ref:`overview_type_conversions` diff --git a/docs/web3.eth.rst b/docs/web3.eth.rst index de06de2a44..afd7bc437b 100644 --- a/docs/web3.eth.rst +++ b/docs/web3.eth.rst @@ -640,7 +640,7 @@ The following methods are available on the ``web3.eth`` namespace. * Delegates to ``eth_signTransaction`` RPC Method. Returns a transaction that's been signed by the node's private key, but not yet submitted. - The signed tx can be submitted with `Eth.sendRawTransaction`` + The signed tx can be submitted with ``Eth.sendRawTransaction`` .. code-block:: python @@ -839,7 +839,7 @@ The following methods are available on the ``web3.eth`` namespace. Uses the selected gas price strategy to calculate a gas price. This method returns the gas price denominated in wei. - The `transaction_params` argument is optional however some gas price strategies + The ``transaction_params`` argument is optional however some gas price strategies may require it to be able to produce a gas price. .. code-block:: python diff --git a/docs/web3.parity.rst b/docs/web3.parity.rst index 5caf08ed01..6ce5add9b4 100644 --- a/docs/web3.parity.rst +++ b/docs/web3.parity.rst @@ -148,12 +148,12 @@ Full documentation for Parity-supported endpoints can be found `here >> web3.parity.shh.post({ - "from":"0x193f71c502feb0c181ed0b97352fdcebcb621c733cd80637b2154a2a2b867a12", - "topics":["0x12270000"], - "payload":"0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", - "priority":40, - "ttl":400 - }) + "from":"0x193f71c502feb0c181ed0b97352fdcebcb621c733cd80637b2154a2a2b867a12", + "topics":["0x12270000"], + "payload":"0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6", + "priority":40, + "ttl":400 + }) True .. py:method:: Shh.newMessageFilter(self, criteria) @@ -169,8 +169,8 @@ Full documentation for Parity-supported endpoints can be found `here >>web3.parity.shh.newMessageFilter({'topic': '0x12340000', 'privateKeyID': recipient_private}) - 0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9 + >>> web3.parity.shh.newMessageFilter({'topic': '0x12340000', 'privateKeyID': recipient_private}) + 0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9 .. py:method:: Shh.deleteMessageFilter(self, filter_id) @@ -180,7 +180,7 @@ Full documentation for Parity-supported endpoints can be found `here >>web3.parity.shh.deleteMessageFilter('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') + >>> web3.parity.shh.deleteMessageFilter('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') True .. py:method:: Shh.getMessages(self, filter_id) @@ -191,7 +191,7 @@ Full documentation for Parity-supported endpoints can be found `here >>web3.parity.shh.getMessages('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') + >>> web3.parity.shh.getMessages('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') [{ 'ttl': 50, 'timestamp': 1524497850, @@ -203,25 +203,25 @@ Full documentation for Parity-supported endpoints can be found `here >>web3.parity.shh.subscribe('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') - True + >>> web3.parity.shh.subscribe('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') + True .. py:method:: Shh.unsubscribe(self, filter_id) - * Close a subscribed filter. + * Close a subscribed filter. * Returns ``True`` if the filter subscription was sucesfully closed, otherwise ``False`` - .. code-block:: python + .. code-block:: python - >>>web3.parity.shh.unsubscribe('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') - True + >>> web3.parity.shh.unsubscribe('0xea7120c5408c72cfd7e0e1d2ff62df8e208d9a1f85d2ed54a4a3e1ad6daeb6f9') + True --------------- Asymmetric Keys @@ -235,7 +235,7 @@ Asymmetric Keys .. code-block:: python - >>>web3.parity.shh.newKeyPair() + >>> web3.parity.shh.newKeyPair() '86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb' .. py:method:: Shh.addPrivateKey(self, key) @@ -246,7 +246,7 @@ Asymmetric Keys .. code-block:: python - >>>web3.parity.shh.addPrivateKey('0x7b8190d96cd061a102e551ee36d08d4f3ca1f56fb0008ef5d70c56271d8c46d0') + >>> web3.parity.shh.addPrivateKey('0x7b8190d96cd061a102e551ee36d08d4f3ca1f56fb0008ef5d70c56271d8c46d0') '86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb' .. py:method:: Shh.getPublicKey(self, id) @@ -255,7 +255,7 @@ Asymmetric Keys .. code-block:: python - >>>web3.parity.shh.getPublicKey('86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb') + >>> web3.parity.shh.getPublicKey('86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb') '0x041b0777ceb8cf8748fe0bba5e55039d650a03eb0239a909f9ee345bbbad249f2aa236a4b8f41f51bd0a97d87c08e69e67c51f154d634ba51a224195212fc31e4e' .. py:method:: Shh.getPrivateKey(self, id) @@ -264,7 +264,7 @@ Asymmetric Keys .. code-block:: python - >>>web3.parity.shh.getPrivateKey('86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb') + >>> web3.parity.shh.getPrivateKey('86e658cbc6da63120b79b5eec0c67d5dcfb6865a8f983eff08932477282b77bb') '0x7b8190d96cd061a102e551ee36d08d4f3ca1f56fb0008ef5d70c56271d8c46d0' --------------- @@ -279,7 +279,7 @@ Symmetric Keys .. code-block:: python - >>>web3.parity.shh.newSymKey() + >>> web3.parity.shh.newSymKey() '6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c' .. py:method:: Shh.addSymKey(self, key) @@ -290,7 +290,7 @@ Symmetric Keys .. code-block:: python - >>>web3.parity.shh.addSymKey('0x58f6556e56a0d41b464a083161377c8a9c2e95156921f954f99ef97d41cebaa2') + >>> web3.parity.shh.addSymKey('0x58f6556e56a0d41b464a083161377c8a9c2e95156921f954f99ef97d41cebaa2') '6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c' .. py:method:: Shh.getSymKey(self, id) @@ -301,7 +301,7 @@ Symmetric Keys .. code-block:: python - >>>web3.parity.shh.getSymKey('6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c') + >>> web3.parity.shh.getSymKey('6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c') '0x58f6556e56a0d41b464a083161377c8a9c2e95156921f954f99ef97d41cebaa2' .. py:method:: Shh.deleteKey(self, id) @@ -312,5 +312,5 @@ Symmetric Keys .. code-block:: python - >>>web3.parity.shh.deleteKey('6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c') + >>> web3.parity.shh.deleteKey('6c388d63003deb378700c9dad87f67df0247e660647d6ba1d04321bbc2f6ce0c') True diff --git a/newsfragments/1626.doc.rst b/newsfragments/1626.doc.rst new file mode 100644 index 0000000000..b233f9c4e0 --- /dev/null +++ b/newsfragments/1626.doc.rst @@ -0,0 +1 @@ +Add dark mode to documentation. Also fixes a bunch of formatting issues in docs.