Example #1
0
        public static LedgerEntryExtensionV1 Decode(XdrDataInputStream stream)
        {
            LedgerEntryExtensionV1 decodedLedgerEntryExtensionV1 = new LedgerEntryExtensionV1();

            decodedLedgerEntryExtensionV1.SponsoringID = SponsorshipDescriptor.Decode(stream);
            decodedLedgerEntryExtensionV1.Ext          = LedgerEntryExtensionV1Ext.Decode(stream);
            return(decodedLedgerEntryExtensionV1);
        }
        public static SponsorshipDescriptor Decode(XdrDataInputStream stream)
        {
            SponsorshipDescriptor decodedSponsorshipDescriptor = new SponsorshipDescriptor();
            int SponsorshipDescriptorPresent = stream.ReadInt();

            if (SponsorshipDescriptorPresent != 0)
            {
                decodedSponsorshipDescriptor.InnerValue = AccountID.Decode(stream);
            }
            return(decodedSponsorshipDescriptor);
        }
 public static void Encode(XdrDataOutputStream stream, SponsorshipDescriptor encodedSponsorshipDescriptor)
 {
     if (encodedSponsorshipDescriptor.InnerValue != null)
     {
         stream.WriteInt(1);
         AccountID.Encode(stream, encodedSponsorshipDescriptor.InnerValue);
     }
     else
     {
         stream.WriteInt(0);
     }
 }
        public static void Encode(XdrDataOutputStream stream, AccountEntryExtensionV2 encodedAccountEntryExtensionV2)
        {
            Uint32.Encode(stream, encodedAccountEntryExtensionV2.NumSponsored);
            Uint32.Encode(stream, encodedAccountEntryExtensionV2.NumSponsoring);
            int signerSponsoringIDssize = encodedAccountEntryExtensionV2.SignerSponsoringIDs.Length;

            stream.WriteInt(signerSponsoringIDssize);
            for (int i = 0; i < signerSponsoringIDssize; i++)
            {
                SponsorshipDescriptor.Encode(stream, encodedAccountEntryExtensionV2.SignerSponsoringIDs[i]);
            }
            AccountEntryExtensionV2Ext.Encode(stream, encodedAccountEntryExtensionV2.Ext);
        }
        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);
        }
Example #6
0
 public static void Encode(XdrDataOutputStream stream, LedgerEntryExtensionV1 encodedLedgerEntryExtensionV1)
 {
     SponsorshipDescriptor.Encode(stream, encodedLedgerEntryExtensionV1.SponsoringID);
     LedgerEntryExtensionV1Ext.Encode(stream, encodedLedgerEntryExtensionV1.Ext);
 }