示例#1
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                { "type", (byte)TransactionType.Transfer },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "recipient", Recipient },
                { "amount", Asset.AmountToLong(Amount) },
                { "assetId", Asset.IdOrNull },
                { "fee", FeeAsset.AmountToLong(Fee) },
                { "feeAsset", FeeAsset.IdOrNull },  // legacy v0.11.1 compat
                { "feeAssetId", FeeAsset.IdOrNull },
                { "timestamp", Timestamp.ToLong() },
                { "attachment", Attachment.ToBase58() }
            };

            if (Version > 1)
            {
                result.Add("version", Version);
            }

            if (Sender != null)
            {
                result.Add("sender", Sender);
            }

            return(result);
        }
示例#2
0
 public override Dictionary <string, object> GetJson()
 {
     return(new Dictionary <string, object>
     {
         { "type", TransactionType.Alias },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "alias", Alias },
         { "fee", Assets.WAVES.AmountToLong(Fee) },
         { "timestamp", Timestamp.ToLong() }
     });
 }
 public override Dictionary <string, object> GetJson()
 {
     return(new Dictionary <string, object>
     {
         { "type", TransactionType.LeaseCancel },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "leaseId", TransactionId },
         { "fee", Assets.TN.AmountToLong(Fee) },
         { "timestamp", Timestamp.ToLong() }
     });
 }
示例#4
0
 public override Dictionary <string, object> GetJson()
 {
     return(new Dictionary <string, object> {
         { "type", TransactionType.Lease },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "recipient", Recipient },
         { "amount", Assets.TN.AmountToLong(Amount) },
         { "fee", Assets.TN.AmountToLong(Fee) },
         { "timestamp", Timestamp.ToLong() }
     });
 }
示例#5
0
 public override Dictionary <string, object> GetJson()
 {
     return(new Dictionary <string, object>
     {
         { "type", TransactionType.SetScript },
         { "version", Version },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "script", Script == null ? null : Script.ToBase64() },
         { "fee", Assets.WAVES.AmountToLong(Fee) },
         { "timestamp", Timestamp.ToLong() }
     });
 }
示例#6
0
 public override Dictionary <string, object> GetJson()
 {
     return(new Dictionary <string, object>
     {
         { "type", TransactionType.Burn },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "assetId", Asset.Id },
         { "quantity", Asset.AmountToLong(Quantity) },
         { "fee", Assets.TN.AmountToLong(Fee) },
         { "timestamp", Timestamp.ToLong() }
     });
 }
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                {"type", (byte) TransactionType.Burn},
                {"senderPublicKey", SenderPublicKey.ToBase58()},
                {"assetId", Asset.Id},
                {"amount", Asset.AmountToLong(Quantity)},
                {"fee", Assets.WAVES.AmountToLong(Fee)},
                {"timestamp", Timestamp.ToLong()}
            };

            if (Sender != null)
                result.Add("sender", Sender);

            return result;
        }
示例#8
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                { "type", (byte)TransactionType.Alias },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "alias", Alias },
                { "fee", Assets.ZBS.AmountToLong(Fee) },
                { "timestamp", Timestamp.ToLong() }
            };

            if (Sender != null)
            {
                result.Add("sender", AddressEncoding.GetAddressFromPublicKey(SenderPublicKey, ChainId));
            }

            return(result);
        }
示例#9
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject {
                { "type", (byte)TransactionType.Lease },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "recipient", Recipient },
                { "amount", Assets.WAVES.AmountToLong(Amount) },
                { "fee", Assets.WAVES.AmountToLong(Fee) },
                { "timestamp", Timestamp.ToLong() }
            };

            if (Sender != null)
            {
                result.Add("sender", Sender);
            }

            return(result);
        }
示例#10
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                { "type", (byte)TransactionType.LeaseCancel },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "leaseId", LeaseId },
                { "fee", Assets.ZBS.AmountToLong(Fee) },
                { "timestamp", Timestamp.ToLong() }
            };

            if (Sender != null)
            {
                result.Add("sender", Sender);
            }

            return(result);
        }
示例#11
0
        public DictionaryObject GetJson()
        {
            var json = new DictionaryObject
            {
                { "amount", AmountAsset.AmountToLong(Amount) },
                { "price", Asset.PriceToLong(AmountAsset, PriceAsset, Price) },
                { "timestamp", Timestamp.ToLong() },
                { "expiration", Expiration.ToLong() },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "matcherPublicKey", MatcherPublicKey.ToBase58() },
                { "matcherFee", Assets.BCT.AmountToLong(MatcherFee) },
                { "assetPair", new DictionaryObject
                  {
                      { "amountAsset", AmountAsset.IdOrNull },
                      { "priceAsset", PriceAsset.IdOrNull }
                  } },
                { "orderType", Side.ToString().ToLower() },
                { "version", Version }
            };

            var proofs = Proofs
                         .Take(Array.FindLastIndex(Proofs, p => p != null && p.Length > 0) + 1)
                         .Select(p => p == null ? "" : p.ToBase58())
                         .ToArray();

            if (SupportsProofs())
            {
                json.Add("proofs", proofs);
            }
            else
            {
                if (proofs.Length == 0)
                {
                    throw new InvalidOperationException("Order is not signed");
                }
                if (proofs.Length > 1)
                {
                    throw new InvalidOperationException("Order version doesn't support multiple proofs");
                }
                json.Add("signature", proofs.Single());
            }

            return(json);
        }
示例#12
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                { "type", (byte)TransactionType.SetScript },
                { "version", Version },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "script", Script?.ToBase64() },
                { "fee", Assets.WAVES.AmountToLong(Fee) },
                { "timestamp", Timestamp.ToLong() }
            };

            if (Sender != null)
            {
                result.Add("sender", Sender);
            }

            return(result);
        }
示例#13
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                { "type", (byte)TransactionType.Reissue },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "assetId", Asset.Id },
                { "quantity", Asset.AmountToLong(Quantity) },
                { "reissuable", Reissuable },
                { "fee", Assets.ZBS.AmountToLong(Fee) },
                { "timestamp", Timestamp.ToLong() }
            };

            if (Sender != null)
            {
                result.Add("sender", Sender);
            }

            return(result);
        }
示例#14
0
        public override Dictionary <string, object> GetJson()
        {
            var result = new Dictionary <string, object>
            {
                { "type", TransactionType.Transfer },
                { "senderPublicKey", SenderPublicKey.ToBase58() },
                { "recipient", Recipient },
                { "amount", Asset.AmountToLong(Amount) },
                { "assetId", Asset.IdOrNull },
                { "fee", FeeAsset.AmountToLong(Fee) },
                { "feeAssetId", FeeAsset.IdOrNull },
                { "timestamp", Timestamp.ToLong() },
                { "attachment", Attachment.ToBase58() }
            };

            if (Version > 1)
            {
                result.Add("version", Version);
            }
            return(result);
        }
示例#15
0
 public DictionaryObject GetJson()
 {
     return(new DictionaryObject
     {
         { "amount", AmountAsset.AmountToLong(Amount) },
         { "price", Asset.PriceToLong(AmountAsset, PriceAsset, Price) },
         { "timestamp", Timestamp.ToLong() },
         { "expiration", Expiration.ToLong() },
         { "senderPublicKey", SenderPublicKey.ToBase58() },
         { "matcherPublicKey", MatcherPublicKey.ToBase58() },
         { "matcherFee", Assets.ZBS.AmountToLong(MatcherFee) },
         { "assetPair", new DictionaryObject
           {
               { "amountAsset", AmountAsset.IdOrNull },
               { "priceAsset", PriceAsset.IdOrNull }
           } },
         { "orderType", Side.ToString().ToLower() },
         { "signature", Signature.ToBase58() },
         { "version", Version }
     });
 }
示例#16
0
        public override DictionaryObject GetJson()
        {
            var result = new DictionaryObject
            {
                {"version", Version },
                {"type", (byte) TransactionType.Exchange},
                {"senderPublicKey", SenderPublicKey.ToBase58() },
                {"fee", Assets.WAVES.AmountToLong(Fee)},
                {"timestamp", Timestamp.ToLong()},
                {"order1", BuyOrder.GetJson()},
                {"order2", SellOrder.GetJson()},
                {"price", Asset.PriceToLong(AmountAsset, PriceAsset, Price) },
                {"amount", AmountAsset.AmountToLong(Amount) },
                {"buyMatcherFee", Assets.WAVES.AmountToLong(BuyMatcherFee)},
                {"sellMatcherFee", Assets.WAVES.AmountToLong(SellMatcherFee)}
            };

            if (Sender != null)
                result.Add("sender", Sender);

            return result;
        }