Skip to content

Commit 523f06d

Browse files
committed
fix: add binance chain wallet and metamask
1 parent 7259669 commit 523f06d

File tree

23 files changed

+739
-47617
lines changed

23 files changed

+739
-47617
lines changed

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"extends": "eslint:recommended",
44
"rules": {
55
"space-before-function-paren": ["error", "never"],
6-
"semi": ["error", "never"],
6+
// "semi": ["error", "never"],
77
"no-underscore-dangle": 0,
8-
"quotes": ["error", "single"]
8+
// "quotes": ["error", "single"]
99
}
1010
}

README.md

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -39,68 +39,37 @@ _Open a PR to add your project to the list!_
3939
1. 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
5852
import Web3 from "web3";
59-
import Web3Modal from "web3modal";
53+
import Web3Modal from "@actool/web3modal";
6054

6155
const providerOptions = {
62-
/* See Provider Options Section */
56+
binancewallet: {
57+
package: window.BinanceChain,
58+
},
59+
metamask: {
60+
package: window.ethereum,
61+
},
6362
};
6463

6564
const web3Modal = new Web3Modal({
66-
network: "mainnet", // optional
67-
cacheProvider: true, // optional
68-
providerOptions // required
65+
cacheProvider: true,
66+
providerOptions,
6967
});
7068

7169
const provider = await web3Modal.connect();
72-
7370
const 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

10675
You should subscribe to provider events compatible with [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) standard.

0 commit comments

Comments
 (0)