Skip to content

Unable to deserialize event from ABI for usage in getLogs call #7

@pointtoken

Description

@pointtoken

Hi Guys - Love the library. We are using it in several places as we continue to develop our decentralized reward and loyalty system. One thing we do is use you to call getLogs in order to query for events on the blockchain, which is how we store achievements on chain. However, try as we might we could not successfully serialize our event from the ABI such that it could be passed to your getLogs call and we had to resort to Web3 as you can see below:

let getAchievements = (address) => {
	//using web3 to format the options correctly
	let event = pointTokenContractInstanceWeb3.Award({ _to: address }, { fromBlock: config.blockFrom, toBlock: 'latest' });
	eth.getLogs(event.options).then(result => {
		result.map(r => {
			//console.log(r);
			console.log(new BN(util.stripHexPrefix(r.topics[3])).toNumber());
		});
	});
};

It would be really cool to use your stuff only and not have to pull in Web3. The ABI created from your code works great for everything else. Any ideas?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions