Skip to content

Commit

Permalink
fix: calculate correct amount to allot mana
Browse files Browse the repository at this point in the history
  • Loading branch information
cpl121 committed May 16, 2024
1 parent d160cae commit 99fe5d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/desktop/components/popups/AllotManaPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@
async function allotMana(): Promise<void> {
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) {
Expand Down

0 comments on commit 99fe5d1

Please sign in to comment.