Web3 & MetaMask
Main plugin element that you will work with.
Last updated
Main plugin element that you will work with.
Last updated
This section contains a description for each action separately, click on the arrow in the section name to open all actions.
Add the element on the page
Make sure it is not inside a group or popup
Add the element on every page where you need it's features (or use reusable elements)
Do not add more than 1 element per page
You will notice that the plugin element have some additional settings, they are optional. 1. Auto-trigger change network
You can setup Auto-trigger request to change the network to the desired one.
To enable it, check the Enable Change Network Request checkbox. To set the desired network, set the ID of it in the Expected Network ID field. Find all chains IDs on this page: https://chainlist.org/ Note! If the user doesn't have the desired chain added in his wallet, an event called Chain ID not added in the Wallet will trigger. If this happens, you can run the action Trigger Switch Chain
You can set the plugin to use Liquality extension only instead of MetaMask. Details on Use with other wallets page: https://docs.novabloq.com/web3-metamask/use-with-other-wallets-and-plugins#liquality-wallet
If you want to use the plugin features that can read the blockchain (read contract, get balance of a token, etc.) without connecting a wallet, you can set a custom RPC URL that the plugin will connect to and will be able to read the blockchain. Note that if you want to send a transaction or write a contract, you still need to connect a wallet. Note! When connecting a wallet, this field is ignored.
These states are common for various actions, meaning the same state will be used for different actions. This is why it is important to save the data like transaction hash in your database before the state will be reset or replaced with new data.
Metamask is Installed
Yes/No
If the MetaMask extension is installed or is the app opened inside the MetaMask browser on mobile then this state will be Yes.
Transaction status
Text
When performing any form of transaction like write contract or send token, this state will show the status: Done, Awaiting confirmation from user, Pending, Rejected, Error
Transaction Hash ID
Text
These are common events for various actions. Also in this list, there are some events that are not particular related to any actions, those are just useful events.
Transaction sent successfully
Triggers when any submitted transaction using plugin actions (write contract, send token, etc.) was successfully confirmed on the blockchain. It may take a while depending on how congested the chain is. Won't trigger if the page was reloaded!
Transaction ID is ready
When the user confirms performing a transaction, this event will trigger right after that. Useful for UX, you can show a popup by letting the user know that the tx is pending. Also you can use it to save the Transaction Hash in your database for later use in case the user reloads the page, because the hash state will be available only after this event triggers.
User canceled action
Any action that requires user confirmation and the user rejects it, will trigger this event.
User selected another Wallet
Triggered when the user connected to your app with multiple wallets from his MetaMask at once and is switching between them.
Similar to Transaction status, it will be available when doing any transactions using one of the plugin actions. Will be available right after the user confirms the action from his wallet. Doesn't mean the transaction was successfully confirmed on blockchain yet! Use to check it.