public String IssueAsset(PrivateKeyAccount account, String name, String description, long quantity, int decimals, bool reissuable, long fee) { Transaction transaction = Transaction.MakeIssueTransaction(account, name, description, quantity, decimals, reissuable, fee); return(Post(transaction)); }
public string PutData(PrivateKeyAccount account, DictionaryObject entries, decimal?fee = null) { var tx = new DataTransaction(ChainId, account.PublicKey, entries, fee); tx.Sign(account); return(Broadcast(tx)); }
public string CreateAlias(PrivateKeyAccount account, string alias, char scheme, long fee) { var tx = new AliasTransaction(account.PublicKey, alias, scheme); tx.Sign(account); return(Broadcast(tx)); }
public String TransferAsset(PrivateKeyAccount from, String toAddress, long amount, String assetId, long fee, String feeAssetId, String message) { Transaction transaction = Transaction.MakeTransferTransaction(from, toAddress, amount, assetId, fee, feeAssetId, message); return(Post(transaction)); }
public string SponsoredFeeForAsset(PrivateKeyAccount account, Asset asset, decimal minimalFeeInAssets, decimal fee = 1m) { var tx = new SponsoredFeeTransaction(ChainId, account.PublicKey, asset, minimalFeeInAssets, fee); tx.Sign(account); return(Broadcast(tx)); }
public string ReissueAsset(PrivateKeyAccount account, Asset asset, decimal quantity, bool reissuable, decimal fee = 1m) { var tx = new ReissueTransaction(ChainId, account.PublicKey, asset, quantity, reissuable, fee); tx.Sign(account); return(Broadcast(tx)); }
public string Lease(PrivateKeyAccount sender, string recipient, decimal amount, decimal fee = 0.001m) { var tx = new LeaseTransaction(ChainId, sender.PublicKey, recipient, amount, fee); tx.Sign(sender); return(Broadcast(tx)); }
public string PutData(PrivateKeyAccount account, DictionaryObject entries) { var tx = new DataTransaction(account.PublicKey, entries); tx.Sign(account); return(Broadcast(tx)); }
public string CreateAlias(PrivateKeyAccount account, string alias, char chainId, decimal fee = 0.001m) { var tx = new AliasTransaction(account.PublicKey, alias, chainId, fee); tx.Sign(account); return(Broadcast(tx)); }
public static Transaction MakeReissueTransaction(PrivateKeyAccount account, String assetId, long quantity, bool reissuable, long fee) { long timestamp = Utils.CurrentTimestamp(); MemoryStream stream = new MemoryStream(MinBufferSize); BinaryWriter writer = new BinaryWriter(stream); writer.Write(Reissue); writer.Write(account.PublicKey); writer.Write(Base58.Decode(assetId)); Utils.WriteToNetwork(writer, quantity); writer.Write((byte)(reissuable ? 1 : 0)); Utils.WriteToNetwork(writer, fee); Utils.WriteToNetwork(writer, timestamp); String signature = Sign(account, stream); return(new Transaction(TransactionsBroadcastPath, "type", Reissue, "senderPublicKey", Base58.Encode(account.PublicKey), "signature", signature, "assetId", assetId, "quantity", quantity, "reissuable", reissuable, "fee", fee, "timestamp", timestamp)); }
public void CancelOrder(PrivateKeyAccount account, String amountAssetId, String priceAssetId, String orderId, long fee) { Transaction transaction = Transaction.MakeOrderCancelTransaction(account, amountAssetId, priceAssetId, orderId, fee); Request(transaction, true); }
public string BurnAsset(PrivateKeyAccount account, Asset asset, decimal amount, decimal fee = 0.001m) { var tx = new BurnTransaction(ChainId, account.PublicKey, asset, amount, fee).Sign(account); tx.Sign(account); return(Broadcast(tx)); }
public string CancelAll(PrivateKeyAccount account) { var request = MakeCancelAllRequest(account); var url = $"{_host}/matcher/orderbook/cancel"; return(Http.Post(url, request)); }
public string PlaceOrder(PrivateKeyAccount sender, OrderSide side, Asset amountAsset, Asset priceAsset, decimal price, decimal amount, DateTime expiration) { var order = MakeOrder(sender, MatcherKey, side, amountAsset, priceAsset, price, amount, expiration, 0.003m); return(Http.Post($"{_host}/matcher/orderbook", order)); }
public string SetAssetScript(PrivateKeyAccount account, Asset asset, byte[] script, char chainId, decimal fee = 1m) { var tx = new SetAssetScriptTransaction(ChainId, account.PublicKey, asset, script, fee = 1m); tx.Sign(account); return(Broadcast(tx)); }
public string SetScript(PrivateKeyAccount account, byte[] script, decimal fee = 1m) { var tx = new SetScriptTransaction(account.PublicKey, script, ChainId, fee = 0.014m); tx.Sign(account); return(Broadcast(tx)); }
public static String Sign(PrivateKeyAccount account, MemoryStream stream) { byte[] bytesToSign = new byte[stream.Position]; bytesToSign = stream.ToArray(); byte[] signature = cipher.calculateSignature(account.PrivateKey, bytesToSign); return(Base58.Encode(signature)); }
public static Transaction MakeAliasTransaction(PrivateKeyAccount account, String alias, char scheme, long fee) { long timestamp = Utils.CurrentTimestamp(); int aliaslen = alias.Length; MemoryStream stream = new MemoryStream(MinBufferSize + aliaslen); BinaryWriter writer = new BinaryWriter(stream); writer.Write(Transaction.Alias); writer.Write(account.PublicKey); Utils.WriteBigEndian(writer, (short)(alias.Length + 4)); writer.Write(0x02); writer.Write((byte)scheme); Utils.WriteBigEndian(writer, (short)alias.Length); writer.Write(Encoding.ASCII.GetBytes(alias)); Utils.WriteToNetwork(writer, fee); Utils.WriteToNetwork(writer, timestamp); String signature = Sign(account, stream); return(new Transaction(TransactionsBroadcastPath, "type", Alias, "senderPublicKey", Base58.Encode(account.PublicKey), "signature", signature, "alias", alias, "fee", fee, "timestamp", timestamp)); }
public string CancelLease(PrivateKeyAccount account, string transactionId, decimal fee = 0.001m) { var tx = new CancelLeasingTransaction(ChainId, account.PublicKey, transactionId, fee); tx.Sign(account); return(Broadcast(tx)); }
public string CancelLease(PrivateKeyAccount account, string transactionId) { var tx = new CancelLeasingTransaction(account.PublicKey, transactionId); tx.Sign(account); return(Broadcast(tx)); }
public string MassTransfer(PrivateKeyAccount sender, Asset asset, IEnumerable <MassTransferItem> transfers, string message = "", decimal?fee = null) { var tx = new MassTransferTransaction(ChainId, sender.PublicKey, asset, transfers, message, fee); tx.Sign(sender); return(Broadcast(tx)); }
public string Transfer(PrivateKeyAccount sender, string recipient, Asset asset, decimal amount, decimal fee, Asset feeAsset = null, byte[] message = null) { var tx = new TransferTransaction(ChainId, sender.PublicKey, recipient, asset, amount, fee, feeAsset, message); tx.Sign(sender); return(Broadcast(tx)); }
public string Transfer(PrivateKeyAccount sender, string recipient, Asset asset, decimal amount, string message = "") { var tx = new TransferTransaction(sender.PublicKey, recipient, asset, amount, message); tx.Sign(sender); return(Broadcast(tx)); }
public string PlaceOrder(PrivateKeyAccount sender, Order order) { order.Sign(sender); var json = order.GetJson(); return(Http.Post($"{_host}/matcher/orderbook", json)); }
public string DeleteOrder(PrivateKeyAccount account, Asset amountAsset, Asset priceAsset, string orderId) { var request = MakeOrderCancelRequest(account, orderId); var url = $"{_host}/matcher/orderbook/{amountAsset.Id}/{priceAsset.Id}/delete"; return(Http.Post(url, request)); }
public String CreateOrder(PrivateKeyAccount account, String matcherKey, String amountAssetId, String priceAssetId, Order.Type orderType, long price, long amount, long expiration, long matcherFee) { Transaction transaction = Transaction.MakeOrderTransaction(account, matcherKey, orderType, amountAssetId, priceAssetId, price, amount, expiration, matcherFee); return(Request(transaction, false)); }
public string InvokeScript(PrivateKeyAccount caller, string dappAddress, Dictionary <Asset, decimal> payment, decimal fee = 0.005m, Asset feeAsset = null) { var tx = new InvokeScriptTransaction(ChainId, caller.PublicKey, dappAddress, payment, fee, feeAsset); tx.Sign(caller); return(Broadcast(tx)); }
public Order[] GetOrders(PrivateKeyAccount account, Asset amountAsset, Asset priceAsset) { string path = $"{_host}/matcher/orderbook/{amountAsset.Id}/{priceAsset.Id}/publicKey/{account.PublicKey.ToBase58()}"; var headers = GetProtectionHeaders(account); var response = Http.GetObjectsWithHeaders(path, headers); return(response.Select(j => Order.CreateFromJson(j, amountAsset, priceAsset)).ToArray()); }
public string Transfer(PrivateKeyAccount sender, string recipient, Asset asset, decimal amount, string message = "") { var fee = 0.001m + (asset.Script != null ? 0.004m : 0); var tx = new TransferTransaction(ChainId, sender.PublicKey, recipient, asset, amount, message); tx.Sign(sender); return(Broadcast(tx)); }
public string PlaceOrder(PrivateKeyAccount sender, Order order) { var bytes = order.GetBytes(); order.Signature = sender.Sign(bytes); var json = order.GetJson(); return(Http.Post($"{_host}/matcher/orderbook", json)); }