Skip to main content
Access your embedded wallet’s EIP-1193 provider to integrate with popular Web3 libraries like viem, ethers, and wagmi.

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 the getEthereumProvider() 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
For common operations like sending transactions or signing messages, consider using MoonKey’s native hooks (useSendTransaction, useSignMessage) for better UI customization and error handling.

Complete Example

Here’s a complete example showing provider usage with viem for contract interaction:

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