The script is incomplete it seems; you need to first receive the trigger from Sheets when a row is added. I think it should be this - it works on manual row additions, but it’s not working from Sheets yet for me:
function onEdit(e) {
const outputSheetName = "Copy of Transactions"
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const outputSheet = spreadsheet.getSheetByName( outputSheetName );
const range = e.range
const output = result(range.getValues())
// do something with output
}