public static void Encode(XdrDataOutputStream stream, AllowTrustOpAsset encodedAllowTrustOpAsset)
            {
                stream.WriteInt((int)encodedAllowTrustOpAsset.Discriminant.InnerValue);
                switch (encodedAllowTrustOpAsset.Discriminant.InnerValue)
                {
                case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4:
                    var assetCode4size = encodedAllowTrustOpAsset.AssetCode4.Length;
                    stream.Write(encodedAllowTrustOpAsset.AssetCode4, 0, assetCode4size);
                    break;

                case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12:
                    var assetCode12size = encodedAllowTrustOpAsset.AssetCode12.Length;
                    stream.Write(encodedAllowTrustOpAsset.AssetCode12, 0, assetCode12size);
                    break;
                }
            }
Beispiel #2
0
        public static void Encode(XdrDataOutputStream stream, Value encodedValue)
        {
            var Valuesize = encodedValue.InnerValue.Length;

            stream.WriteInt(Valuesize);
            stream.Write(encodedValue.InnerValue, 0, Valuesize);
        }
Beispiel #3
0
        public static void Encode(XdrDataOutputStream stream, DataValue encodedDataValue)
        {
            int DataValuesize = encodedDataValue.InnerValue.Length;

            stream.WriteInt(DataValuesize);
            stream.Write(encodedDataValue.InnerValue, 0, DataValuesize);
        }
Beispiel #4
0
        public static void Encode(XdrDataOutputStream stream, Signature encodedSignature)
        {
            var Signaturesize = encodedSignature.InnerValue.Length;

            stream.WriteInt(Signaturesize);
            stream.Write(encodedSignature.InnerValue, 0, Signaturesize);
        }
        public static void Encode(XdrDataOutputStream stream, EncryptedBody encodedEncryptedBody)
        {
            int EncryptedBodysize = encodedEncryptedBody.InnerValue.Length;

            stream.WriteInt(EncryptedBodysize);
            stream.Write(encodedEncryptedBody.InnerValue, 0, EncryptedBodysize);
        }
Beispiel #6
0
            public static void Encode(XdrDataOutputStream stream, AssetAlphaNum4 encodedAssetAlphaNum4)
            {
                var assetCodesize = encodedAssetAlphaNum4.AssetCode.Length;

                stream.Write(encodedAssetAlphaNum4.AssetCode, 0, assetCodesize);
                AccountID.Encode(stream, encodedAssetAlphaNum4.Issuer);
            }
Beispiel #7
0
            public static void Encode(XdrDataOutputStream stream, PeerAddressIp encodedPeerAddressIp)
            {
                stream.WriteInt((int)encodedPeerAddressIp.Discriminant.InnerValue);
                switch (encodedPeerAddressIp.Discriminant.InnerValue)
                {
                case IPAddrType.IPAddrTypeEnum.IPv4:
                    var ipv4size = encodedPeerAddressIp.Ipv4.Length;
                    stream.Write(encodedPeerAddressIp.Ipv4, 0, ipv4size);
                    break;

                case IPAddrType.IPAddrTypeEnum.IPv6:
                    var ipv6size = encodedPeerAddressIp.Ipv6.Length;
                    stream.Write(encodedPeerAddressIp.Ipv6, 0, ipv6size);
                    break;
                }
            }
        public static void Encode(XdrDataOutputStream stream, UpgradeType encodedUpgradeType)
        {
            var UpgradeTypesize = encodedUpgradeType.InnerValue.Length;

            stream.WriteInt(UpgradeTypesize);
            stream.Write(encodedUpgradeType.InnerValue, 0, UpgradeTypesize);
        }
Beispiel #9
0
        /// <summary>
        ///     Returns signature base.
        /// </summary>
        /// <returns></returns>
        public byte[] SignatureBase()
        {
            if (Network.Current == null)
                throw new NoNetworkSelectedException();

            var writer = new XdrDataOutputStream();

            // Hashed NetworkID
            writer.Write(Network.Current.NetworkId);

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

            // Transaction XDR bytes
            var txWriter = new XdrDataOutputStream();
            xdr.Transaction.Encode(txWriter, ToXdr());

            writer.Write(txWriter.ToArray());

            return writer.ToArray();
        }
Beispiel #10
0
        public static void Encode(XdrDataOutputStream stream, Uint256 encodedUint256)
        {
            int uint256size = encodedUint256.InnerValue.Length;

            stream.Write(encodedUint256.InnerValue, 0, uint256size);
        }
        public static void Encode(XdrDataOutputStream stream, Curve25519Secret encodedCurve25519Secret)
        {
            var keysize = encodedCurve25519Secret.Key.Length;

            stream.Write(encodedCurve25519Secret.Key, 0, keysize);
        }
Beispiel #12
0
        public static void Encode(XdrDataOutputStream stream, Hash encodedHash)
        {
            var Hashsize = encodedHash.InnerValue.Length;

            stream.Write(encodedHash.InnerValue, 0, Hashsize);
        }
Beispiel #13
0
        public static void Encode(XdrDataOutputStream stream, Thresholds encodedThresholds)
        {
            var Thresholdssize = encodedThresholds.InnerValue.Length;

            stream.Write(encodedThresholds.InnerValue, 0, Thresholdssize);
        }
        public static void Encode(XdrDataOutputStream stream, Curve25519Public encodedCurve25519Public)
        {
            int keysize = encodedCurve25519Public.Key.Length;

            stream.Write(encodedCurve25519Public.Key, 0, keysize);
        }
Beispiel #15
0
        public static void Encode(XdrDataOutputStream stream, HmacSha256Key encodedHmacSha256Key)
        {
            int keysize = encodedHmacSha256Key.Key.Length;

            stream.Write(encodedHmacSha256Key.Key, 0, keysize);
        }
        public static void Encode(XdrDataOutputStream stream, SignatureHint encodedSignatureHint)
        {
            var SignatureHintsize = encodedSignatureHint.InnerValue.Length;

            stream.Write(encodedSignatureHint.InnerValue, 0, SignatureHintsize);
        }
Beispiel #17
0
        public static void Encode(XdrDataOutputStream stream, AssetCode4 encodedAssetCode4)
        {
            int AssetCode4size = encodedAssetCode4.InnerValue.Length;

            stream.Write(encodedAssetCode4.InnerValue, 0, AssetCode4size);
        }
Beispiel #18
0
        public static void Encode(XdrDataOutputStream stream, HmacSha256Mac encodedHmacSha256Mac)
        {
            var macsize = encodedHmacSha256Mac.Mac.Length;

            stream.Write(encodedHmacSha256Mac.Mac, 0, macsize);
        }