Callback when transaction is done

Is there a way where we can add a callback link to the transaction and when it is done, it gives a call back to the system.

Thanks in advance.

I’m not aware of any way to do that easily. One way to accomplish that would be as follows -

  1. Install an Algorand node and an Algorand indexer.
  2. Configure the indexer to use a Postgres database.
  3. Create a trigger on the Postgres database that would identify the said transaction and invoke something like GitHub - pramsey/pgsql-http: HTTP client for PostgreSQL, retrieve a web page from inside the database..

I have not tried to implement the above, but I believe that it should be doable.

I am looking for a solution similar to this:

Blockchain Receive Payments API: Accept Bitcoin Payments - Blockchain

So, just to make sure I understand what you’re looking for -

You’re wondering if there is a way for your local node to issue a http callback once a transaction was successfully included in a block.

Is that the case ?

Yes you are right, like in btc if there is a transaction against a product or service, it will give a callback to the system on transaction confirmation.

Currently, neither the REST API, nor the goal client provides that functionality.

If the transaction is sent from the local host, once the transaction is sent ( and before its being included in a block ), you can spin a separate process that would monitor the transaction state using pending-transaction-information, and implement the callback as needed yourself.

I’m not a big fan of the above solution since

  • it’s limited to transactions being sent from your local host
  • it’s not scalable

I wish I had a better answer here… please let me know if that helps.

Thanks tsachi, I will look into it and if i found a solution, i will let you know too.