Ejemplo n.º 1
0
            public static LedgerEntryData Decode(IByteReader stream)
            {
                LedgerEntryData decodedLedgerEntryData = new LedgerEntryData();

                decodedLedgerEntryData.Discriminant = LedgerEntryType.Decode(stream);
                switch (decodedLedgerEntryData.Discriminant.InnerValue)
                {
                case LedgerEntryType.LedgerEntryTypeEnum.ACCOUNT:
                    decodedLedgerEntryData.Account = AccountEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.TRUSTLINE:
                    decodedLedgerEntryData.TrustLine = TrustLineEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.OFFER:
                    decodedLedgerEntryData.Offer = OfferEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.DATA:
                    decodedLedgerEntryData.Data = DataEntry.Decode(stream);
                    break;
                }
                return(decodedLedgerEntryData);
            }
Ejemplo n.º 2
0
            public static LedgerEntryData Decode(XdrDataInputStream stream)
            {
                LedgerEntryData decodedLedgerEntryData = new LedgerEntryData();
                LedgerEntryType discriminant           = LedgerEntryType.Decode(stream);

                decodedLedgerEntryData.Discriminant = discriminant;
                switch (decodedLedgerEntryData.Discriminant.InnerValue)
                {
                case LedgerEntryType.LedgerEntryTypeEnum.ACCOUNT:
                    decodedLedgerEntryData.Account = AccountEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.TRUSTLINE:
                    decodedLedgerEntryData.TrustLine = TrustLineEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.OFFER:
                    decodedLedgerEntryData.Offer = OfferEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.DATA:
                    decodedLedgerEntryData.Data = DataEntry.Decode(stream);
                    break;

                case LedgerEntryType.LedgerEntryTypeEnum.CLAIMABLE_BALANCE:
                    decodedLedgerEntryData.ClaimableBalance = ClaimableBalanceEntry.Decode(stream);
                    break;
                }
                return(decodedLedgerEntryData);
            }
Ejemplo n.º 3
0
            public static ManageOfferSuccessResultOffer Decode(IByteReader stream)
            {
                ManageOfferSuccessResultOffer decodedManageOfferSuccessResultOffer = new ManageOfferSuccessResultOffer();

                decodedManageOfferSuccessResultOffer.Discriminant = ManageOfferEffect.Decode(stream);
                switch (decodedManageOfferSuccessResultOffer.Discriminant.InnerValue)
                {
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_CREATED:
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_UPDATED:
                    decodedManageOfferSuccessResultOffer.Offer = OfferEntry.Decode(stream);
                    break;

                default:
                    break;
                }
                return(decodedManageOfferSuccessResultOffer);
            }
Ejemplo n.º 4
0
            public static ManageOfferSuccessResultOffer Decode(XdrDataInputStream stream)
            {
                ManageOfferSuccessResultOffer decodedManageOfferSuccessResultOffer =
                    new ManageOfferSuccessResultOffer();
                ManageOfferEffect discriminant = ManageOfferEffect.Decode(stream);

                decodedManageOfferSuccessResultOffer.Discriminant = discriminant;

                switch (decodedManageOfferSuccessResultOffer.Discriminant.InnerValue)
                {
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_CREATED:
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_UPDATED:
                    decodedManageOfferSuccessResultOffer.Offer = OfferEntry.Decode(stream);
                    break;
                }

                return(decodedManageOfferSuccessResultOffer);
            }