MetaMask Wallet API: Build Power Dapps with Web3’s Leading Wallet
Introducing the MetaMask Wallet API. Learn the key benefits and how to integrate it into your workflow and join the MetaMask Developer community
The MetaMask wallet, with over 100M installs and 30M monthly active users, stands as the leading web3 wallet with one of the largest active user bases in web3. MetaMask processes 100M transactions monthly through more than 17,000 web3 dapps. This positions MetaMask as the preferred choice for developers who build dapps that attract web3 power users across networks and ecosystems.
We created MetaMask Developer: to provide a comprehensive set of tools, APIs, and SDKs for onboarding millions of the web3’s most engaged users, built on the trusted and secure foundations of MetaMask and Infura.
What is the MetaMask Wallet API
window.ethereum provider object. Adhering to the EIP-1193 specification, the API enables Ethereum accounts to read blockchain data, suggest signing messages and transactions, and more.
The Wallet API leverages the
window.ethereum.request(args) function from the provider API to offer a suite of JSON-RPC APIs. This suite expands upon the standard Ethereum methods by incorporating MetaMask-specific enhancements, providing a comprehensive and versatile toolset for developers. The methods supported by the Wallet API are organized into several related categories:
- Ethereum API: This category encompasses the standard Ethereum JSON-RPC API methods as defined by EIP 1193, the foundation for Ethereum blockchain interactions.
- MetaMask: These are MetaMask-specific methods that provide functionality not necessarily supported by other wallets, offering unique features available only to MetaMask users.
- Snaps: This category includes methods specific to the Snaps feature, allowing for a broader range of interactions within the MetaMask ecosystem.
- Restricted: Methods under this category require explicit permission from the MetaMask user, obtained through the
wallet_requestPermissionscall, ensuring a secure and user-consented experience.
- Mobile: This category is dedicated to mobile-specific methods that are not supported by the desktop extension, tailoring the user experience for mobile users.
For a comprehensive overview of all methods supported by the MetaMask Wallet API, including their parameters, expected responses, and the categories they belong to, please refer to the interactive API reference.
While developers have the option to integrate with MetaMask directly through the API, we recommend utilizing the MetaMask SDK for an enhanced and seamless user experience.
Building upon the MetaMask API, the SDK is a comprehensive library designed to facilitate a reliable, secure, and smooth connection between your dapp and both the MetaMask browser extension and MetaMask Mobile. This SDK allows for a variety of connection methods to MetaMask across different dapp platforms, eliminating the dependency on third-party libraries for integration.
Furthermore, the MetaMask SDK enhances the development experience by enabling automatic detection of the MetaMask wallet through EIP-6963. This eliminates the need for manual configuration or detection methods, thereby simplifying the initial setup process for developers and users alike.
Reasons to use the MetaMask Wallet API
Using the MetaMask Wallet API offers five key advantages:
Access to MetaMask-specific methods: The Wallet API provides developers with several MetaMask-specific, battle-tested methods that enable tracking of specific tokens and assets, permission requests, redirection of onboarded users back to your dapp, and simplification of the connect & sign experience, among others.
Access to an established power user base: Developers gain access to MetaMask's extensive user base, which includes over 100M installs and 30M monthly active users, and processes 100M monthly transactions through more than 17,000 connected web3 dapps.
Cross-chain support: MetaMask supports all EVM chains and can be extended to support other chains through MetaMask Snaps, which facilitates transactions and dapps on networks such as Sui, Solana, Bitcoin, Algorand, Cosmos, Tezos, and Polkadot.
Integration with popular libraries: The MetaMask SDK integrates with popular web3 connection libraries like Wagmi, web3onboard, web3 react, ethers.js, web3 auth, WalletConnect, and other wallet-agnostic connection libraries, fitting seamlessly into existing workflows.
Build with the MetaMask Wallet API to onboard millions of web3 power users to your dapp
Connecting with the MetaMask Wallet API offers an unparalleled opportunity to tap into a vast network of web3 enthusiasts and power users. By leveraging the robust, secure, and versatile features of the API and SDK, developers can significantly enhance the user experience of their dapps, streamline onboarding processes, and ensure compatibility across blockchain networks.
To get started, visit the MetaMask Developer portal today. Here, you'll find comprehensive guides, tutorials, templates, and everything you need to seamlessly integrate MetaMask into your dapp.
Keep reading our latest stories
Developers, security news, and more