diff --git a/src/services/invitation.ts b/src/services/invitation.ts index a740853..6934492 100644 --- a/src/services/invitation.ts +++ b/src/services/invitation.ts @@ -510,7 +510,7 @@ export class Invitation extends EventEmitter { const templates = await this.engine.listImportedTemplates(); // For each template, we need to create a 2d array of all the outputs - const outputs = templates.map(template => { + const outputs = templates.flatMap(template => { return Object.keys(template.outputs).map(output => { const templateIdentifier = generateTemplateIdentifier(template); @@ -522,7 +522,7 @@ export class Invitation extends EventEmitter { }); // then, for each output, we need to get the spendable resources - const spendableResources = await Promise.all(outputs.flat().map(output => { + const spendableResources = await Promise.all(outputs.map(output => { return this.engine.getSpendableResources(this.data, { templateIdentifier: output.templateIdentifier, outputIdentifier: output.outputIdentifier,