@monad-crypto/mpp. For a developer-oriented guide with examples, visit the overview.
Server
Example
server.ts
Parameters
Themonad server payment method accepts the following parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
amount | string | — | Default payment amount, human-readable (e.g. "1.50") |
currency | string | USDC | ERC-20 token contract address |
decimals | number | 6 | Token decimals |
description | string | — | Human-readable description |
externalId | string | — | External identifier to echo back in receipt |
recipient | string | — | Recipient address for payments |
testnet | boolean | false | Testnet mode |
waitForConfirmation | boolean | true | Whether to wait for the charge transaction to confirm on-chain |
getClient | (params: { chainId?: number }) => Client | — | Function that returns a viem Client for the given chain ID |
account | Account | Address | — | Server account used to broadcast receiveWithAuthorization transactions. Required when accepting authorization payloads. The server pays gas from this account. |
store | Store | — | Store for transaction hash replay protection. Use a shared store in multi-instance deployments so consumed hashes are visible across all server instances. |
Client
Example
client.ts
Parameters
Themonad client payment method accepts the following parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
account | Account | Address | — | Wallet account. If omitted, resolved from the viem Client. |
mode | "push" | "pull" | Auto | Payment mode. Defaults to "push" for JSON-RPC accounts, "pull" for local accounts. |
getClient | (params: { chainId?: number }) => Client | — | Custom viem Client resolver. Uses built-in RPC URLs if not provided. |

