forked from vu3th/vue-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: stay disconnected after clicking disconnect and refreshing page, c…
- Loading branch information
1 parent
39af1cc
commit 7ae9f40
Showing
4 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Plugin Options | ||
|
||
## Types | ||
```ts | ||
type PluginOptions = { | ||
autoConnect: boolean; | ||
persistDisconnect?: boolean; | ||
networks: { | ||
[key: number]: AddEthereumChainParameter; | ||
}; | ||
}; | ||
``` | ||
|
||
## autoConnect | ||
- Default: false | ||
- If set up to true, will trigger auto-connect when the page load | ||
|
||
## persistDisconnect | ||
- Only take effect when autoConnect is true | ||
- Default to true if autoConnect is true | ||
- If set up to false, the page would keep auto-connect after clicking disconnect and refreshing page | ||
|
||
## networks | ||
[TBD] | ||
|
||
## Example | ||
```ts | ||
app.use(VueDapp, { | ||
autoConnect: true, | ||
networks: { | ||
80001: { | ||
chainId: ethers.utils.hexValue(80001), | ||
blockExplorerUrls: ['https://mumbai.polygonscan.com/'], | ||
chainName: 'Mumbai', | ||
rpcUrls: ['https://rpc-mumbai.maticvigil.com/'], | ||
nativeCurrency: { | ||
name: 'Mumbai', | ||
decimals: 18, | ||
symbol: 'MATIC', | ||
}, | ||
}, | ||
42161: { | ||
chainId: ethers.utils.hexValue(42161), | ||
blockExplorerUrls: ['https://arbiscan.io'], | ||
chainName: 'Arbitrum One', | ||
rpcUrls: ['https://arb1.arbitrum.io/rpc'], | ||
nativeCurrency: { | ||
name: 'Arbitrum', | ||
symbol: 'ETH', | ||
decimals: 18, | ||
}, | ||
}, | ||
}, | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters