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

Commit 7d03412

Browse files
Alexexx8starwalker00mongolsteppeblackblather
authored
Update docs 2 (#4188)
* add nonce to send options. * add nonce to send options. * Update CHANGELOG.md * linting * updating docs * update web3-shh.rst : whisper-overview broken link (#4170) whisper overview has been moved from https://github.com/ethereum/go-ethereum/wiki/Whisper to https://eth.wiki/concepts/whisper/whisper-overview * [Docs] Fixed a broken link (#4151) Original link gives out a 404, replaced by the closest thing I could find. * Possible typo in docs (#4088) I think the author missed a "this" in the phrase * Typically you will have only one Web3 connection, use const (#3967) Co-authored-by: Gregory Markou <[email protected]> * Removing deprecation notice for HttpProvider (#4008) * Removing deprecation notice for HttpProvider From my view, it is just a provider with less capabilities than websockets, but still widely useful — and widely used as well. @frozeman @nivida @GregTheGreek any thoughts? * Update include_package-core.rst * Update CHANGELOG.md Co-authored-by: Gregory Markou <[email protected]> Co-authored-by: Alex <[email protected]> * [Docs] Updated solidity example to modern syntax (#4147) * [Docs] Updated solidity example to modern syntax Replaced the old constructor function syntax with the modern one, added 'emit' to event calls, added pragma, added a valid bytes32 value and updated the JSON ABI. * [Docs] Fixed a broken link (#1) Original link gives out a 404, replaced by the proper guide. Co-authored-by: Juan Alonso <[email protected]> * Revert "[Docs] Fixed a broken link (#1)" This reverts commit 0de1272. Co-authored-by: Juan Alonso <[email protected]> * added EIP-2718 and EIP-1559 documentation * fixing typo * addressing feedback * changing possible types for maxPriorityFeePerGas * updating maxFeePerGas type * update changelog Co-authored-by: exx8 <[email protected]> Co-authored-by: starwalker00 <[email protected]> Co-authored-by: mongolsteppe <[email protected]> Co-authored-by: João Monteiro <[email protected]> Co-authored-by: William Entriken <[email protected]> Co-authored-by: Gregory Markou <[email protected]> Co-authored-by: Ev <[email protected]> Co-authored-by: Juan Alonso <[email protected]>
1 parent 6ba267b commit 7d03412

10 files changed

+59
-38
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,3 +407,11 @@ Released with 1.0.0-beta.37 code base.
407407
### Added
408408

409409
- London transaction support (#4155)
410+
411+
### Changed
412+
- Grammar fix (#4088) and updated Swarm (#4151)and Whisper doc links (#4170)
413+
- Removed deprecation notice for HttpProvider (#4008)
414+
- Nonce added to send options in documentation and types (#4052)
415+
- Updated Solidity example to modern syntax (#4147)
416+
- Changing web3 connection example from lets to const (#3967)
417+
- Updated the documentation for the transaction object to include EIP-2718 and EIP-1559 options

docs/callbacks-promises-events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To help web3 integrate into all kinds of projects with different standards we pr
99
Most web3.js objects allow a callback as the last parameter, as well as returning promises to chain functions.
1010

1111
Ethereum as a blockchain has different levels of finality and therefore needs to return multiple "stages" of an action.
12-
To cope with requirement we return a "promiEvent" for functions like ``web3.eth.sendTransaction`` or contract methods.
12+
To cope with this requirement we return a "promiEvent" for functions like ``web3.eth.sendTransaction`` or contract methods.
1313
This "promiEvent" is a promise combined with an event emitter to allow acting on different stages of action on the blockchain, like a transaction.
1414

1515
PromiEvents work like a normal promises with added ``on``, ``once`` and ``off`` functions.

docs/getting-started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ If this property is ``null`` you should connect to a remote/local node.
3737
3838
// In Node.js use: const Web3 = require('web3');
3939
40-
let web3 = new Web3(Web3.givenProvider || "ws://localhost:8545");
40+
const web3 = new Web3(Web3.givenProvider || "ws://localhost:8545");
4141
4242
That's it! now you can use the ``web3`` object.

docs/glossary.rst

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,47 +51,51 @@ Example
5151

5252
.. code-block:: javascript
5353
54+
pragma solidity ^0.8.4;
5455
contract Test {
5556
uint a;
56-
address d = 0x12345678901234567890123456789012;
57+
address d = 0xdCad3a6d3569DF655070DEd06cb7A1b2Ccd1D3AF;
5758
58-
function Test(uint testInt) { a = testInt;}
59+
constructor(uint testInt) { a = testInt;}
5960
6061
event Event(uint indexed b, bytes32 c);
6162
6263
event Event2(uint indexed b, bytes32 c);
6364
64-
function foo(uint b, bytes32 c) returns(address) {
65-
Event(b, c);
65+
function foo(uint b, bytes32 c) public returns(address) {
66+
emit Event(b, c);
6667
return d;
6768
}
6869
}
6970
71+
7072
// would result in the JSON:
71-
[{
72-
"type":"constructor",
73-
"payable":false,
74-
"stateMutability":"nonpayable"
75-
"inputs":[{"name":"testInt","type":"uint256"}],
76-
},{
77-
"type":"function",
78-
"name":"foo",
79-
"constant":false,
80-
"payable":false,
81-
"stateMutability":"nonpayable",
82-
"inputs":[{"name":"b","type":"uint256"}, {"name":"c","type":"bytes32"}],
83-
"outputs":[{"name":"","type":"address"}]
84-
},{
85-
"type":"event",
86-
"name":"Event",
87-
"inputs":[{"indexed":true,"name":"b","type":"uint256"}, {"indexed":false,"name":"c","type":"bytes32"}],
88-
"anonymous":false
89-
},{
90-
"type":"event",
91-
"name":"Event2",
92-
"inputs":[{"indexed":true,"name":"b","type":"uint256"},{"indexed":false,"name":"c","type":"bytes32"}],
93-
"anonymous":false
94-
}]
73+
[
74+
{
75+
"type": "constructor"
76+
"stateMutability": "nonpayable",
77+
"inputs": [{"internalType":"uint256","name":"testInt","type":"uint256"}],
78+
},
79+
{
80+
"type": "event"
81+
"name": "Event",
82+
"inputs": [{"indexed":true,"internalType":"uint256","name":"b","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"c","type":"bytes32"}],
83+
"anonymous": false,
84+
},
85+
{
86+
"type": "event"
87+
"name": "Event2",
88+
"inputs": [{"indexed":true,"internalType":"uint256","name":"b","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"c","type":"bytes32"}],
89+
"anonymous": false,
90+
},
91+
{
92+
"type": "function"
93+
"name": "foo",
94+
"stateMutability": "nonpayable",
95+
"inputs": [{"internalType":"uint256","name":"b","type":"uint256"},{"internalType":"bytes32","name":"c","type":"bytes32"}],
96+
"outputs": [{"internalType":"address","name":"","type":"address"}],
97+
}
98+
]
9599
96100
97101
------------------------------------------------------------------------------

docs/include_package-core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Value
8484

8585
``Object`` with the following providers:
8686

87-
- ``Object`` - ``HttpProvider``: The HTTP provider is **deprecated**, as it won't work for subscriptions.
87+
- ``Object`` - ``HttpProvider``: HTTP provider, does not support subscriptions.
8888
- ``Object`` - ``WebsocketProvider``: The Websocket provider is the standard for usage in legacy browsers.
8989
- ``Object`` - ``IpcProvider``: The IPC provider is used node.js dapps when running a local node. Gives the most secure connection.
9090

docs/web3-bzz.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ web3.bzz
88

99

1010
The ``web3-bzz`` package allows you to interact with swarm, the decentralized file store.
11-
For more see the `Swarm Docs <http://swarm-guide.readthedocs.io/en/latest/>`_.
11+
For more see the `Swarm Docs <https://docs.ethswarm.org/docs/>`_.
1212

1313

1414
.. code-block:: javascript

docs/web3-eth-contract.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,8 @@ Parameters
837837
* ``gasPrice`` - ``String`` (optional): The gas price in wei to use for this transaction.
838838
* ``gas`` - ``Number`` (optional): The maximum gas provided for this transaction (gas limit).
839839
* ``value`` - ``Number|String|BN|BigNumber``(optional): The value transferred for the transaction in wei.
840+
* ``nonce`` - ``Number`` (optional): the nonce number of transaction
841+
840842
2. ``callback`` - ``Function`` (optional): This callback will be fired first with the "transactionHash", or with an error object as the first argument.
841843

842844
-------

docs/web3-eth.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ The default hardfork property can be one of the following:
236236
- ``"constantinople"`` - ``String``
237237
- ``"petersburg"`` - ``String``
238238
- ``"istanbul"`` - ``String``
239+
- ``"berlin"`` - ``String``
240+
- ``"london"`` - ``String``
239241

240-
Default is ``"petersburg"``
242+
Default is ``"london"``
241243

242244

243245
-------
@@ -247,7 +249,7 @@ Example
247249
.. code-block:: javascript
248250
249251
web3.eth.defaultHardfork;
250-
> "petersburg"
252+
> "london"
251253
252254
// set the default block
253255
web3.eth.defaultHardfork = 'istanbul';
@@ -318,7 +320,7 @@ The default common property does contain the following ``Common`` object:
318320
- ``networkId`` - ``number``: Network ID of the custom chain
319321
- ``chainId`` - ``number``: Chain ID of the custom chain
320322
- ``baseChain`` - ``string``: (optional) ``mainnet``, ``goerli``, ``kovan``, ``rinkeby``, or ``ropsten``
321-
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, or ``istanbul``
323+
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, ``istanbul``, ``berlin``, or ``london``
322324

323325

324326
Default is ``undefined``.
@@ -1419,17 +1421,21 @@ Parameters
14191421
- ``value`` - ``Number|String|BN|BigNumber``: (optional) The value transferred for the transaction in :ref:`wei <what-is-wei>`, also the endowment if it's a contract-creation transaction.
14201422
- ``gas`` - ``Number``: (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).
14211423
- ``gasPrice`` - ``Number|String|BN|BigNumber``: (optional) The price of gas for this transaction in :ref:`wei <what-is-wei>`, defaults to :ref:`web3.eth.gasPrice <eth-gasprice>`.
1424+
- ``type`` - ``Number|String|BN|BigNumber``: (optional) A positive unsigned 8-bit number between 0 and 0x7f that represents the type of the transaction.
1425+
- ``maxFeePerGas`` - ``Number|String|BN``: (optional, defaulted to ``(2 * block.baseFeePerGas) + maxPriorityFeePerGas``) The maximum fee per gas that the transaction is willing to pay in total
1426+
- ``maxPriorityFeePerGas`` - ``Number|String|BN`` (optional, defaulted to ``1 Gwei``) The maximum fee per gas to give miners to incentivize them to include the transaction (Priority fee)
1427+
- ``accessList`` - ``List of hexstrings`` (optional) a list of addresses and storage keys that the transaction plans to access
14221428
- ``data`` - ``String``: (optional) Either a `ABI byte string <http://solidity.readthedocs.io/en/latest/abi-spec.html>`_ containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialisation code.
14231429
- ``nonce`` - ``Number``: (optional) Integer of the nonce. This allows to overwrite your own pending transactions that use the same nonce.
14241430
- ``chain`` - ``String``: (optional) Defaults to ``mainnet``.
1425-
- ``hardfork`` - ``String``: (optional) Defaults to ``petersburg``.
1431+
- ``hardfork`` - ``String``: (optional) Defaults to ``london``.
14261432
- ``common`` - ``Object``: (optional) The common object
14271433
- ``customChain`` - ``Object``: The custom chain properties
14281434
- ``name`` - ``string``: (optional) The name of the chain
14291435
- ``networkId`` - ``number``: Network ID of the custom chain
14301436
- ``chainId`` - ``number``: Chain ID of the custom chain
14311437
- ``baseChain`` - ``string``: (optional) ``mainnet``, ``goerli``, ``kovan``, ``rinkeby``, or ``ropsten``
1432-
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, or ``istanbul``
1438+
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, ``istanbul``, ``berlin``, or ``london``
14331439

14341440
2. ``callback`` - ``Function``: (optional) Optional callback, returns an error object as first parameter and the result as second.
14351441

docs/web3-shh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ web3.shh
55
========
66

77

8-
The ``web3-shh`` package allows you to interact with the whisper protocol for broadcasting. For more see `Whisper Overview <https://github.com/ethereum/go-ethereum/wiki/Whisper>`_.
8+
The ``web3-shh`` package allows you to interact with the whisper protocol for broadcasting. For more see `Whisper Overview <https://eth.wiki/concepts/whisper/whisper-overview>`_.
99

1010

1111
.. code-block:: javascript

packages/web3-eth-contract/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export interface SendOptions {
125125
gasPrice?: string;
126126
gas?: number;
127127
value?: number | string | BN;
128+
nonce?: number;
128129
}
129130

130131
export interface EstimateGasOptions {

0 commit comments

Comments
 (0)