From de0f245008737185d12a8dc022f7f418eefd4d14 Mon Sep 17 00:00:00 2001 From: SorinC6 Date: Tue, 10 Oct 2023 16:52:44 +0300 Subject: [PATCH] add id from metadata --- .../Swap/useCases/StartSwapScreen/ListOrders/mapOrders.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/mapOrders.ts b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/mapOrders.ts index 544542d794..a67f52667b 100644 --- a/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/mapOrders.ts +++ b/apps/wallet-mobile/src/features/Swap/useCases/StartSwapScreen/ListOrders/mapOrders.ts @@ -51,6 +51,7 @@ export const mapCompletedOrders = (orders: TransactionInfo[], wallet: YoroiWalle if (orders.length === 0) return [] const result = orders .map((order) => { + console.log('order', order) let metadata: { buyTokenId: string sellTokenId: string @@ -61,7 +62,6 @@ export const mapCompletedOrders = (orders: TransactionInfo[], wallet: YoroiWalle try { metadata = JSON.parse(order.metadata as string) - const buyTokenInfo = useTokenInfo({wallet, tokenId: metadata.buyTokenId}) const sellTokenInfo = useTokenInfo({wallet, tokenId: metadata.sellTokenId}) @@ -80,10 +80,10 @@ export const mapCompletedOrders = (orders: TransactionInfo[], wallet: YoroiWalle date: order?.lastUpdatedAt, sellLabel, sellQuantity: formattedSellQuantity, - sellTokenId: sellTokenInfo.id, + sellTokenId: metadata.sellTokenId, buyLabel, buyQuantity: formattedBuyQuantity, - buyTokenId: buyTokenInfo.id, + buyTokenId: metadata.buyTokenId, txLink, tokenPrice: Quantities.format(tokenPrice, sellTokenInfo.decimals ?? 0, MAX_DECIMALS), }