Beispiel #1
0
        public static void Encode(IByteWriter stream, Memo encodedMemo)
        {
            XdrEncoding.EncodeInt32((int)encodedMemo.Discriminant.InnerValue, stream);
            switch (encodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                XdrEncoding.WriteString(stream, encodedMemo.Text);
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                Uint64.Encode(stream, encodedMemo.Id);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                Hash.Encode(stream, encodedMemo.Hash);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                Hash.Encode(stream, encodedMemo.RetHash);
                break;
            }
        }
Beispiel #2
0
        public static void Encode(XdrDataOutputStream stream, Memo encodedMemo)
        {
            stream.WriteInt((int)encodedMemo.Discriminant.InnerValue);
            switch (encodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                stream.WriteString(encodedMemo.Text);
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                Uint64.Encode(stream, encodedMemo.Id);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                Hash.Encode(stream, encodedMemo.Hash);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                Hash.Encode(stream, encodedMemo.RetHash);
                break;
            }
        }
Beispiel #3
0
 public static void Encode(IByteWriter stream, ManageOfferOp encodedManageOfferOp)
 {
     Asset.Encode(stream, encodedManageOfferOp.Selling);
     Asset.Encode(stream, encodedManageOfferOp.Buying);
     Int64.Encode(stream, encodedManageOfferOp.Amount);
     Price.Encode(stream, encodedManageOfferOp.Price);
     Uint64.Encode(stream, encodedManageOfferOp.OfferID);
 }
Beispiel #4
0
 public static void Encode(XdrDataOutputStream stream, ManageOfferOp encodedManageOfferOp)
 {
     Asset.Encode(stream, encodedManageOfferOp.Selling);
     Asset.Encode(stream, encodedManageOfferOp.Buying);
     Int64.Encode(stream, encodedManageOfferOp.Amount);
     Price.Encode(stream, encodedManageOfferOp.Price);
     Uint64.Encode(stream, encodedManageOfferOp.OfferID);
 }
Beispiel #5
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);
 }
 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);
 }
Beispiel #7
0
 public static void Encode(IByteWriter stream, OfferEntry encodedOfferEntry)
 {
     AccountID.Encode(stream, encodedOfferEntry.SellerID);
     Uint64.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, StellarValue encodedStellarValue)
        {
            Hash.Encode(stream, encodedStellarValue.TxSetHash);
            Uint64.Encode(stream, encodedStellarValue.CloseTime);
            var upgradessize = encodedStellarValue.Upgrades.Length;

            stream.WriteInt(upgradessize);
            for (var i = 0; i < upgradessize; i++)
            {
                UpgradeType.Encode(stream, encodedStellarValue.Upgrades[i]);
            }
            StellarValueExt.Encode(stream, encodedStellarValue.Ext);
        }
        public static void Encode(IByteWriter stream, StellarValue encodedStellarValue)
        {
            Hash.Encode(stream, encodedStellarValue.TxSetHash);
            Uint64.Encode(stream, encodedStellarValue.CloseTime);
            int upgradessize = encodedStellarValue.Upgrades.Length;

            XdrEncoding.EncodeInt32(upgradessize, stream);
            for (int i = 0; i < upgradessize; i++)
            {
                UpgradeType.Encode(stream, encodedStellarValue.Upgrades[i]);
            }
            StellarValueExt.Encode(stream, encodedStellarValue.Ext);
        }
Beispiel #10
0
        public static void Encode(XdrDataOutputStream stream, LedgerHeader encodedLedgerHeader)
        {
            Uint32.Encode(stream, encodedLedgerHeader.LedgerVersion);
            Hash.Encode(stream, encodedLedgerHeader.PreviousLedgerHash);
            StellarValue.Encode(stream, encodedLedgerHeader.ScpValue);
            Hash.Encode(stream, encodedLedgerHeader.TxSetResultHash);
            Hash.Encode(stream, encodedLedgerHeader.BucketListHash);
            Uint32.Encode(stream, encodedLedgerHeader.LedgerSeq);
            Int64.Encode(stream, encodedLedgerHeader.TotalCoins);
            Int64.Encode(stream, encodedLedgerHeader.FeePool);
            Uint32.Encode(stream, encodedLedgerHeader.InflationSeq);
            Uint64.Encode(stream, encodedLedgerHeader.IdPool);
            Uint32.Encode(stream, encodedLedgerHeader.BaseFee);
            Uint32.Encode(stream, encodedLedgerHeader.BaseReserve);
            Uint32.Encode(stream, encodedLedgerHeader.MaxTxSetSize);
            var skipListsize = encodedLedgerHeader.SkipList.Length;

            for (var i = 0; i < skipListsize; i++)
            {
                Hash.Encode(stream, encodedLedgerHeader.SkipList[i]);
            }
            LedgerHeaderExt.Encode(stream, encodedLedgerHeader.Ext);
        }
Beispiel #11
0
 public static void Encode(XdrDataOutputStream stream, AuthenticatedMessageV0 encodedAuthenticatedMessageV0)
 {
     Uint64.Encode(stream, encodedAuthenticatedMessageV0.Sequence);
     StellarMessage.Encode(stream, encodedAuthenticatedMessageV0.Message);
     HmacSha256Mac.Encode(stream, encodedAuthenticatedMessageV0.Mac);
 }
Beispiel #12
0
 public static void Encode(XdrDataOutputStream stream, SCPStatement encodedSCPStatement)
 {
     NodeID.Encode(stream, encodedSCPStatement.NodeID);
     Uint64.Encode(stream, encodedSCPStatement.SlotIndex);
     SCPStatementPledges.Encode(stream, encodedSCPStatement.Pledges);
 }
Beispiel #13
0
 public static void Encode(XdrDataOutputStream stream, LedgerKeyOffer encodedLedgerKeyOffer)
 {
     AccountID.Encode(stream, encodedLedgerKeyOffer.SellerID);
     Uint64.Encode(stream, encodedLedgerKeyOffer.OfferID);
 }
Beispiel #14
0
 public static void Encode(IByteWriter stream, SCPStatement encodedSCPStatement)
 {
     NodeID.Encode(stream, encodedSCPStatement.NodeID);
     Uint64.Encode(stream, encodedSCPStatement.SlotIndex);
     SCPStatementPledges.Encode(stream, encodedSCPStatement.Pledges);
 }
Beispiel #15
0
 public static void Encode(IByteWriter stream, AuthenticatedMessageV0 encodedAuthenticatedMessageV0)
 {
     Uint64.Encode(stream, encodedAuthenticatedMessageV0.Sequence);
     StellarMessage.Encode(stream, encodedAuthenticatedMessageV0.Message);
     HmacSha256Mac.Encode(stream, encodedAuthenticatedMessageV0.Mac);
 }
 public static void Encode(XdrDataOutputStream stream, TimePoint encodedTimePoint)
 {
     Uint64.Encode(stream, encodedTimePoint.InnerValue);
 }
 public static void Encode(IByteWriter stream, SequenceNumber encodedSequenceNumber)
 {
     Uint64.Encode(stream, encodedSequenceNumber.InnerValue);
 }
Beispiel #18
0
 public static void Encode(IByteWriter stream, LedgerKeyOffer encodedLedgerKeyOffer)
 {
     AccountID.Encode(stream, encodedLedgerKeyOffer.SellerID);
     Uint64.Encode(stream, encodedLedgerKeyOffer.OfferID);
 }
Beispiel #19
0
 public static void Encode(IByteWriter stream, AuthCert encodedAuthCert)
 {
     Curve25519Public.Encode(stream, encodedAuthCert.Pubkey);
     Uint64.Encode(stream, encodedAuthCert.Expiration);
     Signature.Encode(stream, encodedAuthCert.Sig);
 }
Beispiel #20
0
 public static void Encode(XdrDataOutputStream stream, SequenceNumber encodedSequenceNumber)
 {
     Uint64.Encode(stream, encodedSequenceNumber.InnerValue);
 }
Beispiel #21
0
 public static void Encode(XdrDataOutputStream stream, TimeBounds encodedTimeBounds)
 {
     Uint64.Encode(stream, encodedTimeBounds.MinTime);
     Uint64.Encode(stream, encodedTimeBounds.MaxTime);
 }
Beispiel #22
0
 public static void Encode(IByteWriter stream, TimeBounds encodedTimeBounds)
 {
     Uint64.Encode(stream, encodedTimeBounds.MinTime);
     Uint64.Encode(stream, encodedTimeBounds.MaxTime);
 }
Beispiel #23
0
 public static void Encode(XdrDataOutputStream stream, AuthCert encodedAuthCert)
 {
     Curve25519Public.Encode(stream, encodedAuthCert.Pubkey);
     Uint64.Encode(stream, encodedAuthCert.Expiration);
     Signature.Encode(stream, encodedAuthCert.Sig);
 }
 public static void Encode(XdrDataOutputStream stream, MuxedAccountMed25519 encodedMuxedAccountMed25519)
 {
     Uint64.Encode(stream, encodedMuxedAccountMed25519.Id);
     Uint256.Encode(stream, encodedMuxedAccountMed25519.Ed25519);
 }