These are chat archives for Nethereum/Nethereum
Hello, could anyone help me with events?
I have a contract with tokens, in ethereum wallet(mist) I can see events about who buy tokens(and how much tokens),
but in code I can't get this information, I tried something like that
var tokenPurchaseEvent = contract.GetEvent("TokenTransferEvent"); var param1 = new BlockParameter(0); // from first block var param2 = new BlockParameter(); // to latest block var filter = tokenPurchaseEvent.CreateFilterInput(param1, param2); var events = await tokenPurchaseEvent.GetAllChanges<TokenPurchaseData>(filter); // here I got exception because logs are really different form TokenPurchaseData model //also I tried var tokenPurchaseEvent = contract.GetEvent("TokenTransferEvent"); var filter = await tokenPurchaseEvent.CreateFilterAsync(); var logs = await tokenPurchaseEvent.GetAllChanges<TokenPurchaseData>(filter); // empty result var logs = await tokenPurchaseEvent.GetFilterChanges<TokenPurchaseData>(filter); // empty result
When I tried through CreateFilterInput-way I got correct count of events, but data was really "low-level" (fields -address, topics, data, blockNumber, transactionHash, transactionIndex, blockHash, logIndex, removed).
I'm expecting fields - investor, value, tokens.
What I'm doing wrong?