@algorandfoundation/algokit-utils 7.0.1 → 7.0.2

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.
@@ -5,7 +5,7 @@ import { replaceDeployTimeControlParams, performTemplateSubstitution, deployApp,
5
5
  import { Config } from '../config.mjs';
6
6
  import { legacySendTransactionBridge } from '../transaction/legacy-bridge.mjs';
7
7
  import { getSenderAddress, encodeTransactionNote } from '../transaction/transaction.mjs';
8
- import { binaryStartsWith } from '../util.mjs';
8
+ import { asJson, binaryStartsWith } from '../util.mjs';
9
9
  import { UPDATABLE_TEMPLATE_NAME, DELETABLE_TEMPLATE_NAME } from './app.mjs';
10
10
  import { getArc56Method, getArc56ReturnValue, getABITupleFromABIStruct, getABIDecodedValue, getABIEncodedValue } from './app-arc56.mjs';
11
11
  import { arc32ToArc56 } from './app-spec.mjs';
@@ -180,7 +180,7 @@ class AppClient {
180
180
  const availableAppSpecNetworks = Object.keys(appSpec.networks ?? {});
181
181
  const networkIndex = availableAppSpecNetworks.findIndex((n) => networkNames.includes(n));
182
182
  if (networkIndex === -1) {
183
- throw new Error(`No app ID found for network ${JSON.stringify(networkNames)} in the app spec`);
183
+ throw new Error(`No app ID found for network ${asJson(networkNames)} in the app spec`);
184
184
  }
185
185
  const appId = BigInt(appSpec.networks[networkIndex].appID);
186
186
  return new AppClient({ ...params, appId, appSpec });
@@ -474,8 +474,8 @@ class AppClient {
474
474
  getLineForPc);
475
475
  }
476
476
  if (errorMessage) {
477
- const appId = JSON.stringify(e).match(/(?<=app=)\d+/)?.[0] || '';
478
- const txId = JSON.stringify(e).match(/(?<=transaction )\S+(?=:)/)?.[0];
477
+ const appId = asJson(e).match(/(?<=app=)\d+/)?.[0] || '';
478
+ const txId = asJson(e).match(/(?<=transaction )\S+(?=:)/)?.[0];
479
479
  const error = new Error(`Runtime error when executing ${appSpec.name} (appId: ${appId}) in transaction ${txId}: ${errorMessage}`);
480
480
  error.cause = e;
481
481
  return error;