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

Commit 68222fe

Browse files
committed
Merge conflict
2 parents fb3af4b + 436e77a commit 68222fe

21 files changed

+392
-58
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,16 @@ Released with 1.0.0-beta.37 code base.
405405
### Added
406406

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

409418
## [Unreleased]
410419

411420
## [1.5.1]
412-

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: 48 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``.
@@ -714,6 +716,43 @@ Example
714716
715717
------------------------------------------------------------------------------
716718

719+
.. _eth-feehistory:
720+
721+
722+
getFeeHistory
723+
=====================
724+
725+
.. code-block:: javascript
726+
727+
web3.eth.getFeeHistory(blockCount, newestBlock, rewardPercentiles, [callback])
728+
729+
Transaction fee history
730+
Returns base fee per gas and transaction effective priority fee per gas history for the requested block range if available.
731+
The range between headBlock-4 and headBlock is guaranteed to be available while retrieving data from the pending block and older
732+
history are optional to support. For pre-EIP-1559 blocks the gas prices are returned as rewards and zeroes are returned for the base fee per gas.
733+
734+
----------
735+
Parameters
736+
----------
737+
738+
1. ``String|Number|BN|BigNumber`` - Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available.
739+
2. ``String|Number|BN|BigNumber`` - Highest number block of the requested range.
740+
3. ``Array of numbers`` - A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used. Example: `["0", "25", "50", "75", "100"]` or `["0", "0.5", "1", "1.5", "3", "80"]`
741+
4. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.
742+
743+
-------
744+
Returns
745+
-------
746+
747+
``Promise`` returns ``Object`` - Fee history for the returned block range. The object:
748+
749+
- ``Number`` oldestBlock - Lowest number block of the returned range.
750+
- ``Array of strings`` baseFeePerGas - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
751+
- ``Array of numbers`` gasUsedRatio - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.
752+
- ``Array of string arrays`` reward - An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
753+
754+
------------------------------------------------------------------------------
755+
717756

718757
getAccounts
719758
=====================
@@ -1419,17 +1458,21 @@ Parameters
14191458
- ``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.
14201459
- ``gas`` - ``Number``: (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).
14211460
- ``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>`.
1461+
- ``type`` - ``Number|String|BN|BigNumber``: (optional) A positive unsigned 8-bit number between 0 and 0x7f that represents the type of the transaction.
1462+
- ``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
1463+
- ``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)
1464+
- ``accessList`` - ``List of hexstrings`` (optional) a list of addresses and storage keys that the transaction plans to access
14221465
- ``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.
14231466
- ``nonce`` - ``Number``: (optional) Integer of the nonce. This allows to overwrite your own pending transactions that use the same nonce.
14241467
- ``chain`` - ``String``: (optional) Defaults to ``mainnet``.
1425-
- ``hardfork`` - ``String``: (optional) Defaults to ``petersburg``.
1468+
- ``hardfork`` - ``String``: (optional) Defaults to ``london``.
14261469
- ``common`` - ``Object``: (optional) The common object
14271470
- ``customChain`` - ``Object``: The custom chain properties
14281471
- ``name`` - ``string``: (optional) The name of the chain
14291472
- ``networkId`` - ``number``: Network ID of the custom chain
14301473
- ``chainId`` - ``number``: Chain ID of the custom chain
14311474
- ``baseChain`` - ``string``: (optional) ``mainnet``, ``goerli``, ``kovan``, ``rinkeby``, or ``ropsten``
1432-
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, or ``istanbul``
1475+
- ``hardfork`` - ``string``: (optional) ``chainstart``, ``homestead``, ``dao``, ``tangerineWhistle``, ``spuriousDragon``, ``byzantium``, ``constantinople``, ``petersburg``, ``istanbul``, ``berlin``, or ``london``
14331476

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

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)