From a19d6e7de328eafdfe7d8c37abc888c7d3e3c06f Mon Sep 17 00:00:00 2001 From: Hossein Date: Mon, 9 Sep 2024 17:52:59 +0330 Subject: [PATCH] #221: Add request body for WithdrawReq --- .../DepositWithdraw/components/Withdrawal.js | 22 ++++++++++++++++--- yarn.lock | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Wallet/components/DepositWithdraw/components/Withdrawal.js b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Wallet/components/DepositWithdraw/components/Withdrawal.js index e9edeb33..89e7ec48 100644 --- a/src/main/Browser/Pages/UserPanel/Sections/Content/components/Wallet/components/DepositWithdraw/components/Withdrawal.js +++ b/src/main/Browser/Pages/UserPanel/Sections/Content/components/Wallet/components/DepositWithdraw/components/Withdrawal.js @@ -63,11 +63,25 @@ const Withdrawal = () => { } } + console.log("currencyInfo?.chains[networkName.value]?.network", currencyInfo?.chains[networkName.value]?.network) + console.log("currencyInfo?.chains[networkName.value]?.currency", currencyInfo?.chains[networkName.value]?.currency) + const sendWithdrawHandler = async (e) => { e.preventDefault() if (isLoading) return setIsLoading(true) - sendWithdrawReq(amount.value, id, address.value, withdrawFee, `${currencyInfo?.chains[networkName.value]?.network} - ${currencyInfo?.chains[networkName.value]?.currency}`) + + const withdrawRequestData = { + "currency": currencyInfo?.chains[networkName.value]?.currency, + "amount": amount.value, + "destSymbol": currencyInfo?.chains[networkName.value]?.currency, + "destAddress": address.value, + "destNetwork": currencyInfo?.chains[networkName.value]?.network, + /*"destNote": "Personal wallet", //Optional + "description": "Withdrawal to personal wallet" //Optional*/ + } + + sendWithdrawReq(withdrawRequestData) .then(() => { setNetworkName({value: 0, error: []}) setAmount({value: 0, error: []}) @@ -84,7 +98,9 @@ const Withdrawal = () => { getUserAssets() getUserAssetsEstimatedValue() }) - .catch(() => { + .catch((error) => { + + console.log("error", error) toast.error(t('error')); }) .finally(() => setIsLoading(false)) @@ -188,7 +204,7 @@ const Withdrawal = () => {
{t('commission')}: {amount.value ? withdrawFee : 0} + className={`text-orange`}>{withdrawFee ? withdrawFee : 0} {t("currency." + id)} diff --git a/yarn.lock b/yarn.lock index 9a2658f6..fe54d3d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9486,8 +9486,8 @@ __metadata: "js-api-client@https://github.com/opexdev/js-api-client.git#develop": version: 1.0.0-beta2 - resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=0a3cb3b1a8cc9bfea52d8a13b469bcd676923c37" - checksum: 46415811da888600ce149284d02e7cec2bbfffea73bc80ff16406447466c0abb5ac6a21ff82eb8cb48d61c25d65d673b4afeb44afc906d9d7d51f04e7f9b80fe + resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=217ac93076c92fcedc157de8c949a9fdf7e9829d" + checksum: d9e88f2be37d4e8501d48a9986ea7e7d2ef4320752c92bcc12ed98d4bcaca3bb813bbc7cbc65a4f0ad9757b1cb181293c2c780201e787624d7f83fb37f70ce35 languageName: node linkType: hard