From 99fe5d13bb15cd4d5301ced560931f0c9f2d6c74 Mon Sep 17 00:00:00 2001 From: cpl121 Date: Thu, 16 May 2024 12:23:24 +0200 Subject: [PATCH] fix: calculate correct amount to allot mana --- packages/desktop/components/popups/AllotManaPopup.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/desktop/components/popups/AllotManaPopup.svelte b/packages/desktop/components/popups/AllotManaPopup.svelte index 4461f1e40b2..b5fa80d2d92 100644 --- a/packages/desktop/components/popups/AllotManaPopup.svelte +++ b/packages/desktop/components/popups/AllotManaPopup.svelte @@ -102,9 +102,14 @@ async function allotMana(): Promise { try { const accountId = AddressConverter.parseBech32Address(accountAddress) + const _amount = convertToRawAmount( + amount, + asset?.metadata, + getUnitFromTokenMetadata(asset?.metadata) + )?.toString() await $selectedWallet.sendOutputs([], { ...getDefaultTransactionOptions(), - manaAllotments: { [accountId]: Number(rawAmount) }, // if manaAllotments amount passed as bigint it is transformed to string in the sdk + manaAllotments: { [accountId]: Number(_amount) }, // if manaAllotments amount passed as bigint it is transformed to string in the sdk }) closePopup() } catch (err) {