Пример #1
0
 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);
 }
Пример #2
0
            public static void Encode(XdrDataOutputStream stream, AssetAlphaNum4 encodedAssetAlphaNum4)
            {
                var assetCodesize = encodedAssetAlphaNum4.AssetCode.Length;

                stream.Write(encodedAssetAlphaNum4.AssetCode, 0, assetCodesize);
                AccountID.Encode(stream, encodedAssetAlphaNum4.Issuer);
            }
Пример #3
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);
        }
Пример #4
0
        public static void Encode(IByteWriter 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)
            {
                XdrEncoding.EncodeInt32(1, stream);
                AccountID.Encode(stream, encodedAccountEntry.InflationDest);
            }
            else
            {
                XdrEncoding.EncodeInt32(0, stream);
            }
            Uint32.Encode(stream, encodedAccountEntry.Flags);
            String32.Encode(stream, encodedAccountEntry.HomeDomain);
            Thresholds.Encode(stream, encodedAccountEntry.Thresholds);
            int signerssize = encodedAccountEntry.Signers.Length;

            XdrEncoding.EncodeInt32(signerssize, stream);
            for (int i = 0; i < signerssize; i++)
            {
                Signer.Encode(stream, encodedAccountEntry.Signers[i]);
            }
            AccountEntryExt.Encode(stream, encodedAccountEntry.Ext);
        }
Пример #5
0
        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);
        }
Пример #6
0
            public static void Encode(IByteWriter stream, AssetAlphaNum4 encodedAssetAlphaNum4)
            {
                int assetCodesize = encodedAssetAlphaNum4.AssetCode.Length;

                XdrEncoding.WriteFixOpaque(stream, (uint)assetCodesize, encodedAssetAlphaNum4.AssetCode);
                AccountID.Encode(stream, encodedAssetAlphaNum4.Issuer);
            }
Пример #7
0
 public static void Encode(IByteWriter stream, DataEntry encodedDataEntry)
 {
     AccountID.Encode(stream, encodedDataEntry.AccountID);
     String64.Encode(stream, encodedDataEntry.DataName);
     DataValue.Encode(stream, encodedDataEntry.DataValue);
     DataEntryExt.Encode(stream, encodedDataEntry.Ext);
 }
Пример #8
0
 public static void Encode(IByteWriter 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);
 }
Пример #9
0
 public static void Encode(IByteWriter stream, ClaimOfferAtom encodedClaimOfferAtom)
 {
     AccountID.Encode(stream, encodedClaimOfferAtom.SellerID);
     Uint64.Encode(stream, encodedClaimOfferAtom.OfferID);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetSold);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountSold);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetBought);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountBought);
 }
Пример #10
0
 public static void Encode(XdrDataOutputStream stream, ClaimOfferAtom encodedClaimOfferAtom)
 {
     AccountID.Encode(stream, encodedClaimOfferAtom.SellerID);
     Uint64.Encode(stream, encodedClaimOfferAtom.OfferID);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetSold);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountSold);
     Asset.Encode(stream, encodedClaimOfferAtom.AssetBought);
     Int64.Encode(stream, encodedClaimOfferAtom.AmountBought);
 }
Пример #11
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_OFFER:
                    ManageOfferOp.Encode(stream, encodedOperationBody.ManageOfferOp);
                    break;

                case OperationType.OperationTypeEnum.CREATE_PASSIVE_OFFER:
                    CreatePassiveOfferOp.Encode(stream, encodedOperationBody.CreatePassiveOfferOp);
                    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;
                }
            }
Пример #12
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);
     }
 }
Пример #14
0
 public static void Encode(IByteWriter stream, Operation encodedOperation)
 {
     if (encodedOperation.SourceAccount != null)
     {
         XdrEncoding.EncodeInt32(1, stream);
         AccountID.Encode(stream, encodedOperation.SourceAccount);
     }
     else
     {
         XdrEncoding.EncodeInt32(0, stream);
     }
     OperationBody.Encode(stream, encodedOperation.Body);
 }
Пример #15
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);
 }
Пример #16
0
        public static void Encode(XdrDataOutputStream stream, PathPaymentOp encodedPathPaymentOp)
        {
            Asset.Encode(stream, encodedPathPaymentOp.SendAsset);
            Int64.Encode(stream, encodedPathPaymentOp.SendMax);
            AccountID.Encode(stream, encodedPathPaymentOp.Destination);
            Asset.Encode(stream, encodedPathPaymentOp.DestAsset);
            Int64.Encode(stream, encodedPathPaymentOp.DestAmount);
            var pathsize = encodedPathPaymentOp.Path.Length;

            stream.WriteInt(pathsize);
            for (var i = 0; i < pathsize; i++)
            {
                Asset.Encode(stream, encodedPathPaymentOp.Path[i]);
            }
        }
Пример #17
0
        public static void Encode(IByteWriter stream, PathPaymentOp encodedPathPaymentOp)
        {
            Asset.Encode(stream, encodedPathPaymentOp.SendAsset);
            Int64.Encode(stream, encodedPathPaymentOp.SendMax);
            AccountID.Encode(stream, encodedPathPaymentOp.Destination);
            Asset.Encode(stream, encodedPathPaymentOp.DestAsset);
            Int64.Encode(stream, encodedPathPaymentOp.DestAmount);
            int pathsize = encodedPathPaymentOp.Path.Length;

            XdrEncoding.EncodeInt32(pathsize, stream);
            for (int i = 0; i < pathsize; i++)
            {
                Asset.Encode(stream, encodedPathPaymentOp.Path[i]);
            }
        }
Пример #18
0
        public static void Encode(IByteWriter stream, Transaction encodedTransaction)
        {
            AccountID.Encode(stream, encodedTransaction.SourceAccount);
            Uint32.Encode(stream, encodedTransaction.Fee);
            SequenceNumber.Encode(stream, encodedTransaction.SeqNum);
            if (encodedTransaction.TimeBounds != null)
            {
                XdrEncoding.EncodeInt32(1, stream);
                TimeBounds.Encode(stream, encodedTransaction.TimeBounds);
            }
            else
            {
                XdrEncoding.EncodeInt32(0, stream);
            }
            Memo.Encode(stream, encodedTransaction.Memo);
            int operationssize = encodedTransaction.Operations.Length;

            XdrEncoding.EncodeInt32(operationssize, stream);
            for (int i = 0; i < operationssize; i++)
            {
                Operation.Encode(stream, encodedTransaction.Operations[i]);
            }
            TransactionExt.Encode(stream, encodedTransaction.Ext);
        }
Пример #19
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyData encodedLedgerKeyData)
 {
     AccountID.Encode(stream, encodedLedgerKeyData.AccountID);
     String64.Encode(stream, encodedLedgerKeyData.DataName);
 }
 public static void Encode(XdrDataOutputStream stream, CreateAccountOp encodedCreateAccountOp)
 {
     AccountID.Encode(stream, encodedCreateAccountOp.Destination);
     Int64.Encode(stream, encodedCreateAccountOp.StartingBalance);
 }
Пример #21
0
 public static void Encode(IByteWriter stream, AllowTrustOp encodedAllowTrustOp)
 {
     AccountID.Encode(stream, encodedAllowTrustOp.Trustor);
     AllowTrustOpAsset.Encode(stream, encodedAllowTrustOp.Asset);
     XdrEncoding.WriteBool(stream, encodedAllowTrustOp.Authorize);
 }
Пример #22
0
 public static void Encode(IByteWriter stream, SimplePaymentResult encodedSimplePaymentResult)
 {
     AccountID.Encode(stream, encodedSimplePaymentResult.Destination);
     Asset.Encode(stream, encodedSimplePaymentResult.Asset);
     Int64.Encode(stream, encodedSimplePaymentResult.Amount);
 }
Пример #23
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyOffer encodedLedgerKeyOffer)
 {
     AccountID.Encode(stream, encodedLedgerKeyOffer.SellerID);
     Uint64.Encode(stream, encodedLedgerKeyOffer.OfferID);
 }
 public static void Encode(XdrDataOutputStream stream, SimplePaymentResult encodedSimplePaymentResult)
 {
     AccountID.Encode(stream, encodedSimplePaymentResult.Destination);
     Asset.Encode(stream, encodedSimplePaymentResult.Asset);
     Int64.Encode(stream, encodedSimplePaymentResult.Amount);
 }
Пример #25
0
 public static void Encode(IByteWriter stream, CreateAccountOp encodedCreateAccountOp)
 {
     AccountID.Encode(stream, encodedCreateAccountOp.Destination);
     Int64.Encode(stream, encodedCreateAccountOp.StartingBalance);
 }
Пример #26
0
 public static void Encode(XdrDataOutputStream stream, PaymentOp encodedPaymentOp)
 {
     AccountID.Encode(stream, encodedPaymentOp.Destination);
     Asset.Encode(stream, encodedPaymentOp.Asset);
     Int64.Encode(stream, encodedPaymentOp.Amount);
 }
Пример #27
0
 public static void Encode(IByteWriter stream, InflationPayout encodedInflationPayout)
 {
     AccountID.Encode(stream, encodedInflationPayout.Destination);
     Int64.Encode(stream, encodedInflationPayout.Amount);
 }
 public static void Encode(XdrDataOutputStream stream, RevokeSponsorshipOpSigner encodedRevokeSponsorshipOpSigner)
 {
     AccountID.Encode(stream, encodedRevokeSponsorshipOpSigner.AccountID);
     SignerKey.Encode(stream, encodedRevokeSponsorshipOpSigner.SignerKey);
 }
Пример #29
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine)
 {
     AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID);
     Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset);
 }
Пример #30
0
 public static void Encode(XdrDataOutputStream stream, AssetAlphaNum4 encodedAssetAlphaNum4)
 {
     AssetCode4.Encode(stream, encodedAssetAlphaNum4.AssetCode);
     AccountID.Encode(stream, encodedAssetAlphaNum4.Issuer);
 }