Skip to content

Commit

Permalink
add id from metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
SorinC6 committed Oct 11, 2023
1 parent d9c65cf commit de0f245
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})

Expand All @@ -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),
}
Expand Down

0 comments on commit de0f245

Please sign in to comment.