I am creating an inner transaction to opt-in to a ASA from a application creating transaction in PyTeal. I understand that asset array should have the asset id for that. How do I pass the asset id to this asset array so that the inner transaction can use that.
I tried setting TxnField.assets in the inner transaction then i get error : unexpected array field
I tried passing the asset id through parameter Assets in application creating transaction.
I tried passing the asset id through parameter ForeignAssets in application creating transaction. Both these are not recognised in Txn.assets[0] saying invalid Assets index 0
The asset array TxnFields.assets is used to list assets that an application can access.
You do not need and actually cannot set this field in inner transactions.
The field you are looking for is TxnField.xfer_asset.
Thanks for the reply. How to pass the asset id to TxnField.xfer_asset. when i directly provide the asset id like InnerTxnBuilder.SetField(TxnField.xfer_asset, Int(43714228)) getting the error : algosdk.error.AlgodHTTPError: TransactionPool.Remember: transaction BDULPKBE27L5VQ5IMC3NOW2I5AR3QNDWH5OMRS4A27XAUXQNVFOQ: logic eval error: invalid Asset reference 43714228