Appearance
Technical Reference
This section documents how to interact with the MiniPay wallet from your Mini App: provider, signing, transactions, and tokens.
SDK / APIs at a glance
- Provider: MiniPay injects an Ethereum provider when it loads your app. It is available as
window.ethereumand follows the standard EIP-1193 API. You can detect MiniPay withwindow.ethereum?.isMiniPay === true. Optionally wrap access in agetEthereumProvider()that throws if the provider is missing (see Project setup). - Wagmi: We recommend Wagmi (with Viem) to talk to the provider. Use the injected connector and configure Celo and Celo Sepolia chains. In Wagmi v3, use
useConnection()for address, chainId, and connection state. - Signing and transactions: Send tokens (e.g. USDC, USDm) via
useSendTransaction. See Send a transaction and Transaction status. - Tokens: Read balances with
useReadContracts(balanceOf, decimals, symbol). See Retrieve balance. Supported networks: Celo Mainnet and Celo Sepolia only.
NOTE
Wagmi is not required. You can use window.ethereum directly (e.g. with Viem's createPublicClient and custom(provider)), but Wagmi simplifies React integration.
Wallet connection
- Wallet connection — Auto-connect, connection state, and error handling
Code examples
In addition to the Quick Start guide, here are code examples for common wallet operations.
Basic operations
- Retrieve a balance — Get token balances from the wallet
- Send a transaction — Send token transactions (e.g. USDC, USDm)
- Transaction status — Track transaction confirmation
- Chain switching — Celo and Celo Sepolia
Advanced features
- Estimate gas — Estimate transaction gas costs
- Phone number lookup — Map phone number to wallet address
- Custom methods — MiniPay-specific RPC methods
- Deeplinks — Deep linking into MiniPay
Smart contracts
- Interacting with smart contracts — Read and write to smart contracts