How to capture the event emit in Sophia contract?


#1

How to capture the event emit in Sophia contract ?

public stateful function transfer(to : address, tokens : int) = 
	put( state{balances[Call.caller] = sub(state.balances[Call.caller], tokens) })
	put( state{balances[to] = add(Map.lookup_default(to, state.balances, 0), tokens) })
	transferEvent(Call.caller, to, tokens)
	true

How to capture the transferEvent in javascript?

Thank you!


#2

Hey @chenn

We’ve forwarded your question, our devs will answer you as soon as possible :wink:

Best,
Albena


#3

Hey @chenn,

The Core team have implementing exposure of events so that someone can programmatically subscribe to (& capture them) as far as Sophia smart contracts are concerned.

However, they are not yet implemented in the SDK. We are working on that and will let you know once it’s done.

Best,
Albena