Skip to content

Commit

Permalink
support ksm
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Mar 26, 2024
1 parent fc53139 commit c12ccf8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/homa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const routeHoma = async ({ chain, destAddr }: RouteParamsHoma) => {
return receipt.transactionHash;
};

/* --------------------------------- auto route homa --------------------------------- */
export enum RouteStatus {
Waiting = 0,
Routing = 1,
Expand Down Expand Up @@ -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<void>((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();
Expand Down

0 comments on commit c12ccf8

Please sign in to comment.