@@ -39,68 +39,37 @@ _Open a PR to add your project to the list!_
39391 . Install Web3Modal NPM package
4040
4141``` bash
42- npm install --save web3modal
42+ npm install --save @actool/ web3modal
4343
4444# OR
4545
46- yarn add web3modal
46+ yarn add @actool/ web3modal
4747```
4848
49- 2 . Install Provider packages
50-
51- ``` js
52- /* See Provider Options Section */
53- ```
54-
55- 3 . Then you can add Web3Modal to your Dapp as follows
49+ 2 . Then you can add Web3Modal to your Dapp as follows
5650
5751``` js
5852import Web3 from " web3" ;
59- import Web3Modal from " web3modal" ;
53+ import Web3Modal from " @actool/ web3modal" ;
6054
6155const providerOptions = {
62- /* See Provider Options Section */
56+ binancewallet: {
57+ package: window .BinanceChain ,
58+ },
59+ metamask: {
60+ package: window .ethereum ,
61+ },
6362};
6463
6564const web3Modal = new Web3Modal ({
66- network: " mainnet" , // optional
67- cacheProvider: true , // optional
68- providerOptions // required
65+ cacheProvider: true ,
66+ providerOptions,
6967});
7068
7169const provider = await web3Modal .connect ();
72-
7370const web3 = new Web3 (provider);
7471```
7572
76- ## Using in vanilla JavaScript
77-
78- You can use the modal from the old fashioned web page JavaScript as well.
79-
80- [ First get a Web3modal bundled JavaScript from Releases] ( https://github.com/Web3Modal/web3modal/releases ) .
81-
82- After including the bundle in your HTML, you can use it on your web page:
83-
84- ``` js
85- // You have to refer to default since it was bundled for ESModules
86- // but after that the documentation will be the same
87-
88- const Web3Modal = window .Web3Modal .default ;
89- const providerOptions = {
90- /* See Provider Options Section */
91- };
92-
93- const web3Modal = new Web3Modal ({
94- network: " mainnet" , // optional
95- cacheProvider: true , // optional
96- providerOptions // required
97- });
98-
99- const provider = await web3Modal .connect ();
100- ```
101-
102- [ See the full vanilla JavaScript example application] ( https://github.com/Web3Modal/web3modal-vanilla-js-example ) .
103-
10473## Provider Events
10574
10675You should subscribe to provider events compatible with [ EIP-1193] ( https://eips.ethereum.org/EIPS/eip-1193 ) standard.
0 commit comments