async function optInTx (deployer, managerAcc, lsig, assetIndex) {
  const optInTx = [
    {
      type: types.TransactionType.TransferAlgo,
      sign: types.SignType.SecretKey,
      fromAccount: managerAcc,
      toAccountAddr: lsig.address(),
      amountMicroAlgos: 0,
      payFlags: {}
    },
    {
      type: types.TransactionType.OptInASA,
      sign: types.SignType.LogicSignature,
      fromAccountAddr: lsig.address(),
      lsig: lsig,
      assetID: assetIndex,
      payFlags: {}
    }
  ];
  await executeTransaction(deployer, optInTx);
}
/**
 * Returns Opt-In lsigs to a given asa transaction
 * Note: only manager is allowed to opt-in lsigs to asa
 * This is because, no other user can spam asa opt-in in lsigs
 * @param deployer deployer object
 * @param managerAcc manager account
 * @param lsig logic signature
 * @param assetIndex asset index
 */
Returns Opt-In lsigs to a given asa transaction
Note: only manager is allowed to opt-in lsigs to asa
This is because, no other user can spam asa opt-in in lsigs
@param deployer deployer object
@param managerAcc manager account
@param lsig logic signature
@param assetIndex asset index
Returns Opt - In lsigs to a given asa transaction Note : only manager is allowed to opt - in lsigs to asa This is because no other user can spam asa opt - in in lsigs @param deployer deployer object @param managerAcc manager account @param lsig logic signature @param assetIndex asset index
async function optInTx (deployer, managerAcc, lsig, assetIndex) {
  const optInTx = [
    {
      type: types.TransactionType.TransferAlgo,
      sign: types.SignType.SecretKey,
      fromAccount: managerAcc,
      toAccountAddr: lsig.address(),
      amountMicroAlgos: 0,
      payFlags: {}
    },
    {
      type: types.TransactionType.OptInASA,
      sign: types.SignType.LogicSignature,
      fromAccountAddr: lsig.address(),
      lsig: lsig,
      assetID: assetIndex,
      payFlags: {}
    }
  ];
  await executeTransaction(deployer, optInTx);
}
async function optInTx ( deployer , managerAcc , lsig , assetIndex ) { const optInTx = [ { type : types . TransactionType . TransferAlgo , sign : types . SignType . SecretKey , fromAccount : managerAcc , toAccountAddr : lsig . address ( ) , amountMicroAlgos : 0 , payFlags : { } } , { type : types . TransactionType . OptInASA , sign : types . SignType . LogicSignature , fromAccountAddr : lsig . address ( ) , lsig : lsig , assetID : assetIndex , payFlags : { } } ] ; await executeTransaction ( deployer , optInTx ) ; }
Returns Opt-In lsigs to a given asa transaction
 Note: only manager is allowed to opt-in lsigs to asa
 This is because, no other user can spam asa opt-in in lsigs
 @param deployer deployer object
 @param managerAcc manager account
 @param lsig logic signature
 @param assetIndex asset index
Returns Opt - In lsigs to a given asa transaction Note : only manager is allowed to opt - in lsigs to asa This is because no other user can spam asa opt - in in lsigs @param deployer deployer object @param managerAcc manager account @param lsig logic signature @param assetIndex asset index