Overview
All MoonKey embedded wallets expose a standard EIP-1193 provider that enables you to:- Send JSON-RPC requests directly to the wallet
- Integrate with Web3 libraries (viem, ethers, wagmi)
- Use familiar Ethereum API methods
EIP-1193 is the standardized Ethereum JavaScript API for how applications request information, signatures, and transactions from wallets.
Getting the Provider
To get a wallet’s EIP-1193 provider, use thegetEthereumProvider() method:
Using with Web3 Libraries
With Viem
With Ethers
Direct JSON-RPC Requests
You can also send JSON-RPC requests directly to the provider:Common JSON-RPC Methods
The provider supports standard Ethereum JSON-RPC methods:When to Use the Provider
Use the EIP-1193 provider when you need to:- Integrate with existing Web3 libraries (viem, ethers, wagmi)
- Send custom JSON-RPC requests not covered by MoonKey’s SDK
- Use library-specific features (e.g., viem’s contract interactions)
- Migrate from other wallet providers with minimal code changes
Complete Example
Here’s a complete example showing provider usage with viem for contract interaction:Related Documentation
Send Transaction
Use MoonKey’s native transaction sending
Sign Message
Use MoonKey’s native message signing
EIP-1193 Specification
Official EIP-1193 documentation
Viem Documentation
Learn more about viem
Next Steps
- Learn about viem wallet clients for advanced usage
- Explore ethers.js providers and signers
- Understand JSON-RPC methods available on Ethereum