Beispiel #1
0
        public static string EncodeCheck(VersionByte versionByte, byte[] data)
        {
            var writer = new Generated.ByteWriter();

            writer.Write((byte)versionByte);
            writer.Write(data);
            byte[] checksum = StrKey.CalculateChecksum(writer.ToArray());
            writer.Write(checksum);
            return(Base32Encoding.ToString(writer.ToArray()));
        }
Beispiel #2
0
        /// <summary>
        /// Returns signature base.
        /// </summary>
        /// <returns></returns>
        public byte[] SignatureBase()
        {
            var writer = new Generated.ByteWriter();

            // Hashed NetworkID
            writer.Write(Network.CurrentNetworkId);

            // Envelope Type - 4 bytes
            Generated.EnvelopeType.Encode(writer, Generated.EnvelopeType.Create(Generated.EnvelopeType.EnvelopeTypeEnum.ENVELOPE_TYPE_TX));

            // Transaction XDR bytes
            var txWriter = new Generated.ByteWriter();

            Generated.Transaction.Encode(txWriter, this.ToXDR());

            writer.Write(txWriter.ToArray());

            return(writer.ToArray());
        }