mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-23 19:37:52 +00:00
update cancel sell order qortalrequest
This commit is contained in:
parent
9f328c000b
commit
1f2c38e8df
@ -3455,9 +3455,6 @@ export const createSellOrder = async (data, isFromExtension) => {
|
|||||||
|
|
||||||
export const cancelSellOrder = async (data, isFromExtension) => {
|
export const cancelSellOrder = async (data, isFromExtension) => {
|
||||||
const requiredFields = [
|
const requiredFields = [
|
||||||
"qortAmount",
|
|
||||||
"foreignBlockchain",
|
|
||||||
"foreignAmount",
|
|
||||||
"atAddress",
|
"atAddress",
|
||||||
];
|
];
|
||||||
const missingFields: string[] = [];
|
const missingFields: string[] = [];
|
||||||
@ -3472,16 +3469,20 @@ export const cancelSellOrder = async (data, isFromExtension) => {
|
|||||||
throw new Error(errorMsg);
|
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 {
|
try {
|
||||||
const fee = await getFee("MESSAGE");
|
const fee = await getFee("MESSAGE");
|
||||||
|
|
||||||
const resPermission = await getUserPermission(
|
const resPermission = await getUserPermission(
|
||||||
{
|
{
|
||||||
text1:
|
text1:
|
||||||
"Do you give this application permission to perform cancel a sell order?",
|
"Do you give this application permission to perform: cancel a sell order?",
|
||||||
text2: `${data.qortAmount}${" "}
|
text2: `${resData.qortAmount}${" "}
|
||||||
${`QORT`}`,
|
${`QORT`}`,
|
||||||
text3: `FOR ${data.foreignAmount} ${data.foreignBlockchain}`,
|
text3: `FOR ${resData.expectedForeignAmount} ${resData.foreignBlockchain}`,
|
||||||
fee: fee.fee,
|
fee: fee.fee,
|
||||||
},
|
},
|
||||||
isFromExtension
|
isFromExtension
|
||||||
|
Loading…
x
Reference in New Issue
Block a user