Swap
Routing
await swapRouterV3(
tokenIn: string,
tokenOut: string,
amount: bigint,
exactIn: boolean
);swapRouterV3(tokenIn: string, tokenOut: string, amount: bigint, exactIn: boolean)import { swapRouterV3, ADDRESSES } from '@storyhunt/wrapper-sdk';
async function findRoute() {
const routes = await swapRouterV3(
ADDRESSES.TOKENS.WIP.id,
ADDRESSES.TOKENS.USDC.id,
BigInt(10 ** 15),
true
);
if (routes instanceof Error) {
console.error('Error finding routes:', routes.message);
return;
}
console.log('Available trades:', routes);
}