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 Ultra Swap Order
Get a swap order from Jupiter Ultra API to swap SOL for USDC:- Using @faremeter/rides
- Advanced Setup
- transaction: Base64 encoded transaction ready to sign
- requestId: Unique identifier for this order
- inAmount/outAmount: Input and output token amounts
- routePlan: The swap route through DEXs
- gasless: Whether Jupiter pays transaction fees
- rentFeeLamports: Account rent cost (paid by taker)
- taker: Wallet address executing the swap
Payment Flow
When you make a request, the following happens automatically:- Initial Request: Client sends swap order request
- 402 Response: Proxy returns payment requirements
- Payment: Payment handler processes USDC transfer (0.01 USDC)
- Success: Proxy fulfills original request with 200 OK
payer.fetch() or fetchWithPayer!