internal AbstractEncryptedMessage(BinaryHexString message, bool messageIsText, bool compressMessage, bool isPrunable)
 {
     MessageIsText   = messageIsText;
     CompressMessage = compressMessage;
     IsPrunable      = isPrunable;
     Message         = message;
 }
예제 #2
0
 internal ShuffligCancellationAttachment(JToken jToken)
 {
     BlameData           = GetAttachmentValue <string>(jToken, Parameters.BlameData);
     CancellingAccountId = GetAttachmentValue <ulong>(jToken, Parameters.CancellingAccount);
     KeySeeds            = GetAttachmentValue <string>(jToken, Parameters.KeySeeds);
     ShufflingId         = GetAttachmentValue <ulong>(jToken, Parameters.Shuffling);
     ShufflingStateHash  = GetAttachmentValue <string>(jToken, Parameters.ShufflingStateHash);
 }
예제 #3
0
 internal DigitalGoodsDeliveryAttachment(JToken attachments)
 {
     Discount    = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.DiscountNqt));
     GoodsData   = new BinaryHexString(GetAttachmentValue <string>(attachments, Parameters.GoodsData));
     GoodsIsText = GetAttachmentValue <bool>(attachments, Parameters.GoodsIsText);
     GoodsNonce  = new BinaryHexString(GetAttachmentValue <string>(attachments, Parameters.GoodsNonce));
     Purchase    = GetAttachmentValue <ulong>(attachments, Parameters.Purchase);
 }
예제 #4
0
        internal ShufflingRecipientsAttachment(JToken jToken)
        {
            ShufflingId        = GetAttachmentValue <ulong>(jToken, Parameters.Shuffling);
            ShufflingStateHash = GetAttachmentValue <string>(jToken, Parameters.ShufflingStateHash);

            var array = (JArray)jToken.SelectToken(Parameters.RecipientPublicKeys);

            RecipientPublicKeys = array.ToObject <string[]>().Select(s => new BinaryHexString(s));
        }
예제 #5
0
        private Message(string message, bool isText, bool isPrunable, BinaryHexString messageHash)
        {
            IsText      = isText;
            MessageText = message;
            IsPrunable  = isPrunable;
            MessageHash = messageHash;

            Data = IsText
                ? Encoding.UTF8.GetBytes(message)
                : ByteToHexStringConverter.ToBytesFromHexString(message).ToArray();
        }
예제 #6
0
 public EncryptedMessage(BinaryReader reader, byte transactionVersion, bool isPrunable) : base(reader, transactionVersion, true)
 {
     if (!isPrunable)
     {
         throw new ArgumentException("Value must be true", nameof(isPrunable));
     }
     IsPrunable           = true;
     EncryptedMessageHash = reader.ReadBytes(32);
     Data         = null;
     IsText       = false;
     IsCompressed = false;
 }
예제 #7
0
        internal ShufflingProcessingAttachment(JToken jToken)
        {
            Hash               = GetAttachmentValue <string>(jToken, Parameters.Hash);
            ShufflingId        = GetAttachmentValue <ulong>(jToken, Parameters.Shuffling);
            ShufflingStateHash = GetAttachmentValue <string>(jToken, Parameters.ShufflingStateHash);

            var array = (JArray)jToken.SelectToken(Parameters.Data);

            if (array != null)
            {
                Data = array.ToObject <string[]>().Select(s => new BinaryHexString(s));
            }
        }
예제 #8
0
 protected EncryptedMessageBase(JToken messageToken)
 {
     IsCompressed = Convert.ToBoolean(((JValue)messageToken.SelectToken(Parameters.IsCompressed)).Value.ToString());
     IsText       = Convert.ToBoolean(((JValue)messageToken.SelectToken(Parameters.IsText)).Value.ToString());
     if (messageToken.SelectToken(Parameters.MessageToEncrypt) != null)
     {
         MessageToEncrypt = ((JValue)messageToken.SelectToken(Parameters.MessageToEncrypt)).Value.ToString();
     }
     if (messageToken.SelectToken(Parameters.Nonce) != null)
     {
         Nonce = ((JValue)messageToken.SelectToken(Parameters.Nonce)).Value.ToString();
         Data  = ((JValue)messageToken.SelectToken(Parameters.Data)).Value.ToString();
     }
 }
예제 #9
0
 public EncryptedMessageBase(BinaryReader reader, byte transactionVersion, bool isPrunable = false) : base(reader, transactionVersion)
 {
     if (!isPrunable)
     {
         var length = reader.ReadInt32();
         IsText = length < 0;
         if (length < 0)
         {
             length &= int.MaxValue;
         }
         Data         = reader.ReadBytes(length);
         Nonce        = reader.ReadBytes(32);
         IsCompressed = version != 2;
     }
 }
예제 #10
0
 public CreateTransactionByPublicKey(short deadline, Amount fee, BinaryHexString publicKey)
     : base(false, deadline, fee)
 {
     PublicKey = publicKey;
 }
예제 #11
0
 public PublicKeyAnnouncement(BinaryReader reader, byte transactionVersion) : base(reader, transactionVersion)
 {
     RecipientPublicKey = reader.ReadBytes(32);
 }
예제 #12
0
 private PublicKeyAnnouncement(BinaryHexString recipientPublicKey)
 {
     RecipientPublicKey = recipientPublicKey;
 }
예제 #13
0
 private EncryptedMessage(JToken messageToken, bool isPrunable, string encryptedMessageHash)
     : base(messageToken)
 {
     IsPrunable           = isPrunable;
     EncryptedMessageHash = encryptedMessageHash;
 }
 public AlreadyEncryptedMessageToSelf(BinaryHexString message, BinaryHexString messageNonce, bool isText, bool isCompressed)
     : base(message, isText, isCompressed)
 {
     Nonce = messageNonce;
 }
 internal AbstractEncryptedMessageToSelf(BinaryHexString message, bool messageIsText, bool compressMessage)
 {
     MessageIsText   = messageIsText;
     CompressMessage = compressMessage;
     Message         = message;
 }
 public AlreadyEncryptedMessage(BinaryHexString message, BinaryHexString encryptedMessageNonce, bool isText, bool isCompressed, bool isPrunable = false)
     : base(message, isText, isCompressed, isPrunable)
 {
     Nonce = encryptedMessageNonce;
 }
예제 #17
0
 internal ShufflingRegistrationAttachment(JToken jToken)
 {
     ShufflingFullHash = GetAttachmentValue <string>(jToken, Parameters.ShufflingFullHash);
 }
예제 #18
0
 public AccountWithPublicKey(ulong accountId, BinaryHexString publicKey)
     : base(accountId)
 {
     PublicKey = publicKey;
 }
예제 #19
0
 public AccountWithPublicKey(string accountRs, BinaryHexString publicKey)
     : base(accountRs)
 {
     PublicKey = publicKey;
 }
예제 #20
0
 internal TaggedDataUploadAttachment(JToken jToken)
 {
     Hash = new BinaryHexString(GetAttachmentValue <string>(jToken, Parameters.Hash));
     ParseTaggedData(jToken);
 }
예제 #21
0
 internal ShufflingVerificationAttachment(JToken jToken)
 {
     ShufflingId        = GetAttachmentValue <ulong>(jToken, Parameters.Shuffling);
     ShufflingStateHash = GetAttachmentValue <string>(jToken, Parameters.ShufflingStateHash);
 }