Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit bf1311f

Browse files
author
Alex
authoredMay 23, 2023
update docs so web is imported by default (#6112)
1 parent 3b95b5e commit bf1311f

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed
 

‎docs/docs/guides/sign_and_send_tx/local_wallet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The simplest way to sign and send transactions is using a local wallet:
1111

1212
```ts
1313
// First step: initialize `web3` instance
14-
import { Web3 } from 'web3';
14+
import Web3 from 'web3';
1515
const web3 = new Web3(/* PROVIDER*/);
1616

1717
// Second step: add an account to wallet
@@ -45,7 +45,7 @@ List of references:
4545

4646
```ts
4747
// First step: initialize `web3` instance
48-
import { Web3 } from 'web3';
48+
import Web3 from 'web3';
4949
const web3 = new Web3(/* PROVIDER*/);
5050

5151
// Second step: add an account to wallet

‎docs/docs/guides/sign_and_send_tx/raw.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sidebar_label: 'Raw Transaction'
99

1010
```ts
1111
// First step: initialize web3 instance
12-
import { Web3 } from 'web3';
12+
import Web3 from 'web3';
1313
const web3 = new Web3(/* PROVIDER*/);
1414

1515
// Second step: convert private key to account
@@ -43,7 +43,7 @@ List of references:
4343

4444
```ts
4545
// First step: initialize web3 instance
46-
import { Web3 } from 'web3';
46+
import Web3 from 'web3';
4747
const web3 = new Web3(/* PROVIDER*/);
4848

4949
// Second step: convert private key to account

‎docs/docs/guides/sign_and_send_tx/wallet_of_eth_node.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If Eth node have unlocked account in its wallet you can send transaction without
1111

1212
```ts
1313
// First step: initialize web3 instance
14-
import { Web3 } from 'web3';
14+
import Web3 from 'web3';
1515
const web3 = new Web3(/* PROVIDER*/);
1616

1717
// Second step: add an account to the Ethereum node and unlock it
@@ -54,7 +54,7 @@ List of references:
5454

5555
```ts
5656
// First step: initialize web3 instance
57-
import { Web3 } from 'web3';
57+
import Web3 from 'web3';
5858
const web3 = new Web3(/* PROVIDER*/);
5959

6060
// Second step: add an account to the Ethereum node and unlock it

‎docs/docs/guides/web3_providers_guide/events_listening.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Actually, the events can be categorized as follows ([according to EIP 1193](http
2121
Below a sample code for listening and remove listening to EIP 1193 events:
2222

2323
```ts
24-
import { Web3 } from 'web3'
24+
import Web3 from 'web3'
2525

2626
const web3 = new Web3(/* PROVIDER*/);
2727

‎docs/docs/guides/web3_providers_guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar_label: 'Providers'
88
Connecting to a chain happens through a provider. You can pass the provider to the constructor as in the following example:
99

1010
```ts
11-
import { Web3 } from 'web3';
11+
import Web3 from 'web3';
1212

1313
const web3 = new Web3(/* PROVIDER*/);
1414

‎docs/docs/tutorials/deploying_and_interacting_with_smart_contracts.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Note that we are installing the latest version of 4.x, at the time of this tutor
179179
Next, create a new file called `index.js` in your project directory and add the following code to it:
180180

181181
```javascript
182-
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
182+
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
183183

184184
// Set up a connection to the Ganache network
185185
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:7545'));
@@ -214,7 +214,7 @@ Create a file named `deploy.js` and fill it with the following code:
214214
```javascript
215215
// For simplicity we use `web3` package here. However, if you are concerned with the size,
216216
// you may import individual packages like 'web3-eth', 'web3-eth-contract' and 'web3-providers-http'.
217-
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
217+
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
218218
const fs = require('fs');
219219
const path = require('path');
220220

@@ -289,7 +289,7 @@ In this step, we will use web3.js to interact with the smart contract on the Gan
289289
Create a file named `interact.js` and fill it with the following code:
290290

291291
```javascript
292-
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import { Web3 } from 'web3'`)
292+
const { Web3 } = require('web3'); // web3.js has native ESM builds and (`import Web3 from 'web3'`)
293293
const fs = require('fs');
294294
const path = require('path');
295295

‎packages/web3-eth/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
3636
*
3737
* To use this package within the `web3` object use:
3838
* ```ts
39-
* import { Web3 } from 'web3';
39+
* import Web3 from 'web3';
4040
*
4141
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
4242
* web3.eth.getBalance('0x407d73d8a49eeb85d32cf465507dd71d507100c1').then(console.log);

0 commit comments

Comments
 (0)
This repository has been archived.