const ETHEREUM_CHAIN = 1;
const BERACHAIN_CHAIN = 80094;
const PLUME_CHAIN = 98866;
const ARBITRUM_CHAIN = 42161;
const userAddress = "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" as Address;
/**
* Swaps the native gas token BERA for the native stablecoin HONEY on Berachain.
* @returns The route and transaction objects.
*/
export async function swapBeraToHoney() {
const BERA: Address = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
const HONEY: Address = "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590";
const amountIn = "1000000000000000000";
const routeParams: RouteParams = {
fromAddress: userAddress,
receiver: userAddress,
chainId: BERACHAIN_CHAIN,
amountIn: [amountIn], // 1 BERA
tokenIn: [BERA],
tokenOut: [HONEY],
routingStrategy: "router",
};
const approval = await client.getApprovalData({
amount: "1000000000000000000",
tokenAddress: BERA,
chainId: BERACHAIN_CHAIN,
fromAddress: userAddress,
});
const route = await client.getRouteData(routeParams);
await sendEoa(approval.tx, approval.gas);
await sendEoa(route.tx, route.gas);
return route;
}