From b34a43cfce19ed5d292bc7c94e33a292553c5801 Mon Sep 17 00:00:00 2001 From: Rigidity Date: Tue, 24 Dec 2024 08:58:44 -0500 Subject: [PATCH] Fix fee for NFT bulk select --- src/components/MultiSelectActions.tsx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/MultiSelectActions.tsx b/src/components/MultiSelectActions.tsx index 23d2abae..13c404fa 100644 --- a/src/components/MultiSelectActions.tsx +++ b/src/components/MultiSelectActions.tsx @@ -1,5 +1,6 @@ import { commands, TransactionResponse } from '@/bindings'; import { useErrors } from '@/hooks/useErrors'; +import { toMojos } from '@/lib/utils'; import { useWalletState } from '@/state'; import { ChevronDown, @@ -43,7 +44,11 @@ export function MultiSelectActions({ const onTransferSubmit = (address: string, fee: string) => { commands - .transferNfts({ nft_ids: selected, address, fee }) + .transferNfts({ + nft_ids: selected, + address, + fee: toMojos(fee, walletState.sync.unit.decimals), + }) .then(setResponse) .catch(addError) .finally(() => setTransferOpen(false)); @@ -51,7 +56,11 @@ export function MultiSelectActions({ const onAssignSubmit = (profile: string, fee: string) => { commands - .assignNftsToDid({ nft_ids: selected, did_id: profile, fee }) + .assignNftsToDid({ + nft_ids: selected, + did_id: profile, + fee: toMojos(fee, walletState.sync.unit.decimals), + }) .then(setResponse) .catch(addError) .finally(() => setAssignOpen(false)); @@ -59,7 +68,11 @@ export function MultiSelectActions({ const onUnassignSubmit = (fee: string) => { commands - .assignNftsToDid({ nft_ids: selected, did_id: null, fee }) + .assignNftsToDid({ + nft_ids: selected, + did_id: null, + fee: toMojos(fee, walletState.sync.unit.decimals), + }) .then(setResponse) .catch(addError) .finally(() => setUnassignOpen(false)); @@ -70,7 +83,7 @@ export function MultiSelectActions({ .transferNfts({ nft_ids: selected, address: walletState.sync.burn_address, - fee, + fee: toMojos(fee, walletState.sync.unit.decimals), }) .then(setResponse) .catch(addError)