예제 #1
0
        private static string CalculateChecksum(string address)
        {
            // TODO inject curl
            Curl curl = new Curl();

            curl.Reset();
            curl.State = Converter.CopyTrits(address, curl.State);
            curl.Transform();
            return(Converter.ToTrytes(curl.State).Substring(0, 9));
        }
예제 #2
0
        public static void SignSignatures(this IEnumerable <TransactionItem> transactionItems, IEnumerable <AddressItem> addressItems)
        {
            var curl = new Curl();

            foreach (var transactionItem in transactionItems)
            {
                var addressItem = addressItems.FirstOrDefault(a => a.Address == transactionItem.Address);
                if (addressItem != null)
                {
                    transactionItem.SignSignature(addressItem.PrivateKey, curl);
                }
            }
        }