/// <summary>
        /// EstimateEncodedSize returns the estimated encoded size of the transaction including the signature.
        /// This function is useful for calculating the fee from suggested fee per byte.
        /// </summary>
        /// <param name="tx">the transaction</param>
        /// <returns>an estimated byte size for the transaction.</returns>
        public static int EstimatedEncodedSize(Transaction tx)
        {
            Account acc = new Account();

            return(Encoder.EncodeToMsgPack(
                       new SignedTransaction(tx, acc.RawSignBytes(tx.BytesToSign()), tx.TxID())).Length);
        }