@algorandfoundation/algokit-utils 1.0.0 → 1.1.1-beta.1

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.
Files changed (112) hide show
  1. package/README.md +38 -0
  2. package/account.d.ts +11 -10
  3. package/account.d.ts.map +1 -1
  4. package/account.js +13 -12
  5. package/account.js.map +1 -1
  6. package/amount.d.ts +15 -3
  7. package/amount.d.ts.map +1 -1
  8. package/amount.js +15 -3
  9. package/amount.js.map +1 -1
  10. package/app-client.d.ts +14 -0
  11. package/app-client.d.ts.map +1 -0
  12. package/app-client.js +19 -0
  13. package/app-client.js.map +1 -0
  14. package/{deploy-app.d.ts → app-deploy.d.ts} +16 -14
  15. package/app-deploy.d.ts.map +1 -0
  16. package/{deploy-app.js → app-deploy.js} +47 -28
  17. package/app-deploy.js.map +1 -0
  18. package/app.d.ts +53 -8
  19. package/app.d.ts.map +1 -1
  20. package/app.js +305 -146
  21. package/app.js.map +1 -1
  22. package/index.d.ts +2 -2
  23. package/index.d.ts.map +1 -1
  24. package/index.js +2 -2
  25. package/index.js.map +1 -1
  26. package/indexer-lookup.d.ts +11 -4
  27. package/indexer-lookup.d.ts.map +1 -1
  28. package/indexer-lookup.js +19 -9
  29. package/indexer-lookup.js.map +1 -1
  30. package/localnet.d.ts +7 -7
  31. package/localnet.js +7 -7
  32. package/network-client.d.ts +4 -4
  33. package/network-client.js +5 -5
  34. package/network-client.js.map +1 -1
  35. package/package.json +1 -1
  36. package/testing/account.d.ts +2 -2
  37. package/testing/account.js +2 -2
  38. package/testing/fixtures/algorand-fixture.d.ts +6 -2
  39. package/testing/fixtures/algorand-fixture.d.ts.map +1 -1
  40. package/testing/fixtures/algorand-fixture.js +19 -8
  41. package/testing/fixtures/algorand-fixture.js.map +1 -1
  42. package/testing/indexer.d.ts.map +1 -1
  43. package/testing/indexer.js +1 -0
  44. package/testing/indexer.js.map +1 -1
  45. package/testing/test-logger.d.ts +3 -1
  46. package/testing/test-logger.d.ts.map +1 -1
  47. package/testing/test-logger.js +4 -2
  48. package/testing/test-logger.js.map +1 -1
  49. package/testing/transaction-logger.d.ts +4 -4
  50. package/testing/transaction-logger.d.ts.map +1 -1
  51. package/testing/transaction-logger.js +4 -4
  52. package/testing/transaction-logger.js.map +1 -1
  53. package/transaction.d.ts +54 -13
  54. package/transaction.d.ts.map +1 -1
  55. package/transaction.js +201 -93
  56. package/transaction.js.map +1 -1
  57. package/transfer.d.ts +4 -3
  58. package/transfer.d.ts.map +1 -1
  59. package/transfer.js +10 -8
  60. package/transfer.js.map +1 -1
  61. package/types/account.d.ts +6 -3
  62. package/types/account.d.ts.map +1 -1
  63. package/types/account.js +7 -2
  64. package/types/account.js.map +1 -1
  65. package/types/algo-http-client-with-retry.js +1 -1
  66. package/types/algo-http-client-with-retry.js.map +1 -1
  67. package/types/algod.d.ts +6 -6
  68. package/types/algod.d.ts.map +1 -1
  69. package/types/amount.d.ts +6 -2
  70. package/types/amount.d.ts.map +1 -1
  71. package/types/amount.js +6 -2
  72. package/types/amount.js.map +1 -1
  73. package/types/{application-client.d.ts → app-client.d.ts} +75 -22
  74. package/types/app-client.d.ts.map +1 -0
  75. package/types/{application-client.js → app-client.js} +135 -56
  76. package/types/app-client.js.map +1 -0
  77. package/types/app-spec.d.ts +136 -0
  78. package/types/app-spec.d.ts.map +1 -0
  79. package/types/{appspec.js → app-spec.js} +5 -7
  80. package/types/app-spec.js.map +1 -0
  81. package/types/app.d.ts +23 -17
  82. package/types/app.d.ts.map +1 -1
  83. package/types/app.js.map +1 -1
  84. package/types/config.d.ts +19 -2
  85. package/types/config.d.ts.map +1 -1
  86. package/types/config.js +28 -2
  87. package/types/config.js.map +1 -1
  88. package/types/indexer.d.ts +360 -49
  89. package/types/indexer.d.ts.map +1 -1
  90. package/types/indexer.js +9 -0
  91. package/types/indexer.js.map +1 -1
  92. package/types/logic-error.d.ts +5 -1
  93. package/types/logic-error.d.ts.map +1 -1
  94. package/types/logic-error.js +6 -2
  95. package/types/logic-error.js.map +1 -1
  96. package/types/testing.d.ts +9 -9
  97. package/types/testing.d.ts.map +1 -1
  98. package/types/transaction.d.ts +54 -9
  99. package/types/transaction.d.ts.map +1 -1
  100. package/types/transfer.d.ts +7 -7
  101. package/types/transfer.d.ts.map +1 -1
  102. package/application-client.d.ts +0 -10
  103. package/application-client.d.ts.map +0 -1
  104. package/application-client.js +0 -15
  105. package/application-client.js.map +0 -1
  106. package/deploy-app.d.ts.map +0 -1
  107. package/deploy-app.js.map +0 -1
  108. package/types/application-client.d.ts.map +0 -1
  109. package/types/application-client.js.map +0 -1
  110. package/types/appspec.d.ts +0 -77
  111. package/types/appspec.d.ts.map +0 -1
  112. package/types/appspec.js.map +0 -1
@@ -27,16 +27,36 @@ exports.ApplicationClient = void 0;
27
27
  const algosdk_1 = __importStar(require("algosdk"));
28
28
  const buffer_1 = require("buffer");
29
29
  const app_1 = require("../app");
30
- const deploy_app_1 = require("../deploy-app");
30
+ const app_deploy_1 = require("../app-deploy");
31
31
  const transaction_1 = require("../transaction");
32
32
  const transfer_1 = require("../transfer");
33
33
  const app_2 = require("./app");
34
- const appspec_1 = require("./appspec");
35
34
  const logic_error_1 = require("./logic-error");
35
+ /**
36
+ * Determines deploy time control (UPDATABLE, DELETABLE) value by inspecting application specification
37
+ * @param approval TEAL Approval program, not the base64 version found on the appSpec
38
+ * @param appSpec Application Specification
39
+ * @param templateVariableName Template variable
40
+ * @param callConfigKey Call config type
41
+ * @returns true if applicable call config is found, false if not found or undefined if variable not present
42
+ */
43
+ function getDeployTimeControl(approval, appSpec, templateVariableName, callConfigKey) {
44
+ // variable not present, so unknown control value
45
+ if (!approval.includes(templateVariableName))
46
+ return undefined;
47
+ // a bare call for specified CallConfig is present and configured
48
+ const bareCallConfig = appSpec.bare_call_config[callConfigKey];
49
+ if (!!bareCallConfig && bareCallConfig !== 'NEVER')
50
+ return true;
51
+ // an ABI call for specified CallConfig is present and configured
52
+ return Object.values(appSpec.hints).some((h) => {
53
+ const abiCallConfig = h.call_config[callConfigKey];
54
+ return !!abiCallConfig && abiCallConfig !== 'NEVER';
55
+ });
56
+ }
36
57
  /** Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
37
58
  class ApplicationClient {
38
59
  // todo: process ABI args as needed to make them nicer to deal with like beaker-ts
39
- // todo: support importing and exporting a source map
40
60
  // todo: support readonly, noop method calls
41
61
  // todo: support different oncomplete for create
42
62
  // todo: find create, update, delete, etc. methods from app spec and call them by default
@@ -52,7 +72,13 @@ class ApplicationClient {
52
72
  this.algod = algod;
53
73
  this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
54
74
  this._appName = appIdentifier.name ?? this.appSpec.contract.name;
55
- if ('creatorAddress' in appIdentifier) {
75
+ if ('id' in appIdentifier) {
76
+ if (appIdentifier.id < 0) {
77
+ throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);
78
+ }
79
+ this._appId = appIdentifier.id;
80
+ }
81
+ else {
56
82
  this._appId = 0;
57
83
  this._creator = appIdentifier.creatorAddress;
58
84
  if ('indexer' in appIdentifier) {
@@ -65,20 +91,55 @@ class ApplicationClient {
65
91
  this.existingDeployments = appIdentifier.existingDeployments;
66
92
  }
67
93
  }
68
- else {
69
- if (appIdentifier.id < 0) {
70
- throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);
71
- }
72
- this._appId = appIdentifier.id;
73
- }
74
94
  this._appAddress = algosdk_1.default.getApplicationAddress(this._appId);
75
95
  this.sender = sender;
76
96
  this.params = params;
77
97
  }
98
+ /**
99
+ * Compiles the approval and clear programs and sets up the source map.
100
+ * @param compilation The deploy-time parameters for the compilation
101
+ * @returns The compiled approval and clear programs
102
+ */
103
+ async compile(compilation) {
104
+ const { deployTimeParams, updatable, deletable } = compilation ?? {};
105
+ const approvalTemplate = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
106
+ const approval = (0, app_deploy_1.replaceDeployTimeControlParams)((0, app_deploy_1.performTemplateSubstitution)(approvalTemplate, deployTimeParams), {
107
+ updatable,
108
+ deletable,
109
+ });
110
+ const approvalCompiled = await (0, app_1.compileTeal)(approval, this.algod);
111
+ this._approvalSourceMap = approvalCompiled?.sourceMap;
112
+ const clearTemplate = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
113
+ const clear = (0, app_deploy_1.performTemplateSubstitution)(clearTemplate, deployTimeParams);
114
+ const clearCompiled = await (0, app_1.compileTeal)(clear, this.algod);
115
+ this._clearSourceMap = clearCompiled?.sourceMap;
116
+ return { approvalCompiled, clearCompiled };
117
+ }
118
+ /**
119
+ * Export the current source maps for the app.
120
+ * @returns The source maps
121
+ */
122
+ exportSourceMaps() {
123
+ if (!this._approvalSourceMap || !this._clearSourceMap) {
124
+ throw new Error("Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first");
125
+ }
126
+ return {
127
+ approvalSourceMap: this._approvalSourceMap,
128
+ clearSourceMap: this._clearSourceMap,
129
+ };
130
+ }
131
+ /**
132
+ * Import source maps for the app.
133
+ * @param sourceMaps The source maps to import
134
+ */
135
+ importSourceMaps(sourceMaps) {
136
+ this._approvalSourceMap = new algosdk_1.SourceMap(sourceMaps.approvalSourceMap);
137
+ this._clearSourceMap = new algosdk_1.SourceMap(sourceMaps.clearSourceMap);
138
+ }
78
139
  /**
79
140
  * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
80
141
  *
81
- * To understand the architecture decisions behind this functionality please @see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
142
+ * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
82
143
  *
83
144
  * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.
84
145
  *
@@ -103,27 +164,28 @@ class ApplicationClient {
103
164
  throw new Error(`Attempt to deploy contract with a sender address (${(0, transaction_1.getSenderAddress)(from)}) that differs from the given creator address for this application client: ${this._creator}`);
104
165
  }
105
166
  const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
106
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
167
+ const compilation = {
168
+ deployTimeParams: deployArgs.deployTimeParams,
169
+ updatable: allowUpdate !== undefined
170
+ ? allowUpdate
171
+ : getDeployTimeControl(approval, this.appSpec, app_2.UPDATABLE_TEMPLATE_NAME, 'update_application'),
172
+ deletable: allowDelete !== undefined
173
+ ? allowDelete
174
+ : getDeployTimeControl(approval, this.appSpec, app_2.DELETABLE_TEMPLATE_NAME, 'delete_application'),
175
+ };
176
+ const { approvalCompiled, clearCompiled } = await this.compile(compilation);
107
177
  try {
108
178
  await this.getAppReference();
109
- const result = await (0, deploy_app_1.deployApp)({
179
+ const result = await (0, app_deploy_1.deployApp)({
110
180
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
111
181
  from,
112
- approvalProgram: approval,
113
- clearStateProgram: clear,
182
+ approvalProgram: approvalCompiled.compiledBase64ToBytes,
183
+ clearStateProgram: clearCompiled.compiledBase64ToBytes,
114
184
  metadata: {
115
185
  name: this._appName,
116
186
  version: version ?? '1.0',
117
- updatable: allowUpdate ?? approval.includes(app_2.UPDATABLE_TEMPLATE_NAME)
118
- ? (!this.appSpec.bare_call_config.update_application && this.appSpec.bare_call_config.update_application !== 'NEVER') ||
119
- !!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.update_application &&
120
- this.appSpec.hints[h].call_config.update_application !== 'NEVER')[0]
121
- : undefined,
122
- deletable: allowDelete ?? approval.includes(app_2.DELETABLE_TEMPLATE_NAME)
123
- ? (!this.appSpec.bare_call_config.delete_application && this.appSpec.bare_call_config.delete_application !== 'NEVER') ||
124
- !!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.delete_application &&
125
- this.appSpec.hints[h].call_config.delete_application !== 'NEVER')[0]
126
- : undefined,
187
+ updatable: compilation.updatable,
188
+ deletable: compilation.deletable,
127
189
  },
128
190
  schema: {
129
191
  globalByteSlices: this.appSpec.state.global.num_byte_slices,
@@ -139,8 +201,6 @@ class ApplicationClient {
139
201
  deleteArgs: this.getCallArgs(deleteArgs),
140
202
  ...deployArgs,
141
203
  }, this.algod, this.indexer);
142
- this._approvalSourceMap = result.compiledApproval?.sourceMap;
143
- this._clearSourceMap = result.compiledClear?.sourceMap;
144
204
  // Nothing needed to happen
145
205
  if (result.operationPerformed === 'nothing') {
146
206
  return result;
@@ -167,17 +227,13 @@ class ApplicationClient {
167
227
  if (!sender && !this.sender) {
168
228
  throw new Error('No sender provided, unable to create app');
169
229
  }
170
- const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
171
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
230
+ const { approvalCompiled, clearCompiled } = await this.compile(create);
172
231
  try {
173
232
  const result = await (0, app_1.createApp)({
174
233
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
175
234
  from: sender ?? this.sender,
176
- approvalProgram: (0, deploy_app_1.replaceDeployTimeControlParams)((0, deploy_app_1.performTemplateSubstitution)(approval, deployTimeParams), {
177
- updatable,
178
- deletable,
179
- }),
180
- clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParams),
235
+ approvalProgram: approvalCompiled.compiledBase64ToBytes,
236
+ clearStateProgram: clearCompiled.compiledBase64ToBytes,
181
237
  schema: {
182
238
  globalByteSlices: this.appSpec.state.global.num_byte_slices,
183
239
  globalInts: this.appSpec.state.global.num_uints,
@@ -189,8 +245,6 @@ class ApplicationClient {
189
245
  transactionParams: this.params,
190
246
  ...(sendParams ?? {}),
191
247
  }, this.algod);
192
- this._approvalSourceMap = result.compiledApproval?.sourceMap;
193
- this._clearSourceMap = result.compiledClear?.sourceMap;
194
248
  if (result.confirmation) {
195
249
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
196
250
  this._appId = result.confirmation['application-index'];
@@ -210,18 +264,14 @@ class ApplicationClient {
210
264
  if (!sender && !this.sender) {
211
265
  throw new Error('No sender provided, unable to create app');
212
266
  }
213
- const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
214
- const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
267
+ const { approvalCompiled, clearCompiled } = await this.compile(update);
215
268
  try {
216
269
  const result = await (0, app_1.updateApp)({
217
270
  appId: this._appId,
218
271
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
219
272
  from: sender ?? this.sender,
220
- approvalProgram: (0, deploy_app_1.replaceDeployTimeControlParams)((0, deploy_app_1.performTemplateSubstitution)(approval, deployTimeParams), {
221
- updatable,
222
- deletable,
223
- }),
224
- clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParams),
273
+ approvalProgram: approvalCompiled.compiledBase64ToBytes,
274
+ clearStateProgram: clearCompiled.compiledBase64ToBytes,
225
275
  args: this.getCallArgs(args),
226
276
  note: note,
227
277
  transactionParams: this.params,
@@ -242,16 +292,16 @@ class ApplicationClient {
242
292
  return await this._call(call, 'optin');
243
293
  }
244
294
  async closeOut(call) {
245
- return await this._call(call, 'optin');
295
+ return await this._call(call, 'closeout');
246
296
  }
247
297
  async clearState(call) {
248
- return await this._call(call, 'optin');
298
+ return await this._call(call, 'clearstate');
249
299
  }
250
300
  async delete(call) {
251
- return await this._call(call, 'optin');
301
+ return await this._call(call, 'delete');
252
302
  }
253
303
  async _call(call, callType) {
254
- const { sender, note, sendParams, ...args } = call;
304
+ const { sender, note, sendParams, ...args } = call ?? {};
255
305
  if (!sender && !this.sender) {
256
306
  throw new Error('No sender provided, unable to call app');
257
307
  }
@@ -290,7 +340,7 @@ class ApplicationClient {
290
340
  to: ref.appAddress,
291
341
  amount: amount,
292
342
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
293
- from: this.sender ?? sender,
343
+ from: sender ?? this.sender,
294
344
  note: note,
295
345
  transactionParams: this.params,
296
346
  ...(sendParams ?? {}),
@@ -329,6 +379,30 @@ class ApplicationClient {
329
379
  }
330
380
  return await (0, app_1.getAppBoxNames)(appRef.appId, this.algod);
331
381
  }
382
+ /**
383
+ * Returns the value of the given box for the current app.
384
+ * @param name The name of the box to return either as a string, binary array or `BoxName`
385
+ * @returns The current box value as a byte array
386
+ */
387
+ async getBoxValue(name) {
388
+ const appRef = await this.getAppReference();
389
+ if (appRef.appId === 0) {
390
+ throw new Error('No app has been created yet, unable to get global state');
391
+ }
392
+ return await (0, app_1.getAppBoxValue)(appRef.appId, name, this.algod);
393
+ }
394
+ /**
395
+ * Returns the value of the given box for the current app.
396
+ * @param name The name of the box to return either as a string, binary array or `BoxName`
397
+ * @returns The current box value as a byte array
398
+ */
399
+ async getBoxValueFromABIType(name, type) {
400
+ const appRef = await this.getAppReference();
401
+ if (appRef.appId === 0) {
402
+ throw new Error('No app has been created yet, unable to get global state');
403
+ }
404
+ return await (0, app_1.getAppBoxValueFromABIType)({ appId: appRef.appId, boxName: name, type }, this.algod);
405
+ }
332
406
  /**
333
407
  * Returns the values of all current boxes for the current app.
334
408
  * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
@@ -352,7 +426,7 @@ class ApplicationClient {
352
426
  * @param filter Optional filter to filter which boxes' values are returned
353
427
  * @returns The (name, value) pair of the boxes with values as the ABI Value
354
428
  */
355
- async getBoxValuesAsABIType(type, filter) {
429
+ async getBoxValuesFromABIType(type, filter) {
356
430
  const appRef = await this.getAppReference();
357
431
  if (appRef.appId === 0) {
358
432
  throw new Error('No app has been created yet, unable to get global state');
@@ -363,6 +437,10 @@ class ApplicationClient {
363
437
  value: await (0, app_1.getAppBoxValueFromABIType)({ appId: appRef.appId, boxName, type }, this.algod),
364
438
  })));
365
439
  }
440
+ /** @deprecated Use `getBoxValuesFromABIType` instead */
441
+ async getBoxValuesAsABIType(type, filter) {
442
+ return this.getBoxValuesFromABIType(type, filter);
443
+ }
366
444
  /**
367
445
  * Returns the arguments for an app call for the given ABI method or raw method specification.
368
446
  * @param args The call args specific to this application client
@@ -403,11 +481,13 @@ class ApplicationClient {
403
481
  if (!method.includes('(')) {
404
482
  const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
405
483
  if (methods.length > 1) {
406
- throw new Error(`Received a call to method ${method} in contract ${this._appName}, but this resolved to multiple methods; please pass in an ABI signature instead: ${methods.map(appspec_1.getABISignature).join(', ')}`);
484
+ throw new Error(`Received a call to method ${method} in contract ${this._appName}, but this resolved to multiple methods; please pass in an ABI signature instead: ${methods
485
+ .map(app_1.getABIMethodSignature)
486
+ .join(', ')}`);
407
487
  }
408
488
  return methods[0];
409
489
  }
410
- return this.appSpec.contract.methods.find((m) => (0, appspec_1.getABISignature)(m) === method);
490
+ return this.appSpec.contract.methods.find((m) => (0, app_1.getABIMethodSignature)(m) === method);
411
491
  }
412
492
  /**
413
493
  * Returns the ABI Method for the given method name string for the app represented by this application client instance
@@ -426,10 +506,9 @@ class ApplicationClient {
426
506
  async getAppReference() {
427
507
  if (!this.existingDeployments && this._creator) {
428
508
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
429
- this.existingDeployments = await (0, deploy_app_1.getCreatorAppsByName)(this._creator, this.indexer);
509
+ this.existingDeployments = await (0, app_deploy_1.getCreatorAppsByName)(this._creator, this.indexer);
430
510
  }
431
511
  if (this.existingDeployments && this._appId === 0) {
432
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
433
512
  const app = this.existingDeployments.apps[this._appName];
434
513
  if (!app) {
435
514
  return {
@@ -446,7 +525,7 @@ class ApplicationClient {
446
525
  }
447
526
  /**
448
527
  * Takes an error that may include a logic error from a smart contract call and re-exposes the error to include source code information via the source map.
449
- * This is automatically used within @see ApplicationClient but if you pass `skipSending: true` e.g. if doing a group transaction
528
+ * This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
450
529
  * then you can use this in a try/catch block to get better debugging information.
451
530
  * @param e The error to parse
452
531
  * @param isClear Whether or not the code was running the clear state program
@@ -455,7 +534,7 @@ class ApplicationClient {
455
534
  exposeLogicError(e, isClear) {
456
535
  if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))
457
536
  return e;
458
- const errorDetails = logic_error_1.LogicError.parseLogicError(e.message);
537
+ const errorDetails = logic_error_1.LogicError.parseLogicError(e);
459
538
  if (errorDetails !== undefined)
460
539
  return new logic_error_1.LogicError(errorDetails, buffer_1.Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')
461
540
  .toString()
@@ -467,4 +546,4 @@ class ApplicationClient {
467
546
  }
468
547
  }
469
548
  exports.ApplicationClient = ApplicationClient;
470
- //# sourceMappingURL=application-client.js.map
549
+ //# sourceMappingURL=app-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-client.js","sourceRoot":"","sources":["../../src/types/app-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAUgB;AAChB,mCAA+B;AAC/B,gCAWe;AACf,8CAA4H;AAC5H,gDAAiD;AACjD,0CAA2C;AAE3C,+BAec;AAEd,+CAA0C;AAuI1C;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAC3B,QAAgB,EAChB,OAAgB,EAChB,oBAA4B,EAC5B,aAA0D;IAE1D,iDAAiD;IACjD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAAE,OAAO,SAAS,CAAA;IAE9D,iEAAiE;IACjE,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAA;IAC9D,IAAI,CAAC,CAAC,cAAc,IAAI,cAAc,KAAK,OAAO;QAAE,OAAO,IAAI,CAAA;IAE/D,iEAAiE;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,C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AO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;iBACtF,QAAQ,EAAE;iBACV,KAAK,CAAC,IAAI,CAAC;YACd,oEAAoE;YACpE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAmB,CAC3D,CAAA;;YACE,OAAO,CAAC,CAAA;IACf,CAAC;CACF;AAhmBD,8CAgmBC"}
@@ -0,0 +1,136 @@
1
+ import { ABIContractParams } from 'algosdk';
2
+ /** An ARC-0032 Application Specification see https://github.com/algorandfoundation/ARCs/pull/150 */
3
+ export interface AppSpec {
4
+ /** Method call hints */
5
+ hints: HintSpec;
6
+ /** The TEAL source */
7
+ source: AppSources;
8
+ /** The ABI-0004 contract definition see https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0004.md */
9
+ contract: ABIContractParams;
10
+ /** The values that make up the local and global state */
11
+ schema: SchemaSpec;
12
+ /** The rolled-up schema allocation values for local and global state */
13
+ state: StateSchemaSpec;
14
+ /** The config of all BARE calls (i.e. non ABI calls with no args) */
15
+ bare_call_config: CallConfig;
16
+ }
17
+ /** A lookup of encoded method call spec to hint */
18
+ export type HintSpec = Record<string, Hint>;
19
+ /** The TEAL source of a contract */
20
+ export interface AppSources {
21
+ /** The TEAL source of the approval program */
22
+ approval: string;
23
+ /** The TEAL source of the clear program */
24
+ clear: string;
25
+ }
26
+ /** The various call configs:
27
+ * * `NEVER`: Will not be called
28
+ * * `CALL`: Can be called during a non-create call i.e. app id != 0
29
+ * * `CREATE`: Can be called during a create call i.e. app id = 0
30
+ * * `ALL`: Can be during a create OR non-create call
31
+ **/
32
+ export type CallConfigValue = 'NEVER' | 'CALL' | 'CREATE' | 'ALL';
33
+ /** Call configuration for a method */
34
+ export interface CallConfig {
35
+ /** NoOp call config */
36
+ no_op?: CallConfigValue;
37
+ /** Opt-in call config */
38
+ opt_in?: CallConfigValue;
39
+ /** Close out call config */
40
+ close_out?: CallConfigValue;
41
+ /** Clear state call config */
42
+ clear_state?: CallConfigValue;
43
+ /** Update call config */
44
+ update_application?: CallConfigValue;
45
+ /** Delete call config */
46
+ delete_application?: CallConfigValue;
47
+ }
48
+ /** Hint information for a given method call to allow client generation */
49
+ export interface Hint {
50
+ /** Any user-defined struct/tuple types used in the method call, keyed by parameter name or `output` for return type */
51
+ structs: Record<string, Struct>;
52
+ readonly: boolean;
53
+ default_arguments: Record<string, DefaultArgument>;
54
+ call_config: CallConfig;
55
+ }
56
+ /** The name of a field */
57
+ export type FieldName = string;
58
+ /** The string name of an ABI type */
59
+ export type ABIType = string;
60
+ /** The elements of the struct/tuple: `FieldName`, `ABIType` */
61
+ export type StructElement = [FieldName, ABIType];
62
+ /** A user-defined struct/tuple type */
63
+ export interface Struct {
64
+ /** The name of the type */
65
+ name: string;
66
+ /** The elements (in order) that make up the struct/tuple */
67
+ elements: StructElement[];
68
+ }
69
+ /** Any default argument specifications for the given parameter */
70
+ export interface DefaultArgument {
71
+ /** The source of the default argument value:
72
+ * * `global-state`: Global state; `data` is the name of the global state variable
73
+ * * `local-state`: Local state; `data` is the name of the local state variable
74
+ * * `abi-method`: ABI method call; `data` is the method spec of the ABI method to call
75
+ * * `constant`: A constant value; `data` is the value to use
76
+ */
77
+ source: 'global-state' | 'local-state' | 'abi-method' | 'constant';
78
+ /** The name or value corresponding to the source */
79
+ data: string | bigint | number;
80
+ }
81
+ /** AVM data type */
82
+ export declare enum AVMType {
83
+ uint64 = 0,
84
+ bytes = 1
85
+ }
86
+ /** Declared schema value specification */
87
+ export interface DeclaredSchemaValueSpec {
88
+ /** The type of value */
89
+ type: AVMType;
90
+ /** The name of the key */
91
+ key: string;
92
+ /** A description of the variable */
93
+ desc?: string;
94
+ /** Whether or not the value is set statically (at create time only) or dynamically */
95
+ static: boolean;
96
+ }
97
+ /** Reserved schema value specification */
98
+ export interface ReservedSchemaValueSpec {
99
+ /** The type of value */
100
+ type: AVMType;
101
+ /** The description of the reserved storage space */
102
+ desc: string;
103
+ /** The maximum number of slots to reserve */
104
+ max_keys: number;
105
+ }
106
+ /** The schema for global and local storage */
107
+ export interface SchemaSpec {
108
+ /** The local storage schema */
109
+ local: Schema;
110
+ /** The global storage schema */
111
+ global: Schema;
112
+ }
113
+ /** The storage schema definition */
114
+ export interface Schema {
115
+ /** Declared storage schema */
116
+ declared: Record<string, DeclaredSchemaValueSpec>;
117
+ /** Reserved storage schema */
118
+ reserved: Record<string, ReservedSchemaValueSpec>;
119
+ }
120
+ /** The rolled-up schema allocation specification for local and global state */
121
+ export interface StateSchemaSpec {
122
+ /** Global storage spec */
123
+ global: StateSchema;
124
+ /** Local storage spec */
125
+ local: StateSchema;
126
+ }
127
+ /** Schema spec summary for global or local storage */
128
+ export type StateSchema = {
129
+ /** Number of uint slots */
130
+ num_uints: number;
131
+ /** Number of byte slots */
132
+ num_byte_slices: number;
133
+ };
134
+ /** @deprecated Use `algokit.getABIMethodSignature` instead */
135
+ export declare const getABISignature: (method: import("algosdk").ABIMethodParams | import("algosdk").ABIMethod) => string;
136
+ //# sourceMappingURL=app-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-spec.d.ts","sourceRoot":"","sources":["../../src/types/app-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAG3C,oGAAoG;AACpG,MAAM,WAAW,OAAO;IACtB,wBAAwB;IACxB,KAAK,EAAE,QAAQ,CAAA;IACf,sBAAsB;IACtB,MAAM,EAAE,UAAU,CAAA;IAClB,iHAAiH;IACjH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,yDAAyD;IACzD,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,KAAK,EAAE,eAAe,CAAA;IACtB,qEAAqE;IACrE,gBAAgB,EAAE,UAAU,CAAA;CAC7B;AAED,mDAAmD;AACnD,MAAM,MAAM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M,CAAA;IACjB,2BAA2B;IAC3B,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,eAAe,qFAAwB,CAAA"}
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getABISignature = exports.AVMType = void 0;
4
+ const app_1 = require("../app");
5
+ /** AVM data type */
4
6
  var AVMType;
5
7
  (function (AVMType) {
6
8
  AVMType[AVMType["uint64"] = 0] = "uint64";
7
9
  AVMType[AVMType["bytes"] = 1] = "bytes";
8
10
  })(AVMType = exports.AVMType || (exports.AVMType = {}));
9
- const getABISignature = (method) => {
10
- const argSignature = method.args.map((a) => a.type).join(',');
11
- const returnSignature = method.returns.type;
12
- return `{${method.name}}(${argSignature})${returnSignature}`;
13
- };
14
- exports.getABISignature = getABISignature;
15
- //# sourceMappingURL=appspec.js.map
11
+ /** @deprecated Use `algokit.getABIMethodSignature` instead */
12
+ exports.getABISignature = app_1.getABIMethodSignature;
13
+ //# sourceMappingURL=app-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-spec.js","sourceRoot":"","sources":["../../src/types/app-spec.ts"],"names":[],"mappings":";;;AACA,gCAA8C;AA4F9C,oBAAoB;AACpB,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,yCAAM,CAAA;IACN,uCAAK,CAAA;AACP,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AAwDD,8DAA8D;AACjD,QAAA,eAAe,GAAG,2BAAqB,CAAA"}