コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: LedgerKey.cs プロジェクト: wnm-live/kin-csharp-sdk
        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);
        }
コード例 #3
0
ファイル: LedgerKey.cs プロジェクト: wnm-live/kin-csharp-sdk
            public static LedgerKeyTrustLine Decode(XdrDataInputStream stream)
            {
                var decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();

                decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyTrustLine.Asset     = Asset.Decode(stream);
                return(decodedLedgerKeyTrustLine);
            }
コード例 #4
0
            public static LedgerKeyTrustLine Decode(IByteReader stream)
            {
                LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();

                decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
                decodedLedgerKeyTrustLine.Asset     = Asset.Decode(stream);
                return(decodedLedgerKeyTrustLine);
            }
コード例 #5
0
        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;
            }
        }
コード例 #6
0
ファイル: LedgerKey.cs プロジェクト: wnm-live/kin-csharp-sdk
 public static void Encode(XdrDataOutputStream stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine)
 {
     AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID);
     Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset);
 }
コード例 #7
0
 public static void Encode(IByteWriter stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine)
 {
     AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID);
     Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset);
 }
コード例 #8
0
 public static void Encode(IByteWriter stream, LedgerKeyTrustLine encodedLedgerKeyTrustLine) {
   AccountID.Encode(stream, encodedLedgerKeyTrustLine.AccountID);
   Asset.Encode(stream, encodedLedgerKeyTrustLine.Asset);
 }
コード例 #9
0
 public static LedgerKeyTrustLine Decode(IByteReader stream) {
   LedgerKeyTrustLine decodedLedgerKeyTrustLine = new LedgerKeyTrustLine();
   decodedLedgerKeyTrustLine.AccountID = AccountID.Decode(stream);
   decodedLedgerKeyTrustLine.Asset = Asset.Decode(stream);
   return decodedLedgerKeyTrustLine;
 }