Event Listening Using Go-SDK #611
Unanswered
rudreshkoranne
asked this question in
Questions
Replies: 1 comment
-
We have a template that includes an indexer example, but it's in rust cuz the indexer sdk is in rust. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
No response
Describe your question in detail.
Hello Everyone!!!
I'm trying to build a service where I want to listen to events emitted by a Contract.
Now I have achieved this using the
@aptos-labs/ts-sdk
and the method is below:const latestEvent = async (EventName: string) => { try { let x = await aptos.getModuleEventsByEventType({ eventType:
${MODULEADDRESS}::${MODULENAME}::${EventName}, options: { limit: 10, orderBy: [{ transaction_version: "desc" }] }, }); } catch (e) { console.log("Error: ", e); } };
Now I want to implement this function using aptos-go-sdk and here this function queries the blockchain and bring back event details, which means I have to execute this continuously. But instead what I want is whenever any Event gets triggered on chain, the service should note that down.
Can anyone please help me on how to achieve this thing.
Thanks!!!
What error, if any, are you getting?
No response
What have you tried or looked at? Or how can we reproduce the error?
No response
Which operating system are you using?
Linux (Ubuntu, Fedora, Windows WSL, etc.)
Which SDK or tool are you using? (if any)
N/A
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions