Exemple #1
0
        private CurrencyTransaction PrepareNewTransaction(string aFromAddress, string aToAddress, decimal aAmount, decimal aTxFee)
        {
            var lInput = new TransactionUnit[1] {
                new TransactionUnit(0, 0, aFromAddress)
            };
            var lOutput = new TransactionUnit[1] {
                new TransactionUnit(0, FCurrencyItem.AmountToBigInteger(aAmount), aToAddress)
            };

            return(new CurrencyTransaction(lInput, lOutput, FCurrencyItem.AmountToLong(aTxFee), FCurrencyItem.Id));
        }
        private CurrencyTransaction PrepareNewTransaction(string aFromAddress, string aToAddress, decimal aAmount, decimal aTxFee)
        {
            var lInput = new TransactionUnit[1] {
                new TransactionUnit(0, 0, aFromAddress)
            };
            var lTokenTxData = ERC20TokenDecoder.Encode(ERC20Methods.Transfer, aToAddress, (FToken as ICurrencyAmountFormatter).AmountToBigInteger(aAmount).ToString());
            var lOutput      = new TransactionUnit[1] {
                new TransactionUnit(0, 0, FToken.ContractAddress, aScript: lTokenTxData)
            };

            return(new CurrencyTransaction(lInput, lOutput, FCurrencyItem.AmountToLong(aTxFee), FToken.ParentCurrencyID));
        }