#How to get pending inner transactions using the API?

3 messages · Page 1 of 1 (latest)

loud lilyBOT
#

Hi @granite walrus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

To get pending inner transactions using the Algorand API, you need to look for the inner-txns field in the pending transaction response. Here's how you can access this information:

  1. First, retrieve the pending transaction using its ID.
  2. In the response, look for the inner-txns field, which contains an array of inner transactions produced by the application execution.

According to the Algod REST API documentation (https://developer.algorand.org/docs/rest-apis/algod/#pendingtransactionresponse), the PendingTransactionResponse includes an optional inner-txns field:

"inner-txns" *optional* : Inner transactions produced by application execution. < **PendingTransactionResponse** (<https://developer.algorand.org/docs/rest-apis/algod/#pendingtransactionresponse>) > array

If you're using the JavaScript SDK, you can access the inner transactions through the innerTxns property of the PendingTransactionResponse object, as shown in the JS Algorand SDK documentation (https://algorand.github.io/js-algorand-sdk/classes/modelsv2.PendingTransactionResponse.html):

innerTxns?: PendingTransactionResponse[]

It's important to note that inner transactions will only be present if the application execution actually produced them. If there are no inner transactions, this field will be empty or not present.

Remember that pending transactions are not guaranteed to be included in a block, so the inner transactions you see in a pending transaction response might change or disappear if the transaction is not confirmed.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@granite walrus Kapa.ai is still learning and improving, please let me know how I did by reacting below.