@algorandfoundation/algokit-utils 1.0.0 → 1.1.0
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.
- package/README.md +38 -0
- package/account.d.ts +11 -10
- package/account.d.ts.map +1 -1
- package/account.js +13 -12
- package/account.js.map +1 -1
- package/amount.d.ts +15 -3
- package/amount.d.ts.map +1 -1
- package/amount.js +15 -3
- package/amount.js.map +1 -1
- package/app-client.d.ts +14 -0
- package/app-client.d.ts.map +1 -0
- package/app-client.js +19 -0
- package/app-client.js.map +1 -0
- package/{deploy-app.d.ts → app-deploy.d.ts} +16 -14
- package/app-deploy.d.ts.map +1 -0
- package/{deploy-app.js → app-deploy.js} +47 -28
- package/app-deploy.js.map +1 -0
- package/app.d.ts +53 -8
- package/app.d.ts.map +1 -1
- package/app.js +305 -146
- package/app.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/indexer-lookup.d.ts +11 -4
- package/indexer-lookup.d.ts.map +1 -1
- package/indexer-lookup.js +19 -9
- package/indexer-lookup.js.map +1 -1
- package/localnet.d.ts +7 -7
- package/localnet.js +7 -7
- package/network-client.d.ts +4 -4
- package/network-client.js +5 -5
- package/network-client.js.map +1 -1
- package/package.json +1 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +2 -2
- package/testing/fixtures/algorand-fixture.d.ts +6 -2
- package/testing/fixtures/algorand-fixture.d.ts.map +1 -1
- package/testing/fixtures/algorand-fixture.js +19 -8
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/indexer.d.ts.map +1 -1
- package/testing/indexer.js +1 -0
- package/testing/indexer.js.map +1 -1
- package/testing/test-logger.d.ts +3 -1
- package/testing/test-logger.d.ts.map +1 -1
- package/testing/test-logger.js +4 -2
- package/testing/test-logger.js.map +1 -1
- package/testing/transaction-logger.d.ts +4 -4
- package/testing/transaction-logger.d.ts.map +1 -1
- package/testing/transaction-logger.js +4 -4
- package/testing/transaction-logger.js.map +1 -1
- package/transaction.d.ts +54 -13
- package/transaction.d.ts.map +1 -1
- package/transaction.js +201 -93
- package/transaction.js.map +1 -1
- package/transfer.d.ts +4 -3
- package/transfer.d.ts.map +1 -1
- package/transfer.js +10 -8
- package/transfer.js.map +1 -1
- package/types/account.d.ts +6 -3
- package/types/account.d.ts.map +1 -1
- package/types/account.js +7 -2
- package/types/account.js.map +1 -1
- package/types/algo-http-client-with-retry.js +1 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algod.d.ts +6 -6
- package/types/algod.d.ts.map +1 -1
- package/types/amount.d.ts +6 -2
- package/types/amount.d.ts.map +1 -1
- package/types/amount.js +6 -2
- package/types/amount.js.map +1 -1
- package/types/{application-client.d.ts → app-client.d.ts} +75 -22
- package/types/app-client.d.ts.map +1 -0
- package/types/{application-client.js → app-client.js} +115 -56
- package/types/app-client.js.map +1 -0
- package/types/app-spec.d.ts +141 -0
- package/types/app-spec.d.ts.map +1 -0
- package/types/{appspec.js → app-spec.js} +5 -7
- package/types/app-spec.js.map +1 -0
- package/types/app.d.ts +23 -17
- package/types/app.d.ts.map +1 -1
- package/types/app.js.map +1 -1
- package/types/config.d.ts +19 -2
- package/types/config.d.ts.map +1 -1
- package/types/config.js +28 -2
- package/types/config.js.map +1 -1
- package/types/indexer.d.ts +360 -49
- package/types/indexer.d.ts.map +1 -1
- package/types/indexer.js +9 -0
- package/types/indexer.js.map +1 -1
- package/types/logic-error.d.ts +5 -1
- package/types/logic-error.d.ts.map +1 -1
- package/types/logic-error.js +6 -2
- package/types/logic-error.js.map +1 -1
- package/types/testing.d.ts +9 -9
- package/types/testing.d.ts.map +1 -1
- package/types/transaction.d.ts +54 -9
- package/types/transaction.d.ts.map +1 -1
- package/types/transfer.d.ts +7 -7
- package/types/transfer.d.ts.map +1 -1
- package/application-client.d.ts +0 -10
- package/application-client.d.ts.map +0 -1
- package/application-client.js +0 -15
- package/application-client.js.map +0 -1
- package/deploy-app.d.ts.map +0 -1
- package/deploy-app.js.map +0 -1
- package/types/application-client.d.ts.map +0 -1
- package/types/application-client.js.map +0 -1
- package/types/appspec.d.ts +0 -77
- package/types/appspec.d.ts.map +0 -1
- package/types/appspec.js.map +0 -1
|
@@ -27,16 +27,14 @@ 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
|
|
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");
|
|
36
35
|
/** Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
|
|
37
36
|
class ApplicationClient {
|
|
38
37
|
// 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
38
|
// todo: support readonly, noop method calls
|
|
41
39
|
// todo: support different oncomplete for create
|
|
42
40
|
// todo: find create, update, delete, etc. methods from app spec and call them by default
|
|
@@ -52,7 +50,13 @@ class ApplicationClient {
|
|
|
52
50
|
this.algod = algod;
|
|
53
51
|
this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
|
|
54
52
|
this._appName = appIdentifier.name ?? this.appSpec.contract.name;
|
|
55
|
-
if ('
|
|
53
|
+
if ('id' in appIdentifier) {
|
|
54
|
+
if (appIdentifier.id < 0) {
|
|
55
|
+
throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);
|
|
56
|
+
}
|
|
57
|
+
this._appId = appIdentifier.id;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
56
60
|
this._appId = 0;
|
|
57
61
|
this._creator = appIdentifier.creatorAddress;
|
|
58
62
|
if ('indexer' in appIdentifier) {
|
|
@@ -65,20 +69,55 @@ class ApplicationClient {
|
|
|
65
69
|
this.existingDeployments = appIdentifier.existingDeployments;
|
|
66
70
|
}
|
|
67
71
|
}
|
|
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
72
|
this._appAddress = algosdk_1.default.getApplicationAddress(this._appId);
|
|
75
73
|
this.sender = sender;
|
|
76
74
|
this.params = params;
|
|
77
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Compiles the approval and clear programs and sets up the source map.
|
|
78
|
+
* @param compilation The deploy-time parameters for the compilation
|
|
79
|
+
* @returns The compiled approval and clear programs
|
|
80
|
+
*/
|
|
81
|
+
async compile(compilation) {
|
|
82
|
+
const { deployTimeParams, updatable, deletable } = compilation ?? {};
|
|
83
|
+
const approvalTemplate = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
|
|
84
|
+
const approval = (0, app_deploy_1.replaceDeployTimeControlParams)((0, app_deploy_1.performTemplateSubstitution)(approvalTemplate, deployTimeParams), {
|
|
85
|
+
updatable,
|
|
86
|
+
deletable,
|
|
87
|
+
});
|
|
88
|
+
const approvalCompiled = await (0, app_1.compileTeal)(approval, this.algod);
|
|
89
|
+
this._approvalSourceMap = approvalCompiled?.sourceMap;
|
|
90
|
+
const clearTemplate = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
|
|
91
|
+
const clear = (0, app_deploy_1.performTemplateSubstitution)(clearTemplate, deployTimeParams);
|
|
92
|
+
const clearCompiled = await (0, app_1.compileTeal)(clear, this.algod);
|
|
93
|
+
this._clearSourceMap = clearCompiled?.sourceMap;
|
|
94
|
+
return { approvalCompiled, clearCompiled };
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Export the current source maps for the app.
|
|
98
|
+
* @returns The source maps
|
|
99
|
+
*/
|
|
100
|
+
exportSourceMaps() {
|
|
101
|
+
if (!this._approvalSourceMap || !this._clearSourceMap) {
|
|
102
|
+
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");
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
approvalSourceMap: this._approvalSourceMap,
|
|
106
|
+
clearSourceMap: this._clearSourceMap,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Import source maps for the app.
|
|
111
|
+
* @param sourceMaps The source maps to import
|
|
112
|
+
*/
|
|
113
|
+
importSourceMaps(sourceMaps) {
|
|
114
|
+
this._approvalSourceMap = new algosdk_1.SourceMap(sourceMaps.approvalSourceMap);
|
|
115
|
+
this._clearSourceMap = new algosdk_1.SourceMap(sourceMaps.clearSourceMap);
|
|
116
|
+
}
|
|
78
117
|
/**
|
|
79
118
|
* 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
119
|
*
|
|
81
|
-
* To understand the architecture decisions behind this functionality please
|
|
120
|
+
* 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
121
|
*
|
|
83
122
|
* **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
123
|
*
|
|
@@ -103,27 +142,30 @@ class ApplicationClient {
|
|
|
103
142
|
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
143
|
}
|
|
105
144
|
const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
|
|
106
|
-
const
|
|
145
|
+
const compilation = {
|
|
146
|
+
deployTimeParams: deployArgs.deployTimeParams,
|
|
147
|
+
updatable: allowUpdate ?? approval.includes(app_2.UPDATABLE_TEMPLATE_NAME)
|
|
148
|
+
? (!this.appSpec.bare_call_config.update_application && this.appSpec.bare_call_config.update_application !== 'NEVER') ||
|
|
149
|
+
!!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.update_application && this.appSpec.hints[h].call_config.update_application !== 'NEVER')[0]
|
|
150
|
+
: undefined,
|
|
151
|
+
deletable: allowDelete ?? approval.includes(app_2.DELETABLE_TEMPLATE_NAME)
|
|
152
|
+
? (!this.appSpec.bare_call_config.delete_application && this.appSpec.bare_call_config.delete_application !== 'NEVER') ||
|
|
153
|
+
!!Object.keys(this.appSpec.hints).filter((h) => !this.appSpec.hints[h].call_config.delete_application && this.appSpec.hints[h].call_config.delete_application !== 'NEVER')[0]
|
|
154
|
+
: undefined,
|
|
155
|
+
};
|
|
156
|
+
const { approvalCompiled, clearCompiled } = await this.compile(compilation);
|
|
107
157
|
try {
|
|
108
158
|
await this.getAppReference();
|
|
109
|
-
const result = await (0,
|
|
159
|
+
const result = await (0, app_deploy_1.deployApp)({
|
|
110
160
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
111
161
|
from,
|
|
112
|
-
approvalProgram:
|
|
113
|
-
clearStateProgram:
|
|
162
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
163
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
114
164
|
metadata: {
|
|
115
165
|
name: this._appName,
|
|
116
166
|
version: version ?? '1.0',
|
|
117
|
-
updatable:
|
|
118
|
-
|
|
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,
|
|
167
|
+
updatable: compilation.updatable,
|
|
168
|
+
deletable: compilation.deletable,
|
|
127
169
|
},
|
|
128
170
|
schema: {
|
|
129
171
|
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
@@ -139,8 +181,6 @@ class ApplicationClient {
|
|
|
139
181
|
deleteArgs: this.getCallArgs(deleteArgs),
|
|
140
182
|
...deployArgs,
|
|
141
183
|
}, this.algod, this.indexer);
|
|
142
|
-
this._approvalSourceMap = result.compiledApproval?.sourceMap;
|
|
143
|
-
this._clearSourceMap = result.compiledClear?.sourceMap;
|
|
144
184
|
// Nothing needed to happen
|
|
145
185
|
if (result.operationPerformed === 'nothing') {
|
|
146
186
|
return result;
|
|
@@ -167,17 +207,13 @@ class ApplicationClient {
|
|
|
167
207
|
if (!sender && !this.sender) {
|
|
168
208
|
throw new Error('No sender provided, unable to create app');
|
|
169
209
|
}
|
|
170
|
-
const
|
|
171
|
-
const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
|
|
210
|
+
const { approvalCompiled, clearCompiled } = await this.compile(create);
|
|
172
211
|
try {
|
|
173
212
|
const result = await (0, app_1.createApp)({
|
|
174
213
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
175
214
|
from: sender ?? this.sender,
|
|
176
|
-
approvalProgram:
|
|
177
|
-
|
|
178
|
-
deletable,
|
|
179
|
-
}),
|
|
180
|
-
clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParams),
|
|
215
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
216
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
181
217
|
schema: {
|
|
182
218
|
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
183
219
|
globalInts: this.appSpec.state.global.num_uints,
|
|
@@ -189,8 +225,6 @@ class ApplicationClient {
|
|
|
189
225
|
transactionParams: this.params,
|
|
190
226
|
...(sendParams ?? {}),
|
|
191
227
|
}, this.algod);
|
|
192
|
-
this._approvalSourceMap = result.compiledApproval?.sourceMap;
|
|
193
|
-
this._clearSourceMap = result.compiledClear?.sourceMap;
|
|
194
228
|
if (result.confirmation) {
|
|
195
229
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
196
230
|
this._appId = result.confirmation['application-index'];
|
|
@@ -210,18 +244,14 @@ class ApplicationClient {
|
|
|
210
244
|
if (!sender && !this.sender) {
|
|
211
245
|
throw new Error('No sender provided, unable to create app');
|
|
212
246
|
}
|
|
213
|
-
const
|
|
214
|
-
const clear = buffer_1.Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
|
|
247
|
+
const { approvalCompiled, clearCompiled } = await this.compile(update);
|
|
215
248
|
try {
|
|
216
249
|
const result = await (0, app_1.updateApp)({
|
|
217
250
|
appId: this._appId,
|
|
218
251
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
219
252
|
from: sender ?? this.sender,
|
|
220
|
-
approvalProgram:
|
|
221
|
-
|
|
222
|
-
deletable,
|
|
223
|
-
}),
|
|
224
|
-
clearStateProgram: (0, deploy_app_1.performTemplateSubstitution)(clear, deployTimeParams),
|
|
253
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
254
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
225
255
|
args: this.getCallArgs(args),
|
|
226
256
|
note: note,
|
|
227
257
|
transactionParams: this.params,
|
|
@@ -242,16 +272,16 @@ class ApplicationClient {
|
|
|
242
272
|
return await this._call(call, 'optin');
|
|
243
273
|
}
|
|
244
274
|
async closeOut(call) {
|
|
245
|
-
return await this._call(call, '
|
|
275
|
+
return await this._call(call, 'closeout');
|
|
246
276
|
}
|
|
247
277
|
async clearState(call) {
|
|
248
|
-
return await this._call(call, '
|
|
278
|
+
return await this._call(call, 'clearstate');
|
|
249
279
|
}
|
|
250
280
|
async delete(call) {
|
|
251
|
-
return await this._call(call, '
|
|
281
|
+
return await this._call(call, 'delete');
|
|
252
282
|
}
|
|
253
283
|
async _call(call, callType) {
|
|
254
|
-
const { sender, note, sendParams, ...args } = call;
|
|
284
|
+
const { sender, note, sendParams, ...args } = call ?? {};
|
|
255
285
|
if (!sender && !this.sender) {
|
|
256
286
|
throw new Error('No sender provided, unable to call app');
|
|
257
287
|
}
|
|
@@ -290,7 +320,7 @@ class ApplicationClient {
|
|
|
290
320
|
to: ref.appAddress,
|
|
291
321
|
amount: amount,
|
|
292
322
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
293
|
-
from:
|
|
323
|
+
from: sender ?? this.sender,
|
|
294
324
|
note: note,
|
|
295
325
|
transactionParams: this.params,
|
|
296
326
|
...(sendParams ?? {}),
|
|
@@ -329,6 +359,30 @@ class ApplicationClient {
|
|
|
329
359
|
}
|
|
330
360
|
return await (0, app_1.getAppBoxNames)(appRef.appId, this.algod);
|
|
331
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Returns the value of the given box for the current app.
|
|
364
|
+
* @param name The name of the box to return either as a string, binary array or `BoxName`
|
|
365
|
+
* @returns The current box value as a byte array
|
|
366
|
+
*/
|
|
367
|
+
async getBoxValue(name) {
|
|
368
|
+
const appRef = await this.getAppReference();
|
|
369
|
+
if (appRef.appId === 0) {
|
|
370
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
371
|
+
}
|
|
372
|
+
return await (0, app_1.getAppBoxValue)(appRef.appId, name, this.algod);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Returns the value of the given box for the current app.
|
|
376
|
+
* @param name The name of the box to return either as a string, binary array or `BoxName`
|
|
377
|
+
* @returns The current box value as a byte array
|
|
378
|
+
*/
|
|
379
|
+
async getBoxValueFromABIType(name, type) {
|
|
380
|
+
const appRef = await this.getAppReference();
|
|
381
|
+
if (appRef.appId === 0) {
|
|
382
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
383
|
+
}
|
|
384
|
+
return await (0, app_1.getAppBoxValueFromABIType)({ appId: appRef.appId, boxName: name, type }, this.algod);
|
|
385
|
+
}
|
|
332
386
|
/**
|
|
333
387
|
* Returns the values of all current boxes for the current app.
|
|
334
388
|
* 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 +406,7 @@ class ApplicationClient {
|
|
|
352
406
|
* @param filter Optional filter to filter which boxes' values are returned
|
|
353
407
|
* @returns The (name, value) pair of the boxes with values as the ABI Value
|
|
354
408
|
*/
|
|
355
|
-
async
|
|
409
|
+
async getBoxValuesFromABIType(type, filter) {
|
|
356
410
|
const appRef = await this.getAppReference();
|
|
357
411
|
if (appRef.appId === 0) {
|
|
358
412
|
throw new Error('No app has been created yet, unable to get global state');
|
|
@@ -363,6 +417,10 @@ class ApplicationClient {
|
|
|
363
417
|
value: await (0, app_1.getAppBoxValueFromABIType)({ appId: appRef.appId, boxName, type }, this.algod),
|
|
364
418
|
})));
|
|
365
419
|
}
|
|
420
|
+
/** @deprecated Use `getBoxValuesFromABIType` instead */
|
|
421
|
+
async getBoxValuesAsABIType(type, filter) {
|
|
422
|
+
return this.getBoxValuesFromABIType(type, filter);
|
|
423
|
+
}
|
|
366
424
|
/**
|
|
367
425
|
* Returns the arguments for an app call for the given ABI method or raw method specification.
|
|
368
426
|
* @param args The call args specific to this application client
|
|
@@ -403,11 +461,13 @@ class ApplicationClient {
|
|
|
403
461
|
if (!method.includes('(')) {
|
|
404
462
|
const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
|
|
405
463
|
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
|
|
464
|
+
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
|
|
465
|
+
.map(app_1.getABIMethodSignature)
|
|
466
|
+
.join(', ')}`);
|
|
407
467
|
}
|
|
408
468
|
return methods[0];
|
|
409
469
|
}
|
|
410
|
-
return this.appSpec.contract.methods.find((m) => (0,
|
|
470
|
+
return this.appSpec.contract.methods.find((m) => (0, app_1.getABIMethodSignature)(m) === method);
|
|
411
471
|
}
|
|
412
472
|
/**
|
|
413
473
|
* Returns the ABI Method for the given method name string for the app represented by this application client instance
|
|
@@ -426,10 +486,9 @@ class ApplicationClient {
|
|
|
426
486
|
async getAppReference() {
|
|
427
487
|
if (!this.existingDeployments && this._creator) {
|
|
428
488
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
429
|
-
this.existingDeployments = await (0,
|
|
489
|
+
this.existingDeployments = await (0, app_deploy_1.getCreatorAppsByName)(this._creator, this.indexer);
|
|
430
490
|
}
|
|
431
491
|
if (this.existingDeployments && this._appId === 0) {
|
|
432
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
433
492
|
const app = this.existingDeployments.apps[this._appName];
|
|
434
493
|
if (!app) {
|
|
435
494
|
return {
|
|
@@ -446,7 +505,7 @@ class ApplicationClient {
|
|
|
446
505
|
}
|
|
447
506
|
/**
|
|
448
507
|
* 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
|
|
508
|
+
* This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
|
|
450
509
|
* then you can use this in a try/catch block to get better debugging information.
|
|
451
510
|
* @param e The error to parse
|
|
452
511
|
* @param isClear Whether or not the code was running the clear state program
|
|
@@ -455,7 +514,7 @@ class ApplicationClient {
|
|
|
455
514
|
exposeLogicError(e, isClear) {
|
|
456
515
|
if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))
|
|
457
516
|
return e;
|
|
458
|
-
const errorDetails = logic_error_1.LogicError.parseLogicError(e
|
|
517
|
+
const errorDetails = logic_error_1.LogicError.parseLogicError(e);
|
|
459
518
|
if (errorDetails !== undefined)
|
|
460
519
|
return new logic_error_1.LogicError(errorDetails, buffer_1.Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')
|
|
461
520
|
.toString()
|
|
@@ -467,4 +526,4 @@ class ApplicationClient {
|
|
|
467
526
|
}
|
|
468
527
|
}
|
|
469
528
|
exports.ApplicationClient = ApplicationClient;
|
|
470
|
-
//# sourceMappingURL=
|
|
529
|
+
//# 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,qIAAqI;AACrI,MAAa,iBAAiB;IAgB5B,kFAAkF;IAClF,4CAA4C;IAC5C,gDAAgD;IAChD,yFAAyF;IACzF,sDAAsD;IAEtD;;;;;OAKG;IACH,YAAY,UAA6B,EAAE,KAAc;QACvD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,GAAG,UAAU,CAAA;QAC5D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAa,CAAC,CAAC,CAAC,GAAG,CAAA;QAC1E,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAA;QAEhE,IAAI,IAAI,IAAI,aAAa,EAAE;YACzB,IAAI,aAAa,CAAC,EAAE,GAAG,CAAC,EAAE;gBACxB,MAAM,IAAI,KAAK,CAAC,+DAA+D,aAAa,CAAC,E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AC,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;AAxmBD,8CAwmBC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
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: {
|
|
16
|
+
/** NoOp bare call config */
|
|
17
|
+
no_op?: CallConfigValue;
|
|
18
|
+
/** Opt-in bare call config */
|
|
19
|
+
opt_in?: CallConfigValue;
|
|
20
|
+
/** Close out bare call config */
|
|
21
|
+
close_out?: CallConfigValue;
|
|
22
|
+
/** Clear state bare call config */
|
|
23
|
+
clear_state?: CallConfigValue;
|
|
24
|
+
/** Update bare call config */
|
|
25
|
+
update_application?: CallConfigValue;
|
|
26
|
+
/** Delete bare call config */
|
|
27
|
+
delete_application?: CallConfigValue;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** A lookup of encoded method call spec to hint */
|
|
31
|
+
export type HintSpec = Record<string, Hint>;
|
|
32
|
+
/** The TEAL source of a contract */
|
|
33
|
+
export interface AppSources {
|
|
34
|
+
/** The TEAL source of the approval program */
|
|
35
|
+
approval: string;
|
|
36
|
+
/** The TEAL source of the clear program */
|
|
37
|
+
clear: string;
|
|
38
|
+
}
|
|
39
|
+
/** The various call configs:
|
|
40
|
+
* * `NEVER`: Will not be called
|
|
41
|
+
* * `CALL`: Can be called during a non-create call i.e. app id != 0
|
|
42
|
+
* * `CREATE`: Can be called during a create call i.e. app id = 0
|
|
43
|
+
* * `ALL`: Can be during a create OR non-create call
|
|
44
|
+
**/
|
|
45
|
+
export type CallConfigValue = 'NEVER' | 'CALL' | 'CREATE' | 'ALL';
|
|
46
|
+
/** Hint information for a given method call to allow client generation */
|
|
47
|
+
export interface Hint {
|
|
48
|
+
/** Any user-defined struct/tuple types used in the method call, keyed by parameter name or `output` for return type */
|
|
49
|
+
structs: Record<string, Struct>;
|
|
50
|
+
readonly: boolean;
|
|
51
|
+
default_arguments: Record<string, DefaultArgument>;
|
|
52
|
+
call_config: {
|
|
53
|
+
no_op?: CallConfigValue;
|
|
54
|
+
opt_in?: CallConfigValue;
|
|
55
|
+
close_out?: CallConfigValue;
|
|
56
|
+
clear_state?: CallConfigValue;
|
|
57
|
+
update_application?: CallConfigValue;
|
|
58
|
+
delete_application?: CallConfigValue;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The name of a field */
|
|
62
|
+
export type FieldName = string;
|
|
63
|
+
/** The string name of an ABI type */
|
|
64
|
+
export type ABIType = string;
|
|
65
|
+
/** The elements of the struct/tuple: `FieldName`, `ABIType` */
|
|
66
|
+
export type StructElement = [FieldName, ABIType];
|
|
67
|
+
/** A user-defined struct/tuple type */
|
|
68
|
+
export interface Struct {
|
|
69
|
+
/** The name of the type */
|
|
70
|
+
name: string;
|
|
71
|
+
/** The elements (in order) that make up the struct/tuple */
|
|
72
|
+
elements: StructElement[];
|
|
73
|
+
}
|
|
74
|
+
/** Any default argument specifications for the given parameter */
|
|
75
|
+
export interface DefaultArgument {
|
|
76
|
+
/** The source of the default argument value:
|
|
77
|
+
* * `global-state`: Global state; `data` is the name of the global state variable
|
|
78
|
+
* * `local-state`: Local state; `data` is the name of the local state variable
|
|
79
|
+
* * `abi-method`: ABI method call; `data` is the method spec of the ABI method to call
|
|
80
|
+
* * `constant`: A constant value; `data` is the value to use
|
|
81
|
+
*/
|
|
82
|
+
source: 'global-state' | 'local-state' | 'abi-method' | 'constant';
|
|
83
|
+
/** The name or value corresponding to the source */
|
|
84
|
+
data: string | bigint | number;
|
|
85
|
+
}
|
|
86
|
+
/** AVM data type */
|
|
87
|
+
export declare enum AVMType {
|
|
88
|
+
uint64 = 0,
|
|
89
|
+
bytes = 1
|
|
90
|
+
}
|
|
91
|
+
/** Declared schema value specification */
|
|
92
|
+
export interface DeclaredSchemaValueSpec {
|
|
93
|
+
/** The type of value */
|
|
94
|
+
type: AVMType;
|
|
95
|
+
/** The name of the key */
|
|
96
|
+
key: string;
|
|
97
|
+
/** A description of the variable */
|
|
98
|
+
desc?: string;
|
|
99
|
+
/** Whether or not the value is set statically (at create time only) or dynamically */
|
|
100
|
+
static: boolean;
|
|
101
|
+
}
|
|
102
|
+
/** Reserved schema value specification */
|
|
103
|
+
export interface ReservedSchemaValueSpec {
|
|
104
|
+
/** The type of value */
|
|
105
|
+
type: AVMType;
|
|
106
|
+
/** The description of the reserved storage space */
|
|
107
|
+
desc: string;
|
|
108
|
+
/** The maximum number of slots to reserve */
|
|
109
|
+
max_keys: number;
|
|
110
|
+
}
|
|
111
|
+
/** The schema for global and local storage */
|
|
112
|
+
export interface SchemaSpec {
|
|
113
|
+
/** The local storage schema */
|
|
114
|
+
local: Schema;
|
|
115
|
+
/** The global storage schema */
|
|
116
|
+
global: Schema;
|
|
117
|
+
}
|
|
118
|
+
/** The storage schema definition */
|
|
119
|
+
export interface Schema {
|
|
120
|
+
/** Declared storage schema */
|
|
121
|
+
declared: Record<string, DeclaredSchemaValueSpec>;
|
|
122
|
+
/** Reserved storage schema */
|
|
123
|
+
reserved: Record<string, ReservedSchemaValueSpec>;
|
|
124
|
+
}
|
|
125
|
+
/** The rolled-up schema allocation specification for local and global state */
|
|
126
|
+
export interface StateSchemaSpec {
|
|
127
|
+
/** Global storage spec */
|
|
128
|
+
global: StateSchema;
|
|
129
|
+
/** Local storage spec */
|
|
130
|
+
local: StateSchema;
|
|
131
|
+
}
|
|
132
|
+
/** Schema spec summary for global or local storage */
|
|
133
|
+
export type StateSchema = {
|
|
134
|
+
/** Number of uint slots */
|
|
135
|
+
num_uints: number;
|
|
136
|
+
/** Number of byte slots */
|
|
137
|
+
num_byte_slices: number;
|
|
138
|
+
};
|
|
139
|
+
/** @deprecated Use `algokit.getABIMethodSignature` instead */
|
|
140
|
+
export declare const getABISignature: (method: import("algosdk").ABIMethodParams | import("algosdk").ABIMethod) => string;
|
|
141
|
+
//# 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;QAChB,4BAA4B;QAC5B,KAAK,CAAC,EAAE,eAAe,CAAA;QACvB,8BAA8B;QAC9B,MAAM,CAAC,EAAE,eAAe,CAAA;QACxB,iCAAiC;QACjC,SAAS,CAAC,EAAE,eAAe,CAAA;QAC3B,mCAAmC;QACnC,WAAW,CAAC,EAAE,eAAe,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A2B;IAC3B,SAAS,EAAE,MAAM,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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;AAgG9C,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"}
|