Skip to content

Commit

Permalink
Fix fee for NFT bulk select
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Dec 24, 2024
1 parent f6bfff8 commit b34a43c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/components/MultiSelectActions.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -43,23 +44,35 @@ 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));
};

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));
};

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));
Expand All @@ -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)
Expand Down

0 comments on commit b34a43c

Please sign in to comment.