From 56d4aec22972320bb1a4ac2ce2a9cb88a569a12a Mon Sep 17 00:00:00 2001 From: Dan Forbes Date: Tue, 19 Nov 2024 07:27:24 -0800 Subject: [PATCH] Replaces #7390, #7391, & #7400 (#7401) --- RELEASE.md | 17 +++++----- docs/docs/glossary/index.md | 2 +- .../events_listening.md | 2 +- .../05_smart_contracts/tips_and_tricks.md | 4 +-- .../guides/06_events_subscriptions/index.md | 34 +++++++++---------- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 5e2182e995f..1fdcfc3de47 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -36,8 +36,8 @@ Further details about versioning can be found in the [semver 2.0.0 specification - `bumped-version` of release branch should be of main web3 package. 3. `yarn`: Verify all dependencies have been installed 4. Bump packages version numbers using `lerna version --no-push --no-private --no-git-tag-version` . This will update package versions and also run lifecycle scripts. - - It will prompt for new version , modify package metadata and run life cycle scripts (in our case `version`), for bootstrapping lerna will use underlying yarn. -5. Update each package's and also root `CHANGELOG.md`: + - It will prompt for new version , modify package metadata and run lifecycle scripts (in our case `version`), for bootstrapping lerna will use underlying yarn. +5. Update each package's and also root `CHANGELOG.md`: 5.A. If there are any changes in package during release PR e.g. dependency updated that effects package, add entry in changelog under `## [Unreleased]` of that package's changelog. @@ -61,19 +61,20 @@ Further details about versioning can be found in the [semver 2.0.0 specification - In the release description, copy all entries in `CHANGELOG.md` for the version being released - Click `Save draft` - + 12. Open pull request to merge branch created in `Step 2` (`release/bumped-version`) into `4.x` 13. Wait for all tests to pass in github CI/CD , If there are any unusual warnings or errors in logs, discuss with team 14. When sufficient approvals have been met, publish draft release created in `Step 11` 15. Publish on NPM. + - login in NPM and verify you are logged in with right user and in right dir - + - If you want to publish `latest` tag release, run `npx lerna publish from-package --ignore-scripts` in the root directory to publish packages to NPM. - - - If you want to publish any other tag, run `npx lerna publish from-package --ignore-scripts --dist-tag <>` in the root directory e.g. `rc` - + + - If you want to publish any other tag, run `npx lerna publish from-package --ignore-scripts --dist-tag <>` in the root directory e.g. `rc` + IMPORTANT: Replace `<>` with required tag in above command, e.g. if publishing `RC`, use following command: - `npx lerna publish from-package --ignore-scripts --dist-tag rc` + `npx lerna publish from-package --ignore-scripts --dist-tag rc` - lerna will not invoke life cycle scripts before publishing and this will publish all packages to NPM public registry. diff --git a/docs/docs/glossary/index.md b/docs/docs/glossary/index.md index 7af367af75b..4f67ceaa4f6 100644 --- a/docs/docs/glossary/index.md +++ b/docs/docs/glossary/index.md @@ -24,7 +24,7 @@ The `Contract` class is an important class in the `web3-eth-contract` package, a The JSON interface is a `JSON` object describing the [Application Binary Interface (ABI)](https://docs.soliditylang.org/en/develop/abi-spec.html) for an Ethereum smart contract. -Using this JSON interface, web3.js is able to create a JavaScript object representing the smart contract , its methods and events using the `web3.eth.Contract` object. +Using this JSON interface, web3.js is able to create a JavaScript object representing the smart contract, its methods and events using the `web3.eth.Contract` object. ### Functions diff --git a/docs/docs/guides/02_web3_providers_guide/events_listening.md b/docs/docs/guides/02_web3_providers_guide/events_listening.md index ae0b809d4a5..9b84fa7dcac 100644 --- a/docs/docs/guides/02_web3_providers_guide/events_listening.md +++ b/docs/docs/guides/02_web3_providers_guide/events_listening.md @@ -5,7 +5,7 @@ sidebar_label: 'Providers Events Listening' # Providers Events Listening -Some providers are, by design, always connected. Therefor, they can communicate changes with the user through events. Actually, among the 3 providers, `HttpProvider` is the only one that does not support event. And the other 2: +Some providers are, by design, always connected. Therefore, they can communicate changes with the user through events. Actually, among the 3 providers, `HttpProvider` is the only one that does not support event. And the other 2: [WebSocketProvider](/api/web3-providers-ws/class/WebSocketProvider) and [IpcProvider](/api/web3-providers-ipc/class/IpcProvider) enable the user to listen to emitted events. Actually, the events can be categorized as follows ([according to EIP 1193](https://eips.ethereum.org/EIPS/eip-1193#rationale)): diff --git a/docs/docs/guides/05_smart_contracts/tips_and_tricks.md b/docs/docs/guides/05_smart_contracts/tips_and_tricks.md index 35964550ca5..911dccaa5f0 100644 --- a/docs/docs/guides/05_smart_contracts/tips_and_tricks.md +++ b/docs/docs/guides/05_smart_contracts/tips_and_tricks.md @@ -39,7 +39,7 @@ The Solidity code: pragma solidity >=0.8.20 <0.9.0; -contract TestOverlading { +contract TestOverloading { function funcWithParamsOverloading(uint256 userId) public pure returns (string memory) { return "called for the parameter with the type 'uint256'"; } @@ -138,6 +138,6 @@ Multiple methods found that are compatible with the given inputs. Found 2 compat Future releases of web3.js, specifically version 5.x, will replace the warning with an error whenever multiple methods match a call without explicit overloading. This aims to foster greater precision in method invocation. -### Key Takeaway for function overlading: Method Specification +### Key Takeaway for function overloading: Method Specification When working with overloaded smart contract methods, it's imperative to specify the intended method by appending its parameter types within parentheses, such as `funcWithParamsOverloading(address)` versus `funcWithParamsOverloading(uint256)`. This ensures the accuracy of method invocation, leading to more efficient and clearer contract interactions. diff --git a/docs/docs/guides/06_events_subscriptions/index.md b/docs/docs/guides/06_events_subscriptions/index.md index 80a1457874d..4ecaaafed52 100644 --- a/docs/docs/guides/06_events_subscriptions/index.md +++ b/docs/docs/guides/06_events_subscriptions/index.md @@ -1,6 +1,6 @@ --- sidebar_position: 1 -sidebar_label: 'Mastering Events Subcriptions' +sidebar_label: 'Mastering Events Subscriptions' --- # Events Subscription @@ -46,25 +46,25 @@ If you are the developer who provides custom subscriptions to users. We encourag - `on("data")` - Fires on each incoming log with the log object as argument. ```ts -subcription.on('data', data => console.log(data)); +subscription.on('data', data => console.log(data)); ``` - `on("changed")` - Fires on each log which was removed from the blockchain. The log will have the additional property "removed: true". ```ts -subcription.on('changed', changed => console.log(changed)); +subscription.on('changed', changed => console.log(changed)); ``` - `on("error")` - Fires when an error in the subscription occurs. ```ts -subcription.on('error', error => console.log(error)); +subscription.on('error', error => console.log(error)); ``` - `on("connected")` - Fires once after the subscription successfully connected. Returns the subscription id. ```ts -subcription.on('connected', connected => console.log(connected)); +subscription.on('connected', connected => console.log(connected)); ``` ### Logs @@ -77,11 +77,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('logs'); + //create subscription + const subscription = await web3.eth.subscribe('logs'); //print logs of the latest mined block - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -104,11 +104,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('pendingTransactions'); //or ("newPendingTransactions") + //create subscription + const subscription = await web3.eth.subscribe('pendingTransactions'); //or ("newPendingTransactions") //print tx hashs of pending transactions - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -131,11 +131,11 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('newBlockHeaders'); //or ("newHeads") + //create subscription + const subscription = await web3.eth.subscribe('newBlockHeaders'); //or ("newHeads") //print block header everytime a block is mined - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription @@ -157,12 +157,12 @@ import { Web3 } from 'web3'; const web3 = new Web3('wss://ethereum-rpc.publicnode.com'); async function subscribe() { - //create subcription - const subcription = await web3.eth.subscribe('syncing'); + //create subscription + const subscription = await web3.eth.subscribe('syncing'); //this will return `true` when the node is syncing //when it’s finished syncing will return `false`, for the `changed` event. - subcription.on('data', data => console.log(data)); + subscription.on('data', data => console.log(data)); } // function to unsubscribe from a subscription