public static void Encode(XdrDataOutputStream stream, LedgerKey encodedLedgerKey) { stream.WriteInt((int)encodedLedgerKey.Discriminant.InnerValue); switch (encodedLedgerKey.Discriminant.InnerValue) { case LedgerEntryType.LedgerEntryTypeEnum.ACCOUNT: LedgerKeyAccount.Encode(stream, encodedLedgerKey.Account); break; case LedgerEntryType.LedgerEntryTypeEnum.TRUSTLINE: LedgerKeyTrustLine.Encode(stream, encodedLedgerKey.TrustLine); break; case LedgerEntryType.LedgerEntryTypeEnum.OFFER: LedgerKeyOffer.Encode(stream, encodedLedgerKey.Offer); break; case LedgerEntryType.LedgerEntryTypeEnum.DATA: LedgerKeyData.Encode(stream, encodedLedgerKey.Data); break; case LedgerEntryType.LedgerEntryTypeEnum.CLAIMABLE_BALANCE: LedgerKeyClaimableBalance.Encode(stream, encodedLedgerKey.ClaimableBalance); break; } }
public static LedgerKey Decode(XdrDataInputStream stream) { var decodedLedgerKey = new LedgerKey(); var discriminant = LedgerEntryType.Decode(stream); decodedLedgerKey.Discriminant = discriminant; switch (decodedLedgerKey.Discriminant.InnerValue) { case LedgerEntryType.LedgerEntryTypeEnum.ACCOUNT: decodedLedgerKey.Account = LedgerKeyAccount.Decode(stream); break; case LedgerEntryType.LedgerEntryTypeEnum.TRUSTLINE: decodedLedgerKey.TrustLine = LedgerKeyTrustLine.Decode(stream); break; case LedgerEntryType.LedgerEntryTypeEnum.OFFER: decodedLedgerKey.Offer = LedgerKeyOffer.Decode(stream); break; case LedgerEntryType.LedgerEntryTypeEnum.DATA: decodedLedgerKey.Data = LedgerKeyData.Decode(stream); break; } return(decodedLedgerKey); }
public static LedgerKeyTrustLine Decode(XdrDataInputStream stream) { var decodedLedgerKeyTrustLine = new LedgerKeyTrustLine(); decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream); decodedLedgerKeyTrustLine.Asset = Asset.Decode(stream); return(decodedLedgerKeyTrustLine); }
public static LedgerKeyTrustLine Decode(IByteReader stream) { LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine(); decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream); decodedLedgerKeyTrustLine.Asset = Asset.Decode(stream); return(decodedLedgerKeyTrustLine); }
public static void Encode(IByteWriter stream, LedgerKey encodedLedgerKey) { XdrEncoding.EncodeInt32((int)encodedLedgerKey.Discriminant.InnerValue, stream); switch (encodedLedgerKey.Discriminant.InnerValue) { case LedgerEntryType.LedgerEntryTypeEnum.ACCOUNT: LedgerKeyAccount.Encode(stream, encodedLedgerKey.Account); break; case LedgerEntryType.LedgerEntryTypeEnum.TRUSTLINE: LedgerKeyTrustLine.Encode(stream, encodedLedgerKey.TrustLine); break; case LedgerEntryType.LedgerEntryTypeEnum.OFFER: LedgerKeyOffer.Encode(stream, encodedLedgerKey.Offer); break; case LedgerEntryType.LedgerEntryTypeEnum.DATA: LedgerKeyData.Encode(stream, encodedLedgerKey.Data); break; } }
public static void Encode(XdrDataOutputStream stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine) { AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID); Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset); }
public static void Encode(IByteWriter stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine) { AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID); Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset); }
public static LedgerKeyTrustLine Decode(IByteReader stream) { LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine(); decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream); decodedLedgerKeyTrustLine.Asset = Asset.Decode(stream); return decodedLedgerKeyTrustLine; }