From ffc15e8c46079e7973cee771c4fbead7c3073cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20Arau=CC=81jo=20Silva?= Date: Wed, 18 Oct 2023 20:59:18 +0200 Subject: [PATCH] Fixing wrong reference. --- src/connectors/kujira/kujira.convertors.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/connectors/kujira/kujira.convertors.ts b/src/connectors/kujira/kujira.convertors.ts index 147464571a..72836795fd 100644 --- a/src/connectors/kujira/kujira.convertors.ts +++ b/src/connectors/kujira/kujira.convertors.ts @@ -689,11 +689,11 @@ export const convertKujiraSettlementToSettlement = ( const tokenFees = { base: { - tokenId: market.base.id, + tokenId: market.baseToken.id, feeAmount: BigNumber(0), }, quote: { - tokenId: market.quote.id, + tokenId: market.quoteToken.id, feeAmount: BigNumber(0), }, native: { @@ -705,18 +705,21 @@ export const convertKujiraSettlementToSettlement = ( for (const transferEventFee of transferEventFeeAmountArray) { const tokenIdFromFeeMatch = transferEventFee.match(/^(\d+)(.*)/); - if (tokenIdFromFeeMatch[2] == market.base.id) { + if (tokenIdFromFeeMatch[2] == market.baseToken.id) { tokenFees.base.feeAmount = tokenFees.base.feeAmount.plus( BigNumber(parseInt(tokenIdFromFeeMatch[1])) ); - } else if (tokenIdFromFeeMatch[2] == market.quote.id) { + } else if (tokenIdFromFeeMatch[2] == market.quoteToken.id) { tokenFees.quote.feeAmount = tokenFees.quote.feeAmount.plus( BigNumber(parseInt(tokenIdFromFeeMatch[1])) ); } } - if (market.base.id != nativeToken[2] && market.quote.id != nativeToken[2]) { + if ( + market.baseToken.id != nativeToken[2] && + market.quoteToken.id != nativeToken[2] + ) { tokenFees.native.feeAmount = tokenFees.native.feeAmount.plus( BigNumber(parseInt(nativeToken[1])) );