Setup
- Using @faremeter/rides
- Advanced Setup
Set up your payment handler in just 3 lines:
@faremeter/rides automatically detects your network, looks up USDC, and sets up payments using your existing wallet.
All examples below use payer.fetch().Example: Get Swap Quote
Get a quote for swapping SOL to USDC:- Using @faremeter/rides
- Advanced Setup
- outAmount: Expected output amount (221.72 USDC for 1 SOL)
- minOutAmount: Minimum amount with slippage protection
- routePlan: Optimal routing across multiple DEXs (PancakeSwap, Meteora DLMM, AlphaQ)
- slippageBps: Slippage tolerance in basis points (50 = 0.5%)
Payment Flow
When you make a request, the following happens automatically:- Initial Request: Client sends quote request
- 402 Response: Proxy returns payment requirements
- Payment: Payment handler processes USDC transfer (0.01 USDC)
- Success: Proxy fulfills original request with 200 OK
fetchWithPayer!