diff --git a/wails-frontend/src/pages/PasswordPromptHandler/CallSC/CallSc.tsx b/wails-frontend/src/pages/PasswordPromptHandler/CallSC/CallSc.tsx index b4fb117e..c47dce1c 100644 --- a/wails-frontend/src/pages/PasswordPromptHandler/CallSC/CallSc.tsx +++ b/wails-frontend/src/pages/PasswordPromptHandler/CallSC/CallSc.tsx @@ -45,7 +45,11 @@ export function CallSc(props: SignBodyProps) { - +
diff --git a/wails-frontend/src/pages/PasswordPromptHandler/CallSC/FTTransferInfo.tsx b/wails-frontend/src/pages/PasswordPromptHandler/CallSC/FTTransferInfo.tsx index cb573af6..07cc4705 100644 --- a/wails-frontend/src/pages/PasswordPromptHandler/CallSC/FTTransferInfo.tsx +++ b/wails-frontend/src/pages/PasswordPromptHandler/CallSC/FTTransferInfo.tsx @@ -1,6 +1,7 @@ import { Args } from '@massalabs/massa-web3'; import { formatFTAmount } from '@massalabs/react-ui-kit'; import { maskAddress } from '@massalabs/react-ui-kit/src/lib/massa-react/utils'; +import { LogPrint } from '@wailsjs/runtime/runtime'; import Intl from '@/i18n/i18n'; import { AmountBox } from '@/pages/PasswordPromptHandler/AmountBox'; @@ -8,20 +9,27 @@ import { AssetInfo } from '@/pages/PasswordPromptHandler/Sign'; import { base64ToArray } from '@/utils/parameters'; interface FTTransferInfoProps { + targetFunction: string; asset?: AssetInfo; parameters?: string; } export function FTTransferInfo(props: FTTransferInfoProps) { - const { asset, parameters } = props; + const { targetFunction, asset, parameters } = props; - if (!asset || !parameters) { + if (targetFunction !== 'transfer' || !asset || !parameters) { return null; } - const args = new Args(base64ToArray(parameters)); - const recipient = args.nextString(); - const amount = args.nextU256(); + let amount = 0n; + let recipient = ''; + try { + const args = new Args(base64ToArray(parameters)); + recipient = args.nextString(); + amount = args.nextU256(); + } catch (error) { + LogPrint(`error FTTransferInfo: ${error}`); + } return ( <>