Introduction
Metamask is a chrome-based cryptocurrency wallet used to interact with the Ethereum and ERC-20 compatible blockchains. This plugin allows users to access their Ethereum wallet through a browser extension or mobile app, which can then be used to interact with decentralized applications. It's like a bridge that allows you to interact with blockchain-based applications.
PAY ATTENTION!!! The MetaMask extension MUST be installed in the browser in which you will use this plugin.
How to setup
Place the plugin element on the page in order to use all possible actions.
PAY ATTENTION!!! The MetaMask extension MUST be installed in the browser in which you will use this plugin.
Actions
- Get accounts - Returns a list of addresses for the accounts owned
- Login - Login the user
- Request permission - Request additional permissions from the user
- Get Permission - Get the users permissions
- Send Transaction - Creates new message call transaction or a contract creation
Params:
- Sender address - A hex-encoded Ethereum address. Must match user's active address.
- Recipient's address - A hex-encoded Ethereum address. Required for transactions with a recipient (all transactions except for contract creation).
- Value - (number) Value of the network's native currency to send
- Data - (optional) Required for smart contract creation. This field is also used for specifying contract methods and their parameters. NOTE! Field "Recipient's address" must be empty!
- Gas - (optional) The gas limit provided by the sender in Wei
- Gas price - (optional) The gas price provided by the sender in Wei
6. Get chain ID - Get the current chain ID
7. Get coinbase address - Return the client coinbase address
8. Add chain - Add the specific chain
Params:
- Chain Name - Must specify a human-readable name for the chain.
- Chain ID - Must specify the ID of the chain (dec or hex format)
- RPC URLs - RPC Url. To find the correct RPC LEGAL entity go to https://rpc.info/
- Block Explorer URLs - BlockExplorer Url. To find the correct LEGAL entity go to https://rpc.info/
- Name - NativeCurrency name. Should be human-readable
- Symbol - NativeCurrency symbol. Should be human-readable
9. Get Block Number - Returns the number of most recent block.
10. Get Balance - Returns Ether balance of a given or account or contract
Params:
- Address - A hex-encoded Ethereum address of the account or contract
- Block Number - A BlockNumber at which to request the balance
11. Get Logs - Returns an array of all logs matching a given filter object.
Params:
- From Block - The hex representation of the block's height. Integer block number "latest" for the last mined block "pending", "earliest" for not yet mined transactions.
- To Block - The hex representation of the block's height. Integer block number "latest" for the last mined block "pending", "earliest" for not yet mined transactions.
- Address (optional) - List of contract addresses from which to monitor events
12. Track the Token - Tracks the custom Token in Metamask
Params:
- Address - The address of the token contract
- Symbol - A ticker symbol or shorthand, up to 5 characters
- Image - A string url of the token logo
Fields
The element of this plugin has only one parameter field for parsing the logs response. You have to choose a single API call from this plugin "Log Response".
States
- Is Connected - Check if the Metamask extension is present in the browser
- Is logged In? - Check if the Metamask extension is enabled on the page
- Public user ID - The ID of the current address used
- List of Accounts - List of accounts available to the user. The first one will be current
- Permissions id - Every capability document, except for the target, MUST have an associated id
- Permission Invoker - links to one or more instances of cryptographic material (such as public keys) being granted authority to use this capability
- Permission Parent Capability - Permission Parent Capability
- Current chain ID - hex format integer of the current chain id
- Transaction hash - Keccak 256 Hash of the RLP encoding of a transaction
- Coinbase address - The address owned by the client that is used as default for things like the mining reward
- Block Number - The hex representation of the block's height
- Balance - The balance value in decimals
- Logs - List of logs
Events
- Logged in successful - triggered on successful login
- Login Failed - triggered when a login fails
- Logs are empty - triggered when requested logs are empty
Changelogs
- Update 8.04.22 - Version 1.4.0. "Added new state 'Current Chain ID (numb)'"
- Update 15.12.22 - Version 1.16.0 Fixed login in Metamask and wallet detection