How Vigvam wallet may be connected to any Dapp with the aid of Metamask
In this article, we will describe how Vigvam may be connected to any dapp by using Metamask.
Vigvam uses the same Web3 protocol as MetaMask.
MetaMask injects a global API into websites visited by its users at window.ethereum. This API allows websites to request users’ Ethereum accounts, read data from blockchains to which a user is connected, and suggest a user signs messages and transactions.
Vigvam does the same. So in the process of the first connection to the dApp we have two identical providers, the first for MetaMask, and the second for Vigvam. These providers work in the following order:
- When you click the “Connect to Wallet” button on the website, it sends a request to both providers, and we see two windows offering to connect: One from MetaMask, and one from Vigvam.
The application we choose (in our case Vigvam) will be connected to the website first. The second application window that we don’t plan to use should be closed.
- After successfully connecting Vigvam, our wallet will remain as a preferred provider for this dApp until it is disconnected. Consequently, all work on the website will go only through this connected wallet. The second provider (Metamask) will be disconnected.
- To disconnect Vigvam from the website, you need to open Vigvam and click Disconnect.
Vigvam also injects a global API at window.vigvamEthereum that communicates directly only with the Vigvam provider and allows creating a connection only with Vigvam.
If you want to disable dual-connect mode, you need to turn off Vigvam on the extension page. In future wallet updates, we will add this switcher in the Vigvam settings section.
In the video below, you may see how Vigvam connects to the dApp via the Metamask button.
You must remember that Vigvam has no access to your Metamask wallet and its funds. We use the Metamask connection button only to create a route to our application.
Do you have more questions? Ask them in our chat.