コード例 #1
0
 public static void Encode(XdrDataOutputStream stream, Claimant encodedClaimant)
 {
     stream.WriteInt((int)encodedClaimant.Discriminant.InnerValue);
     switch (encodedClaimant.Discriminant.InnerValue)
     {
     case ClaimantType.ClaimantTypeEnum.CLAIMANT_TYPE_V0:
         ClaimantV0.Encode(stream, encodedClaimant.V0);
         break;
     }
 }
コード例 #2
0
        public static void Encode(XdrDataOutputStream stream, CreateClaimableBalanceOp encodedCreateClaimableBalanceOp)
        {
            Asset.Encode(stream, encodedCreateClaimableBalanceOp.Asset);
            Int64.Encode(stream, encodedCreateClaimableBalanceOp.Amount);
            int claimantssize = encodedCreateClaimableBalanceOp.Claimants.Length;

            stream.WriteInt(claimantssize);
            for (int i = 0; i < claimantssize; i++)
            {
                Claimant.Encode(stream, encodedCreateClaimableBalanceOp.Claimants[i]);
            }
        }
コード例 #3
0
        public static void Encode(XdrDataOutputStream stream, ClaimableBalanceEntry encodedClaimableBalanceEntry)
        {
            ClaimableBalanceID.Encode(stream, encodedClaimableBalanceEntry.BalanceID);
            int claimantssize = encodedClaimableBalanceEntry.Claimants.Length;

            stream.WriteInt(claimantssize);
            for (int i = 0; i < claimantssize; i++)
            {
                Claimant.Encode(stream, encodedClaimableBalanceEntry.Claimants[i]);
            }
            Asset.Encode(stream, encodedClaimableBalanceEntry.Asset);
            Int64.Encode(stream, encodedClaimableBalanceEntry.Amount);
            ClaimableBalanceEntryExt.Encode(stream, encodedClaimableBalanceEntry.Ext);
        }
コード例 #4
0
        public static Claimant Decode(XdrDataInputStream stream)
        {
            Claimant     decodedClaimant = new Claimant();
            ClaimantType discriminant    = ClaimantType.Decode(stream);

            decodedClaimant.Discriminant = discriminant;
            switch (decodedClaimant.Discriminant.InnerValue)
            {
            case ClaimantType.ClaimantTypeEnum.CLAIMANT_TYPE_V0:
                decodedClaimant.V0 = ClaimantV0.Decode(stream);
                break;
            }
            return(decodedClaimant);
        }
コード例 #5
0
        public static CreateClaimableBalanceOp Decode(XdrDataInputStream stream)
        {
            CreateClaimableBalanceOp decodedCreateClaimableBalanceOp = new CreateClaimableBalanceOp();

            decodedCreateClaimableBalanceOp.Asset  = Asset.Decode(stream);
            decodedCreateClaimableBalanceOp.Amount = Int64.Decode(stream);
            int claimantssize = stream.ReadInt();

            decodedCreateClaimableBalanceOp.Claimants = new Claimant[claimantssize];
            for (int i = 0; i < claimantssize; i++)
            {
                decodedCreateClaimableBalanceOp.Claimants[i] = Claimant.Decode(stream);
            }
            return(decodedCreateClaimableBalanceOp);
        }
コード例 #6
0
        public static ClaimableBalanceEntry Decode(XdrDataInputStream stream)
        {
            ClaimableBalanceEntry decodedClaimableBalanceEntry = new ClaimableBalanceEntry();

            decodedClaimableBalanceEntry.BalanceID = ClaimableBalanceID.Decode(stream);
            int claimantssize = stream.ReadInt();

            decodedClaimableBalanceEntry.Claimants = new Claimant[claimantssize];
            for (int i = 0; i < claimantssize; i++)
            {
                decodedClaimableBalanceEntry.Claimants[i] = Claimant.Decode(stream);
            }
            decodedClaimableBalanceEntry.Asset  = Asset.Decode(stream);
            decodedClaimableBalanceEntry.Amount = Int64.Decode(stream);
            decodedClaimableBalanceEntry.Ext    = ClaimableBalanceEntryExt.Decode(stream);
            return(decodedClaimableBalanceEntry);
        }