Example #1
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_STRICT_RECEIVE:
                    decodedOperationBody.PathPaymentStrictReceiveOp = PathPaymentStrictReceiveOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER:
                    decodedOperationBody.ManageSellOfferOp = ManageSellOfferOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER:
                    decodedOperationBody.CreatePassiveSellOfferOp = CreatePassiveSellOfferOp.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 = MuxedAccount.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;

                case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER:
                    decodedOperationBody.ManageBuyOfferOp = ManageBuyOfferOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT_STRICT_SEND:
                    decodedOperationBody.PathPaymentStrictSendOp = PathPaymentStrictSendOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CREATE_CLAIMABLE_BALANCE:
                    decodedOperationBody.CreateClaimableBalanceOp = CreateClaimableBalanceOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAIM_CLAIMABLE_BALANCE:
                    decodedOperationBody.ClaimClaimableBalanceOp = ClaimClaimableBalanceOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.BEGIN_SPONSORING_FUTURE_RESERVES:
                    decodedOperationBody.BeginSponsoringFutureReservesOp = BeginSponsoringFutureReservesOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.END_SPONSORING_FUTURE_RESERVES:
                    break;

                case OperationType.OperationTypeEnum.REVOKE_SPONSORSHIP:
                    decodedOperationBody.RevokeSponsorshipOp = RevokeSponsorshipOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK:
                    decodedOperationBody.ClawbackOp = ClawbackOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.CLAWBACK_CLAIMABLE_BALANCE:
                    decodedOperationBody.ClawbackClaimableBalanceOp = ClawbackClaimableBalanceOp.Decode(stream);
                    break;

                case OperationType.OperationTypeEnum.SET_TRUST_LINE_FLAGS:
                    decodedOperationBody.SetTrustLineFlagsOp = SetTrustLineFlagsOp.Decode(stream);
                    break;
                }
                return(decodedOperationBody);
            }