Esempio n. 1
0
            public static OfferEntryExt Decode(XdrDataInputStream stream)
            {
                OfferEntryExt decodedOfferEntryExt = new OfferEntryExt();
                int           discriminant         = stream.ReadInt();

                decodedOfferEntryExt.Discriminant = discriminant;

                switch (decodedOfferEntryExt.Discriminant)
                {
                case 0:
                    break;
                }

                return(decodedOfferEntryExt);
            }
Esempio n. 2
0
        public static ManageDataResult Decode(XdrDataInputStream stream)
        {
            ManageDataResult     decodedManageDataResult = new ManageDataResult();
            ManageDataResultCode discriminant            = ManageDataResultCode.Decode(stream);

            decodedManageDataResult.Discriminant = discriminant;

            switch (decodedManageDataResult.Discriminant.InnerValue)
            {
            case ManageDataResultCode.ManageDataResultCodeEnum.MANAGE_DATA_SUCCESS:
                break;
            }

            return(decodedManageDataResult);
        }
        public static SetOptionsResult Decode(XdrDataInputStream stream)
        {
            SetOptionsResult     decodedSetOptionsResult = new SetOptionsResult();
            SetOptionsResultCode discriminant            = SetOptionsResultCode.Decode(stream);

            decodedSetOptionsResult.Discriminant = discriminant;

            switch (decodedSetOptionsResult.Discriminant.InnerValue)
            {
            case SetOptionsResultCode.SetOptionsResultCodeEnum.SET_OPTIONS_SUCCESS:
                break;
            }

            return(decodedSetOptionsResult);
        }
Esempio n. 4
0
            public static LedgerHeaderExt Decode(XdrDataInputStream stream)
            {
                LedgerHeaderExt decodedLedgerHeaderExt = new LedgerHeaderExt();
                int             discriminant           = stream.ReadInt();

                decodedLedgerHeaderExt.Discriminant = discriminant;

                switch (decodedLedgerHeaderExt.Discriminant)
                {
                case 0:
                    break;
                }

                return(decodedLedgerHeaderExt);
            }
Esempio n. 5
0
        public static PaymentResult Decode(XdrDataInputStream stream)
        {
            PaymentResult     decodedPaymentResult = new PaymentResult();
            PaymentResultCode discriminant         = PaymentResultCode.Decode(stream);

            decodedPaymentResult.Discriminant = discriminant;

            switch (decodedPaymentResult.Discriminant.InnerValue)
            {
            case PaymentResultCode.PaymentResultCodeEnum.PAYMENT_SUCCESS:
                break;
            }

            return(decodedPaymentResult);
        }
Esempio n. 6
0
        public static CreateClaimableBalanceOp Decode(XdrDataInputStream stream)
        {
            CreateClaimableBalanceOp decodedCreateClaimableBalanceOp = new CreateClaimableBalanceOp();

            decodedCreateClaimableBalanceOp.Asset  = Asset.Decode(stream);
            decodedCreateClaimableBalanceOp.Amount = Int64.Decode(stream);
            int claimantssize = stream.ReadInt();

            decodedCreateClaimableBalanceOp.Claimants = new Claimant[claimantssize];
            for (int i = 0; i < claimantssize; i++)
            {
                decodedCreateClaimableBalanceOp.Claimants[i] = Claimant.Decode(stream);
            }
            return(decodedCreateClaimableBalanceOp);
        }
Esempio n. 7
0
        public static ManageOfferSuccessResult Decode(XdrDataInputStream stream)
        {
            ManageOfferSuccessResult decodedManageOfferSuccessResult = new ManageOfferSuccessResult();
            int offersClaimedsize = stream.ReadInt();

            decodedManageOfferSuccessResult.OffersClaimed = new ClaimOfferAtom[offersClaimedsize];

            for (int i = 0; i < offersClaimedsize; i++)
            {
                decodedManageOfferSuccessResult.OffersClaimed[i] = ClaimOfferAtom.Decode(stream);
            }

            decodedManageOfferSuccessResult.Offer = ManageOfferSuccessResultOffer.Decode(stream);
            return(decodedManageOfferSuccessResult);
        }
Esempio n. 8
0
        public static Hello Decode(XdrDataInputStream stream)
        {
            var decodedHello = new Hello();

            decodedHello.LedgerVersion     = Uint32.Decode(stream);
            decodedHello.OverlayVersion    = Uint32.Decode(stream);
            decodedHello.OverlayMinVersion = Uint32.Decode(stream);
            decodedHello.NetworkID         = Hash.Decode(stream);
            decodedHello.VersionStr        = stream.ReadString();
            decodedHello.ListeningPort     = stream.ReadInt();
            decodedHello.PeerID            = NodeID.Decode(stream);
            decodedHello.Cert  = AuthCert.Decode(stream);
            decodedHello.Nonce = Uint256.Decode(stream);
            return(decodedHello);
        }
Esempio n. 9
0
            public static TransactionExt Decode(XdrDataInputStream stream)
            {
                TransactionExt decodedTransactionExt = new TransactionExt();
                int            discriminant          = stream.ReadInt();

                decodedTransactionExt.Discriminant = discriminant;

                switch (decodedTransactionExt.Discriminant)
                {
                case 0:
                    break;
                }

                return(decodedTransactionExt);
            }
        public static BeginSponsoringFutureReservesResult Decode(XdrDataInputStream stream)
        {
            BeginSponsoringFutureReservesResult     decodedBeginSponsoringFutureReservesResult = new BeginSponsoringFutureReservesResult();
            BeginSponsoringFutureReservesResultCode discriminant = BeginSponsoringFutureReservesResultCode.Decode(stream);

            decodedBeginSponsoringFutureReservesResult.Discriminant = discriminant;
            switch (decodedBeginSponsoringFutureReservesResult.Discriminant.InnerValue)
            {
            case BeginSponsoringFutureReservesResultCode.BeginSponsoringFutureReservesResultCodeEnum.BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedBeginSponsoringFutureReservesResult);
        }
        public static ClaimClaimableBalanceResult Decode(XdrDataInputStream stream)
        {
            ClaimClaimableBalanceResult     decodedClaimClaimableBalanceResult = new ClaimClaimableBalanceResult();
            ClaimClaimableBalanceResultCode discriminant = ClaimClaimableBalanceResultCode.Decode(stream);

            decodedClaimClaimableBalanceResult.Discriminant = discriminant;
            switch (decodedClaimClaimableBalanceResult.Discriminant.InnerValue)
            {
            case ClaimClaimableBalanceResultCode.ClaimClaimableBalanceResultCodeEnum.CLAIM_CLAIMABLE_BALANCE_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedClaimClaimableBalanceResult);
        }
Esempio n. 12
0
        public static TransactionMetaV1 Decode(XdrDataInputStream stream)
        {
            TransactionMetaV1 decodedTransactionMetaV1 = new TransactionMetaV1();

            decodedTransactionMetaV1.TxChanges = LedgerEntryChanges.Decode(stream);
            int operationssize = stream.ReadInt();

            decodedTransactionMetaV1.Operations = new OperationMeta[operationssize];

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

            return(decodedTransactionMetaV1);
        }
        public static EndSponsoringFutureReservesResult Decode(XdrDataInputStream stream)
        {
            EndSponsoringFutureReservesResult     decodedEndSponsoringFutureReservesResult = new EndSponsoringFutureReservesResult();
            EndSponsoringFutureReservesResultCode discriminant = EndSponsoringFutureReservesResultCode.Decode(stream);

            decodedEndSponsoringFutureReservesResult.Discriminant = discriminant;
            switch (decodedEndSponsoringFutureReservesResult.Discriminant.InnerValue)
            {
            case EndSponsoringFutureReservesResultCode.EndSponsoringFutureReservesResultCodeEnum.END_SPONSORING_FUTURE_RESERVES_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedEndSponsoringFutureReservesResult);
        }
Esempio n. 14
0
        public static AllowTrustResult Decode(XdrDataInputStream stream)
        {
            var decodedAllowTrustResult = new AllowTrustResult();
            var discriminant            = AllowTrustResultCode.Decode(stream);

            decodedAllowTrustResult.Discriminant = discriminant;
            switch (decodedAllowTrustResult.Discriminant.InnerValue)
            {
            case AllowTrustResultCode.AllowTrustResultCodeEnum.ALLOW_TRUST_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedAllowTrustResult);
        }
Esempio n. 15
0
        public static RevokeSponsorshipResult Decode(XdrDataInputStream stream)
        {
            RevokeSponsorshipResult     decodedRevokeSponsorshipResult = new RevokeSponsorshipResult();
            RevokeSponsorshipResultCode discriminant = RevokeSponsorshipResultCode.Decode(stream);

            decodedRevokeSponsorshipResult.Discriminant = discriminant;
            switch (decodedRevokeSponsorshipResult.Discriminant.InnerValue)
            {
            case RevokeSponsorshipResultCode.RevokeSponsorshipResultCodeEnum.REVOKE_SPONSORSHIP_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedRevokeSponsorshipResult);
        }
        public static AccountEntryExtensionV2 Decode(XdrDataInputStream stream)
        {
            AccountEntryExtensionV2 decodedAccountEntryExtensionV2 = new AccountEntryExtensionV2();

            decodedAccountEntryExtensionV2.NumSponsored  = Uint32.Decode(stream);
            decodedAccountEntryExtensionV2.NumSponsoring = Uint32.Decode(stream);
            int signerSponsoringIDssize = stream.ReadInt();

            decodedAccountEntryExtensionV2.SignerSponsoringIDs = new SponsorshipDescriptor[signerSponsoringIDssize];
            for (int i = 0; i < signerSponsoringIDssize; i++)
            {
                decodedAccountEntryExtensionV2.SignerSponsoringIDs[i] = SponsorshipDescriptor.Decode(stream);
            }
            decodedAccountEntryExtensionV2.Ext = AccountEntryExtensionV2Ext.Decode(stream);
            return(decodedAccountEntryExtensionV2);
        }
Esempio n. 17
0
        public static OperationResult Decode(XdrDataInputStream stream)
        {
            OperationResult     decodedOperationResult = new OperationResult();
            OperationResultCode discriminant           = OperationResultCode.Decode(stream);

            decodedOperationResult.Discriminant = discriminant;

            switch (decodedOperationResult.Discriminant.InnerValue)
            {
            case OperationResultCode.OperationResultCodeEnum.opINNER:
                decodedOperationResult.Tr = OperationResultTr.Decode(stream);
                break;
            }

            return(decodedOperationResult);
        }
Esempio n. 18
0
        public static BumpSequenceResult Decode(XdrDataInputStream stream)
        {
            BumpSequenceResult     decodedBumpSequenceResult = new BumpSequenceResult();
            BumpSequenceResultCode discriminant = BumpSequenceResultCode.Decode(stream);

            decodedBumpSequenceResult.Discriminant = discriminant;
            switch (decodedBumpSequenceResult.Discriminant.InnerValue)
            {
            case BumpSequenceResultCode.BumpSequenceResultCodeEnum.BUMP_SEQUENCE_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedBumpSequenceResult);
        }
        public static AccountMergeResult Decode(XdrDataInputStream stream)
        {
            AccountMergeResult     decodedAccountMergeResult = new AccountMergeResult();
            AccountMergeResultCode discriminant = AccountMergeResultCode.Decode(stream);

            decodedAccountMergeResult.Discriminant = discriminant;

            switch (decodedAccountMergeResult.Discriminant.InnerValue)
            {
            case AccountMergeResultCode.AccountMergeResultCodeEnum.ACCOUNT_MERGE_SUCCESS:
                decodedAccountMergeResult.SourceAccountBalance = Int64.Decode(stream);
                break;
            }

            return(decodedAccountMergeResult);
        }
Esempio n. 20
0
        public static TransactionSet Decode(XdrDataInputStream stream)
        {
            TransactionSet decodedTransactionSet = new TransactionSet();

            decodedTransactionSet.PreviousLedgerHash = Hash.Decode(stream);
            int txssize = stream.ReadInt();

            decodedTransactionSet.Txs = new TransactionEnvelope[txssize];

            for (int i = 0; i < txssize; i++)
            {
                decodedTransactionSet.Txs[i] = TransactionEnvelope.Decode(stream);
            }

            return(decodedTransactionSet);
        }
Esempio n. 21
0
        public static ChangeTrustResult Decode(XdrDataInputStream stream)
        {
            ChangeTrustResult     decodedChangeTrustResult = new ChangeTrustResult();
            ChangeTrustResultCode discriminant             = ChangeTrustResultCode.Decode(stream);

            decodedChangeTrustResult.Discriminant = discriminant;
            switch (decodedChangeTrustResult.Discriminant.InnerValue)
            {
            case ChangeTrustResultCode.ChangeTrustResultCodeEnum.CHANGE_TRUST_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedChangeTrustResult);
        }
Esempio n. 22
0
        public static ManageOfferResult Decode(XdrDataInputStream stream)
        {
            ManageOfferResult     decodedManageOfferResult = new ManageOfferResult();
            ManageOfferResultCode discriminant             = ManageOfferResultCode.Decode(stream);

            decodedManageOfferResult.Discriminant = discriminant;

            switch (decodedManageOfferResult.Discriminant.InnerValue)
            {
            case ManageOfferResultCode.ManageOfferResultCodeEnum.MANAGE_OFFER_SUCCESS:
                decodedManageOfferResult.Success = ManageOfferSuccessResult.Decode(stream);
                break;
            }

            return(decodedManageOfferResult);
        }
Esempio n. 23
0
        public static LedgerSCPMessages Decode(XdrDataInputStream stream)
        {
            LedgerSCPMessages decodedLedgerSCPMessages = new LedgerSCPMessages();

            decodedLedgerSCPMessages.LedgerSeq = Uint32.Decode(stream);
            int messagessize = stream.ReadInt();

            decodedLedgerSCPMessages.Messages = new SCPEnvelope[messagessize];

            for (int i = 0; i < messagessize; i++)
            {
                decodedLedgerSCPMessages.Messages[i] = SCPEnvelope.Decode(stream);
            }

            return(decodedLedgerSCPMessages);
        }
Esempio n. 24
0
        public static StellarValue Decode(XdrDataInputStream stream)
        {
            var decodedStellarValue = new StellarValue();

            decodedStellarValue.TxSetHash = Hash.Decode(stream);
            decodedStellarValue.CloseTime = Uint64.Decode(stream);
            var upgradessize = stream.ReadInt();

            decodedStellarValue.Upgrades = new UpgradeType[upgradessize];
            for (var i = 0; i < upgradessize; i++)
            {
                decodedStellarValue.Upgrades[i] = UpgradeType.Decode(stream);
            }
            decodedStellarValue.Ext = StellarValueExt.Decode(stream);
            return(decodedStellarValue);
        }
        public static SCPHistoryEntry Decode(XdrDataInputStream stream)
        {
            SCPHistoryEntry decodedSCPHistoryEntry = new SCPHistoryEntry();
            int             discriminant           = stream.ReadInt();

            decodedSCPHistoryEntry.Discriminant = discriminant;

            switch (decodedSCPHistoryEntry.Discriminant)
            {
            case 0:
                decodedSCPHistoryEntry.V0 = SCPHistoryEntryV0.Decode(stream);
                break;
            }

            return(decodedSCPHistoryEntry);
        }
Esempio n. 26
0
        public static PublicKey Decode(XdrDataInputStream stream)
        {
            PublicKey     decodedPublicKey = new PublicKey();
            PublicKeyType discriminant     = PublicKeyType.Decode(stream);

            decodedPublicKey.Discriminant = discriminant;

            switch (decodedPublicKey.Discriminant.InnerValue)
            {
            case PublicKeyType.PublicKeyTypeEnum.PUBLIC_KEY_TYPE_ED25519:
                decodedPublicKey.Ed25519 = Uint256.Decode(stream);
                break;
            }

            return(decodedPublicKey);
        }
        public static CreateAccountResult Decode(XdrDataInputStream stream)
        {
            var decodedCreateAccountResult = new CreateAccountResult();
            var discriminant = CreateAccountResultCode.Decode(stream);

            decodedCreateAccountResult.Discriminant = discriminant;
            switch (decodedCreateAccountResult.Discriminant.InnerValue)
            {
            case CreateAccountResultCode.CreateAccountResultCodeEnum.CREATE_ACCOUNT_SUCCESS:
                break;

            default:
                break;
            }
            return(decodedCreateAccountResult);
        }
        public static AuthenticatedMessage Decode(XdrDataInputStream stream)
        {
            AuthenticatedMessage decodedAuthenticatedMessage = new AuthenticatedMessage();
            Uint32 discriminant = Uint32.Decode(stream);

            decodedAuthenticatedMessage.Discriminant = discriminant;

            switch (decodedAuthenticatedMessage.Discriminant.InnerValue)
            {
            case 0:
                decodedAuthenticatedMessage.V0 = AuthenticatedMessageV0.Decode(stream);
                break;
            }

            return(decodedAuthenticatedMessage);
        }
Esempio n. 29
0
        public static TransactionEnvelope Decode(XdrDataInputStream stream)
        {
            TransactionEnvelope decodedTransactionEnvelope = new TransactionEnvelope();

            decodedTransactionEnvelope.Tx = Transaction.Decode(stream);
            int signaturessize = stream.ReadInt();

            decodedTransactionEnvelope.Signatures = new DecoratedSignature[signaturessize];

            for (int i = 0; i < signaturessize; i++)
            {
                decodedTransactionEnvelope.Signatures[i] = DecoratedSignature.Decode(stream);
            }

            return(decodedTransactionEnvelope);
        }
        public static ClaimPredicate Decode(XdrDataInputStream stream)
        {
            ClaimPredicate     decodedClaimPredicate = new ClaimPredicate();
            ClaimPredicateType discriminant          = ClaimPredicateType.Decode(stream);

            decodedClaimPredicate.Discriminant = discriminant;
            switch (decodedClaimPredicate.Discriminant.InnerValue)
            {
            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_UNCONDITIONAL:
                break;

            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_AND:
                int andPredicatessize = stream.ReadInt();
                decodedClaimPredicate.AndPredicates = new ClaimPredicate[andPredicatessize];
                for (int i = 0; i < andPredicatessize; i++)
                {
                    decodedClaimPredicate.AndPredicates[i] = ClaimPredicate.Decode(stream);
                }
                break;

            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_OR:
                int orPredicatessize = stream.ReadInt();
                decodedClaimPredicate.OrPredicates = new ClaimPredicate[orPredicatessize];
                for (int i = 0; i < orPredicatessize; i++)
                {
                    decodedClaimPredicate.OrPredicates[i] = ClaimPredicate.Decode(stream);
                }
                break;

            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_NOT:
                int NotPredicatePresent = stream.ReadInt();
                if (NotPredicatePresent != 0)
                {
                    decodedClaimPredicate.NotPredicate = ClaimPredicate.Decode(stream);
                }
                break;

            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME:
                decodedClaimPredicate.AbsBefore = Int64.Decode(stream);
                break;

            case ClaimPredicateType.ClaimPredicateTypeEnum.CLAIM_PREDICATE_BEFORE_RELATIVE_TIME:
                decodedClaimPredicate.RelBefore = Int64.Decode(stream);
                break;
            }
            return(decodedClaimPredicate);
        }