public static TimePoint Decode(XdrDataInputStream stream)
        {
            TimePoint decodedTimePoint = new TimePoint();

            decodedTimePoint.InnerValue = Uint64.Decode(stream);
            return(decodedTimePoint);
        }
Beispiel #2
0
        public static SequenceNumber Decode(XdrDataInputStream stream)
        {
            var decodedSequenceNumber = new SequenceNumber();

            decodedSequenceNumber.InnerValue = Uint64.Decode(stream);
            return(decodedSequenceNumber);
        }
Beispiel #3
0
        public static Memo Decode(IByteReader stream)
        {
            Memo decodedMemo = new Memo();

            decodedMemo.Discriminant = MemoType.Decode(stream);
            switch (decodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                decodedMemo.Text = XdrEncoding.ReadString(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                decodedMemo.Id = Uint64.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                decodedMemo.Hash = Hash.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                decodedMemo.RetHash = Hash.Decode(stream);
                break;
            }
            return(decodedMemo);
        }
Beispiel #4
0
        public static Memo Decode(XdrDataInputStream stream)
        {
            var decodedMemo  = new Memo();
            var discriminant = MemoType.Decode(stream);

            decodedMemo.Discriminant = discriminant;
            switch (decodedMemo.Discriminant.InnerValue)
            {
            case MemoType.MemoTypeEnum.MEMO_NONE:
                break;

            case MemoType.MemoTypeEnum.MEMO_TEXT:
                decodedMemo.Text = stream.ReadString();
                break;

            case MemoType.MemoTypeEnum.MEMO_ID:
                decodedMemo.Id = Uint64.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_HASH:
                decodedMemo.Hash = Hash.Decode(stream);
                break;

            case MemoType.MemoTypeEnum.MEMO_RETURN:
                decodedMemo.RetHash = Hash.Decode(stream);
                break;
            }
            return(decodedMemo);
        }
Beispiel #5
0
        public static LedgerHeader Decode(XdrDataInputStream stream)
        {
            var decodedLedgerHeader = new LedgerHeader();

            decodedLedgerHeader.LedgerVersion      = Uint32.Decode(stream);
            decodedLedgerHeader.PreviousLedgerHash = Hash.Decode(stream);
            decodedLedgerHeader.ScpValue           = StellarValue.Decode(stream);
            decodedLedgerHeader.TxSetResultHash    = Hash.Decode(stream);
            decodedLedgerHeader.BucketListHash     = Hash.Decode(stream);
            decodedLedgerHeader.LedgerSeq          = Uint32.Decode(stream);
            decodedLedgerHeader.TotalCoins         = Int64.Decode(stream);
            decodedLedgerHeader.FeePool            = Int64.Decode(stream);
            decodedLedgerHeader.InflationSeq       = Uint32.Decode(stream);
            decodedLedgerHeader.IdPool             = Uint64.Decode(stream);
            decodedLedgerHeader.BaseFee            = Uint32.Decode(stream);
            decodedLedgerHeader.BaseReserve        = Uint32.Decode(stream);
            decodedLedgerHeader.MaxTxSetSize       = Uint32.Decode(stream);
            var skipListsize = 4;

            decodedLedgerHeader.SkipList = new Hash[skipListsize];
            for (var i = 0; i < skipListsize; i++)
            {
                decodedLedgerHeader.SkipList[i] = Hash.Decode(stream);
            }
            decodedLedgerHeader.Ext = LedgerHeaderExt.Decode(stream);
            return(decodedLedgerHeader);
        }
        public static SequenceNumber Decode(IByteReader stream)
        {
            SequenceNumber decodedSequenceNumber = new SequenceNumber();

            decodedSequenceNumber.InnerValue = Uint64.Decode(stream);
            return(decodedSequenceNumber);
        }
Beispiel #7
0
            public static LedgerKeyOffer Decode(IByteReader stream)
            {
                LedgerKeyOffer decodedLedgerKeyOffer = new LedgerKeyOffer();

                decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream);
                decodedLedgerKeyOffer.OfferID  = Uint64.Decode(stream);
                return(decodedLedgerKeyOffer);
            }
Beispiel #8
0
        public static TimeBounds Decode(XdrDataInputStream stream)
        {
            var decodedTimeBounds = new TimeBounds();

            decodedTimeBounds.MinTime = Uint64.Decode(stream);
            decodedTimeBounds.MaxTime = Uint64.Decode(stream);
            return(decodedTimeBounds);
        }
            public static MuxedAccountMed25519 Decode(XdrDataInputStream stream)
            {
                MuxedAccountMed25519 decodedMuxedAccountMed25519 = new MuxedAccountMed25519();

                decodedMuxedAccountMed25519.Id      = Uint64.Decode(stream);
                decodedMuxedAccountMed25519.Ed25519 = Uint256.Decode(stream);
                return(decodedMuxedAccountMed25519);
            }
Beispiel #10
0
        public static TimeBounds Decode(IByteReader stream)
        {
            TimeBounds decodedTimeBounds = new TimeBounds();

            decodedTimeBounds.MinTime = Uint64.Decode(stream);
            decodedTimeBounds.MaxTime = Uint64.Decode(stream);
            return(decodedTimeBounds);
        }
Beispiel #11
0
            public static LedgerKeyOffer Decode(XdrDataInputStream stream)
            {
                var decodedLedgerKeyOffer = new LedgerKeyOffer();

                decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream);
                decodedLedgerKeyOffer.OfferID  = Uint64.Decode(stream);
                return(decodedLedgerKeyOffer);
            }
Beispiel #12
0
 public static AuthenticatedMessageV0 Decode(XdrDataInputStream stream)
 {
     var decodedAuthenticatedMessageV0 = new AuthenticatedMessageV0();
     decodedAuthenticatedMessageV0.Sequence = Uint64.Decode(stream);
     decodedAuthenticatedMessageV0.Message = StellarMessage.Decode(stream);
     decodedAuthenticatedMessageV0.Mac = HmacSha256Mac.Decode(stream);
     return decodedAuthenticatedMessageV0;
 }
Beispiel #13
0
        public static AuthCert Decode(XdrDataInputStream stream)
        {
            var decodedAuthCert = new AuthCert();

            decodedAuthCert.Pubkey     = Curve25519Public.Decode(stream);
            decodedAuthCert.Expiration = Uint64.Decode(stream);
            decodedAuthCert.Sig        = Signature.Decode(stream);
            return(decodedAuthCert);
        }
Beispiel #14
0
        public static AuthCert Decode(IByteReader stream)
        {
            AuthCert decodedAuthCert = new AuthCert();

            decodedAuthCert.Pubkey     = Curve25519Public.Decode(stream);
            decodedAuthCert.Expiration = Uint64.Decode(stream);
            decodedAuthCert.Sig        = Signature.Decode(stream);
            return(decodedAuthCert);
        }
Beispiel #15
0
        public static SCPStatement Decode(XdrDataInputStream stream)
        {
            var decodedSCPStatement = new SCPStatement();

            decodedSCPStatement.NodeID    = NodeID.Decode(stream);
            decodedSCPStatement.SlotIndex = Uint64.Decode(stream);
            decodedSCPStatement.Pledges   = SCPStatementPledges.Decode(stream);
            return(decodedSCPStatement);
        }
Beispiel #16
0
            public static AuthenticatedMessageV0 Decode(IByteReader stream)
            {
                AuthenticatedMessageV0 decodedAuthenticatedMessageV0 = new AuthenticatedMessageV0();

                decodedAuthenticatedMessageV0.Sequence = Uint64.Decode(stream);
                decodedAuthenticatedMessageV0.Message  = StellarMessage.Decode(stream);
                decodedAuthenticatedMessageV0.Mac      = HmacSha256Mac.Decode(stream);
                return(decodedAuthenticatedMessageV0);
            }
Beispiel #17
0
        public static SCPStatement Decode(IByteReader stream)
        {
            SCPStatement decodedSCPStatement = new SCPStatement();

            decodedSCPStatement.NodeID    = NodeID.Decode(stream);
            decodedSCPStatement.SlotIndex = Uint64.Decode(stream);
            decodedSCPStatement.Pledges   = SCPStatementPledges.Decode(stream);
            return(decodedSCPStatement);
        }
Beispiel #18
0
        public static ManageOfferOp Decode(XdrDataInputStream stream)
        {
            var decodedManageOfferOp = new ManageOfferOp();

            decodedManageOfferOp.Selling = Asset.Decode(stream);
            decodedManageOfferOp.Buying  = Asset.Decode(stream);
            decodedManageOfferOp.Amount  = Int64.Decode(stream);
            decodedManageOfferOp.Price   = Price.Decode(stream);
            decodedManageOfferOp.OfferID = Uint64.Decode(stream);
            return(decodedManageOfferOp);
        }
Beispiel #19
0
        public static ManageOfferOp Decode(IByteReader stream)
        {
            ManageOfferOp decodedManageOfferOp = new ManageOfferOp();

            decodedManageOfferOp.Selling = Asset.Decode(stream);
            decodedManageOfferOp.Buying  = Asset.Decode(stream);
            decodedManageOfferOp.Amount  = Int64.Decode(stream);
            decodedManageOfferOp.Price   = Price.Decode(stream);
            decodedManageOfferOp.OfferID = Uint64.Decode(stream);
            return(decodedManageOfferOp);
        }
        public static ClaimOfferAtom Decode(XdrDataInputStream stream)
        {
            var decodedClaimOfferAtom = new ClaimOfferAtom();

            decodedClaimOfferAtom.SellerID     = AccountID.Decode(stream);
            decodedClaimOfferAtom.OfferID      = Uint64.Decode(stream);
            decodedClaimOfferAtom.AssetSold    = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountSold   = Int64.Decode(stream);
            decodedClaimOfferAtom.AssetBought  = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountBought = Int64.Decode(stream);
            return(decodedClaimOfferAtom);
        }
Beispiel #21
0
        public static ClaimOfferAtom Decode(IByteReader stream)
        {
            ClaimOfferAtom decodedClaimOfferAtom = new ClaimOfferAtom();

            decodedClaimOfferAtom.SellerID     = AccountID.Decode(stream);
            decodedClaimOfferAtom.OfferID      = Uint64.Decode(stream);
            decodedClaimOfferAtom.AssetSold    = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountSold   = Int64.Decode(stream);
            decodedClaimOfferAtom.AssetBought  = Asset.Decode(stream);
            decodedClaimOfferAtom.AmountBought = Int64.Decode(stream);
            return(decodedClaimOfferAtom);
        }
Beispiel #22
0
        public static OfferEntry Decode(IByteReader stream)
        {
            OfferEntry decodedOfferEntry = new OfferEntry();

            decodedOfferEntry.SellerID = AccountID.Decode(stream);
            decodedOfferEntry.OfferID  = Uint64.Decode(stream);
            decodedOfferEntry.Selling  = Asset.Decode(stream);
            decodedOfferEntry.Buying   = Asset.Decode(stream);
            decodedOfferEntry.Amount   = Int64.Decode(stream);
            decodedOfferEntry.Price    = Price.Decode(stream);
            decodedOfferEntry.Flags    = Uint32.Decode(stream);
            decodedOfferEntry.Ext      = OfferEntryExt.Decode(stream);
            return(decodedOfferEntry);
        }
        public static OfferEntry Decode(XdrDataInputStream stream)
        {
            var decodedOfferEntry = new OfferEntry();

            decodedOfferEntry.SellerID = AccountID.Decode(stream);
            decodedOfferEntry.OfferID  = Uint64.Decode(stream);
            decodedOfferEntry.Selling  = Asset.Decode(stream);
            decodedOfferEntry.Buying   = Asset.Decode(stream);
            decodedOfferEntry.Amount   = Int64.Decode(stream);
            decodedOfferEntry.Price    = Price.Decode(stream);
            decodedOfferEntry.Flags    = Uint32.Decode(stream);
            decodedOfferEntry.Ext      = OfferEntryExt.Decode(stream);
            return(decodedOfferEntry);
        }
Beispiel #24
0
        public static StellarValue Decode(XdrDataInputStream stream)
        {
            var decodedStellarValue = new StellarValue();

            decodedStellarValue.TxSetHash = Hash.Decode(stream);
            decodedStellarValue.CloseTime = Uint64.Decode(stream);
            var upgradessize = stream.ReadInt();

            decodedStellarValue.Upgrades = new UpgradeType[upgradessize];
            for (var i = 0; i < upgradessize; i++)
            {
                decodedStellarValue.Upgrades[i] = UpgradeType.Decode(stream);
            }
            decodedStellarValue.Ext = StellarValueExt.Decode(stream);
            return(decodedStellarValue);
        }
        public static StellarValue Decode(IByteReader stream)
        {
            StellarValue decodedStellarValue = new StellarValue();

            decodedStellarValue.TxSetHash = Hash.Decode(stream);
            decodedStellarValue.CloseTime = Uint64.Decode(stream);
            int upgradessize = XdrEncoding.DecodeInt32(stream);

            decodedStellarValue.Upgrades = new UpgradeType[upgradessize];
            for (int i = 0; i < upgradessize; i++)
            {
                decodedStellarValue.Upgrades[i] = UpgradeType.Decode(stream);
            }
            decodedStellarValue.Ext = StellarValueExt.Decode(stream);
            return(decodedStellarValue);
        }