示例#1
0
        public static BeginSponsoringFutureReservesOp Decode(XdrDataInputStream stream)
        {
            BeginSponsoringFutureReservesOp decodedBeginSponsoringFutureReservesOp = new BeginSponsoringFutureReservesOp();

            decodedBeginSponsoringFutureReservesOp.SponsoredID = AccountID.Decode(stream);
            return(decodedBeginSponsoringFutureReservesOp);
        }
示例#2
0
        public static AccountEntry Decode(XdrDataInputStream stream)
        {
            var decodedAccountEntry = new AccountEntry();

            decodedAccountEntry.AccountID     = AccountID.Decode(stream);
            decodedAccountEntry.Balance       = Int64.Decode(stream);
            decodedAccountEntry.SeqNum        = SequenceNumber.Decode(stream);
            decodedAccountEntry.NumSubEntries = Uint32.Decode(stream);
            var InflationDestPresent = stream.ReadInt();

            if (InflationDestPresent != 0)
            {
                decodedAccountEntry.InflationDest = AccountID.Decode(stream);
            }
            decodedAccountEntry.Flags      = Uint32.Decode(stream);
            decodedAccountEntry.HomeDomain = String32.Decode(stream);
            decodedAccountEntry.Thresholds = Thresholds.Decode(stream);
            var signerssize = stream.ReadInt();

            decodedAccountEntry.Signers = new Signer[signerssize];
            for (var i = 0; i < signerssize; i++)
            {
                decodedAccountEntry.Signers[i] = Signer.Decode(stream);
            }
            decodedAccountEntry.Ext = AccountEntryExt.Decode(stream);
            return(decodedAccountEntry);
        }
示例#3
0
        public static Transaction Decode(XdrDataInputStream stream)
        {
            Transaction decodedTransaction = new Transaction();

            decodedTransaction.SourceAccount = AccountID.Decode(stream);
            decodedTransaction.Fee           = Uint32.Decode(stream);
            decodedTransaction.SeqNum        = SequenceNumber.Decode(stream);
            int TimeBoundsPresent = stream.ReadInt();

            if (TimeBoundsPresent != 0)
            {
                decodedTransaction.TimeBounds = TimeBounds.Decode(stream);
            }

            decodedTransaction.Memo = Memo.Decode(stream);
            int operationssize = stream.ReadInt();

            decodedTransaction.Operations = new Operation[operationssize];

            for (int i = 0; i < operationssize; i++)
            {
                decodedTransaction.Operations[i] = Operation.Decode(stream);
            }

            decodedTransaction.Ext = TransactionExt.Decode(stream);
            return(decodedTransaction);
        }
示例#4
0
        public static AccountEntry Decode(IByteReader stream)
        {
            AccountEntry decodedAccountEntry = new AccountEntry();

            decodedAccountEntry.AccountID     = AccountID.Decode(stream);
            decodedAccountEntry.Balance       = Int64.Decode(stream);
            decodedAccountEntry.SeqNum        = SequenceNumber.Decode(stream);
            decodedAccountEntry.NumSubEntries = Uint32.Decode(stream);
            int inflationDestPresent = XdrEncoding.DecodeInt32(stream);

            if (inflationDestPresent != 0)
            {
                decodedAccountEntry.InflationDest = AccountID.Decode(stream);
            }
            decodedAccountEntry.Flags      = Uint32.Decode(stream);
            decodedAccountEntry.HomeDomain = String32.Decode(stream);
            decodedAccountEntry.Thresholds = Thresholds.Decode(stream);
            int signerssize = XdrEncoding.DecodeInt32(stream);

            decodedAccountEntry.Signers = new Signer[signerssize];
            for (int i = 0; i < signerssize; i++)
            {
                decodedAccountEntry.Signers[i] = Signer.Decode(stream);
            }
            decodedAccountEntry.Ext = AccountEntryExt.Decode(stream);
            return(decodedAccountEntry);
        }
示例#5
0
        public static SetOptionsOp Decode(XdrDataInputStream stream)
        {
            var decodedSetOptionsOp  = new SetOptionsOp();
            var InflationDestPresent = stream.ReadInt();

            if (InflationDestPresent != 0)
            {
                decodedSetOptionsOp.InflationDest = AccountID.Decode(stream);
            }
            var ClearFlagsPresent = stream.ReadInt();

            if (ClearFlagsPresent != 0)
            {
                decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream);
            }
            var SetFlagsPresent = stream.ReadInt();

            if (SetFlagsPresent != 0)
            {
                decodedSetOptionsOp.SetFlags = Uint32.Decode(stream);
            }
            var MasterWeightPresent = stream.ReadInt();

            if (MasterWeightPresent != 0)
            {
                decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream);
            }
            var LowThresholdPresent = stream.ReadInt();

            if (LowThresholdPresent != 0)
            {
                decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream);
            }
            var MedThresholdPresent = stream.ReadInt();

            if (MedThresholdPresent != 0)
            {
                decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream);
            }
            var HighThresholdPresent = stream.ReadInt();

            if (HighThresholdPresent != 0)
            {
                decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream);
            }
            var HomeDomainPresent = stream.ReadInt();

            if (HomeDomainPresent != 0)
            {
                decodedSetOptionsOp.HomeDomain = String32.Decode(stream);
            }
            var SignerPresent = stream.ReadInt();

            if (SignerPresent != 0)
            {
                decodedSetOptionsOp.Signer = Signer.Decode(stream);
            }
            return(decodedSetOptionsOp);
        }
示例#6
0
            public static OperationBody Decode(XdrDataInputStream stream)
            {
                OperationBody decodedOperationBody = new OperationBody();
                OperationType discriminant         = OperationType.Decode(stream);

                decodedOperationBody.Discriminant = discriminant;

                switch (decodedOperationBody.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    decodedOperationBody.CreateAccountOp = CreateAccountOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    decodedOperationBody.PaymentOp = PaymentOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT:
                    decodedOperationBody.PathPaymentOp = PathPaymentOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_OFFER:
                    decodedOperationBody.ManageOfferOp = ManageOfferOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
                    decodedOperationBody.CreatePassiveOfferOp = CreatePassiveOfferOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    decodedOperationBody.SetOptionsOp = SetOptionsOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    decodedOperationBody.ChangeTrustOp = ChangeTrustOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    decodedOperationBody.AllowTrustOp = AllowTrustOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    decodedOperationBody.Destination = AccountID.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    decodedOperationBody.ManageDataOp = ManageDataOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    decodedOperationBody.BumpSequenceOp = BumpSequenceOp.Decode(stream);
                    break;
                }

                return(decodedOperationBody);
            }
示例#7
0
        public static SetOptionsOp Decode(IByteReader stream)
        {
            SetOptionsOp decodedSetOptionsOp  = new SetOptionsOp();
            int          inflationDestPresent = XdrEncoding.DecodeInt32(stream);

            if (inflationDestPresent != 0)
            {
                decodedSetOptionsOp.InflationDest = AccountID.Decode(stream);
            }
            int clearFlagsPresent = XdrEncoding.DecodeInt32(stream);

            if (clearFlagsPresent != 0)
            {
                decodedSetOptionsOp.ClearFlags = Uint32.Decode(stream);
            }
            int setFlagsPresent = XdrEncoding.DecodeInt32(stream);

            if (setFlagsPresent != 0)
            {
                decodedSetOptionsOp.SetFlags = Uint32.Decode(stream);
            }
            int masterWeightPresent = XdrEncoding.DecodeInt32(stream);

            if (masterWeightPresent != 0)
            {
                decodedSetOptionsOp.MasterWeight = Uint32.Decode(stream);
            }
            int lowThresholdPresent = XdrEncoding.DecodeInt32(stream);

            if (lowThresholdPresent != 0)
            {
                decodedSetOptionsOp.LowThreshold = Uint32.Decode(stream);
            }
            int medThresholdPresent = XdrEncoding.DecodeInt32(stream);

            if (medThresholdPresent != 0)
            {
                decodedSetOptionsOp.MedThreshold = Uint32.Decode(stream);
            }
            int highThresholdPresent = XdrEncoding.DecodeInt32(stream);

            if (highThresholdPresent != 0)
            {
                decodedSetOptionsOp.HighThreshold = Uint32.Decode(stream);
            }
            int homeDomainPresent = XdrEncoding.DecodeInt32(stream);

            if (homeDomainPresent != 0)
            {
                decodedSetOptionsOp.HomeDomain = String32.Decode(stream);
            }
            int signerPresent = XdrEncoding.DecodeInt32(stream);

            if (signerPresent != 0)
            {
                decodedSetOptionsOp.Signer = Signer.Decode(stream);
            }
            return(decodedSetOptionsOp);
        }
        public static InflationPayout Decode(XdrDataInputStream stream)
        {
            var decodedInflationPayout = new InflationPayout();

            decodedInflationPayout.Destination = AccountID.Decode(stream);
            decodedInflationPayout.Amount      = Int64.Decode(stream);
            return(decodedInflationPayout);
        }
示例#9
0
            public static ClaimantV0 Decode(XdrDataInputStream stream)
            {
                ClaimantV0 decodedClaimantV0 = new ClaimantV0();

                decodedClaimantV0.Destination = AccountID.Decode(stream);
                decodedClaimantV0.Predicate   = ClaimPredicate.Decode(stream);
                return(decodedClaimantV0);
            }
示例#10
0
            public static LedgerKeyData Decode(IByteReader stream)
            {
                LedgerKeyData decodedLedgerKeyData = new LedgerKeyData();

                decodedLedgerKeyData.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyData.DataName  = String64.Decode(stream);
                return(decodedLedgerKeyData);
            }
示例#11
0
            public static LedgerKeyOffer Decode(IByteReader stream)
            {
                LedgerKeyOffer decodedLedgerKeyOffer = new LedgerKeyOffer();

                decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream);
                decodedLedgerKeyOffer.OfferID  = Uint64.Decode(stream);
                return(decodedLedgerKeyOffer);
            }
示例#12
0
        public static CreateAccountOp Decode(IByteReader stream)
        {
            CreateAccountOp decodedCreateAccountOp = new CreateAccountOp();

            decodedCreateAccountOp.Destination     = AccountID.Decode(stream);
            decodedCreateAccountOp.StartingBalance = Int64.Decode(stream);
            return(decodedCreateAccountOp);
        }
            public static RevokeSponsorshipOpSigner Decode(XdrDataInputStream stream)
            {
                RevokeSponsorshipOpSigner decodedRevokeSponsorshipOpSigner = new RevokeSponsorshipOpSigner();

                decodedRevokeSponsorshipOpSigner.AccountID = AccountID.Decode(stream);
                decodedRevokeSponsorshipOpSigner.SignerKey = SignerKey.Decode(stream);
                return(decodedRevokeSponsorshipOpSigner);
            }
示例#14
0
        public static Signer Decode(IByteReader stream)
        {
            Signer decodedSigner = new Signer();

            decodedSigner.PubKey = AccountID.Decode(stream);
            decodedSigner.Weight = Uint32.Decode(stream);
            return(decodedSigner);
        }
示例#15
0
            public static AssetAlphaNum12 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum12 decodedAssetAlphaNum12 = new AssetAlphaNum12();

                decodedAssetAlphaNum12.AssetCode = AssetCode12.Decode(stream);
                decodedAssetAlphaNum12.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum12);
            }
示例#16
0
        public static InflationPayout Decode(IByteReader stream)
        {
            InflationPayout decodedInflationPayout = new InflationPayout();

            decodedInflationPayout.Destination = AccountID.Decode(stream);
            decodedInflationPayout.Amount      = Int64.Decode(stream);
            return(decodedInflationPayout);
        }
        public static CreateAccountOp Decode(XdrDataInputStream stream)
        {
            CreateAccountOp decodedCreateAccountOp = new CreateAccountOp();

            decodedCreateAccountOp.Destination     = AccountID.Decode(stream);
            decodedCreateAccountOp.StartingBalance = Int64.Decode(stream);
            return(decodedCreateAccountOp);
        }
示例#18
0
            public static LedgerKeyOffer Decode(XdrDataInputStream stream)
            {
                var decodedLedgerKeyOffer = new LedgerKeyOffer();

                decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream);
                decodedLedgerKeyOffer.OfferID  = Uint64.Decode(stream);
                return(decodedLedgerKeyOffer);
            }
示例#19
0
            public static AssetAlphaNum4 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum4 decodedAssetAlphaNum4 = new AssetAlphaNum4();

                decodedAssetAlphaNum4.AssetCode = AssetCode4.Decode(stream);
                decodedAssetAlphaNum4.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum4);
            }
示例#20
0
            public static LedgerKeyData Decode(XdrDataInputStream stream)
            {
                var decodedLedgerKeyData = new LedgerKeyData();

                decodedLedgerKeyData.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyData.DataName  = String64.Decode(stream);
                return(decodedLedgerKeyData);
            }
示例#21
0
            public static LedgerKeyTrustLine Decode(XdrDataInputStream stream)
            {
                var decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();

                decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyTrustLine.Asset     = Asset.Decode(stream);
                return(decodedLedgerKeyTrustLine);
            }
示例#22
0
            public static LedgerKeyTrustLine Decode(IByteReader stream)
            {
                LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();

                decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyTrustLine.Asset     = Asset.Decode(stream);
                return(decodedLedgerKeyTrustLine);
            }
示例#23
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);
            }
示例#24
0
        public static PaymentOp Decode(XdrDataInputStream stream)
        {
            var decodedPaymentOp = new PaymentOp();

            decodedPaymentOp.Destination = AccountID.Decode(stream);
            decodedPaymentOp.Asset       = Asset.Decode(stream);
            decodedPaymentOp.Amount      = Int64.Decode(stream);
            return(decodedPaymentOp);
        }
示例#25
0
        public static SimplePaymentResult Decode(IByteReader stream)
        {
            SimplePaymentResult decodedSimplePaymentResult = new SimplePaymentResult();

            decodedSimplePaymentResult.Destination = AccountID.Decode(stream);
            decodedSimplePaymentResult.Asset       = Asset.Decode(stream);
            decodedSimplePaymentResult.Amount      = Int64.Decode(stream);
            return(decodedSimplePaymentResult);
        }
        public static SimplePaymentResult Decode(XdrDataInputStream stream)
        {
            SimplePaymentResult decodedSimplePaymentResult = new SimplePaymentResult();

            decodedSimplePaymentResult.Destination = AccountID.Decode(stream);
            decodedSimplePaymentResult.Asset       = Asset.Decode(stream);
            decodedSimplePaymentResult.Amount      = Int64.Decode(stream);
            return(decodedSimplePaymentResult);
        }
示例#27
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);
            }
示例#28
0
        public static PaymentOp Decode(IByteReader stream)
        {
            PaymentOp decodedPaymentOp = new PaymentOp();

            decodedPaymentOp.Destination = AccountID.Decode(stream);
            decodedPaymentOp.Asset       = Asset.Decode(stream);
            decodedPaymentOp.Amount      = Int64.Decode(stream);
            return(decodedPaymentOp);
        }
示例#29
0
        public static AllowTrustOp Decode(IByteReader stream)
        {
            AllowTrustOp decodedAllowTrustOp = new AllowTrustOp();

            decodedAllowTrustOp.Trustor   = AccountID.Decode(stream);
            decodedAllowTrustOp.Asset     = AllowTrustOpAsset.Decode(stream);
            decodedAllowTrustOp.Authorize = XdrEncoding.ReadBool(stream);
            return(decodedAllowTrustOp);
        }
示例#30
0
        public static AllowTrustOp Decode(XdrDataInputStream stream)
        {
            AllowTrustOp decodedAllowTrustOp = new AllowTrustOp();

            decodedAllowTrustOp.Trustor   = AccountID.Decode(stream);
            decodedAllowTrustOp.Asset     = AllowTrustOpAsset.Decode(stream);
            decodedAllowTrustOp.Authorize = stream.ReadInt() == 1 ? true : false;
            return(decodedAllowTrustOp);
        }