Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 3107c98

Browse files
Velenircgewecke
andauthored
Document defaultBlock in methods.myMethod.call (#3558)
* Document defaultBlock in methods.myMethod.call * Add use case explanation Co-authored-by: cgewecke <[email protected]>
1 parent e1ba5d5 commit 3107c98

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/web3-eth-contract.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ methods.myMethod.call
737737

738738
.. code-block:: javascript
739739
740-
myContract.methods.myMethod([param1[, param2[, ...]]]).call(options[, callback])
740+
myContract.methods.myMethod([param1[, param2[, ...]]]).call(options [, defaultBlock] [, callback])
741741
742742
Will call a "constant" method and execute its smart contract method in the EVM without sending any transaction. Note calling cannot alter the smart contract state.
743743

@@ -749,7 +749,8 @@ Parameters
749749
* ``from`` - ``String`` (optional): The address the call "transaction" should be made from. For calls the ``from`` property is optional however it is highly recommended to explicitly set it or it may default to `address(0)` depending on your node or provider.
750750
* ``gasPrice`` - ``String`` (optional): The gas price in wei to use for this call "transaction".
751751
* ``gas`` - ``Number`` (optional): The maximum gas provided for this call "transaction" (gas limit).
752-
2. ``callback`` - ``Function`` (optional): This callback will be fired with the result of the smart contract method execution as the second argument, or with an error object as the first argument.
752+
``Number|String|BN|BigNumber`` - (optional) If you pass this parameter it will not use the default block set with :ref:`contract.defaultBlock <defaultblock>`. Pre-defined block numbers as ``"latest"``, ``"earliest"``, ``"pending"``, and ``"genesis"`` can also be used. Useful for requesting data from or replaying transactions in past blocks.
753+
3. ``callback`` - ``Function`` (optional): This callback will be fired with the result of the smart contract method execution as the second argument, or with an error object as the first argument.
753754

754755
-------
755756
Returns

0 commit comments

Comments
 (0)