Setup
Shared listener (Socket.IO)
The event stream is served over Socket.IO. The listener below resolves once a settlement is terminal (completed / dead) for a given wallet. Both examples import it. Install the client once:
listen.ts
Shared quote helper
The deposit address comes from a Mayan quote withmpsDeposit enabled, not a separate API call. The helper below fetches a quote and returns the mpsDepositAddress (the deterministic address on the quote’s source chain). Both examples import it.
mps-quote.ts
Base (EVM): deposit USDC on Base
The user sends ~5 USDC to the quote’s deposit address on Base; it’s settled as USDC to your destination wallet on Arbitrum.evm-base.ts
Solana: deposit USDC on Solana
A quote from a Solana source returns a Solana vault as itsmpsDepositAddress. The user sends ~5 USDC to it on Solana; it’s settled as USDC to your destination wallet on Arbitrum.
solana.ts
The status chain differs by source chain. EVM runs
pending_deploy → deploying → pending_swap → swapping → completed; Solana runs pending_settle → settling → completed. See Swap Statuses for the full lifecycle and the error field.