I have two Clarity contracts (lets call them A and B), and an application that listens to function calls on A, using the @stacks API client.
This works fine for when I manually call any function on A (using scripts or the Sandbox, initiating a transaction
).
But if I am calling a function of A from contract B like so:
(as-contract (contract-call? .contract-A contract-A-function-name param1 param2))
Let's say contract-A-function-name
is a simple function with just a (print) event.
This is successful, but there is no separate tx/event to listen to on contract A. This might be intended behaviour, but my question is nevertheless: Is there a way to know when contract-A's function was called this way?
That's right, there is no event reported when a function is called, but there is an event for the print that you can find. You can query for events and get a response like this: