Execute Routes & Quotes
After obtaining a route, you can delegate to the SDK to execute it.
Disclaimer
The Suave Aggregator SDK will only function properly in a browser-like environment. You can use a library like web3-mock to simulate this in Node.js.
Use the executeRoute
function to begin executing a route.
Here is a simple example of executing a route for bridging 10 USDC on Arbitrum to the maximum amount of DAI on Polygon. Note that you will need to configure a Viem wallet client to your preferences in order to begin executing.
Execution parameters
Below are the parameters for the executeRoutes
function along with their descriptions:
route RouteResponse
required
This is a route object as produced by the getRoutes
function.
walletClient WalletClient
required
This is a Viem-compatible wallet client object which will be used for resolving onchain transactions such as swapping and bridging. See the Viem docs for more details.