From b4696e67feeb6f6e41588ae697453f05b416dd70 Mon Sep 17 00:00:00 2001 From: Mark Nardi Date: Mon, 27 May 2024 14:17:09 +0200 Subject: [PATCH] show basetoken amount on smartcontract popups --- .../popup/popups/EvmTransactionFromDappPopup.svelte | 13 +++++++------ .../core/wallet/types/token-transfer-data.type.ts | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte b/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte index 784fd28641..4c401df701 100644 --- a/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte +++ b/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte @@ -55,6 +55,10 @@ } } $: preparedTransaction.gasPrice = Converter.bigIntToHex(gasPrices?.[selectedGasSpeed] ?? gasPrices.required) + $: baseCoinTransfer = { + token: getTokenFromSelectedAccountTokens(BASE_TOKEN_ID, evmNetwork.id), + rawAmount: Converter.bigIntLikeToBigInt(preparedTransaction.value), + } setParsedContractData() function setParsedContractData(): void { @@ -217,13 +221,10 @@ />
- {#if !preparedTransaction.data} - {@const baseCoinTransfer = { - token: getTokenFromSelectedAccountTokens(BASE_TOKEN_ID, evmNetwork.id), - rawAmount: Converter.bigIntLikeToBigInt(preparedTransaction.value), - }} + {#if preparedTransaction.value} - {:else if parsedData?.type === ParsedSmartContractType.CoinTransfer} + {/if} + {#if parsedData?.type === ParsedSmartContractType.CoinTransfer} {@const baseCoinTransfer = { token: getTokenFromSelectedAccountTokens(BASE_TOKEN_ID, evmNetwork.id), rawAmount: parsedData.rawAmount, diff --git a/packages/shared/src/lib/core/wallet/types/token-transfer-data.type.ts b/packages/shared/src/lib/core/wallet/types/token-transfer-data.type.ts index 96306d010e..e40f6ea570 100644 --- a/packages/shared/src/lib/core/wallet/types/token-transfer-data.type.ts +++ b/packages/shared/src/lib/core/wallet/types/token-transfer-data.type.ts @@ -2,6 +2,6 @@ import { IToken } from '@core/token/interfaces' export type TokenTransferData = { rawAmount: bigint - token: IToken + token?: IToken unit?: string }