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

ensure backward compatibility for Web3 constructor #5221

Merged
merged 3 commits into from
Jul 19, 2022
Merged
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 packages/web3-eth-accounts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*
* To use this package within the web3 object use:
* ```ts
* import { Web3 } from 'web3';
* import Web3 from 'web3';
*
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
* // now you have access to the accounts class
Expand Down
13 changes: 5 additions & 8 deletions packages/web3/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
* This is the main (or 'umbrella') class of the web3.js library.
*
* ```ts
* import { Web3 } from 'web3';
* import Web3 from 'web3';
*
* > Web3.utils
* > Web3.version
Expand Down Expand Up @@ -67,7 +67,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
* The Web3 class is an umbrella package to house all Ethereum related modules.
*
* ```ts
* import { Web3 } from 'web3';
* import Web3 from 'web3';
*
* // "Web3.givenProvider" will be set if in an Ethereum supported browser.
* const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546');
Expand Down Expand Up @@ -121,7 +121,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*
* #### Example: Local Geth Node
* ```ts
* import { Web3 } from "web3";
* import Web3 from "web3";
* let web3: Web3 = new Web3('http://localhost:8545');
* // or
* let web3: Web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
Expand All @@ -138,7 +138,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*
* ```ts
* // Using a remote node provider, like Alchemy (https://www.alchemyapi.io/supernode), is simple.
* import { Web3 } from "web3";
* import Web3 from "web3";
* let web3: Web3 = new Web3("https://eth-mainnet.alchemyapi.io/v2/your-api-key");
* ```
*
Expand Down Expand Up @@ -323,7 +323,4 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
import { Web3 } from './web3';

export * from './web3';
export * from './types';
Muhammad-Altabba marked this conversation as resolved.
Show resolved Hide resolved

export default Web3;
export = Web3;
2 changes: 1 addition & 1 deletion packages/web3/test/integration/ipc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.

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

describe('Web3 instance', () => {
let clientUrl: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/test/integration/web3.abi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
waitForOpenConnection,
closeOpenConnection,
} from '../shared_fixtures/system_tests_utils';
import { Web3 } from '../../src/index';
import Web3 from '../../src/index';

describe('web3.abi', () => {
let clientUrl: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/web3/test/integration/web3.accounts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
waitForOpenConnection,
closeOpenConnection,
} from '../shared_fixtures/system_tests_utils';
import { Web3 } from '../../src/index';
import Web3 from '../../src/index';

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

Expand Down
2 changes: 1 addition & 1 deletion packages/web3/test/integration/web3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { Web3EthExecutionAPI } from 'web3-eth/dist/web3_eth_execution_api';
import HttpProvider from 'web3-providers-http';
import IpcProvider from 'web3-providers-ipc';
import WebsocketProvider from 'web3-providers-ws';
import { Web3 } from '../../src/index';
import Web3 from '../../src/index';
import { BasicAbi } from '../shared_fixtures/Basic';
import { validEncodeParametersData } from '../shared_fixtures/data';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/

import HDWalletProvider from '@truffle/hdwallet-provider';
import { Web3 } from '../../src/index';
import Web3 from '../../src/index';
import {
createNewAccount,
getSystemTestProvider,
Expand Down