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)); }
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); } } }