Skip to content

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.ethereum and follows the standard EIP-1193 API. You can detect MiniPay with window.ethereum?.isMiniPay === true. Optionally wrap access in a getEthereumProvider() 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

Code examples

In addition to the Quick Start guide, here are code examples for common wallet operations.

Basic operations

Advanced features

Smart contracts