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

Commit 071959c

Browse files
export Web3 as export = Web3
1 parent 18078f3 commit 071959c

File tree

7 files changed

+11
-19
lines changed

7 files changed

+11
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
2828
*
2929
* To use this package within the web3 object use:
3030
* ```ts
31-
* import { Web3 } from 'web3';
31+
* import Web3 from 'web3';
3232
*
3333
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
3434
* // now you have access to the accounts class

packages/web3/src/index.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1919
* This is the main (or 'umbrella') class of the web3.js library.
2020
*
2121
* ```ts
22-
* import { Web3 } from 'web3';
22+
* import Web3 from 'web3';
2323
*
2424
* > Web3.utils
2525
* > Web3.version
@@ -67,7 +67,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
6767
* The Web3 class is an umbrella package to house all Ethereum related modules.
6868
*
6969
* ```ts
70-
* import { Web3 } from 'web3';
70+
* import Web3 from 'web3';
7171
*
7272
* // "Web3.givenProvider" will be set if in an Ethereum supported browser.
7373
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
@@ -121,7 +121,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
121121
*
122122
* #### Example: Local Geth Node
123123
* ```ts
124-
* import { Web3 } from "web3";
124+
* import Web3 from "web3";
125125
* let web3: Web3 = new Web3('http://localhost:8545');
126126
* // or
127127
* let web3: Web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
@@ -138,7 +138,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
138138
*
139139
* ```ts
140140
* // Using a remote node provider, like Alchemy (https://www.alchemyapi.io/supernode), is simple.
141-
* import { Web3 } from "web3";
141+
* import Web3 from "web3";
142142
* let web3: Web3 = new Web3("https://eth-mainnet.alchemyapi.io/v2/your-api-key");
143143
* ```
144144
*
@@ -323,12 +323,4 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
323323
*/
324324
import { Web3 } from './web3';
325325

326-
export * from './web3';
327-
export * from './types';
328-
329-
export default Web3;
330-
331-
// The following JavaScript command is used instead of the equivalent TypeScript `export = Web3`,
332-
// to allow exporting the types along with Web3 constructor as the default function,
333-
// in order to maintain backward compatibility.
334-
module.exports = Web3;
326+
export = Web3;

packages/web3/test/integration/ipc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1717

1818
import IpcProvider from 'web3-providers-ipc';
1919
import { getSystemTestProvider, describeIf, isIpc } from '../shared_fixtures/system_tests_utils';
20-
import { Web3 } from '../../src/index';
20+
import Web3 from '../../src/index';
2121

2222
describe('Web3 instance', () => {
2323
let clientUrl: string;

packages/web3/test/integration/web3.abi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
waitForOpenConnection,
2222
closeOpenConnection,
2323
} from '../shared_fixtures/system_tests_utils';
24-
import { Web3 } from '../../src/index';
24+
import Web3 from '../../src/index';
2525

2626
describe('web3.abi', () => {
2727
let clientUrl: string;

packages/web3/test/integration/web3.accounts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
waitForOpenConnection,
2424
closeOpenConnection,
2525
} from '../shared_fixtures/system_tests_utils';
26-
import { Web3 } from '../../src/index';
26+
import Web3 from '../../src/index';
2727

2828
const hexRegx = /0[xX][0-9a-fA-F]+/;
2929

packages/web3/test/integration/web3.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { Web3EthExecutionAPI } from 'web3-eth/dist/web3_eth_execution_api';
2222
import HttpProvider from 'web3-providers-http';
2323
import IpcProvider from 'web3-providers-ipc';
2424
import WebsocketProvider from 'web3-providers-ws';
25-
import { Web3 } from '../../src/index';
25+
import Web3 from '../../src/index';
2626
import { BasicAbi } from '../shared_fixtures/Basic';
2727
import { validEncodeParametersData } from '../shared_fixtures/data';
2828
import {

packages/web3/test/integration/web3_external_providers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

1818
import HDWalletProvider from '@truffle/hdwallet-provider';
19-
import { Web3 } from '../../src/index';
19+
import Web3 from '../../src/index';
2020
import {
2121
createNewAccount,
2222
getSystemTestProvider,

0 commit comments

Comments
 (0)