Open BeeSeeChain opened 6 years ago
Hi, @BeeSeeChain
To have Solidity emit events that you can listen to on the dApp, you'll have to run the event within the relevant context. For example, using the event won
that you declared in this issue (assuming amount
is known), one would expect to see a method where the event is emitted thus:
won(true, amount)
By running the event as stated above, Solidity emits the won
event, which can easily be listened to outside the blockchain.
Let us know if this helps or not [hoping it'll help :)].
Thanks for your reply but when i'm doing like this in Vue for listening event like this
let playgroundBattleContractInstance = contract(PlaygroundBattleContractJSON)
playgroundBattleContractInstance.setProvider(this.$store.state.web3.instance().currentProvider)
let won = playgroundBattleContractInstance.won()
won.watch((err, result) => {
if (err) {
console.log('could not get event won()')
} else {
this.winEvent = result.args
this.pending = false
}
})
i will recived that error : Uncaught (in promise) TypeError: playgroundBattleContractInstance.won is not a function
so can i do for listening solidity event correctly in DOkwufulueze/eth-vue?how should i write the Code?
@BeeSeeChain Could you check the logs to see how playgroundBattleContractInstance
is structured? That should help you try to read its members correctly.
Hi, i'm using the amazing framework,but i couldn't to getting a event of solidity in VUE,for example: PlaygroudBattle.sol contract PlaygroundBattle is Destructible { address public dbAddress;
}
The problem is: How should i to do for using "event won() " in DOkwufulueze/eth-vue framework in VUE?