import { getAwaitedTasks } from '../../runtime';

import { prepareTx } from './prepareTxs';

export const constructTx = (isFullyExecuted: boolean) => {
  const awaitedTasks = getAwaitedTasks();

  const { calls, txFee } = prepareTx({ awaitedTasks, isFullyExecuted, txFee: 0n });

  const { txs } = prepareTx({ awaitedTasks, isFullyExecuted, txFee, callsCount: calls });

  return txs;
};
