0x Swap API v2 (AllowanceHolder) Headless Example
Created by
0xproject
A headless example of how to use 0x Swap API v2 (AllowanceHolder) price and quote endpoints using viem.
To run in replit, fork the project.
Demonstrates the following on Base mainnet:
- Build price params. Fetch price.
- Check token approval.
- Build quote params. Fetch quote.
- Send transaction
See additional details in github repo: https://github.com/0xProject/0x-examples/tree/main/swap-v2-allowance-holder-headless-example