diff --git a/Atomex.Client.Wpf.Installer/Product.wxs b/Atomex.Client.Wpf.Installer/Product.wxs index 1359a37..4e32b9e 100644 --- a/Atomex.Client.Wpf.Installer/Product.wxs +++ b/Atomex.Client.Wpf.Installer/Product.wxs @@ -3,7 +3,7 @@ - + diff --git a/Atomex.Client.Wpf/ViewModels/TransactionViewModels/TezosTokenTransferViewModel.cs b/Atomex.Client.Wpf/ViewModels/TransactionViewModels/TezosTokenTransferViewModel.cs index 6496708..3775dce 100644 --- a/Atomex.Client.Wpf/ViewModels/TransactionViewModels/TezosTokenTransferViewModel.cs +++ b/Atomex.Client.Wpf/ViewModels/TransactionViewModels/TezosTokenTransferViewModel.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics; -using System.Numerics; using System.Windows; using System.Windows.Input; @@ -8,6 +7,7 @@ using Atomex.Blockchain.Abstract; using Atomex.Blockchain.Tezos; +using Atomex.Common; using Atomex.Client.Wpf.Common; namespace Atomex.Client.Wpf.ViewModels.TransactionViewModels @@ -18,7 +18,6 @@ public class TezosTokenTransferViewModel : BaseViewModel, ITransactionViewModel private readonly TezosConfig _tezosConfig; - public IBlockchainTransaction Transaction { get; } public string Id { get; set; } public BlockchainTransactionState State { get; set; } @@ -110,14 +109,16 @@ public TezosTokenTransferViewModel(TokenTransfer tx, TezosConfig tezosConfig) private static decimal GetAmount(TokenTransfer tx) { - if (!decimal.TryParse(tx.Amount, out var amount)) - return 0; + if (tx.Amount.TryParseWithRound(tx.Token.Decimals, out var amount)) + { + var sign = tx.Type.HasFlag(BlockchainTransactionType.Input) + ? 1 + : -1; - var sign = tx.Type.HasFlag(BlockchainTransactionType.Input) - ? 1 - : -1; + return sign * amount; + } - return sign * amount / (decimal)BigInteger.Pow(10, tx.Token.Decimals); + return 0; } private void DesignerMode()