private void _remote_Transactions(object sender, TransactionsEventArgs e) { if (_books.Count == 0) { return; } var response = e.Result; var books = ResponseParser.AffectBooks(response.Transaction, response.Meta); if (books == null) { return; } var result = new MessageResult <TxResult>(e.Message, null, response.TxResult); foreach (var book in books) { if (_books.ContainsKey(book)) { _books[book](result); } } }
private void _remote_Transactions(object sender, TransactionsEventArgs e) { if (_accounts.Count == 0) { return; } var response = e.Result; var accounts = ResponseParser.AffectedAccounts(response.Transaction, response.Meta); foreach (var account in accounts) { if (_accounts.ContainsKey(account)) { var result = ResponseParser.ProcessTx(response.Transaction, response.Meta, account); _accounts[account].Invoke(new MessageResult <TxResult>(e.Message, null, result)); } } }
private void HandleTransaction(string data) { if (_transactions == null) { return; } var response = JsonConvert.DeserializeObject <TransactionResponse>(data); var hash = response.Transaction.Hash; if (_txCache.Contains(hash)) { return; } _txCache.Add(hash, true); response.TxResult = ResponseParser.ProcessTx(response.Transaction, response.Meta, response.Transaction.Account); var args = new TransactionsEventArgs { Message = data, Result = response }; OnTransactions(args); }
private void OnTransactions(TransactionsEventArgs eArgs) { _transactions?.Invoke(this, eArgs); }