public static BeginSponsoringFutureReservesOp Decode(XdrDataInputStream stream)
        {
            BeginSponsoringFutureReservesOp decodedBeginSponsoringFutureReservesOp = new BeginSponsoringFutureReservesOp();

            decodedBeginSponsoringFutureReservesOp.SponsoredID = AccountID.Decode(stream);
            return(decodedBeginSponsoringFutureReservesOp);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public static AccountEntry Decode(XdrDataInputStream 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 = 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);
            int signerssize = stream.ReadInt();

            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);
        }
Exemplo n.º 4
0
        public static SetOptionsOp Decode(XdrDataInputStream stream)
        {
            SetOptionsOp decodedSetOptionsOp  = new SetOptionsOp();
            int          InflationDestPresent = stream.ReadInt();

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

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

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

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

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

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

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

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

            if (SignerPresent != 0)
            {
                decodedSetOptionsOp.Signer = Signer.Decode(stream);
            }
            return(decodedSetOptionsOp);
        }
Exemplo n.º 5
0
            public static RevokeSponsorshipOpSigner Decode(XdrDataInputStream stream)
            {
                RevokeSponsorshipOpSigner decodedRevokeSponsorshipOpSigner = new RevokeSponsorshipOpSigner();

                decodedRevokeSponsorshipOpSigner.AccountID = AccountID.Decode(stream);
                decodedRevokeSponsorshipOpSigner.SignerKey = SignerKey.Decode(stream);
                return(decodedRevokeSponsorshipOpSigner);
            }
        public static InflationPayout Decode(XdrDataInputStream stream)
        {
            InflationPayout decodedInflationPayout = new InflationPayout();

            decodedInflationPayout.Destination = AccountID.Decode(stream);
            decodedInflationPayout.Amount      = Int64.Decode(stream);
            return(decodedInflationPayout);
        }
Exemplo n.º 7
0
            public static ClaimantV0 Decode(XdrDataInputStream stream)
            {
                ClaimantV0 decodedClaimantV0 = new ClaimantV0();

                decodedClaimantV0.Destination = AccountID.Decode(stream);
                decodedClaimantV0.Predicate   = ClaimPredicate.Decode(stream);
                return(decodedClaimantV0);
            }
Exemplo n.º 8
0
            public static AssetAlphaNum12 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum12 decodedAssetAlphaNum12 = new AssetAlphaNum12();

                decodedAssetAlphaNum12.AssetCode = AssetCode12.Decode(stream);
                decodedAssetAlphaNum12.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum12);
            }
        public static CreateAccountOp Decode(XdrDataInputStream stream)
        {
            CreateAccountOp decodedCreateAccountOp = new CreateAccountOp();

            decodedCreateAccountOp.Destination     = AccountID.Decode(stream);
            decodedCreateAccountOp.StartingBalance = Int64.Decode(stream);
            return(decodedCreateAccountOp);
        }
Exemplo n.º 10
0
            public static LedgerKeyTrustLine Decode(XdrDataInputStream stream)
            {
                LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();

                decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyTrustLine.Asset     = Asset.Decode(stream);
                return(decodedLedgerKeyTrustLine);
            }
Exemplo n.º 11
0
            public static LedgerKeyOffer Decode(XdrDataInputStream stream)
            {
                LedgerKeyOffer decodedLedgerKeyOffer = new LedgerKeyOffer();

                decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream);
                decodedLedgerKeyOffer.OfferID  = Int64.Decode(stream);
                return(decodedLedgerKeyOffer);
            }
Exemplo n.º 12
0
            public static AssetAlphaNum4 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum4 decodedAssetAlphaNum4 = new AssetAlphaNum4();

                decodedAssetAlphaNum4.AssetCode = AssetCode4.Decode(stream);
                decodedAssetAlphaNum4.Issuer    = AccountID.Decode(stream);
                return(decodedAssetAlphaNum4);
            }
Exemplo n.º 13
0
            public static LedgerKeyData Decode(XdrDataInputStream stream)
            {
                LedgerKeyData decodedLedgerKeyData = new LedgerKeyData();

                decodedLedgerKeyData.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyData.DataName  = String64.Decode(stream);
                return(decodedLedgerKeyData);
            }
Exemplo n.º 14
0
        public static AllowTrustOp Decode(XdrDataInputStream stream)
        {
            AllowTrustOp decodedAllowTrustOp = new AllowTrustOp();

            decodedAllowTrustOp.Trustor   = AccountID.Decode(stream);
            decodedAllowTrustOp.Asset     = AssetCode.Decode(stream);
            decodedAllowTrustOp.Authorize = Uint32.Decode(stream);
            return(decodedAllowTrustOp);
        }
Exemplo n.º 15
0
        public static PaymentOp Decode(XdrDataInputStream stream)
        {
            PaymentOp decodedPaymentOp = new PaymentOp();

            decodedPaymentOp.Destination = AccountID.Decode(stream);
            decodedPaymentOp.Asset       = Asset.Decode(stream);
            decodedPaymentOp.Amount      = Int64.Decode(stream);
            return(decodedPaymentOp);
        }
        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);
        }
Exemplo n.º 17
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);
            }
        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);
        }
        public static SetTrustLineFlagsOp Decode(XdrDataInputStream stream)
        {
            SetTrustLineFlagsOp decodedSetTrustLineFlagsOp = new SetTrustLineFlagsOp();

            decodedSetTrustLineFlagsOp.Trustor    = AccountID.Decode(stream);
            decodedSetTrustLineFlagsOp.Asset      = Asset.Decode(stream);
            decodedSetTrustLineFlagsOp.ClearFlags = Uint32.Decode(stream);
            decodedSetTrustLineFlagsOp.SetFlags   = Uint32.Decode(stream);
            return(decodedSetTrustLineFlagsOp);
        }
Exemplo n.º 20
0
            public static AssetAlphaNum4 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum4 decodedAssetAlphaNum4 = new AssetAlphaNum4();
                int            assetCodesize         = 4;

                decodedAssetAlphaNum4.AssetCode = new byte[assetCodesize];
                stream.Read(decodedAssetAlphaNum4.AssetCode, 0, assetCodesize);
                decodedAssetAlphaNum4.Issuer = AccountID.Decode(stream);
                return(decodedAssetAlphaNum4);
            }
Exemplo n.º 21
0
            public static AssetAlphaNum12 Decode(XdrDataInputStream stream)
            {
                AssetAlphaNum12 decodedAssetAlphaNum12 = new AssetAlphaNum12();
                int             assetCodesize          = 12;

                decodedAssetAlphaNum12.AssetCode = new byte[assetCodesize];
                stream.Read(decodedAssetAlphaNum12.AssetCode, 0, assetCodesize);
                decodedAssetAlphaNum12.Issuer = AccountID.Decode(stream);
                return(decodedAssetAlphaNum12);
            }
Exemplo n.º 22
0
        public static DataEntry Decode(XdrDataInputStream stream)
        {
            DataEntry decodedDataEntry = new DataEntry();

            decodedDataEntry.AccountID = AccountID.Decode(stream);
            decodedDataEntry.DataName  = String64.Decode(stream);
            decodedDataEntry.DataValue = DataValue.Decode(stream);
            decodedDataEntry.Ext       = DataEntryExt.Decode(stream);
            return(decodedDataEntry);
        }
        public static SponsorshipDescriptor Decode(XdrDataInputStream stream)
        {
            SponsorshipDescriptor decodedSponsorshipDescriptor = new SponsorshipDescriptor();
            int SponsorshipDescriptorPresent = stream.ReadInt();

            if (SponsorshipDescriptorPresent != 0)
            {
                decodedSponsorshipDescriptor.InnerValue = AccountID.Decode(stream);
            }
            return(decodedSponsorshipDescriptor);
        }
Exemplo n.º 24
0
        public static TrustLineEntry Decode(XdrDataInputStream stream)
        {
            TrustLineEntry decodedTrustLineEntry = new TrustLineEntry();

            decodedTrustLineEntry.AccountID = AccountID.Decode(stream);
            decodedTrustLineEntry.Asset     = Asset.Decode(stream);
            decodedTrustLineEntry.Balance   = Int64.Decode(stream);
            decodedTrustLineEntry.Limit     = Int64.Decode(stream);
            decodedTrustLineEntry.Flags     = Uint32.Decode(stream);
            decodedTrustLineEntry.Ext       = TrustLineEntryExt.Decode(stream);
            return(decodedTrustLineEntry);
        }
Exemplo n.º 25
0
        public static Operation Decode(XdrDataInputStream stream)
        {
            Operation decodedOperation     = new Operation();
            int       SourceAccountPresent = stream.ReadInt();

            if (SourceAccountPresent != 0)
            {
                decodedOperation.SourceAccount = AccountID.Decode(stream);
            }
            decodedOperation.Body = OperationBody.Decode(stream);
            return(decodedOperation);
        }
Exemplo n.º 26
0
        public static ClaimOfferAtom Decode(XdrDataInputStream stream)
        {
            ClaimOfferAtom decodedClaimOfferAtom = new ClaimOfferAtom();

            decodedClaimOfferAtom.SellerID     = AccountID.Decode(stream);
            decodedClaimOfferAtom.OfferID      = Int64.Decode(stream);
            decodedClaimOfferAtom.AssetSold    = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountSold   = Int64.Decode(stream);
            decodedClaimOfferAtom.AssetBought  = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountBought = Int64.Decode(stream);
            return(decodedClaimOfferAtom);
        }
Exemplo n.º 27
0
        public static OfferEntry Decode(XdrDataInputStream stream)
        {
            OfferEntry decodedOfferEntry = new OfferEntry();

            decodedOfferEntry.SellerID = AccountID.Decode(stream);
            decodedOfferEntry.OfferID  = Int64.Decode(stream);
            decodedOfferEntry.Selling  = Asset.Decode(stream);
            decodedOfferEntry.Buying   = Asset.Decode(stream);
            decodedOfferEntry.Amount   = Int64.Decode(stream);
            decodedOfferEntry.Price    = Price.Decode(stream);
            decodedOfferEntry.Flags    = Uint32.Decode(stream);
            decodedOfferEntry.Ext      = OfferEntryExt.Decode(stream);
            return(decodedOfferEntry);
        }
        public static PathPaymentStrictReceiveOp Decode(XdrDataInputStream stream)
        {
            PathPaymentStrictReceiveOp decodedPathPaymentStrictReceiveOp = new PathPaymentStrictReceiveOp();

            decodedPathPaymentStrictReceiveOp.SendAsset   = Asset.Decode(stream);
            decodedPathPaymentStrictReceiveOp.SendMax     = Int64.Decode(stream);
            decodedPathPaymentStrictReceiveOp.Destination = AccountID.Decode(stream);
            decodedPathPaymentStrictReceiveOp.DestAsset   = Asset.Decode(stream);
            decodedPathPaymentStrictReceiveOp.DestAmount  = Int64.Decode(stream);
            int pathsize = stream.ReadInt();

            decodedPathPaymentStrictReceiveOp.Path = new Asset[pathsize];
            for (int i = 0; i < pathsize; i++)
            {
                decodedPathPaymentStrictReceiveOp.Path[i] = Asset.Decode(stream);
            }
            return(decodedPathPaymentStrictReceiveOp);
        }