这是我对Etherum的第一个实验,当我尝试检索过去的事件时遇到此错误。 Web3版本:^ 1.0.0-beta.55
App.todoList.getPastEvents is not a function
这是我的js文件
getEvents: async () => {
const todoList = await $.getJSON('TodoList.json')
todoList.getPastEvents('TaskCreated', {
filter: {myIndexedParam: [20,23], myOtherIndexedParam: '0x123456789...'},
fromBlock: 0,
toBlock: 'latest'
}, (error, events) => { console.log(events); })
.then((events) => {
console.log(events) // same results as the optional callback above
});
}
预先感谢 安德里亚