Exemple #1
0
 public static void WriteAsset(this BinaryWriter stream, string assetId)
 {
     if (string.IsNullOrEmpty(assetId) || assetId == "ZBS")
     {
         stream.WriteByte(0);
     }
     else
     {
         stream.WriteByte(1);
         var decoded = Base58.Decode(assetId);
         stream.Write(decoded, 0, decoded.Length);
     }
 }
Exemple #2
0
        public static DictionaryObject MakeOrderCancelRequest(PrivateKeyAccount sender, string orderId)
        {
            var stream = new MemoryStream();
            var writer = new BinaryWriter(stream);

            writer.Write(sender.PublicKey);
            writer.Write(Base58.Decode(orderId));
            var signature = sender.Sign(stream);

            return(new DictionaryObject
            {
                { "sender", sender.PublicKey.ToBase58() },
                { "orderId", orderId },
                { "signature", signature.ToBase58() }
            });
        }
Exemple #3
0
 private PrivateKeyAccount(string privateKey, char chainId) : this(Base58.Decode(privateKey), chainId)
 {
 }