Cross-Chain Swap Guide
Step-by-step guide to swapping tokens across different chains using the Notus API.
Steps
Install viem
We’ll use viem, a library for blockchain interactions, to simplify our integration. Install it by running:
Initialize Wallet Account
Use your private key to initialize a wallet account. This will allow you to sign messages and interact with the blockchain.
Register a Smart Wallet Address
Before initiating a cross-chain swap, register and retrieve the smart wallet address used for Account Abstraction.
overview", "defi-swap", "defi-cross-chain-swap",
Create a Cross-chain Swap Quote
Query a quote for cross-chain swaps (e.g., USDC on Arbitrum to USDC on Polygon).
For cross-chain swaps involving a native token, use the following address as tokenIn: 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
. This ensures that the Notus API recognizes the asset as a native token.