Skip to content

Commit

Permalink
Solving lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-silva-funttastic committed Oct 5, 2023
1 parent f508b75 commit 9e6aff5
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/connectors/kujira/kujira.convertors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,26 +510,26 @@ export const convertKujiraBalancesToBalances = async (
let token: any = undefined;
let amount: any = undefined;
if (
[OrderStatus.OPEN, OrderStatus.PARTIALLY_FILLED].includes(
getNotNullOrThrowError<OrderStatus>(order.status)
)
[OrderStatus.OPEN, OrderStatus.PARTIALLY_FILLED].includes(
getNotNullOrThrowError<OrderStatus>(order.status)
)
) {
token =
order.side == OrderSide.BUY
? order.market.quoteToken
: order.market.baseToken;
order.side == OrderSide.BUY
? order.market.quoteToken
: order.market.baseToken;

amount = BigNumber(order.connectorOrder.offer_amount).div(
BigNumber(10).pow(token?.decimals)
BigNumber(10).pow(token?.decimals)
);
} else if (order.status == OrderStatus.FILLED) {
token =
order.side == OrderSide.BUY
? order.market.baseToken
: order.market.quoteToken;
order.side == OrderSide.BUY
? order.market.baseToken
: order.market.quoteToken;

amount = BigNumber(order.connectorOrder.filled_amount).div(
BigNumber(10).pow(token?.decimals)
BigNumber(10).pow(token?.decimals)
);
}

Expand Down Expand Up @@ -569,7 +569,9 @@ export const convertKujiraBalancesToBalances = async (
tokenBalance.inUSD.lockedInOrders.plus(amount?.multipliedBy(quotation));
} else if (order.status == OrderStatus.FILLED) {
tokenBalance.unsettled = tokenBalance.unsettled.plus(amount);
tokenBalance.inUSD.unsettled = tokenBalance.inUSD.unsettled.plus(amount?.multipliedBy(quotation));
tokenBalance.inUSD.unsettled = tokenBalance.inUSD.unsettled.plus(
amount?.multipliedBy(quotation)
);
}
}

Expand Down

0 comments on commit 9e6aff5

Please sign in to comment.