From 9e65cf89876ba326934c239fb03e287396a67964 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Fri, 17 Jan 2025 16:47:01 +0200 Subject: [PATCH] update cancel sell order qortalrequest --- src/qortalRequests/get.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qortalRequests/get.ts b/src/qortalRequests/get.ts index 15e9202..e7683b9 100644 --- a/src/qortalRequests/get.ts +++ b/src/qortalRequests/get.ts @@ -3253,9 +3253,6 @@ const receivingAddress = await getUserWalletFunc(data.foreignBlockchain) export const cancelSellOrder = async (data, isFromExtension) => { const requiredFields = [ - "qortAmount", - "foreignBlockchain", - "foreignAmount", "atAddress" ]; const missingFields: string[] = []; @@ -3270,14 +3267,19 @@ export const cancelSellOrder = async (data, isFromExtension) => { throw new Error(errorMsg); } + const url = await createEndpoint(`/crosschain/trade/${data.atAddress}`) + const resAddress = await fetch(url); + const resData = await resAddress.json(); + if(!resData?.qortalAtAddress) throw new Error('Cannot find AT info.') + try { const fee = await getFee("MESSAGE"); const resPermission = await getUserPermission({ text1: "Do you give this application permission to perform cancel a sell order?", - text2: `${data.qortAmount}${" "} + text2: `${resData.qortAmount}${" "} ${`QORT`}`, - text3: `FOR ${data.foreignAmount} ${data.foreignBlockchain}`, + text3: `FOR ${resData.expectedForeignAmount} ${resData.foreignBlockchain}`, fee: fee.fee }, isFromExtension); const { accepted } = resPermission;