From c12ccf8faff2d7a904b95ee204b4f2dd7a5721b6 Mon Sep 17 00:00:00 2001 From: Shunji Zhan Date: Tue, 26 Mar 2024 16:53:07 +0800 Subject: [PATCH] support ksm --- src/api/homa.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/homa.ts b/src/api/homa.ts index 9263902..09f3e39 100644 --- a/src/api/homa.ts +++ b/src/api/homa.ts @@ -54,6 +54,7 @@ export const routeHoma = async ({ chain, destAddr }: RouteParamsHoma) => { return receipt.transactionHash; }; +/* --------------------------------- auto route homa --------------------------------- */ export enum RouteStatus { Waiting = 0, Routing = 1, @@ -82,11 +83,11 @@ export const routeHomaAuto = async (params: RouteParamsHoma) => { routeTracker[reqId] = { status: RouteStatus.Waiting }; const { homaFactory, feeAddr, routeToken, wallet } = await prepareRouteHoma(chain); - const dot = ERC20__factory.connect(DOT, wallet); + const dotOrKsm = ERC20__factory.connect(routeToken, wallet); const waitForToken = new Promise((resolve, reject) => { const id = setInterval(async () => { - const bal = await dot.balanceOf(routerAddr!); // TODO: probably should add retry here to make sure this won't throw + const bal = await dotOrKsm.balanceOf(routerAddr!); // TODO: probably should add retry here to make sure this won't throw if (bal.gt(0)) { clearInterval(id); resolve();