Real-time events/callbacks?

#1

I am thinking about building a really simple web app to demonstrate the testnet – something really simple like sending transactions between known accounts

To give the demo some sizzle, and to demonstrate the unique speed / fast finality of algorand, what I would like to do is visually indicate when the transaction has been confirmed

Ideally there would be a way to register some kind of callback with the node, which would then ping the JS client when the tx was confirmed

Any thoughts on how best to accomplish doing this? A simple start would be to just poll the node from the JS client and look for the published transaction, but that seems less elegant

It is also possible that I am just thinking about this the wrong way entirely, so happy to be educated if that’s the case

Thanks!
Nick

1 Like
#2

Nick,

I like this idea. We are working on a JS SDK. This should be available soon. You could build on top of the REST API, but you may want to hold for just a bit and let us get the JS SDK out. I am not certain it will have callbacks though.

Jason

#3

This is not something we’re going to provide in the REST API itself. You will need to poll the node. There will be no callbacks in our API.

1 Like
#4

Jason,

Do you have a rough estimate for the availability of the JS SDK? I also have an interest in developing some basic web Apps.

#5

We are hoping to put something out in the next couple of weeks on a couple of APIs.

1 Like
#6

Very excited about that!

#7

Webhooks are very useful in a node and wallet, this should be straightforward to implement

#8

@David would you mind going into a little more detail as to why this design decision was made? Are there any specific tradeoffs?

#9

These things can be implemented on top of the REST APIs. We want to ensure we provide the necessary primitives to build on top of. Higher-level abstractions and convenience features can be added by the community if we don’t get to them.

2 Likes
#10

Ah, great. That was my assumption. Once we open, the API basically turns into an OPI or “Open Protocol Interface.” :sunglasses:

Thank you for your answer.

1 Like