Using the Swap API
- If you're swapping
from
an ERC-20 token, you'll need to check token approval withcheckApprove
. If approval doesn't meet your requirements for the swap, you'll need to request approval. - Get a quote for the swap with
getQuote
. - Retrieve the swap transaction object with
getSwap
. - Execute the swap transaction.
Native tokens, such as ETH, are represented as
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee