public static TimePoint Decode(XdrDataInputStream stream) { TimePoint decodedTimePoint = new TimePoint(); decodedTimePoint.InnerValue = Uint64.Decode(stream); return(decodedTimePoint); }
public static LedgerHeader Decode(XdrDataInputStream stream) { LedgerHeader 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); int skipListsize = 4; decodedLedgerHeader.SkipList = new Hash[skipListsize]; for (int i = 0; i < skipListsize; i++) { decodedLedgerHeader.SkipList[i] = Hash.Decode(stream); } decodedLedgerHeader.Ext = LedgerHeaderExt.Decode(stream); return(decodedLedgerHeader); }
public static Uint64 Decode(XdrDataInputStream stream) { Uint64 decodedUint64 = new Uint64(); decodedUint64.InnerValue = stream.ReadULong(); return(decodedUint64); }
public static Memo Decode(XdrDataInputStream stream) { Memo decodedMemo = new Memo(); MemoType 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); }
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; } }
public override sdkxdr.Operation.OperationBody ToOperationBody() { var op = new sdkxdr.ManageOfferOp(); op.Selling = Selling.ToXdr(); op.Buying = Buying.ToXdr(); var amount = new sdkxdr.Int64(); amount.InnerValue = ToXdrAmount(Amount); op.Amount = amount; var price = stellar_dotnet_sdk.Price.FromString(Price); op.Price = price.ToXdr(); var offerId = new sdkxdr.Uint64(); offerId.InnerValue = OfferId; op.OfferID = offerId; var body = new sdkxdr.Operation.OperationBody(); body.Discriminant = sdkxdr.OperationType.Create(sdkxdr.OperationType.OperationTypeEnum.MANAGE_OFFER); body.ManageOfferOp = op; return(body); }
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); }
public static TimeBounds Decode(XdrDataInputStream stream) { TimeBounds 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); }
public static LedgerKeyOffer Decode(XdrDataInputStream stream) { LedgerKeyOffer decodedLedgerKeyOffer = new LedgerKeyOffer(); decodedLedgerKeyOffer.SellerID = AccountID.Decode(stream); decodedLedgerKeyOffer.OfferID = Uint64.Decode(stream); return(decodedLedgerKeyOffer); }
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); }
public static AuthenticatedMessageV0 Decode(XdrDataInputStream stream) { AuthenticatedMessageV0 decodedAuthenticatedMessageV0 = new AuthenticatedMessageV0(); decodedAuthenticatedMessageV0.Sequence = Uint64.Decode(stream); decodedAuthenticatedMessageV0.Message = StellarMessage.Decode(stream); decodedAuthenticatedMessageV0.Mac = HmacSha256Mac.Decode(stream); return(decodedAuthenticatedMessageV0); }
public static AuthCert Decode(XdrDataInputStream stream) { AuthCert decodedAuthCert = new AuthCert(); decodedAuthCert.Pubkey = Curve25519Public.Decode(stream); decodedAuthCert.Expiration = Uint64.Decode(stream); decodedAuthCert.Sig = Signature.Decode(stream); return(decodedAuthCert); }
public static SCPStatement Decode(XdrDataInputStream stream) { SCPStatement decodedSCPStatement = new SCPStatement(); decodedSCPStatement.NodeID = NodeID.Decode(stream); decodedSCPStatement.SlotIndex = Uint64.Decode(stream); decodedSCPStatement.Pledges = SCPStatementPledges.Decode(stream); return(decodedSCPStatement); }
public static void Encode(XdrDataOutputStream 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 ManageOfferOp Decode(XdrDataInputStream 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) { 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); }
public static void Encode(XdrDataOutputStream stream, StellarValue encodedStellarValue) { Hash.Encode(stream, encodedStellarValue.TxSetHash); Uint64.Encode(stream, encodedStellarValue.CloseTime); int upgradessize = encodedStellarValue.Upgrades.Length; stream.WriteInt(upgradessize); for (int i = 0; i < upgradessize; i++) { UpgradeType.Encode(stream, encodedStellarValue.Upgrades[i]); } StellarValueExt.Encode(stream, encodedStellarValue.Ext); }
public static OfferEntry Decode(XdrDataInputStream 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 StellarValue Decode(XdrDataInputStream stream) { StellarValue decodedStellarValue = new StellarValue(); decodedStellarValue.TxSetHash = Hash.Decode(stream); decodedStellarValue.CloseTime = Uint64.Decode(stream); int upgradessize = stream.ReadInt(); 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); }
public static void Encode(XdrDataOutputStream stream, PeerStats encodedPeerStats) { NodeID.Encode(stream, encodedPeerStats.Id); stream.WriteString(encodedPeerStats.VersionStr); Uint64.Encode(stream, encodedPeerStats.MessagesRead); Uint64.Encode(stream, encodedPeerStats.MessagesWritten); Uint64.Encode(stream, encodedPeerStats.BytesRead); Uint64.Encode(stream, encodedPeerStats.BytesWritten); Uint64.Encode(stream, encodedPeerStats.SecondsConnected); Uint64.Encode(stream, encodedPeerStats.UniqueFloodBytesRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFloodBytesRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFetchBytesRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFetchBytesRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFloodMessageRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFloodMessageRecv); Uint64.Encode(stream, encodedPeerStats.UniqueFetchMessageRecv); Uint64.Encode(stream, encodedPeerStats.DuplicateFetchMessageRecv); }
public static PeerStats Decode(XdrDataInputStream stream) { PeerStats decodedPeerStats = new PeerStats(); decodedPeerStats.Id = NodeID.Decode(stream); decodedPeerStats.VersionStr = stream.ReadString(); decodedPeerStats.MessagesRead = Uint64.Decode(stream); decodedPeerStats.MessagesWritten = Uint64.Decode(stream); decodedPeerStats.BytesRead = Uint64.Decode(stream); decodedPeerStats.BytesWritten = Uint64.Decode(stream); decodedPeerStats.SecondsConnected = Uint64.Decode(stream); decodedPeerStats.UniqueFloodBytesRecv = Uint64.Decode(stream); decodedPeerStats.DuplicateFloodBytesRecv = Uint64.Decode(stream); decodedPeerStats.UniqueFetchBytesRecv = Uint64.Decode(stream); decodedPeerStats.DuplicateFetchBytesRecv = Uint64.Decode(stream); decodedPeerStats.UniqueFloodMessageRecv = Uint64.Decode(stream); decodedPeerStats.DuplicateFloodMessageRecv = Uint64.Decode(stream); decodedPeerStats.UniqueFetchMessageRecv = Uint64.Decode(stream); decodedPeerStats.DuplicateFetchMessageRecv = Uint64.Decode(stream); return(decodedPeerStats); }
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); int skipListsize = encodedLedgerHeader.SkipList.Length; for (int i = 0; i < skipListsize; i++) { Hash.Encode(stream, encodedLedgerHeader.SkipList[i]); } LedgerHeaderExt.Encode(stream, encodedLedgerHeader.Ext); }
public static void Encode(XdrDataOutputStream stream, SCPStatement encodedSCPStatement) { NodeID.Encode(stream, encodedSCPStatement.NodeID); Uint64.Encode(stream, encodedSCPStatement.SlotIndex); SCPStatementPledges.Encode(stream, encodedSCPStatement.Pledges); }
public static void Encode(XdrDataOutputStream stream, AuthenticatedMessageV0 encodedAuthenticatedMessageV0) { Uint64.Encode(stream, encodedAuthenticatedMessageV0.Sequence); StellarMessage.Encode(stream, encodedAuthenticatedMessageV0.Message); HmacSha256Mac.Encode(stream, encodedAuthenticatedMessageV0.Mac); }
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, Uint64 encodedUint64) { stream.WriteULong(encodedUint64.InnerValue); }
public static void Encode(XdrDataOutputStream stream, TimePoint encodedTimePoint) { Uint64.Encode(stream, encodedTimePoint.InnerValue); }
public TimePoint(Uint64 value) { InnerValue = value; }
public static void Encode(XdrDataOutputStream stream, TimeBounds encodedTimeBounds) { Uint64.Encode(stream, encodedTimeBounds.MinTime); Uint64.Encode(stream, encodedTimeBounds.MaxTime); }