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