Skip to content

Commit

Permalink
doc: fix spelling and grammar for provider docs (#6572)
Browse files Browse the repository at this point in the history
* doc: fix spelling and grammar for provider docs

* revert accidental delete
  • Loading branch information
dkurukula authored Nov 10, 2023
1 parent 09c8ad0 commit 8e3e676
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/docs/guides/web3_providers_guide/events_listening.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ web3.provider.on('error',()=>{

// ...

// for every event above `once` could be used to register to the event only once
// for every event above `once` can be used to register to the event only once
web3.provider.once('SUPPORTED_EVENT_NAME',()=>{
// ...
})
Expand Down Expand Up @@ -104,15 +104,15 @@ web3.provider.on('chainChanged',()=>{
})

// it is possible to catch errors that could happen in the underlying connection Socket with the `error` event
// and it is also used to catch the error when max reconnection attempts exceeded
// and it is also used to catch the error when max reconnection attempts is exceeded
// as in section: /docs/guides/web3_providers_guide/#error-message
web3.provider.on('error',()=>{
// ...
})

// ...

// for every event above `once` could be used to register to the event only once
// for every event above `once` can be used to register to the event only once
web3.provider.once('SUPPORTED_EVENT_NAME',()=>{
// ...
})
Expand Down
23 changes: 4 additions & 19 deletions docs/docs/guides/web3_providers_guide/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@ The first 3 steps are the same as in the pervious section. So, you may skip them
```bash
<<<<<<< HEAD
npm i web3
=======
npm install web3
> > > > > > > 4.x
```
Expand Down Expand Up @@ -236,7 +231,7 @@ async function main() {
subscription.on('data', async blockhead => {
console.log('New block header: ', blockhead);
// You do not need the next line if you like to keep notified for every new block
// You do not need the next line if you like to keep being notified for every new block
await subscription.unsubscribe();
console.log('Unsubscribed from new block headers.');
});
Expand Down Expand Up @@ -287,7 +282,7 @@ async function main() {
subscription.on('data', async blockhead => {
console.log('New block header: ', blockhead);
// You do not need the next line if you like to keep notified for every new block
// You do not need the next line if you like to keep being notified for every new block
await subscription.unsubscribe();
console.log('Unsubscribed from new block headers.');
});
Expand Down Expand Up @@ -403,12 +398,7 @@ INFO [12-10|15:10:37.127] Mapped network port proto=udp extport=0 intport=30
```bash
<<<<<<< HEAD
npm i web3
=======
npm install web3
> > > > > > > 4.x
```
Expand All @@ -433,7 +423,7 @@ const web3 = new Web3(ipcProvider);
async function main() {
try {
console.log('Do the provider supports subscription?:', ipcProvider.supportsSubscriptions());
console.log('Does the provider support subscriptions?:', ipcProvider.supportsSubscriptions());
// Get the list of accounts in the connected node which is in this case: geth in dev mode.
const accounts = await web3.eth.getAccounts();
Expand Down Expand Up @@ -471,7 +461,7 @@ const web3 = new Web3(ipcProvider);
async function main() {
try {
console.log('Do the provider supports subscription?:', ipcProvider.supportsSubscriptions());
console.log('Does the provider support subscriptions?:', ipcProvider.supportsSubscriptions());
// Get the list of accounts in the connected node which is in this case: geth in dev mode.
const accounts = await web3.eth.getAccounts();
Expand Down Expand Up @@ -535,12 +525,7 @@ Here is a step-by-step example and a code snippet to connect your web applicatio
```bash
<<<<<<< HEAD
npm i web3 @truffle/hdwallet-provider bip39
=======
npm install web3 @truffle/hdwallet-provider bip39
> > > > > > > 4.x
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/web3_providers_guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ await web3.eth.sendTransaction({
</TabItem>
</Tabs>

The created Web3 instance will use the passed provider to interact with the blockchain network. This interaction happen when sending a request and receiving the response, and when possibly listen to provider events (if the provider support this).
The created Web3 instance will use the passed provider to interact with the blockchain network. This interaction happens when sending a request and receiving the response, and possibly when listening to provider events (if the provider support this).

## Providers Types

Expand Down

0 comments on commit 8e3e676

Please sign in to comment.