Skip to content

Commit

Permalink
Merge branch '4.x' into 6485-throw-insecurecontexterror-if-window.cry…
Browse files Browse the repository at this point in the history
…pto.subtle-is-undefined
  • Loading branch information
Muhammad-Altabba authored Dec 13, 2023
2 parents b5fa731 + e1080d9 commit 23bc4fb
Show file tree
Hide file tree
Showing 124 changed files with 3,253 additions and 2,050 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Description

Please include a summary of the changes and be sure to follow our [Contribution Guidelines](../CONTRIBUTIONS.md).
Please include a summary of the changes and be sure to follow our [Contribution Guidelines](https://github.com/web3/web3.js/blob/4.x/CONTRIBUTIONS.md).

<!--
Optional if an issue is fixed:
Expand Down
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,7 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
- Dependencies updated

## [4.2.2]

### Added

#### web3-core
Expand Down Expand Up @@ -2253,4 +2254,72 @@ If there are any bugs, improvements, optimizations or any new feature proposal f

- Will populate `data` for transactions in contract for metamask provider instead of `input` (#6534)

## [4.3.0]

### Changed

#### web3-core

- Web3config `contractDataInputFill` has been defaulted to `data`, istead of `input`. (#6622)

#### web3-eth-contracts

- By default, contracts will fill `data` instead of `input` within method calls (#6622)

### Added


#### web3-utils

- `SocketProvider` now contains public function `getPendingRequestQueueSize`, `getSentRequestsQueueSize` and `clearQueues` (#6479)
- Added `safeDisconnect` as a `SocketProvider` method to disconnect only when request queue size and send request queue size is 0 (#6479)
- Add `isContractInitOptions` method (#6555)

#### web3

- Added methods (privateKeyToAddress, parseAndValidatePrivateKey, and privateKeyToPublicKey) to web3.eth.accounts (#6620)

### Fixed

#### web3-rpc-methods

- Fix web3-types import #6590 (#6589)

#### web3-utils

- Fix unecessary array copy when pack encoding (#6553)

## [Unreleased]

### Added

#### web3


#### web3-eth

- Catch `TransactionPollingTimeoutError` was added to send transaction events (#6623)

#### web3-utils

- `SocketProvider` now contains public function `getPendingRequestQueueSize`, `getSentRequestsQueueSize` and `clearQueues` (#6479)
- Added `safeDisconnect` as a `SocketProvider` method to disconnect only when request queue size and send request queue size is 0 (#6479)
- Add `isContractInitOptions` method (#6555)

### Changed

#### web3-core


#### web3-eth-contract


### Fixed

#### web3-rpc-methods

- Fix web3-types import #6590 (#6589)

#### web3-utils

- Fix unecessary array copy when pack encoding (#6553)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ yarn add web3
## Package.json Scripts

| Script | Description |
| ---------------- | ------------------------------------------------------------------ |
| ---------------- |--------------------------------------------------------------------|
| clean | Uses `rimraf` to remove `dist/` |
| build | Uses `tsc` to build all packages |
| lint | Uses `eslint` to lint all packages |
Expand All @@ -86,6 +86,8 @@ yarn add web3
| test | Uses `jest` to run unit tests in each package |
| test:integration | Uses `jest` to run tests under `/test/integration` in each package |
| test:unit | Uses `jest` to run tests under `/test/unit` in each package |
| test:manual:long-connection-ws | Runs manual tests for keeping a long WebSocket connection |
| test:manual | Runs manual tests under `test/manual` in the web3 package |

[npm-url]: https://npmjs.org/package/web3
[downloads-image]: https://img.shields.io/npm/dm/web3?label=npm%20downloads
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ignore:
- "./packages/web3-core/src/formatters.ts" # ignore deprecated formatters from coverage report
coverage:
status:
project:
Expand Down Expand Up @@ -75,4 +77,4 @@ comment:
behavior: 'default'
require_changes: false
require_base: no
require_head: no
require_head: no
15 changes: 10 additions & 5 deletions docs/docs/guides/basics/sign_and_send_tx/local_wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const { Web3 } = require('web3');
const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to wallet
const privateKeyString = '0x1f953dc9b6437fb94fcafa5dabe3faa0c34315b954dd66f41bf53273339c6d26';
const account = web3.eth.accounts.wallet.add(privateKeyString).get(0);
const account = web3.eth.accounts.wallet.add("privateKey").get(0);

// Make sure the account has enough eth on balance to send the transaction

Expand Down Expand Up @@ -62,7 +61,7 @@ import { Web3 } from 'web3';
const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to wallet
const privateKeyString = '0x1f953dc9b6437fb94fcafa5dabe3faa0c34315b954dd66f41bf53273339c6d26';
const privateKeyString = 'privateKey';
const account = web3.eth.accounts.wallet.add(privateKeyString).get(0);

// Make sure the account has enough eth on balance to send the transaction
Expand Down Expand Up @@ -111,7 +110,7 @@ const { Web3 } = require('web3');
const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to wallet
const privateKeyString = '0x1f953dc9b6437fb94fcafa5dabe3faa0c34315b954dd66f41bf53273339c6d26';
const privateKeyString = 'privateKey';
const account = web3.eth.accounts.wallet.add(privateKeyString).get(0);

// Make sure the account has enough eth on balance to send the transaction
Expand Down Expand Up @@ -160,13 +159,19 @@ async function deploy() {
<TabItem value="typescript" label="TypeScript" default
attributes={{className: "typescript-tab"}}>


```typescript

:::warning
Using `web3.eth.personal` web3.eth.personal is not considered secure and is strongly discouraged. The personal RPC endpoints have been deprecated due to significant security issues.
:::

// First step: initialize `web3` instance
import { Web3 } from 'web3';
const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to wallet
const privateKeyString = '0x1f953dc9b6437fb94fcafa5dabe3faa0c34315b954dd66f41bf53273339c6d26';
const privateKeyString = 'privateKey';
const account = web3.eth.accounts.wallet.add(privateKeyString).get(0);

// Make sure the account has enough eth on balance to send the transaction
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/basics/sign_and_send_tx/promi_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ web3.eth.sendTransaction({...})
// at Generator.next (<anonymous>)
// at fulfilled (.../web3_request_manager.js:5:58)
// at processTicksAndRejections (node:internal/process/task_queues:96:5) {
// innerError: { code: -32000, message: 'exceeds block gas limit' },
// cause: { code: -32000, message: 'exceeds block gas limit' },
// code: 101,
// data: undefined,
// request: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to the Ethereum node and unlock it
const account = {
privateKey: '0xb45b02f408a0dd0996aab2b55a54f4ed7735f82b133c0786a9ff372ffaaf11bd',
privateKey: 'privateKey',
address: '0xe4beef667408b99053dc147ed19592ada0d77f59',
};

Expand Down Expand Up @@ -64,7 +64,7 @@ const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to the Ethereum node and unlock it
const account = {
privateKey: '0xb45b02f408a0dd0996aab2b55a54f4ed7735f82b133c0786a9ff372ffaaf11bd',
privateKey: 'privateKey',
address: '0xe4beef667408b99053dc147ed19592ada0d77f59',
};

Expand Down Expand Up @@ -116,7 +116,7 @@ const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to the Ethereum node and unlock it
const account = {
privateKey: '0xb45b02f408a0dd0996aab2b55a54f4ed7735f82b133c0786a9ff372ffaaf11bd',
privateKey: 'privateKey',
address: '0xe4beef667408b99053dc147ed19592ada0d77f59',
};

Expand Down Expand Up @@ -170,7 +170,7 @@ const web3 = new Web3(/* PROVIDER*/);

// Second step: add an account to the Ethereum node and unlock it
const account = {
privateKey: '0xb45b02f408a0dd0996aab2b55a54f4ed7735f82b133c0786a9ff372ffaaf11bd',
privateKey: 'privateKey',
address: '0xe4beef667408b99053dc147ed19592ada0d77f59',
};

Expand Down
Loading

0 comments on commit 23bc4fb

Please sign in to comment.