Ejemplo n.º 1
0
        public static Curve25519Public Decode(IByteReader stream)
        {
            Curve25519Public decodedCurve25519Public = new Curve25519Public();
            int keysize = 32;

            decodedCurve25519Public.Key = XdrEncoding.ReadFixOpaque(stream, (uint)keysize);
            return(decodedCurve25519Public);
        }
Ejemplo n.º 2
0
        public static Value Decode(IByteReader stream)
        {
            Value decodedValue = new Value();
            int   Valuesize    = XdrEncoding.DecodeInt32(stream);

            decodedValue.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Valuesize);
            return(decodedValue);
        }
Ejemplo n.º 3
0
        public static Hash Decode(IByteReader stream)
        {
            Hash decodedHash = new Hash();
            int  Hashsize    = 32;

            decodedHash.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Hashsize);
            return(decodedHash);
        }
Ejemplo n.º 4
0
        public static Curve25519Secret Decode(IByteReader stream)
        {
            Curve25519Secret decodedCurve25519Secret = new Curve25519Secret();
            int keysize = 32;

            decodedCurve25519Secret.Key = XdrEncoding.ReadFixOpaque(stream, (uint)keysize);
            return(decodedCurve25519Secret);
        }
Ejemplo n.º 5
0
        public static HmacSha256Key Decode(IByteReader stream)
        {
            HmacSha256Key decodedHmacSha256Key = new HmacSha256Key();
            int           keysize = 32;

            decodedHmacSha256Key.Key = XdrEncoding.ReadFixOpaque(stream, (uint)keysize);
            return(decodedHmacSha256Key);
        }
        public static UpgradeType Decode(IByteReader stream)
        {
            UpgradeType decodedUpgradeType = new UpgradeType();
            int         UpgradeTypesize    = XdrEncoding.DecodeInt32(stream);

            decodedUpgradeType.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)UpgradeTypesize);
            return(decodedUpgradeType);
        }
Ejemplo n.º 7
0
        public static Thresholds Decode(IByteReader stream)
        {
            Thresholds decodedThresholds = new Thresholds();
            int        Thresholdssize    = 4;

            decodedThresholds.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Thresholdssize);
            return(decodedThresholds);
        }
Ejemplo n.º 8
0
        public static HmacSha256Mac Decode(IByteReader stream)
        {
            HmacSha256Mac decodedHmacSha256Mac = new HmacSha256Mac();
            int           macsize = 32;

            decodedHmacSha256Mac.Mac = XdrEncoding.ReadFixOpaque(stream, (uint)macsize);
            return(decodedHmacSha256Mac);
        }
Ejemplo n.º 9
0
        public static Signature Decode(IByteReader stream)
        {
            Signature decodedSignature = new Signature();
            int       Signaturesize    = XdrEncoding.DecodeInt32(stream);

            decodedSignature.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)Signaturesize);
            return(decodedSignature);
        }
Ejemplo n.º 10
0
        public static Uint256 Decode(IByteReader stream)
        {
            Uint256 decodedUint256 = new Uint256();
            int     uint256size    = 32;

            decodedUint256.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)uint256size);
            return(decodedUint256);
        }
Ejemplo n.º 11
0
        public static SignatureHint Decode(IByteReader stream)
        {
            SignatureHint decodedSignatureHint = new SignatureHint();
            int           SignatureHintsize    = 4;

            decodedSignatureHint.InnerValue = XdrEncoding.ReadFixOpaque(stream, (uint)SignatureHintsize);
            return(decodedSignatureHint);
        }
Ejemplo n.º 12
0
            public static AssetAlphaNum12 Decode(IByteReader stream)
            {
                AssetAlphaNum12 decodedAssetAlphaNum12 = new AssetAlphaNum12();
                int             assetCodesize          = 12;

                decodedAssetAlphaNum12.AssetCode = XdrEncoding.ReadFixOpaque(stream, (uint)assetCodesize);
                decodedAssetAlphaNum12.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum12);
            }
Ejemplo n.º 13
0
            public static AssetAlphaNum4 Decode(IByteReader stream)
            {
                AssetAlphaNum4 decodedAssetAlphaNum4 = new AssetAlphaNum4();
                int            assetCodesize         = 4;

                decodedAssetAlphaNum4.AssetCode = XdrEncoding.ReadFixOpaque(stream, (uint)assetCodesize);
                decodedAssetAlphaNum4.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum4);
            }
Ejemplo n.º 14
0
            public static PeerAddressIp Decode(IByteReader stream)
            {
                PeerAddressIp decodedPeerAddressIp = new PeerAddressIp();

                decodedPeerAddressIp.Discriminant = IPAddrType.Decode(stream);
                switch (decodedPeerAddressIp.Discriminant.InnerValue)
                {
                case IPAddrType.IPAddrTypeEnum.IPv4:
                    int ipv4size = 4;
                    decodedPeerAddressIp.Ipv4 = XdrEncoding.ReadFixOpaque(stream, (uint)ipv4size);
                    break;

                case IPAddrType.IPAddrTypeEnum.IPv6:
                    int ipv6size = 16;
                    decodedPeerAddressIp.Ipv6 = XdrEncoding.ReadFixOpaque(stream, (uint)ipv6size);
                    break;
                }
                return(decodedPeerAddressIp);
            }
Ejemplo n.º 15
0
            public static AllowTrustOpAsset Decode(IByteReader stream)
            {
                AllowTrustOpAsset decodedAllowTrustOpAsset = new AllowTrustOpAsset();

                decodedAllowTrustOpAsset.Discriminant = AssetType.Decode(stream);
                switch (decodedAllowTrustOpAsset.Discriminant.InnerValue)
                {
                case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4:
                    int assetCode4size = 4;
                    decodedAllowTrustOpAsset.AssetCode4 = XdrEncoding.ReadFixOpaque(stream, (uint)assetCode4size);
                    break;

                case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12:
                    int assetCode12size = 12;
                    decodedAllowTrustOpAsset.AssetCode12 = XdrEncoding.ReadFixOpaque(stream, (uint)assetCode12size);
                    break;
                }
                return(decodedAllowTrustOpAsset);
            }