public static void Encode(XdrDataOutputStream stream, SetTrustLineFlagsOp encodedSetTrustLineFlagsOp)
 {
     AccountID.Encode(stream, encodedSetTrustLineFlagsOp.Trustor);
     Asset.Encode(stream, encodedSetTrustLineFlagsOp.Asset);
     Uint32.Encode(stream, encodedSetTrustLineFlagsOp.ClearFlags);
     Uint32.Encode(stream, encodedSetTrustLineFlagsOp.SetFlags);
 }
 public static void Encode(XdrDataOutputStream stream, DataEntry encodedDataEntry)
 {
     AccountID.Encode(stream, encodedDataEntry.AccountID);
     String64.Encode(stream, encodedDataEntry.DataName);
     DataValue.Encode(stream, encodedDataEntry.DataValue);
     DataEntryExt.Encode(stream, encodedDataEntry.Ext);
 }
        public static void Encode(XdrDataOutputStream stream, Transaction encodedTransaction)
        {
            AccountID.Encode(stream, encodedTransaction.SourceAccount);
            Uint32.Encode(stream, encodedTransaction.Fee);
            SequenceNumber.Encode(stream, encodedTransaction.SeqNum);
            if (encodedTransaction.TimeBounds != null)
            {
                stream.WriteInt(1);
                TimeBounds.Encode(stream, encodedTransaction.TimeBounds);
            }
            else
            {
                stream.WriteInt(0);
            }

            Memo.Encode(stream, encodedTransaction.Memo);
            int operationssize = encodedTransaction.Operations.Length;

            stream.WriteInt(operationssize);
            for (int i = 0; i < operationssize; i++)
            {
                Operation.Encode(stream, encodedTransaction.Operations[i]);
            }

            TransactionExt.Encode(stream, encodedTransaction.Ext);
        }
Example #4
0
        public static void Encode(XdrDataOutputStream stream, AccountEntry encodedAccountEntry)
        {
            AccountID.Encode(stream, encodedAccountEntry.AccountID);
            Int64.Encode(stream, encodedAccountEntry.Balance);
            SequenceNumber.Encode(stream, encodedAccountEntry.SeqNum);
            Uint32.Encode(stream, encodedAccountEntry.NumSubEntries);
            if (encodedAccountEntry.InflationDest != null)
            {
                stream.WriteInt(1);
                AccountID.Encode(stream, encodedAccountEntry.InflationDest);
            }
            else
            {
                stream.WriteInt(0);
            }
            Uint32.Encode(stream, encodedAccountEntry.Flags);
            String32.Encode(stream, encodedAccountEntry.HomeDomain);
            Thresholds.Encode(stream, encodedAccountEntry.Thresholds);
            int signerssize = encodedAccountEntry.Signers.Length;

            stream.WriteInt(signerssize);
            for (int i = 0; i < signerssize; i++)
            {
                Signer.Encode(stream, encodedAccountEntry.Signers[i]);
            }
            AccountEntryExt.Encode(stream, encodedAccountEntry.Ext);
        }
Example #5
0
            public static void Encode(XdrDataOutputStream stream, AssetAlphaNum12 encodedAssetAlphaNum12)
            {
                int assetCodesize = encodedAssetAlphaNum12.AssetCode.Length;

                stream.Write(encodedAssetAlphaNum12.AssetCode, 0, assetCodesize);
                AccountID.Encode(stream, encodedAssetAlphaNum12.Issuer);
            }
Example #6
0
            public static void Encode(XdrDataOutputStream stream, OperationBody encodedOperationBody)
            {
                stream.WriteInt((int)encodedOperationBody.Discriminant.InnerValue);
                switch (encodedOperationBody.Discriminant.InnerValue)
                {
                case OperationType.OperationTypeEnum.CREATE_ACCOUNT:
                    CreateAccountOp.Encode(stream, encodedOperationBody.CreateAccountOp);
                    break;

                case OperationType.OperationTypeEnum.PAYMENT:
                    PaymentOp.Encode(stream, encodedOperationBody.PaymentOp);
                    break;

                case OperationType.OperationTypeEnum.PATH_PAYMENT:
                    PathPaymentOp.Encode(stream, encodedOperationBody.PathPaymentOp);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_SELL_OFFER:
                    ManageSellOfferOp.Encode(stream, encodedOperationBody.ManageSellOfferOp);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_SELL_OFFER:
                    CreatePassiveSellOfferOp.Encode(stream, encodedOperationBody.CreatePassiveSellOfferOp);
                    break;

                case OperationType.OperationTypeEnum.SET_OPTIONS:
                    SetOptionsOp.Encode(stream, encodedOperationBody.SetOptionsOp);
                    break;

                case OperationType.OperationTypeEnum.CHANGE_TRUST:
                    ChangeTrustOp.Encode(stream, encodedOperationBody.ChangeTrustOp);
                    break;

                case OperationType.OperationTypeEnum.ALLOW_TRUST:
                    AllowTrustOp.Encode(stream, encodedOperationBody.AllowTrustOp);
                    break;

                case OperationType.OperationTypeEnum.ACCOUNT_MERGE:
                    AccountID.Encode(stream, encodedOperationBody.Destination);
                    break;

                case OperationType.OperationTypeEnum.INFLATION:
                    break;

                case OperationType.OperationTypeEnum.MANAGE_DATA:
                    ManageDataOp.Encode(stream, encodedOperationBody.ManageDataOp);
                    break;

                case OperationType.OperationTypeEnum.BUMP_SEQUENCE:
                    BumpSequenceOp.Encode(stream, encodedOperationBody.BumpSequenceOp);
                    break;

                case OperationType.OperationTypeEnum.MANAGE_BUY_OFFER:
                    ManageBuyOfferOp.Encode(stream, encodedOperationBody.ManageBuyOfferOp);
                    break;
                }
            }
Example #7
0
 public static void Encode(XdrDataOutputStream stream, ClaimOfferAtom encodedClaimOfferAtom)
 {
     AccountID.Encode(stream, encodedClaimOfferAtom.SellerID);
     Int64.Encode(stream, encodedClaimOfferAtom.OfferID);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetSold);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountSold);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetBought);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountBought);
 }
Example #8
0
 public static void Encode(XdrDataOutputStream stream, TrustLineEntry encodedTrustLineEntry)
 {
     AccountID.Encode(stream, encodedTrustLineEntry.AccountID);
     Asset.Encode(stream, encodedTrustLineEntry.Asset);
     Int64.Encode(stream, encodedTrustLineEntry.Balance);
     Int64.Encode(stream, encodedTrustLineEntry.Limit);
     Uint32.Encode(stream, encodedTrustLineEntry.Flags);
     TrustLineEntryExt.Encode(stream, encodedTrustLineEntry.Ext);
 }
Example #9
0
 public static void Encode(XdrDataOutputStream stream, OfferEntry encodedOfferEntry)
 {
     AccountID.Encode(stream, encodedOfferEntry.SellerID);
     Int64.Encode(stream, encodedOfferEntry.OfferID);
     Asset.Encode(stream, encodedOfferEntry.Selling);
     Asset.Encode(stream, encodedOfferEntry.Buying);
     Int64.Encode(stream, encodedOfferEntry.Amount);
     Price.Encode(stream, encodedOfferEntry.Price);
     Uint32.Encode(stream, encodedOfferEntry.Flags);
     OfferEntryExt.Encode(stream, encodedOfferEntry.Ext);
 }
 public static void Encode(XdrDataOutputStream stream, SponsorshipDescriptor encodedSponsorshipDescriptor)
 {
     if (encodedSponsorshipDescriptor.InnerValue != null)
     {
         stream.WriteInt(1);
         AccountID.Encode(stream, encodedSponsorshipDescriptor.InnerValue);
     }
     else
     {
         stream.WriteInt(0);
     }
 }
Example #11
0
 public static void Encode(XdrDataOutputStream stream, Operation encodedOperation)
 {
     if (encodedOperation.SourceAccount != null)
     {
         stream.WriteInt(1);
         AccountID.Encode(stream, encodedOperation.SourceAccount);
     }
     else
     {
         stream.WriteInt(0);
     }
     OperationBody.Encode(stream, encodedOperation.Body);
 }
        public static void Encode(XdrDataOutputStream stream, PathPaymentStrictReceiveOp encodedPathPaymentStrictReceiveOp)
        {
            Asset.Encode(stream, encodedPathPaymentStrictReceiveOp.SendAsset);
            Int64.Encode(stream, encodedPathPaymentStrictReceiveOp.SendMax);
            AccountID.Encode(stream, encodedPathPaymentStrictReceiveOp.Destination);
            Asset.Encode(stream, encodedPathPaymentStrictReceiveOp.DestAsset);
            Int64.Encode(stream, encodedPathPaymentStrictReceiveOp.DestAmount);
            int pathsize = encodedPathPaymentStrictReceiveOp.Path.Length;

            stream.WriteInt(pathsize);
            for (int i = 0; i < pathsize; i++)
            {
                Asset.Encode(stream, encodedPathPaymentStrictReceiveOp.Path[i]);
            }
        }
        public static void Encode(XdrDataOutputStream stream, SetOptionsOp encodedSetOptionsOp)
        {
            if (encodedSetOptionsOp.InflationDest != null)
            {
                stream.WriteInt(1);
                AccountID.Encode(stream, encodedSetOptionsOp.InflationDest);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.ClearFlags != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.ClearFlags);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.SetFlags != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.SetFlags);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.MasterWeight != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.MasterWeight);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.LowThreshold != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.LowThreshold);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.MedThreshold != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.MedThreshold);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.HighThreshold != null)
            {
                stream.WriteInt(1);
                Uint32.Encode(stream, encodedSetOptionsOp.HighThreshold);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.HomeDomain != null)
            {
                stream.WriteInt(1);
                String32.Encode(stream, encodedSetOptionsOp.HomeDomain);
            }
            else
            {
                stream.WriteInt(0);
            }

            if (encodedSetOptionsOp.Signer != null)
            {
                stream.WriteInt(1);
                Signer.Encode(stream, encodedSetOptionsOp.Signer);
            }
            else
            {
                stream.WriteInt(0);
            }
        }
Example #14
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyData encodedLedgerKeyData)
 {
     AccountID.Encode(stream, encodedLedgerKeyData.AccountID);
     String64.Encode(stream, encodedLedgerKeyData.DataName);
 }
Example #15
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyOffer encodedLedgerKeyOffer)
 {
     AccountID.Encode(stream, encodedLedgerKeyOffer.SellerID);
     Int64.Encode(stream, encodedLedgerKeyOffer.OfferID);
 }
Example #16
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine)
 {
     AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID);
     Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset);
 }
 public static void Encode(XdrDataOutputStream stream, AllowTrustOp encodedAllowTrustOp)
 {
     AccountID.Encode(stream, encodedAllowTrustOp.Trustor);
     AssetCode.Encode(stream, encodedAllowTrustOp.Asset);
     Uint32.Encode(stream, encodedAllowTrustOp.Authorize);
 }
 public static void Encode(XdrDataOutputStream stream, CreateAccountOp encodedCreateAccountOp)
 {
     AccountID.Encode(stream, encodedCreateAccountOp.Destination);
     Int64.Encode(stream, encodedCreateAccountOp.StartingBalance);
 }
 public static void Encode(XdrDataOutputStream stream, SimplePaymentResult encodedSimplePaymentResult)
 {
     AccountID.Encode(stream, encodedSimplePaymentResult.Destination);
     Asset.Encode(stream, encodedSimplePaymentResult.Asset);
     Int64.Encode(stream, encodedSimplePaymentResult.Amount);
 }
 public static void Encode(XdrDataOutputStream stream, InflationPayout encodedInflationPayout)
 {
     AccountID.Encode(stream, encodedInflationPayout.Destination);
     Int64.Encode(stream, encodedInflationPayout.Amount);
 }
 public static void Encode(XdrDataOutputStream stream, BeginSponsoringFutureReservesOp encodedBeginSponsoringFutureReservesOp)
 {
     AccountID.Encode(stream, encodedBeginSponsoringFutureReservesOp.SponsoredID);
 }
Example #22
0
 public static void Encode(XdrDataOutputStream stream, RevokeSponsorshipOpSigner encodedRevokeSponsorshipOpSigner)
 {
     AccountID.Encode(stream, encodedRevokeSponsorshipOpSigner.AccountID);
     SignerKey.Encode(stream, encodedRevokeSponsorshipOpSigner.SignerKey);
 }
Example #23
0
 public static void Encode(XdrDataOutputStream stream, AssetAlphaNum12 encodedAssetAlphaNum12)
 {
     AssetCode12.Encode(stream, encodedAssetAlphaNum12.AssetCode);
     AccountID.Encode(stream, encodedAssetAlphaNum12.Issuer);
 }
Example #24
0
 public static void Encode(XdrDataOutputStream stream, PaymentOp encodedPaymentOp)
 {
     AccountID.Encode(stream, encodedPaymentOp.Destination);
     Asset.Encode(stream, encodedPaymentOp.Asset);
     Int64.Encode(stream, encodedPaymentOp.Amount);
 }
 public static void Encode(XdrDataOutputStream stream, AllowTrustOp encodedAllowTrustOp)
 {
     AccountID.Encode(stream, encodedAllowTrustOp.Trustor);
     AllowTrustOpAsset.Encode(stream, encodedAllowTrustOp.Asset);
     stream.WriteInt(encodedAllowTrustOp.Authorize ? 1 : 0);
 }
Example #26
0
 public static void Encode(XdrDataOutputStream stream, ClaimantV0 encodedClaimantV0)
 {
     AccountID.Encode(stream, encodedClaimantV0.Destination);
     ClaimPredicate.Encode(stream, encodedClaimantV0.Predicate);
 }