@algorandfoundation/algokit-utils 7.0.0-beta.7 → 7.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -338,11 +338,11 @@ class AppClient {
338
338
  */
339
339
  async compile(compilation) {
340
340
  const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation);
341
- if (result.compiledApproval) {
342
- this._approvalSourceMap = result.compiledApproval.sourceMap;
341
+ if (result.approvalProgramCompilationResult) {
342
+ this._approvalSourceMap = result.approvalProgramCompilationResult.sourceMap;
343
343
  }
344
- if (result.compiledClear) {
345
- this._clearSourceMap = result.compiledClear.sourceMap;
344
+ if (result.clearStateProgramCompilationResult) {
345
+ this._clearSourceMap = result.clearStateProgramCompilationResult.sourceMap;
346
346
  }
347
347
  return result;
348
348
  }
@@ -394,31 +394,29 @@ class AppClient {
394
394
  }
395
395
  return {
396
396
  approvalProgram: Buffer.from(appSpec.byteCode.approval, 'base64'),
397
- compiledApproval: undefined,
398
397
  clearStateProgram: Buffer.from(appSpec.byteCode.clear, 'base64'),
399
- compiledClear: undefined,
400
398
  };
401
399
  }
402
400
  const approvalTemplate = Buffer.from(appSpec.source.approval, 'base64').toString('utf-8');
403
- const compiledApproval = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, {
401
+ const approvalProgramCompilationResult = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, {
404
402
  updatable,
405
403
  deletable,
406
404
  });
407
405
  const clearTemplate = Buffer.from(appSpec.source.clear, 'base64').toString('utf-8');
408
- const compiledClear = await appManager.compileTealTemplate(clearTemplate, deployTimeParams);
406
+ const clearStateProgramCompilationResult = await appManager.compileTealTemplate(clearTemplate, deployTimeParams);
409
407
  if (Config.debug) {
410
408
  await Config.events.emitAsync(EventType.AppCompiled, {
411
409
  sources: [
412
- { compiledTeal: compiledApproval, appName: appSpec.name, fileName: 'approval' },
413
- { compiledTeal: compiledClear, appName: appSpec.name, fileName: 'clear' },
410
+ { compiledTeal: approvalProgramCompilationResult, appName: appSpec.name, fileName: 'approval' },
411
+ { compiledTeal: clearStateProgramCompilationResult, appName: appSpec.name, fileName: 'clear' },
414
412
  ],
415
413
  });
416
414
  }
417
415
  return {
418
- approvalProgram: compiledApproval.compiledBase64ToBytes,
419
- compiledApproval,
420
- clearStateProgram: compiledClear.compiledBase64ToBytes,
421
- compiledClear,
416
+ approvalProgram: approvalProgramCompilationResult.compiledBase64ToBytes,
417
+ approvalProgramCompilationResult,
418
+ clearStateProgram: clearStateProgramCompilationResult.compiledBase64ToBytes,
419
+ clearStateProgramCompilationResult,
422
420
  };
423
421
  }
424
422
  /**
@@ -540,7 +538,14 @@ class AppClient {
540
538
  return {
541
539
  /** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */
542
540
  update: async (params) => {
543
- return await this.handleCallErrors(async () => this._algorand.send.appUpdate(await this.params.bare.update(params)));
541
+ const compiled = await this.compile(params);
542
+ return {
543
+ ...(await this.handleCallErrors(async () => this._algorand.send.appUpdate(await this.params.bare.update(params)))),
544
+ ...{
545
+ compiledApproval: compiled.approvalProgramCompilationResult,
546
+ compiledClear: compiled.clearStateProgramCompilationResult,
547
+ },
548
+ };
544
549
  },
545
550
  /** Signs and sends an opt-in call */
546
551
  optIn: (params) => {
@@ -612,7 +617,10 @@ class AppClient {
612
617
  const compiled = await this.compile(params);
613
618
  return {
614
619
  ...(await this.handleCallErrors(async () => this.processMethodCallReturn(this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), getArc56Method(params.method, this._appSpec)))),
615
- ...compiled,
620
+ ...{
621
+ compiledApproval: compiled.approvalProgramCompilationResult,
622
+ compiledClear: compiled.clearStateProgramCompilationResult,
623
+ },
616
624
  };
617
625
  },
618
626
  /**
@@ -643,7 +651,9 @@ class AppClient {
643
651
  const result = await this._algorand
644
652
  .newGroup()
645
653
  .addAppCallMethodCall(await this.params.call(params))
646
- .simulate();
654
+ .simulate({
655
+ allowUnnamedResources: params.populateAppCallResources,
656
+ });
647
657
  return this.processMethodCallReturn({
648
658
  ...result,
649
659
  transaction: result.transactions.at(-1),