public static OperationIDId Decode(XdrDataInputStream stream)
            {
                OperationIDId decodedOperationIDId = new OperationIDId();

                decodedOperationIDId.SourceAccount = MuxedAccount.Decode(stream);
                decodedOperationIDId.SeqNum        = SequenceNumber.Decode(stream);
                decodedOperationIDId.OpNum         = Uint32.Decode(stream);
                return(decodedOperationIDId);
            }
Exemple #2
0
        public static PaymentOp Decode(XdrDataInputStream stream)
        {
            PaymentOp decodedPaymentOp = new PaymentOp();

            decodedPaymentOp.Destination = MuxedAccount.Decode(stream);
            decodedPaymentOp.Asset       = Asset.Decode(stream);
            decodedPaymentOp.Amount      = Int64.Decode(stream);
            return(decodedPaymentOp);
        }
        public static FeeBumpTransaction Decode(XdrDataInputStream stream)
        {
            FeeBumpTransaction decodedFeeBumpTransaction = new FeeBumpTransaction();

            decodedFeeBumpTransaction.FeeSource = MuxedAccount.Decode(stream);
            decodedFeeBumpTransaction.Fee       = Int64.Decode(stream);
            decodedFeeBumpTransaction.InnerTx   = FeeBumpTransactionInnerTx.Decode(stream);
            decodedFeeBumpTransaction.Ext       = FeeBumpTransactionExt.Decode(stream);
            return(decodedFeeBumpTransaction);
        }
Exemple #4
0
        public static Operation Decode(XdrDataInputStream stream)
        {
            Operation decodedOperation     = new Operation();
            int       SourceAccountPresent = stream.ReadInt();

            if (SourceAccountPresent != 0)
            {
                decodedOperation.SourceAccount = MuxedAccount.Decode(stream);
            }
            decodedOperation.Body = OperationBody.Decode(stream);
            return(decodedOperation);
        }
        public static PathPaymentStrictSendOp Decode(XdrDataInputStream stream)
        {
            PathPaymentStrictSendOp decodedPathPaymentStrictSendOp = new PathPaymentStrictSendOp();

            decodedPathPaymentStrictSendOp.SendAsset   = Asset.Decode(stream);
            decodedPathPaymentStrictSendOp.SendAmount  = Int64.Decode(stream);
            decodedPathPaymentStrictSendOp.Destination = MuxedAccount.Decode(stream);
            decodedPathPaymentStrictSendOp.DestAsset   = Asset.Decode(stream);
            decodedPathPaymentStrictSendOp.DestMin     = Int64.Decode(stream);
            int pathsize = stream.ReadInt();

            decodedPathPaymentStrictSendOp.Path = new Asset[pathsize];
            for (int i = 0; i < pathsize; i++)
            {
                decodedPathPaymentStrictSendOp.Path[i] = Asset.Decode(stream);
            }
            return(decodedPathPaymentStrictSendOp);
        }
        public static Transaction Decode(XdrDataInputStream stream)
        {
            Transaction decodedTransaction = new Transaction();

            decodedTransaction.SourceAccount = MuxedAccount.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);
        }
Exemple #7
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;
                }
                return(decodedOperationBody);
            }