Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in documentation files #7400

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/glossary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/05_smart_contracts/tips_and_tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'";
}
Expand Down Expand Up @@ -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.
34 changes: 17 additions & 17 deletions docs/docs/guides/06_events_subscriptions/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 1
sidebar_label: 'Mastering Events Subcriptions'
sidebar_label: 'Mastering Events Subscriptions'
---

# Events Subscription
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down