Hi I am developing project where there are multiple transactions throughout the project one of which is creation of contract for which I have created transaction as follows using python sdk
catching txn in my api as follows and while returning it to pass to front-end so that I can use Algosigner sign and send functionality It gives me error
Error: TypeError: Object of type 'ApplicationCreateTxn' is not JSON serializable
It would be best if you used JS SDK to build transactions.
Using python SDK you need to send that transaction to frontend and you will have serialization issues.
Hi,
I am able to create ApplicationCreateTxn using Pythonsdk and Sign and Send the transaction using algosigner. But in response I am only getting txn. I also need App ID for further actions on application. How do I get that?
I am already sending the transaction AlgoSigner.send({ ledger: 'TestNet', tx: signedTxs[0].blob, })
Also able to view Application ID and transaction on testnet explorer. But algosigner is not returning application ID
Do I need to send it using sdk ?
You need to get the transaction back from the network in order to get it’s AppID. Just as you searched for the ID on the explorer, you need to do the same but from your code.
That can be done with a call to Indexer like I mentioned; I also think you can use Algod to call the pending transactions endpoint after the tx is sent and you’re waiting for confirmation.
Hi
How did you serialze the ApplicationCreateTxn and sent it to frontend please?
I appreciate your help
I also have this “TypeError: Object of type ‘ApplicationCreateTxn’ is not JSON serializable”
error
The best solution is always to msgpack serialize transactions between frontend and backend.
If the transfer is to be taken in text format, you should in addition base64 the result.
See Encoding and Decoding - Algorand Developer Portal for details