@algorandfoundation/algokit-utils 1.0.0-beta.9 → 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 +41 -36
- package/account.d.ts.map +1 -1
- package/account.js +59 -44
- package/account.js.map +1 -1
- package/amount.d.ts +20 -0
- package/amount.d.ts.map +1 -0
- package/amount.js +36 -0
- package/amount.js.map +1 -0
- 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/app-deploy.d.ts +95 -0
- package/app-deploy.d.ts.map +1 -0
- package/{deploy-app.js → app-deploy.js} +129 -119
- package/app-deploy.js.map +1 -0
- package/app.d.ts +112 -148
- package/app.d.ts.map +1 -1
- package/app.js +460 -143
- package/app.js.map +1 -1
- package/index.d.ts +6 -4
- package/index.d.ts.map +1 -1
- package/index.js +7 -4
- 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 +10 -10
- package/localnet.d.ts.map +1 -1
- package/localnet.js +16 -16
- package/localnet.js.map +1 -1
- package/network-client.d.ts +15 -24
- package/network-client.d.ts.map +1 -1
- package/network-client.js +16 -16
- package/network-client.js.map +1 -1
- package/package.json +2 -2
- package/testing/account.d.ts +14 -0
- package/testing/account.d.ts.map +1 -0
- package/testing/account.js +31 -0
- package/testing/account.js.map +1 -0
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/testing/fixtures/algokit-log-capture-fixture.js +43 -0
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/testing/fixtures/algorand-fixture.d.ts +24 -0
- package/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/testing/fixtures/algorand-fixture.js +60 -0
- package/testing/fixtures/algorand-fixture.js.map +1 -0
- package/testing/fixtures/index.d.ts +3 -0
- package/testing/fixtures/index.d.ts.map +1 -0
- package/testing/fixtures/index.js +19 -0
- package/testing/fixtures/index.js.map +1 -0
- package/testing/index.d.ts +6 -0
- package/testing/index.d.ts.map +1 -0
- package/testing/index.js +22 -0
- package/testing/index.js.map +1 -0
- package/testing/indexer.d.ts +12 -0
- package/testing/indexer.d.ts.map +1 -0
- package/testing/indexer.js +40 -0
- package/testing/indexer.js.map +1 -0
- package/testing/test-logger.d.ts +41 -0
- package/testing/test-logger.d.ts.map +1 -0
- package/testing/test-logger.js +71 -0
- package/testing/test-logger.js.map +1 -0
- package/testing/transaction-logger.d.ts +29 -0
- package/testing/transaction-logger.d.ts.map +1 -0
- package/testing/transaction-logger.js +71 -0
- package/testing/transaction-logger.js.map +1 -0
- package/transaction.d.ts +55 -91
- package/transaction.d.ts.map +1 -1
- package/transaction.js +213 -155
- package/transaction.js.map +1 -1
- package/transfer.d.ts +14 -16
- package/transfer.d.ts.map +1 -1
- package/transfer.js +38 -4
- package/transfer.js.map +1 -1
- package/types/account.d.ts +55 -0
- package/types/account.d.ts.map +1 -0
- package/types/account.js +91 -0
- package/types/account.js.map +1 -0
- package/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/{algo-http-client-with-retry.js → types/algo-http-client-with-retry.js} +3 -3
- package/types/algo-http-client-with-retry.js.map +1 -0
- package/types/algod.d.ts +28 -15
- package/types/algod.d.ts.map +1 -1
- package/{algo-amount.d.ts → types/amount.d.ts} +9 -3
- package/types/amount.d.ts.map +1 -0
- package/{algo-amount.js → types/amount.js} +13 -3
- package/types/amount.js.map +1 -0
- package/types/app-client.d.ts +282 -0
- package/types/app-client.d.ts.map +1 -0
- package/types/app-client.js +529 -0
- 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 +285 -0
- package/types/app.d.ts.map +1 -0
- package/types/app.js +32 -0
- package/types/app.js.map +1 -0
- package/types/config.d.ts +32 -0
- package/types/config.d.ts.map +1 -0
- package/types/config.js +53 -0
- package/types/config.js.map +1 -0
- package/types/indexer.d.ts +368 -58
- package/types/indexer.d.ts.map +1 -1
- package/types/indexer.js +9 -0
- package/types/indexer.js.map +1 -1
- package/{config.d.ts → types/logging.d.ts} +2 -16
- package/types/logging.d.ts.map +1 -0
- package/{config.js → types/logging.js} +5 -24
- package/types/logging.js.map +1 -0
- package/types/logic-error.d.ts +37 -0
- package/types/logic-error.d.ts.map +1 -0
- package/types/logic-error.js +50 -0
- package/types/logic-error.js.map +1 -0
- package/types/network-client.d.ts +11 -0
- package/types/network-client.d.ts.map +1 -0
- package/types/network-client.js +3 -0
- package/types/network-client.js.map +1 -0
- package/types/testing.d.ts +89 -0
- package/types/testing.d.ts.map +1 -0
- package/types/testing.js +3 -0
- package/types/testing.js.map +1 -0
- package/types/transaction.d.ts +112 -0
- package/types/transaction.d.ts.map +1 -0
- package/types/transaction.js +3 -0
- package/types/transaction.js.map +1 -0
- package/types/transfer.d.ts +32 -0
- package/types/transfer.d.ts.map +1 -0
- package/types/transfer.js +3 -0
- package/types/transfer.js.map +1 -0
- package/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/algo-amount.d.ts.map +0 -1
- package/algo-amount.js.map +0 -1
- package/algo-http-client-with-retry.d.ts.map +0 -1
- package/algo-http-client-with-retry.js.map +0 -1
- package/application-client.d.ts +0 -113
- package/application-client.d.ts.map +0 -1
- package/application-client.js +0 -258
- package/application-client.js.map +0 -1
- package/config.d.ts.map +0 -1
- package/config.js.map +0 -1
- package/deploy-app.d.ts +0 -164
- package/deploy-app.d.ts.map +0 -1
- package/deploy-app.js.map +0 -1
- package/types/appspec.d.ts +0 -78
- package/types/appspec.d.ts.map +0 -1
- package/types/appspec.js.map +0 -1
- package/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/urlTokenBaseHTTPClient.js.map +0 -1
- /package/{algo-http-client-with-retry.d.ts → types/algo-http-client-with-retry.d.ts} +0 -0
- /package/{urlTokenBaseHTTPClient.d.ts → types/urlTokenBaseHTTPClient.d.ts} +0 -0
- /package/{urlTokenBaseHTTPClient.js → types/urlTokenBaseHTTPClient.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-client.d.ts","sourceRoot":"","sources":["../../src/types/app-client.ts"],"names":[],"mappings":"AAAA,OAAgB,EACd,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EACR,OAAO,EAEP,OAAO,EAEP,eAAe,EAChB,MAAM,SAAS,CAAA;AAiBhB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EACL,aAAa,EACb,cAAc,EACd,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,OAAO,EAEP,aAAa,EACb,QAAQ,EACR,cAAc,EACd,kBAAkB,EAEnB,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE3F,8EAA8E;AAC9E,MAAM,MAAM,0BAA0B,GAAG;IACvC,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAA;IACtB,sHAAsH;IACtH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,CACA;IACE,qEAAqE;IACrE,OAAO,EAAE,OAAO,CAAA;CACjB,GACD;IACE,+FAA+F;IAC/F,mBAAmB,EAAE,SAAS,CAAA;CAC/B,CACJ,CAAA;AAED,yCAAyC;AACzC,MAAM,WAAW,cAAc;IAC7B,mGAAmG;IACnG,EAAE,EAAE,MAAM,CAAA;IACV,sIAAsI;IACtI,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wDA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BrD"}
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ApplicationClient = void 0;
|
|
27
|
+
const algosdk_1 = __importStar(require("algosdk"));
|
|
28
|
+
const buffer_1 = require("buffer");
|
|
29
|
+
const app_1 = require("../app");
|
|
30
|
+
const app_deploy_1 = require("../app-deploy");
|
|
31
|
+
const transaction_1 = require("../transaction");
|
|
32
|
+
const transfer_1 = require("../transfer");
|
|
33
|
+
const app_2 = require("./app");
|
|
34
|
+
const logic_error_1 = require("./logic-error");
|
|
35
|
+
/** Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
|
|
36
|
+
class ApplicationClient {
|
|
37
|
+
// todo: process ABI args as needed to make them nicer to deal with like beaker-ts
|
|
38
|
+
// todo: support readonly, noop method calls
|
|
39
|
+
// todo: support different oncomplete for create
|
|
40
|
+
// todo: find create, update, delete, etc. methods from app spec and call them by default
|
|
41
|
+
// todo: intelligent version management when deploying
|
|
42
|
+
/**
|
|
43
|
+
* Create a new ApplicationClient instance
|
|
44
|
+
* @param appDetails The details of the app
|
|
45
|
+
* @param algod An algod instance
|
|
46
|
+
* @param indexer An indexer instance
|
|
47
|
+
*/
|
|
48
|
+
constructor(appDetails, algod) {
|
|
49
|
+
const { app, sender, params, ...appIdentifier } = appDetails;
|
|
50
|
+
this.algod = algod;
|
|
51
|
+
this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
|
|
52
|
+
this._appName = appIdentifier.name ?? this.appSpec.contract.name;
|
|
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 {
|
|
60
|
+
this._appId = 0;
|
|
61
|
+
this._creator = appIdentifier.creatorAddress;
|
|
62
|
+
if ('indexer' in appIdentifier) {
|
|
63
|
+
this.indexer = appIdentifier.indexer;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (appIdentifier.existingDeployments.creator !== this._creator) {
|
|
67
|
+
throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.existingDeployments.creator}) instead of expected creator ${this._creator}`);
|
|
68
|
+
}
|
|
69
|
+
this.existingDeployments = appIdentifier.existingDeployments;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
this._appAddress = algosdk_1.default.getApplicationAddress(this._appId);
|
|
73
|
+
this.sender = sender;
|
|
74
|
+
this.params = params;
|
|
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
|
+
}
|
|
117
|
+
/**
|
|
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.
|
|
119
|
+
*
|
|
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
|
|
121
|
+
*
|
|
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.
|
|
123
|
+
*
|
|
124
|
+
* **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.
|
|
125
|
+
* @param deploy Deployment details
|
|
126
|
+
* @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
|
|
127
|
+
*/
|
|
128
|
+
async deploy(deploy) {
|
|
129
|
+
const { sender, version, allowUpdate, allowDelete, sendParams, createArgs, updateArgs, deleteArgs, ...deployArgs } = deploy ?? {};
|
|
130
|
+
if (this._appId !== 0) {
|
|
131
|
+
throw new Error(`Attempt to deploy app which already has an app id of ${this._appId}`);
|
|
132
|
+
}
|
|
133
|
+
if (!sender && !this.sender) {
|
|
134
|
+
throw new Error('No sender provided, unable to deploy app');
|
|
135
|
+
}
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
|
+
const from = sender ?? this.sender;
|
|
138
|
+
if (!this._creator) {
|
|
139
|
+
throw new Error('Attempt to deploy a contract without having specified a creator');
|
|
140
|
+
}
|
|
141
|
+
if (this._creator !== (0, transaction_1.getSenderAddress)(from)) {
|
|
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}`);
|
|
143
|
+
}
|
|
144
|
+
const approval = buffer_1.Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
|
|
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);
|
|
157
|
+
try {
|
|
158
|
+
await this.getAppReference();
|
|
159
|
+
const result = await (0, app_deploy_1.deployApp)({
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
161
|
+
from,
|
|
162
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
163
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
164
|
+
metadata: {
|
|
165
|
+
name: this._appName,
|
|
166
|
+
version: version ?? '1.0',
|
|
167
|
+
updatable: compilation.updatable,
|
|
168
|
+
deletable: compilation.deletable,
|
|
169
|
+
},
|
|
170
|
+
schema: {
|
|
171
|
+
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
172
|
+
globalInts: this.appSpec.state.global.num_uints,
|
|
173
|
+
localByteSlices: this.appSpec.state.local.num_byte_slices,
|
|
174
|
+
localInts: this.appSpec.state.local.num_uints,
|
|
175
|
+
},
|
|
176
|
+
transactionParams: this.params,
|
|
177
|
+
...(sendParams ?? {}),
|
|
178
|
+
existingDeployments: this.existingDeployments,
|
|
179
|
+
createArgs: this.getCallArgs(createArgs),
|
|
180
|
+
updateArgs: this.getCallArgs(updateArgs),
|
|
181
|
+
deleteArgs: this.getCallArgs(deleteArgs),
|
|
182
|
+
...deployArgs,
|
|
183
|
+
}, this.algod, this.indexer);
|
|
184
|
+
// Nothing needed to happen
|
|
185
|
+
if (result.operationPerformed === 'nothing') {
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
if (!this.existingDeployments) {
|
|
189
|
+
throw new Error('Expected existingDeployments to be present');
|
|
190
|
+
}
|
|
191
|
+
const { transaction, confirmation, operationPerformed, ...appMetadata } = result;
|
|
192
|
+
this.existingDeployments = {
|
|
193
|
+
creator: this.existingDeployments.creator,
|
|
194
|
+
apps: { ...this.existingDeployments.apps, [this._appName]: appMetadata },
|
|
195
|
+
};
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
catch (e) {
|
|
199
|
+
throw this.exposeLogicError(e);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async create(create) {
|
|
203
|
+
const { sender, note, sendParams, deployTimeParams, updatable, deletable, ...args } = create ?? {};
|
|
204
|
+
if (this._appId !== 0) {
|
|
205
|
+
throw new Error(`Attempt to create app which already has an app id of ${this._appId}`);
|
|
206
|
+
}
|
|
207
|
+
if (!sender && !this.sender) {
|
|
208
|
+
throw new Error('No sender provided, unable to create app');
|
|
209
|
+
}
|
|
210
|
+
const { approvalCompiled, clearCompiled } = await this.compile(create);
|
|
211
|
+
try {
|
|
212
|
+
const result = await (0, app_1.createApp)({
|
|
213
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
214
|
+
from: sender ?? this.sender,
|
|
215
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
216
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
217
|
+
schema: {
|
|
218
|
+
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
219
|
+
globalInts: this.appSpec.state.global.num_uints,
|
|
220
|
+
localByteSlices: this.appSpec.state.local.num_byte_slices,
|
|
221
|
+
localInts: this.appSpec.state.local.num_uints,
|
|
222
|
+
},
|
|
223
|
+
args: this.getCallArgs(args),
|
|
224
|
+
note: note,
|
|
225
|
+
transactionParams: this.params,
|
|
226
|
+
...(sendParams ?? {}),
|
|
227
|
+
}, this.algod);
|
|
228
|
+
if (result.confirmation) {
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
230
|
+
this._appId = result.confirmation['application-index'];
|
|
231
|
+
this._appAddress = (0, algosdk_1.getApplicationAddress)(this._appId);
|
|
232
|
+
}
|
|
233
|
+
return result;
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
throw this.exposeLogicError(e);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async update(update) {
|
|
240
|
+
const { sender, note, sendParams, deployTimeParams, updatable, deletable, ...args } = update ?? {};
|
|
241
|
+
if (this._appId === 0) {
|
|
242
|
+
throw new Error(`Attempt to update app which doesn't have an app id defined`);
|
|
243
|
+
}
|
|
244
|
+
if (!sender && !this.sender) {
|
|
245
|
+
throw new Error('No sender provided, unable to create app');
|
|
246
|
+
}
|
|
247
|
+
const { approvalCompiled, clearCompiled } = await this.compile(update);
|
|
248
|
+
try {
|
|
249
|
+
const result = await (0, app_1.updateApp)({
|
|
250
|
+
appId: this._appId,
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
252
|
+
from: sender ?? this.sender,
|
|
253
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
254
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
255
|
+
args: this.getCallArgs(args),
|
|
256
|
+
note: note,
|
|
257
|
+
transactionParams: this.params,
|
|
258
|
+
...(sendParams ?? {}),
|
|
259
|
+
}, this.algod);
|
|
260
|
+
this._approvalSourceMap = result.compiledApproval?.sourceMap;
|
|
261
|
+
this._clearSourceMap = result.compiledClear?.sourceMap;
|
|
262
|
+
return result;
|
|
263
|
+
}
|
|
264
|
+
catch (e) {
|
|
265
|
+
throw this.exposeLogicError(e);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
async call(call) {
|
|
269
|
+
return await this._call(call, 'normal');
|
|
270
|
+
}
|
|
271
|
+
async optIn(call) {
|
|
272
|
+
return await this._call(call, 'optin');
|
|
273
|
+
}
|
|
274
|
+
async closeOut(call) {
|
|
275
|
+
return await this._call(call, 'closeout');
|
|
276
|
+
}
|
|
277
|
+
async clearState(call) {
|
|
278
|
+
return await this._call(call, 'clearstate');
|
|
279
|
+
}
|
|
280
|
+
async delete(call) {
|
|
281
|
+
return await this._call(call, 'delete');
|
|
282
|
+
}
|
|
283
|
+
async _call(call, callType) {
|
|
284
|
+
const { sender, note, sendParams, ...args } = call ?? {};
|
|
285
|
+
if (!sender && !this.sender) {
|
|
286
|
+
throw new Error('No sender provided, unable to call app');
|
|
287
|
+
}
|
|
288
|
+
const appMetadata = await this.getAppReference();
|
|
289
|
+
if (appMetadata.appId === 0) {
|
|
290
|
+
throw new Error(`Attempt to call an app that can't be found '${this._appName}' for creator '${this._creator}'.`);
|
|
291
|
+
}
|
|
292
|
+
try {
|
|
293
|
+
return await (0, app_1.callApp)({
|
|
294
|
+
appId: appMetadata.appId,
|
|
295
|
+
callType: callType,
|
|
296
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
297
|
+
from: sender ?? this.sender,
|
|
298
|
+
args: this.getCallArgs(args),
|
|
299
|
+
note: note,
|
|
300
|
+
transactionParams: this.params,
|
|
301
|
+
...(sendParams ?? {}),
|
|
302
|
+
}, this.algod);
|
|
303
|
+
}
|
|
304
|
+
catch (e) {
|
|
305
|
+
throw this.exposeLogicError(e);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Funds ALGOs into the app account for this app.
|
|
310
|
+
* @param fund The parameters for the funding or the funding amount
|
|
311
|
+
* @returns The result of the funding
|
|
312
|
+
*/
|
|
313
|
+
async fundAppAccount(fund) {
|
|
314
|
+
const { amount, sender, note, sendParams } = 'microAlgos' in fund ? { amount: fund } : fund;
|
|
315
|
+
if (!sender && !this.sender) {
|
|
316
|
+
throw new Error('No sender provided, unable to call app');
|
|
317
|
+
}
|
|
318
|
+
const ref = await this.getAppReference();
|
|
319
|
+
return await (0, transfer_1.transferAlgos)({
|
|
320
|
+
to: ref.appAddress,
|
|
321
|
+
amount: amount,
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
323
|
+
from: sender ?? this.sender,
|
|
324
|
+
note: note,
|
|
325
|
+
transactionParams: this.params,
|
|
326
|
+
...(sendParams ?? {}),
|
|
327
|
+
}, this.algod);
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Returns global state for the current app.
|
|
331
|
+
* @returns The global state
|
|
332
|
+
*/
|
|
333
|
+
async getGlobalState() {
|
|
334
|
+
const appRef = await this.getAppReference();
|
|
335
|
+
if (appRef.appId === 0) {
|
|
336
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
337
|
+
}
|
|
338
|
+
return (0, app_1.getAppGlobalState)(appRef.appId, this.algod);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Returns local state for the given account / account address.
|
|
342
|
+
* @returns The global state
|
|
343
|
+
*/
|
|
344
|
+
async getLocalState(account) {
|
|
345
|
+
const appRef = await this.getAppReference();
|
|
346
|
+
if (appRef.appId === 0) {
|
|
347
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
348
|
+
}
|
|
349
|
+
return (0, app_1.getAppLocalState)(appRef.appId, account, this.algod);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Returns the names of all current boxes for the current app.
|
|
353
|
+
* @returns The names of the boxes
|
|
354
|
+
*/
|
|
355
|
+
async getBoxNames() {
|
|
356
|
+
const appRef = await this.getAppReference();
|
|
357
|
+
if (appRef.appId === 0) {
|
|
358
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
359
|
+
}
|
|
360
|
+
return await (0, app_1.getAppBoxNames)(appRef.appId, this.algod);
|
|
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
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Returns the values of all current boxes for the current app.
|
|
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.
|
|
389
|
+
* @param filter Optional filter to filter which boxes' values are returned
|
|
390
|
+
* @returns The (name, value) pair of the boxes with values as raw byte arrays
|
|
391
|
+
*/
|
|
392
|
+
async getBoxValues(filter) {
|
|
393
|
+
const appRef = await this.getAppReference();
|
|
394
|
+
if (appRef.appId === 0) {
|
|
395
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
396
|
+
}
|
|
397
|
+
const names = await this.getBoxNames();
|
|
398
|
+
return await Promise.all(names
|
|
399
|
+
.filter(filter ?? ((_) => true))
|
|
400
|
+
.map(async (boxName) => ({ name: boxName, value: await (0, app_1.getAppBoxValue)(appRef.appId, boxName, this.algod) })));
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Returns the values of all current boxes for the current app decoded using an ABI Type.
|
|
404
|
+
* Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
|
|
405
|
+
* @param type The ABI type to decode the values with
|
|
406
|
+
* @param filter Optional filter to filter which boxes' values are returned
|
|
407
|
+
* @returns The (name, value) pair of the boxes with values as the ABI Value
|
|
408
|
+
*/
|
|
409
|
+
async getBoxValuesFromABIType(type, filter) {
|
|
410
|
+
const appRef = await this.getAppReference();
|
|
411
|
+
if (appRef.appId === 0) {
|
|
412
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
413
|
+
}
|
|
414
|
+
const names = await this.getBoxNames();
|
|
415
|
+
return await Promise.all(names.filter(filter ?? ((_) => true)).map(async (boxName) => ({
|
|
416
|
+
name: boxName,
|
|
417
|
+
value: await (0, app_1.getAppBoxValueFromABIType)({ appId: appRef.appId, boxName, type }, this.algod),
|
|
418
|
+
})));
|
|
419
|
+
}
|
|
420
|
+
/** @deprecated Use `getBoxValuesFromABIType` instead */
|
|
421
|
+
async getBoxValuesAsABIType(type, filter) {
|
|
422
|
+
return this.getBoxValuesFromABIType(type, filter);
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Returns the arguments for an app call for the given ABI method or raw method specification.
|
|
426
|
+
* @param args The call args specific to this application client
|
|
427
|
+
* @returns The call args ready to pass into an app call
|
|
428
|
+
*/
|
|
429
|
+
getCallArgs(args) {
|
|
430
|
+
if (!args) {
|
|
431
|
+
return undefined;
|
|
432
|
+
}
|
|
433
|
+
if ('method' in args) {
|
|
434
|
+
const abiMethod = this.getABIMethodParams(args.method);
|
|
435
|
+
if (!abiMethod) {
|
|
436
|
+
throw new Error(`Attempt to call ABI method ${args.method}, but it wasn't found`);
|
|
437
|
+
}
|
|
438
|
+
if (Array.isArray(args.methodArgs)) {
|
|
439
|
+
return {
|
|
440
|
+
method: abiMethod,
|
|
441
|
+
args: args.methodArgs,
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
return {
|
|
446
|
+
method: abiMethod,
|
|
447
|
+
...args.methodArgs,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
return args.args;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Returns the ABI Method parameters for the given method name string for the app represented by this application client instance
|
|
457
|
+
* @param method Either the name of the method or the ABI method spec definition string
|
|
458
|
+
* @returns The ABI method params for the given method
|
|
459
|
+
*/
|
|
460
|
+
getABIMethodParams(method) {
|
|
461
|
+
if (!method.includes('(')) {
|
|
462
|
+
const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
|
|
463
|
+
if (methods.length > 1) {
|
|
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(', ')}`);
|
|
467
|
+
}
|
|
468
|
+
return methods[0];
|
|
469
|
+
}
|
|
470
|
+
return this.appSpec.contract.methods.find((m) => (0, app_1.getABIMethodSignature)(m) === method);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Returns the ABI Method for the given method name string for the app represented by this application client instance
|
|
474
|
+
* @param method Either the name of the method or the ABI method spec definition string
|
|
475
|
+
* @returns The ABI method for the given method
|
|
476
|
+
*/
|
|
477
|
+
getABIMethod(method) {
|
|
478
|
+
const methodParams = this.getABIMethodParams(method);
|
|
479
|
+
return methodParams ? new algosdk_1.ABIMethod(methodParams) : undefined;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Gets the reference information for the current application instance.
|
|
483
|
+
* `appId` will be 0 if it can't find an app.
|
|
484
|
+
* @returns The app reference, or if deployed using the `deploy` method, the app metadata too
|
|
485
|
+
*/
|
|
486
|
+
async getAppReference() {
|
|
487
|
+
if (!this.existingDeployments && this._creator) {
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
489
|
+
this.existingDeployments = await (0, app_deploy_1.getCreatorAppsByName)(this._creator, this.indexer);
|
|
490
|
+
}
|
|
491
|
+
if (this.existingDeployments && this._appId === 0) {
|
|
492
|
+
const app = this.existingDeployments.apps[this._appName];
|
|
493
|
+
if (!app) {
|
|
494
|
+
return {
|
|
495
|
+
appId: 0,
|
|
496
|
+
appAddress: (0, algosdk_1.getApplicationAddress)(0),
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
return app;
|
|
500
|
+
}
|
|
501
|
+
return {
|
|
502
|
+
appId: this._appId,
|
|
503
|
+
appAddress: this._appAddress,
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
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.
|
|
508
|
+
* This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
|
|
509
|
+
* then you can use this in a try/catch block to get better debugging information.
|
|
510
|
+
* @param e The error to parse
|
|
511
|
+
* @param isClear Whether or not the code was running the clear state program
|
|
512
|
+
* @returns The new error, or if there was no logic error or source map then the wrapped error with source details
|
|
513
|
+
*/
|
|
514
|
+
exposeLogicError(e, isClear) {
|
|
515
|
+
if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))
|
|
516
|
+
return e;
|
|
517
|
+
const errorDetails = logic_error_1.LogicError.parseLogicError(e);
|
|
518
|
+
if (errorDetails !== undefined)
|
|
519
|
+
return new logic_error_1.LogicError(errorDetails, buffer_1.Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')
|
|
520
|
+
.toString()
|
|
521
|
+
.split('\n'),
|
|
522
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
523
|
+
isClear ? this._clearSourceMap : this._approvalSourceMap);
|
|
524
|
+
else
|
|
525
|
+
return e;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
exports.ApplicationClient = ApplicationClient;
|
|
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,MAA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