diff --git a/src/connectors/kujira/kujira.convertors.ts b/src/connectors/kujira/kujira.convertors.ts index 151d220922..e43d10b337 100644 --- a/src/connectors/kujira/kujira.convertors.ts +++ b/src/connectors/kujira/kujira.convertors.ts @@ -540,18 +540,17 @@ export const convertKujiraBalancesToBalances = async ( tokenBalance.inUSD.quotation = quotation; - if ([OrderStatus.OPEN, OrderStatus.PARTIALLY_FILLED].includes( + if ( + [OrderStatus.OPEN, OrderStatus.PARTIALLY_FILLED].includes( getNotNullOrThrowError(order.status) - )) { + ) + ) { tokenBalance.lockedInOrders = tokenBalance.lockedInOrders.plus(amount); tokenBalance.inUSD.lockedInOrders = - tokenBalance.inUSD.lockedInOrders.plus( - amount.multipliedBy(quotation) - ); + tokenBalance.inUSD.lockedInOrders.plus(amount.multipliedBy(quotation)); } else if (order.status == OrderStatus.FILLED) { tokenBalance.unsettled = tokenBalance.unsettled.plus(amount); - tokenBalance.inUSD.unsettled = - amount.multipliedBy(quotation); + tokenBalance.inUSD.unsettled = amount.multipliedBy(quotation); } } @@ -623,10 +622,10 @@ export const convertKujiraSettlementToSettlement = ( const rawAmounts: string[] = [nativeFees]; if (rawBaseTokenFees) { - rawAmounts.push(rawBaseTokenFees) + rawAmounts.push(rawBaseTokenFees); } if (rawQuoteTokenFees) { - rawAmounts.push(rawQuoteTokenFees) + rawAmounts.push(rawQuoteTokenFees); } const tokenWithdraw = IMap().asMutable(); diff --git a/test/connectors/kujira/kujira.routes.test.ts b/test/connectors/kujira/kujira.routes.test.ts index 408f8d6d6a..ea9f1f0709 100644 --- a/test/connectors/kujira/kujira.routes.test.ts +++ b/test/connectors/kujira/kujira.routes.test.ts @@ -2266,6 +2266,7 @@ describe('Kujira', () => { userBalances.tokens.get(targetOrder.market.quoteToken.id)?.total ), inUSD: { + quotation: BigNumber(0), free: getNotNullOrThrowError( userBalances.tokens.get(targetOrder.market.quoteToken.id) )?.free, @@ -2455,6 +2456,7 @@ describe('Kujira', () => { userBalances.tokens.get(targetOrder.market.baseToken.id)?.total ), inUSD: { + quotation: BigNumber(0), free: getNotNullOrThrowError( userBalances.tokens.get(targetOrder.market.baseToken.id)?.inUSD.free ), @@ -2507,6 +2509,7 @@ describe('Kujira', () => { userBalances.tokens.get(targetOrder.market.quoteToken.id)?.total ), inUSD: { + quotation: BigNumber(0), free: getNotNullOrThrowError( userBalances.tokens.get(targetOrder.market.quoteToken.id) )?.free, @@ -2677,6 +2680,7 @@ describe('Kujira', () => { userBalances.tokens.get(primaryTargetOrder.market.baseToken.id)?.total ), inUSD: { + quotation: BigNumber(0), free: getNotNullOrThrowError( userBalances.tokens.get(primaryTargetOrder.market.baseToken.id) ?.inUSD.free @@ -2729,6 +2733,7 @@ describe('Kujira', () => { ?.total ), inUSD: { + quotation: BigNumber(0), free: getNotNullOrThrowError( userBalances.tokens.get(primaryTargetOrder.market.quoteToken.id) )?.free,