@algorandfoundation/algokit-utils 2.3.3-beta.3 → 2.3.3-beta.5
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/cjs/account.d.ts.map +1 -0
- package/cjs/account.js.map +1 -0
- package/cjs/amount.d.ts.map +1 -0
- package/cjs/amount.js.map +1 -0
- package/cjs/app-client.d.ts.map +1 -0
- package/cjs/app-client.js.map +1 -0
- package/cjs/app-deploy.d.ts.map +1 -0
- package/cjs/app-deploy.js.map +1 -0
- package/cjs/app.d.ts.map +1 -0
- package/cjs/app.js.map +1 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js.map +1 -0
- package/cjs/indexer-lookup.d.ts.map +1 -0
- package/cjs/indexer-lookup.js.map +1 -0
- package/cjs/localnet.d.ts.map +1 -0
- package/{localnet.js → cjs/localnet.js} +1 -1
- package/cjs/localnet.js.map +1 -0
- package/cjs/network-client.d.ts.map +1 -0
- package/cjs/network-client.js.map +1 -0
- package/cjs/testing/account.d.ts.map +1 -0
- package/cjs/testing/account.js.map +1 -0
- package/cjs/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/cjs/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/cjs/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/cjs/testing/fixtures/algorand-fixture.js.map +1 -0
- package/cjs/testing/fixtures/index.d.ts.map +1 -0
- package/cjs/testing/fixtures/index.js.map +1 -0
- package/cjs/testing/index.d.ts.map +1 -0
- package/cjs/testing/index.js.map +1 -0
- package/cjs/testing/indexer.d.ts.map +1 -0
- package/cjs/testing/indexer.js.map +1 -0
- package/cjs/testing/test-logger.d.ts.map +1 -0
- package/{testing → cjs/testing}/test-logger.js +2 -0
- package/cjs/testing/test-logger.js.map +1 -0
- package/cjs/testing/transaction-logger.d.ts.map +1 -0
- package/{testing → cjs/testing}/transaction-logger.js +2 -3
- package/cjs/testing/transaction-logger.js.map +1 -0
- package/cjs/transaction.d.ts.map +1 -0
- package/cjs/transaction.js.map +1 -0
- package/cjs/transfer.d.ts.map +1 -0
- package/cjs/transfer.js.map +1 -0
- package/cjs/types/account.d.ts +66 -0
- package/cjs/types/account.d.ts.map +1 -0
- package/{types → cjs/types}/account.js +7 -0
- package/cjs/types/account.js.map +1 -0
- package/cjs/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/{types → cjs/types}/algo-http-client-with-retry.js +16 -16
- package/cjs/types/algo-http-client-with-retry.js.map +1 -0
- package/cjs/types/amount.d.ts +24 -0
- package/cjs/types/amount.d.ts.map +1 -0
- package/{types → cjs/types}/amount.js +1 -0
- package/cjs/types/amount.js.map +1 -0
- package/cjs/types/app-client.d.ts +408 -0
- package/cjs/types/app-client.d.ts.map +1 -0
- package/{types → cjs/types}/app-client.js +13 -0
- package/cjs/types/app-client.js.map +1 -0
- package/cjs/types/app-spec.d.ts.map +1 -0
- package/{types → cjs/types}/app-spec.js.map +1 -1
- package/cjs/types/app.d.ts +308 -0
- package/cjs/types/app.d.ts.map +1 -0
- package/cjs/types/app.js.map +1 -0
- package/cjs/types/config.d.ts.map +1 -0
- package/{types → cjs/types}/config.js +1 -0
- package/cjs/types/config.js.map +1 -0
- package/cjs/types/indexer.d.ts.map +1 -0
- package/cjs/types/indexer.js.map +1 -0
- package/cjs/types/logging.d.ts.map +1 -0
- package/cjs/types/logging.js.map +1 -0
- package/cjs/types/logic-error.d.ts.map +1 -0
- package/{types → cjs/types}/logic-error.js +5 -2
- package/cjs/types/logic-error.js.map +1 -0
- package/cjs/types/network-client.d.ts +20 -0
- package/cjs/types/network-client.d.ts.map +1 -0
- package/cjs/types/network-client.js.map +1 -0
- package/cjs/types/testing.d.ts.map +1 -0
- package/{types → cjs/types}/testing.js.map +1 -1
- package/cjs/types/transaction.d.ts +111 -0
- package/cjs/types/transaction.d.ts.map +1 -0
- package/{types → cjs/types}/transaction.js.map +1 -1
- package/cjs/types/transfer.d.ts +32 -0
- package/cjs/types/transfer.d.ts.map +1 -0
- package/{types → cjs/types}/transfer.js.map +1 -1
- package/cjs/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/{types → cjs/types}/urlTokenBaseHTTPClient.js +4 -0
- package/cjs/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/cjs/util.d.ts.map +1 -0
- package/cjs/util.js.map +1 -0
- package/esm/account.js +170 -0
- package/esm/account.js.map +1 -0
- package/esm/amount.js +27 -0
- package/esm/amount.js.map +1 -0
- package/esm/app-client.js +76 -0
- package/esm/app-client.js.map +1 -0
- package/esm/app-deploy.js +446 -0
- package/esm/app-deploy.js.map +1 -0
- package/esm/app.js +572 -0
- package/esm/app.js.map +1 -0
- package/esm/index.js +14 -0
- package/esm/index.js.map +1 -0
- package/esm/indexer-lookup.js +98 -0
- package/esm/indexer-lookup.js.map +1 -0
- package/esm/localnet.js +111 -0
- package/esm/localnet.js.map +1 -0
- package/esm/network-client.js +179 -0
- package/esm/network-client.js.map +1 -0
- package/esm/testing/account.js +24 -0
- package/esm/testing/account.js.map +1 -0
- package/esm/testing/fixtures/algokit-log-capture-fixture.js +39 -0
- package/esm/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/esm/testing/fixtures/algorand-fixture.js +53 -0
- package/esm/testing/fixtures/algorand-fixture.js.map +1 -0
- package/esm/testing/fixtures/index.js +3 -0
- package/esm/testing/fixtures/index.js.map +1 -0
- package/esm/testing/index.js +6 -0
- package/esm/testing/index.js.map +1 -0
- package/esm/testing/indexer.js +36 -0
- package/esm/testing/indexer.js.map +1 -0
- package/esm/testing/test-logger.js +69 -0
- package/esm/testing/test-logger.js.map +1 -0
- package/esm/testing/transaction-logger.js +66 -0
- package/esm/testing/transaction-logger.js.map +1 -0
- package/esm/transaction.js +365 -0
- package/esm/transaction.js.map +1 -0
- package/esm/transfer.js +59 -0
- package/esm/transfer.js.map +1 -0
- package/esm/types/account.js +90 -0
- package/esm/types/account.js.map +1 -0
- package/esm/types/algo-http-client-with-retry.js +58 -0
- package/esm/types/algo-http-client-with-retry.js.map +1 -0
- package/esm/types/amount.js +35 -0
- package/esm/types/amount.js.map +1 -0
- package/esm/types/app-client.js +624 -0
- package/esm/types/app-client.js.map +1 -0
- package/esm/types/app-spec.js +2 -0
- package/esm/types/app-spec.js.map +1 -0
- package/esm/types/app.js +33 -0
- package/esm/types/app.js.map +1 -0
- package/esm/types/config.js +50 -0
- package/esm/types/config.js.map +1 -0
- package/esm/types/indexer.js +31 -0
- package/esm/types/indexer.js.map +1 -0
- package/esm/types/logging.js +24 -0
- package/esm/types/logging.js.map +1 -0
- package/esm/types/logic-error.js +49 -0
- package/esm/types/logic-error.js.map +1 -0
- package/esm/types/network-client.js +2 -0
- package/esm/types/network-client.js.map +1 -0
- package/esm/types/testing.js +2 -0
- package/esm/types/testing.js.map +1 -0
- package/esm/types/transaction.js +2 -0
- package/esm/types/transaction.js.map +1 -0
- package/esm/types/transfer.js +2 -0
- package/esm/types/transfer.js.map +1 -0
- package/esm/types/urlTokenBaseHTTPClient.js +151 -0
- package/esm/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/esm/util.js +20 -0
- package/esm/util.js.map +1 -0
- package/package.json +42 -6
- package/types/account.d.ts +125 -63
- package/types/account.d.ts.map +1 -1
- package/types/amount.d.ts +18 -22
- package/types/amount.d.ts.map +1 -1
- package/types/app-client.d.ts +70 -407
- package/types/app-client.d.ts.map +1 -1
- package/types/app-deploy.d.ts +101 -0
- package/types/app-deploy.d.ts.map +1 -0
- package/types/app.d.ts +145 -290
- package/types/app.d.ts.map +1 -1
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/indexer-lookup.d.ts +38 -0
- package/types/indexer-lookup.d.ts.map +1 -0
- package/types/localnet.d.ts +54 -0
- package/types/localnet.d.ts.map +1 -0
- package/types/network-client.d.ts +96 -19
- package/types/network-client.d.ts.map +1 -1
- package/types/testing/account.d.ts +14 -0
- package/types/testing/account.d.ts.map +1 -0
- package/types/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
- package/types/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/types/testing/fixtures/algorand-fixture.d.ts +48 -0
- package/types/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/types/testing/fixtures/index.d.ts +3 -0
- package/types/testing/fixtures/index.d.ts.map +1 -0
- package/types/testing/index.d.ts +6 -0
- package/types/testing/index.d.ts.map +1 -0
- package/types/testing/indexer.d.ts +12 -0
- package/types/testing/indexer.d.ts.map +1 -0
- package/types/testing/test-logger.d.ts +41 -0
- package/types/testing/test-logger.d.ts.map +1 -0
- package/types/testing/transaction-logger.d.ts +29 -0
- package/types/testing/transaction-logger.d.ts.map +1 -0
- package/types/transaction.d.ts +133 -106
- package/types/transaction.d.ts.map +1 -1
- package/types/transfer.d.ts +21 -31
- package/types/transfer.d.ts.map +1 -1
- package/types/types/account.d.ts +66 -0
- package/types/types/account.d.ts.map +1 -0
- package/types/types/algo-http-client-with-retry.d.ts +14 -0
- package/types/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/types/types/amount.d.ts +24 -0
- package/types/types/amount.d.ts.map +1 -0
- package/types/types/app-client.d.ts +408 -0
- package/types/types/app-client.d.ts.map +1 -0
- package/types/types/app-spec.d.ts +154 -0
- package/types/types/app-spec.d.ts.map +1 -0
- package/types/types/app.d.ts +308 -0
- package/types/types/app.d.ts.map +1 -0
- package/types/types/config.d.ts +32 -0
- package/types/types/config.d.ts.map +1 -0
- package/types/types/indexer.d.ts +623 -0
- package/types/types/indexer.d.ts.map +1 -0
- package/types/types/logging.d.ts +13 -0
- package/types/types/logging.d.ts.map +1 -0
- package/types/types/logic-error.d.ts +37 -0
- package/types/types/logic-error.d.ts.map +1 -0
- package/types/types/network-client.d.ts +20 -0
- package/types/types/network-client.d.ts.map +1 -0
- package/types/types/testing.d.ts +89 -0
- package/types/types/testing.d.ts.map +1 -0
- package/types/types/transaction.d.ts +111 -0
- package/types/types/transaction.d.ts.map +1 -0
- package/types/types/transfer.d.ts +32 -0
- package/types/types/transfer.d.ts.map +1 -0
- package/types/types/urlTokenBaseHTTPClient.d.ts +41 -0
- package/types/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/types/util.d.ts +10 -0
- package/types/util.d.ts.map +1 -0
- package/account.d.ts.map +0 -1
- package/account.js.map +0 -1
- package/amount.d.ts.map +0 -1
- package/amount.js.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-client.js.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app-deploy.js.map +0 -1
- package/app.d.ts.map +0 -1
- package/app.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/indexer-lookup.js.map +0 -1
- package/localnet.d.ts.map +0 -1
- package/localnet.js.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/network-client.js.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/account.js.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.js.map +0 -1
- package/testing/fixtures/index.d.ts.map +0 -1
- package/testing/fixtures/index.js.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/index.js.map +0 -1
- package/testing/indexer.d.ts.map +0 -1
- package/testing/indexer.js.map +0 -1
- package/testing/test-logger.d.ts.map +0 -1
- package/testing/test-logger.js.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/testing/transaction-logger.js.map +0 -1
- package/transaction.d.ts.map +0 -1
- package/transaction.js.map +0 -1
- package/transfer.d.ts.map +0 -1
- package/transfer.js.map +0 -1
- package/types/account.js.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.js.map +0 -1
- package/types/amount.js.map +0 -1
- package/types/app-client.js.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.js.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/config.js.map +0 -1
- package/types/indexer.d.ts.map +0 -1
- package/types/indexer.js.map +0 -1
- package/types/logging.d.ts.map +0 -1
- package/types/logging.js.map +0 -1
- package/types/logic-error.d.ts.map +0 -1
- package/types/logic-error.js.map +0 -1
- package/types/network-client.js.map +0 -1
- package/types/testing.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.js.map +0 -1
- package/util.d.ts.map +0 -1
- package/util.js.map +0 -1
- /package/{account.d.ts → cjs/account.d.ts} +0 -0
- /package/{account.js → cjs/account.js} +0 -0
- /package/{amount.d.ts → cjs/amount.d.ts} +0 -0
- /package/{amount.js → cjs/amount.js} +0 -0
- /package/{app-client.d.ts → cjs/app-client.d.ts} +0 -0
- /package/{app-client.js → cjs/app-client.js} +0 -0
- /package/{app-deploy.d.ts → cjs/app-deploy.d.ts} +0 -0
- /package/{app-deploy.js → cjs/app-deploy.js} +0 -0
- /package/{app.d.ts → cjs/app.d.ts} +0 -0
- /package/{app.js → cjs/app.js} +0 -0
- /package/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/{index.js → cjs/index.js} +0 -0
- /package/{indexer-lookup.d.ts → cjs/indexer-lookup.d.ts} +0 -0
- /package/{indexer-lookup.js → cjs/indexer-lookup.js} +0 -0
- /package/{localnet.d.ts → cjs/localnet.d.ts} +0 -0
- /package/{network-client.d.ts → cjs/network-client.d.ts} +0 -0
- /package/{network-client.js → cjs/network-client.js} +0 -0
- /package/{testing → cjs/testing}/account.d.ts +0 -0
- /package/{testing → cjs/testing}/account.js +0 -0
- /package/{testing → cjs/testing}/fixtures/algokit-log-capture-fixture.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
- /package/{testing → cjs/testing}/fixtures/algorand-fixture.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/algorand-fixture.js +0 -0
- /package/{testing → cjs/testing}/fixtures/index.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/index.js +0 -0
- /package/{testing → cjs/testing}/index.d.ts +0 -0
- /package/{testing → cjs/testing}/index.js +0 -0
- /package/{testing → cjs/testing}/indexer.d.ts +0 -0
- /package/{testing → cjs/testing}/indexer.js +0 -0
- /package/{testing → cjs/testing}/test-logger.d.ts +0 -0
- /package/{testing → cjs/testing}/transaction-logger.d.ts +0 -0
- /package/{transaction.d.ts → cjs/transaction.d.ts} +0 -0
- /package/{transaction.js → cjs/transaction.js} +0 -0
- /package/{transfer.d.ts → cjs/transfer.d.ts} +0 -0
- /package/{transfer.js → cjs/transfer.js} +0 -0
- /package/{types → cjs/types}/algo-http-client-with-retry.d.ts +0 -0
- /package/{types → cjs/types}/app-spec.d.ts +0 -0
- /package/{types → cjs/types}/app-spec.js +0 -0
- /package/{types → cjs/types}/app.js +0 -0
- /package/{types → cjs/types}/config.d.ts +0 -0
- /package/{types → cjs/types}/indexer.d.ts +0 -0
- /package/{types → cjs/types}/indexer.js +0 -0
- /package/{types → cjs/types}/logging.d.ts +0 -0
- /package/{types → cjs/types}/logging.js +0 -0
- /package/{types → cjs/types}/logic-error.d.ts +0 -0
- /package/{types → cjs/types}/network-client.js +0 -0
- /package/{types → cjs/types}/testing.d.ts +0 -0
- /package/{types → cjs/types}/testing.js +0 -0
- /package/{types → cjs/types}/transaction.js +0 -0
- /package/{types → cjs/types}/transfer.js +0 -0
- /package/{types → cjs/types}/urlTokenBaseHTTPClient.d.ts +0 -0
- /package/{util.d.ts → cjs/util.d.ts} +0 -0
- /package/{util.js → cjs/util.js} +0 -0
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import algosdk, { ABIMethod, AtomicTransactionComposer, getApplicationAddress, Indexer, SourceMap, } from 'algosdk';
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
import { callApp, compileTeal, createApp, getABIMethodSignature, getAppBoxNames, getAppBoxValue, getAppBoxValueFromABIType, getAppGlobalState, getAppLocalState, updateApp, } from '../app';
|
|
4
|
+
import { deployApp, getCreatorAppsByName, performTemplateSubstitution, replaceDeployTimeControlParams } from '../app-deploy';
|
|
5
|
+
import { getSenderAddress } from '../transaction';
|
|
6
|
+
import { transferAlgos } from '../transfer';
|
|
7
|
+
import { DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME, } from './app';
|
|
8
|
+
import { LogicError } from './logic-error';
|
|
9
|
+
/**
|
|
10
|
+
* Determines deploy time control (UPDATABLE, DELETABLE) value by inspecting application specification
|
|
11
|
+
* @param approval TEAL Approval program, not the base64 version found on the appSpec
|
|
12
|
+
* @param appSpec Application Specification
|
|
13
|
+
* @param templateVariableName Template variable
|
|
14
|
+
* @param callConfigKey Call config type
|
|
15
|
+
* @returns true if applicable call config is found, false if not found or undefined if variable not present
|
|
16
|
+
*/
|
|
17
|
+
function getDeployTimeControl(approval, appSpec, templateVariableName, callConfigKey) {
|
|
18
|
+
// variable not present, so unknown control value
|
|
19
|
+
if (!approval.includes(templateVariableName))
|
|
20
|
+
return undefined;
|
|
21
|
+
// a bare call for specified CallConfig is present and configured
|
|
22
|
+
const bareCallConfig = appSpec.bare_call_config[callConfigKey];
|
|
23
|
+
if (!!bareCallConfig && bareCallConfig !== 'NEVER')
|
|
24
|
+
return true;
|
|
25
|
+
// an ABI call for specified CallConfig is present and configured
|
|
26
|
+
return Object.values(appSpec.hints).some((h) => {
|
|
27
|
+
const abiCallConfig = h.call_config[callConfigKey];
|
|
28
|
+
return !!abiCallConfig && abiCallConfig !== 'NEVER';
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */
|
|
32
|
+
export class ApplicationClient {
|
|
33
|
+
algod;
|
|
34
|
+
indexer;
|
|
35
|
+
appSpec;
|
|
36
|
+
sender;
|
|
37
|
+
params;
|
|
38
|
+
existingDeployments;
|
|
39
|
+
deployTimeParams;
|
|
40
|
+
_appId;
|
|
41
|
+
_appAddress;
|
|
42
|
+
_creator;
|
|
43
|
+
_appName;
|
|
44
|
+
_approvalSourceMap;
|
|
45
|
+
_clearSourceMap;
|
|
46
|
+
// todo: process ABI args as needed to make them nicer to deal with like beaker-ts
|
|
47
|
+
// todo: support readonly, noop method calls
|
|
48
|
+
// todo: find create, update, delete, etc. methods from app spec and call them by default
|
|
49
|
+
// todo: intelligent version management when deploying
|
|
50
|
+
/**
|
|
51
|
+
* Create a new ApplicationClient instance
|
|
52
|
+
* @param appDetails The details of the app
|
|
53
|
+
* @param algod An algod instance
|
|
54
|
+
*/
|
|
55
|
+
constructor(appDetails, algod) {
|
|
56
|
+
const { app, sender, params, deployTimeParams, ...appIdentifier } = appDetails;
|
|
57
|
+
this.algod = algod;
|
|
58
|
+
this.appSpec = typeof app == 'string' ? JSON.parse(app) : app;
|
|
59
|
+
this._appName = appIdentifier.name ?? this.appSpec.contract.name;
|
|
60
|
+
this.deployTimeParams = deployTimeParams;
|
|
61
|
+
if (appIdentifier.resolveBy === 'id') {
|
|
62
|
+
if (appIdentifier.id < 0) {
|
|
63
|
+
throw new Error(`Attempt to create application client with invalid app id of ${appIdentifier.id}`);
|
|
64
|
+
}
|
|
65
|
+
this._appId = appIdentifier.id;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this._appId = 0;
|
|
69
|
+
this._creator = appIdentifier.creatorAddress;
|
|
70
|
+
if (appIdentifier.findExistingUsing instanceof Indexer) {
|
|
71
|
+
this.indexer = appIdentifier.findExistingUsing;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (appIdentifier.findExistingUsing.creator !== this._creator) {
|
|
75
|
+
throw new Error(`Attempt to create application client with invalid existingDeployments against a different creator (${appIdentifier.findExistingUsing.creator}) instead of expected creator ${this._creator}`);
|
|
76
|
+
}
|
|
77
|
+
this.existingDeployments = appIdentifier.findExistingUsing;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
this._appAddress = algosdk.getApplicationAddress(this._appId);
|
|
81
|
+
this.sender = sender;
|
|
82
|
+
this.params = params;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Compiles the approval and clear programs and sets up the source map.
|
|
86
|
+
* @param compilation The deploy-time parameters for the compilation
|
|
87
|
+
* @returns The compiled approval and clear programs
|
|
88
|
+
*/
|
|
89
|
+
async compile(compilation) {
|
|
90
|
+
const { deployTimeParams, updatable, deletable } = compilation ?? {};
|
|
91
|
+
const approvalTemplate = Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
|
|
92
|
+
const approval = replaceDeployTimeControlParams(performTemplateSubstitution(approvalTemplate, deployTimeParams ?? this.deployTimeParams), {
|
|
93
|
+
updatable,
|
|
94
|
+
deletable,
|
|
95
|
+
});
|
|
96
|
+
const approvalCompiled = await compileTeal(approval, this.algod);
|
|
97
|
+
this._approvalSourceMap = approvalCompiled?.sourceMap;
|
|
98
|
+
const clearTemplate = Buffer.from(this.appSpec.source.clear, 'base64').toString('utf-8');
|
|
99
|
+
const clear = performTemplateSubstitution(clearTemplate, deployTimeParams ?? this.deployTimeParams);
|
|
100
|
+
const clearCompiled = await compileTeal(clear, this.algod);
|
|
101
|
+
this._clearSourceMap = clearCompiled?.sourceMap;
|
|
102
|
+
return { approvalCompiled, clearCompiled };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Export the current source maps for the app.
|
|
106
|
+
* @returns The source maps
|
|
107
|
+
*/
|
|
108
|
+
exportSourceMaps() {
|
|
109
|
+
if (!this._approvalSourceMap || !this._clearSourceMap) {
|
|
110
|
+
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");
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
approvalSourceMap: this._approvalSourceMap,
|
|
114
|
+
clearSourceMap: this._clearSourceMap,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Import source maps for the app.
|
|
119
|
+
* @param sourceMaps The source maps to import
|
|
120
|
+
*/
|
|
121
|
+
importSourceMaps(sourceMaps) {
|
|
122
|
+
this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap);
|
|
123
|
+
this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
|
|
127
|
+
*
|
|
128
|
+
* 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
|
|
129
|
+
*
|
|
130
|
+
* **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.
|
|
131
|
+
*
|
|
132
|
+
* **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.
|
|
133
|
+
* @param deploy Deployment details
|
|
134
|
+
* @returns The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions
|
|
135
|
+
*/
|
|
136
|
+
async deploy(deploy) {
|
|
137
|
+
const { sender: deploySender, version, allowUpdate, allowDelete, sendParams, createArgs, createOnCompleteAction, updateArgs, deleteArgs, ...deployArgs } = deploy ?? {};
|
|
138
|
+
if (this._appId !== 0) {
|
|
139
|
+
throw new Error(`Attempt to deploy app which already has an app id of ${this._appId}`);
|
|
140
|
+
}
|
|
141
|
+
const sender = deploySender ?? this.sender;
|
|
142
|
+
if (!sender) {
|
|
143
|
+
throw new Error('No sender provided, unable to deploy app');
|
|
144
|
+
}
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
146
|
+
const from = sender ?? this.sender;
|
|
147
|
+
if (!this._creator) {
|
|
148
|
+
throw new Error("Attempt to `deploy` a contract without specifying `resolveBy: 'creatorAndName'` in the constructor");
|
|
149
|
+
}
|
|
150
|
+
if (this._creator !== getSenderAddress(from)) {
|
|
151
|
+
throw new Error(`Attempt to deploy contract with a sender address (${getSenderAddress(from)}) that differs from the given creator address for this application client: ${this._creator}`);
|
|
152
|
+
}
|
|
153
|
+
const approval = Buffer.from(this.appSpec.source.approval, 'base64').toString('utf-8');
|
|
154
|
+
const compilation = {
|
|
155
|
+
deployTimeParams: deployArgs.deployTimeParams,
|
|
156
|
+
updatable: allowUpdate !== undefined
|
|
157
|
+
? allowUpdate
|
|
158
|
+
: getDeployTimeControl(approval, this.appSpec, UPDATABLE_TEMPLATE_NAME, 'update_application'),
|
|
159
|
+
deletable: allowDelete !== undefined
|
|
160
|
+
? allowDelete
|
|
161
|
+
: getDeployTimeControl(approval, this.appSpec, DELETABLE_TEMPLATE_NAME, 'delete_application'),
|
|
162
|
+
};
|
|
163
|
+
const { approvalCompiled, clearCompiled } = await this.compile(compilation);
|
|
164
|
+
try {
|
|
165
|
+
await this.getAppReference();
|
|
166
|
+
const result = await deployApp({
|
|
167
|
+
from: sender,
|
|
168
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
169
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
170
|
+
metadata: {
|
|
171
|
+
name: this._appName,
|
|
172
|
+
version: version ?? '1.0',
|
|
173
|
+
updatable: compilation.updatable,
|
|
174
|
+
deletable: compilation.deletable,
|
|
175
|
+
},
|
|
176
|
+
schema: {
|
|
177
|
+
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
178
|
+
globalInts: this.appSpec.state.global.num_uints,
|
|
179
|
+
localByteSlices: this.appSpec.state.local.num_byte_slices,
|
|
180
|
+
localInts: this.appSpec.state.local.num_uints,
|
|
181
|
+
},
|
|
182
|
+
transactionParams: this.params,
|
|
183
|
+
...(sendParams ?? {}),
|
|
184
|
+
existingDeployments: this.existingDeployments,
|
|
185
|
+
createArgs: await this.getCallArgs(createArgs, sender),
|
|
186
|
+
createOnCompleteAction: createOnCompleteAction,
|
|
187
|
+
updateArgs: await this.getCallArgs(updateArgs, sender),
|
|
188
|
+
deleteArgs: await this.getCallArgs(deleteArgs, sender),
|
|
189
|
+
...deployArgs,
|
|
190
|
+
}, this.algod, this.indexer);
|
|
191
|
+
// Nothing needed to happen
|
|
192
|
+
if (result.operationPerformed === 'nothing') {
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
if (!this.existingDeployments) {
|
|
196
|
+
throw new Error('Expected existingDeployments to be present');
|
|
197
|
+
}
|
|
198
|
+
const { transaction, confirmation, operationPerformed, ...appMetadata } = result;
|
|
199
|
+
this.existingDeployments = {
|
|
200
|
+
creator: this.existingDeployments.creator,
|
|
201
|
+
apps: { ...this.existingDeployments.apps, [this._appName]: appMetadata },
|
|
202
|
+
};
|
|
203
|
+
return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
throw this.exposeLogicError(e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Creates a smart contract app, returns the details of the created app.
|
|
211
|
+
* @param create The parameters to create the app with
|
|
212
|
+
* @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
|
|
213
|
+
*/
|
|
214
|
+
async create(create) {
|
|
215
|
+
const { sender: createSender, note, sendParams, deployTimeParams, updatable, deletable, onCompleteAction, ...args } = create ?? {};
|
|
216
|
+
if (this._appId !== 0) {
|
|
217
|
+
throw new Error(`Attempt to create app which already has an app id of ${this._appId}`);
|
|
218
|
+
}
|
|
219
|
+
const sender = createSender ?? this.sender;
|
|
220
|
+
if (!sender) {
|
|
221
|
+
throw new Error('No sender provided, unable to create app');
|
|
222
|
+
}
|
|
223
|
+
const { approvalCompiled, clearCompiled } = await this.compile(create);
|
|
224
|
+
try {
|
|
225
|
+
const result = await createApp({
|
|
226
|
+
from: sender,
|
|
227
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
228
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
229
|
+
schema: {
|
|
230
|
+
globalByteSlices: this.appSpec.state.global.num_byte_slices,
|
|
231
|
+
globalInts: this.appSpec.state.global.num_uints,
|
|
232
|
+
localByteSlices: this.appSpec.state.local.num_byte_slices,
|
|
233
|
+
localInts: this.appSpec.state.local.num_uints,
|
|
234
|
+
},
|
|
235
|
+
onCompleteAction,
|
|
236
|
+
args: await this.getCallArgs(args, sender),
|
|
237
|
+
note: note,
|
|
238
|
+
transactionParams: this.params,
|
|
239
|
+
...(sendParams ?? {}),
|
|
240
|
+
}, this.algod);
|
|
241
|
+
if (result.confirmation) {
|
|
242
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
243
|
+
this._appId = result.confirmation.applicationIndex;
|
|
244
|
+
this._appAddress = getApplicationAddress(this._appId);
|
|
245
|
+
}
|
|
246
|
+
return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
|
|
247
|
+
}
|
|
248
|
+
catch (e) {
|
|
249
|
+
throw this.exposeLogicError(e);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Updates the smart contract app.
|
|
254
|
+
* @param update The parameters to update the app with
|
|
255
|
+
* @returns The transaction send result and the compilation result
|
|
256
|
+
*/
|
|
257
|
+
async update(update) {
|
|
258
|
+
const { sender: updateSender, note, sendParams, deployTimeParams, updatable, deletable, ...args } = update ?? {};
|
|
259
|
+
if (this._appId === 0) {
|
|
260
|
+
throw new Error(`Attempt to update app which doesn't have an app id defined`);
|
|
261
|
+
}
|
|
262
|
+
const sender = updateSender ?? this.sender;
|
|
263
|
+
if (!sender) {
|
|
264
|
+
throw new Error('No sender provided, unable to create app');
|
|
265
|
+
}
|
|
266
|
+
const { approvalCompiled, clearCompiled } = await this.compile(update);
|
|
267
|
+
try {
|
|
268
|
+
const result = await updateApp({
|
|
269
|
+
appId: this._appId,
|
|
270
|
+
from: sender,
|
|
271
|
+
approvalProgram: approvalCompiled.compiledBase64ToBytes,
|
|
272
|
+
clearStateProgram: clearCompiled.compiledBase64ToBytes,
|
|
273
|
+
args: await this.getCallArgs(args, sender),
|
|
274
|
+
note: note,
|
|
275
|
+
transactionParams: this.params,
|
|
276
|
+
...(sendParams ?? {}),
|
|
277
|
+
}, this.algod);
|
|
278
|
+
return { ...result, ...{ compiledApproval: approvalCompiled, compiledClear: clearCompiled } };
|
|
279
|
+
}
|
|
280
|
+
catch (e) {
|
|
281
|
+
throw this.exposeLogicError(e);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Issues a no_op (normal) call to the app.
|
|
286
|
+
* @param call The call details.
|
|
287
|
+
* @returns The result of the call
|
|
288
|
+
*/
|
|
289
|
+
async call(call) {
|
|
290
|
+
if (
|
|
291
|
+
// ABI call
|
|
292
|
+
call?.method &&
|
|
293
|
+
// We aren't skipping the send
|
|
294
|
+
!call.sendParams?.skipSending &&
|
|
295
|
+
// There isn't an ATC passed in
|
|
296
|
+
!call.sendParams?.atc &&
|
|
297
|
+
// The method is readonly
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
299
|
+
this.appSpec.hints[getABIMethodSignature(this.getABIMethod(call.method))].read_only) {
|
|
300
|
+
const atc = new AtomicTransactionComposer();
|
|
301
|
+
await this.callOfType({ ...call, sendParams: { ...call.sendParams, atc } }, 'no_op');
|
|
302
|
+
const result = await atc.simulate(this.algod);
|
|
303
|
+
if (result.simulateResponse.txnGroups.some((group) => group.failureMessage)) {
|
|
304
|
+
throw new Error(result.simulateResponse.txnGroups.find((x) => x.failureMessage)?.failureMessage);
|
|
305
|
+
}
|
|
306
|
+
const txns = atc.buildGroup();
|
|
307
|
+
return {
|
|
308
|
+
transaction: txns[txns.length - 1].txn,
|
|
309
|
+
confirmation: result.simulateResponse.txnGroups[0].txnResults.at(-1)?.txnResult,
|
|
310
|
+
confirmations: result.simulateResponse.txnGroups[0].txnResults.map((t) => t.txnResult),
|
|
311
|
+
transactions: txns.map((t) => t.txn),
|
|
312
|
+
return: (result.methodResults?.length ?? 0 > 0) ? result.methodResults[result.methodResults.length - 1] : undefined,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return await this.callOfType(call, 'no_op');
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Issues a opt_in call to the app.
|
|
319
|
+
* @param call The call details.
|
|
320
|
+
* @returns The result of the call
|
|
321
|
+
*/
|
|
322
|
+
async optIn(call) {
|
|
323
|
+
return await this.callOfType(call, 'opt_in');
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Issues a close_out call to the app.
|
|
327
|
+
* @param call The call details.
|
|
328
|
+
* @returns The result of the call
|
|
329
|
+
*/
|
|
330
|
+
async closeOut(call) {
|
|
331
|
+
return await this.callOfType(call, 'close_out');
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Issues a clear_state call to the app.
|
|
335
|
+
* @param call The call details.
|
|
336
|
+
* @returns The result of the call
|
|
337
|
+
*/
|
|
338
|
+
async clearState(call) {
|
|
339
|
+
return await this.callOfType(call, 'clear_state');
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Issues a delete_application call to the app.
|
|
343
|
+
* @param call The call details.
|
|
344
|
+
* @returns The result of the call
|
|
345
|
+
*/
|
|
346
|
+
async delete(call) {
|
|
347
|
+
return await this.callOfType(call, 'delete_application');
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Issues a call to the app with the given call type.
|
|
351
|
+
* @param call The call details.
|
|
352
|
+
* @param callType The call type
|
|
353
|
+
* @returns The result of the call
|
|
354
|
+
*/
|
|
355
|
+
async callOfType(call = {}, callType) {
|
|
356
|
+
const { sender: callSender, note, sendParams, ...args } = call;
|
|
357
|
+
const sender = callSender ?? this.sender;
|
|
358
|
+
if (!sender) {
|
|
359
|
+
throw new Error('No sender provided, unable to call app');
|
|
360
|
+
}
|
|
361
|
+
const appMetadata = await this.getAppReference();
|
|
362
|
+
if (appMetadata.appId === 0) {
|
|
363
|
+
throw new Error(`Attempt to call an app that can't be found '${this._appName}' for creator '${this._creator}'.`);
|
|
364
|
+
}
|
|
365
|
+
try {
|
|
366
|
+
return await callApp({
|
|
367
|
+
appId: appMetadata.appId,
|
|
368
|
+
callType: callType,
|
|
369
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
370
|
+
from: sender,
|
|
371
|
+
args: await this.getCallArgs(args, sender),
|
|
372
|
+
note: note,
|
|
373
|
+
transactionParams: this.params,
|
|
374
|
+
...(sendParams ?? {}),
|
|
375
|
+
}, this.algod);
|
|
376
|
+
}
|
|
377
|
+
catch (e) {
|
|
378
|
+
throw this.exposeLogicError(e);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Funds ALGOs into the app account for this app.
|
|
383
|
+
* @param fund The parameters for the funding or the funding amount
|
|
384
|
+
* @returns The result of the funding
|
|
385
|
+
*/
|
|
386
|
+
async fundAppAccount(fund) {
|
|
387
|
+
const { amount, sender, note, sendParams } = 'microAlgos' in fund ? { amount: fund } : fund;
|
|
388
|
+
if (!sender && !this.sender) {
|
|
389
|
+
throw new Error('No sender provided, unable to call app');
|
|
390
|
+
}
|
|
391
|
+
const ref = await this.getAppReference();
|
|
392
|
+
return await transferAlgos({
|
|
393
|
+
to: ref.appAddress,
|
|
394
|
+
amount: amount,
|
|
395
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
396
|
+
from: sender ?? this.sender,
|
|
397
|
+
note: note,
|
|
398
|
+
transactionParams: this.params,
|
|
399
|
+
...(sendParams ?? {}),
|
|
400
|
+
}, this.algod);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Returns global state for the current app.
|
|
404
|
+
* @returns The global state
|
|
405
|
+
*/
|
|
406
|
+
async getGlobalState() {
|
|
407
|
+
const appRef = await this.getAppReference();
|
|
408
|
+
if (appRef.appId === 0) {
|
|
409
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
410
|
+
}
|
|
411
|
+
return getAppGlobalState(appRef.appId, this.algod);
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Returns local state for the given account / account address.
|
|
415
|
+
* @returns The global state
|
|
416
|
+
*/
|
|
417
|
+
async getLocalState(account) {
|
|
418
|
+
const appRef = await this.getAppReference();
|
|
419
|
+
if (appRef.appId === 0) {
|
|
420
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
421
|
+
}
|
|
422
|
+
return getAppLocalState(appRef.appId, account, this.algod);
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Returns the names of all current boxes for the current app.
|
|
426
|
+
* @returns The names of the boxes
|
|
427
|
+
*/
|
|
428
|
+
async getBoxNames() {
|
|
429
|
+
const appRef = await this.getAppReference();
|
|
430
|
+
if (appRef.appId === 0) {
|
|
431
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
432
|
+
}
|
|
433
|
+
return await getAppBoxNames(appRef.appId, this.algod);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Returns the value of the given box for the current app.
|
|
437
|
+
* @param name The name of the box to return either as a string, binary array or `BoxName`
|
|
438
|
+
* @returns The current box value as a byte array
|
|
439
|
+
*/
|
|
440
|
+
async getBoxValue(name) {
|
|
441
|
+
const appRef = await this.getAppReference();
|
|
442
|
+
if (appRef.appId === 0) {
|
|
443
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
444
|
+
}
|
|
445
|
+
return await getAppBoxValue(appRef.appId, name, this.algod);
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Returns the value of the given box for the current app.
|
|
449
|
+
* @param name The name of the box to return either as a string, binary array or `BoxName`
|
|
450
|
+
* @param type
|
|
451
|
+
* @returns The current box value as a byte array
|
|
452
|
+
*/
|
|
453
|
+
async getBoxValueFromABIType(name, type) {
|
|
454
|
+
const appRef = await this.getAppReference();
|
|
455
|
+
if (appRef.appId === 0) {
|
|
456
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
457
|
+
}
|
|
458
|
+
return await getAppBoxValueFromABIType({ appId: appRef.appId, boxName: name, type }, this.algod);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Returns the values of all current boxes for the current app.
|
|
462
|
+
* Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
|
|
463
|
+
* @param filter Optional filter to filter which boxes' values are returned
|
|
464
|
+
* @returns The (name, value) pair of the boxes with values as raw byte arrays
|
|
465
|
+
*/
|
|
466
|
+
async getBoxValues(filter) {
|
|
467
|
+
const appRef = await this.getAppReference();
|
|
468
|
+
if (appRef.appId === 0) {
|
|
469
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
470
|
+
}
|
|
471
|
+
const names = await this.getBoxNames();
|
|
472
|
+
return await Promise.all(names
|
|
473
|
+
.filter(filter ?? ((_) => true))
|
|
474
|
+
.map(async (boxName) => ({ name: boxName, value: await getAppBoxValue(appRef.appId, boxName, this.algod) })));
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Returns the values of all current boxes for the current app decoded using an ABI Type.
|
|
478
|
+
* Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync.
|
|
479
|
+
* @param type The ABI type to decode the values with
|
|
480
|
+
* @param filter Optional filter to filter which boxes' values are returned
|
|
481
|
+
* @returns The (name, value) pair of the boxes with values as the ABI Value
|
|
482
|
+
*/
|
|
483
|
+
async getBoxValuesFromABIType(type, filter) {
|
|
484
|
+
const appRef = await this.getAppReference();
|
|
485
|
+
if (appRef.appId === 0) {
|
|
486
|
+
throw new Error('No app has been created yet, unable to get global state');
|
|
487
|
+
}
|
|
488
|
+
const names = await this.getBoxNames();
|
|
489
|
+
return await Promise.all(names.filter(filter ?? ((_) => true)).map(async (boxName) => ({
|
|
490
|
+
name: boxName,
|
|
491
|
+
value: await getAppBoxValueFromABIType({ appId: appRef.appId, boxName, type }, this.algod),
|
|
492
|
+
})));
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Returns the arguments for an app call for the given ABI method or raw method specification.
|
|
496
|
+
* @param args The call args specific to this application client
|
|
497
|
+
* @param sender The sender of this call. Will be used to fetch any default argument values if applicable
|
|
498
|
+
* @returns The call args ready to pass into an app call
|
|
499
|
+
*/
|
|
500
|
+
async getCallArgs(args, sender) {
|
|
501
|
+
if (!args) {
|
|
502
|
+
return undefined;
|
|
503
|
+
}
|
|
504
|
+
if (args.method) {
|
|
505
|
+
const abiMethod = this.getABIMethodParams(args.method);
|
|
506
|
+
if (!abiMethod) {
|
|
507
|
+
throw new Error(`Attempt to call ABI method ${args.method}, but it wasn't found`);
|
|
508
|
+
}
|
|
509
|
+
const methodSignature = getABIMethodSignature(abiMethod);
|
|
510
|
+
return {
|
|
511
|
+
...args,
|
|
512
|
+
method: abiMethod,
|
|
513
|
+
methodArgs: await Promise.all(args.methodArgs.map(async (arg, index) => {
|
|
514
|
+
if (arg !== undefined)
|
|
515
|
+
return arg;
|
|
516
|
+
const argName = abiMethod.args[index].name;
|
|
517
|
+
const defaultValueStrategy = argName && this.appSpec.hints?.[methodSignature]?.default_arguments?.[argName];
|
|
518
|
+
if (!defaultValueStrategy)
|
|
519
|
+
throw new Error(`Argument at position ${index} with the name ${argName} is undefined and does not have a default value strategy`);
|
|
520
|
+
switch (defaultValueStrategy.source) {
|
|
521
|
+
case 'constant':
|
|
522
|
+
return defaultValueStrategy.data;
|
|
523
|
+
case 'abi-method': {
|
|
524
|
+
const method = defaultValueStrategy.data;
|
|
525
|
+
const result = await this.callOfType({
|
|
526
|
+
method: getABIMethodSignature(method),
|
|
527
|
+
methodArgs: method.args.map(() => undefined),
|
|
528
|
+
sender,
|
|
529
|
+
}, 'no_op');
|
|
530
|
+
return result.return?.returnValue;
|
|
531
|
+
}
|
|
532
|
+
case 'local-state':
|
|
533
|
+
case 'global-state': {
|
|
534
|
+
const state = defaultValueStrategy.source === 'global-state' ? await this.getGlobalState() : await this.getLocalState(sender);
|
|
535
|
+
const key = defaultValueStrategy.data;
|
|
536
|
+
if (key in state) {
|
|
537
|
+
return state[key].value;
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
throw new Error(`Preparing default value for argument at position ${index} with the name ${argName} resulted in the failure: The key '${key}' could not be found in ${defaultValueStrategy.source}`);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
})),
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
return args;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Returns the ABI Method parameters for the given method name string for the app represented by this application client instance
|
|
553
|
+
* @param method Either the name of the method or the ABI method spec definition string
|
|
554
|
+
* @returns The ABI method params for the given method
|
|
555
|
+
*/
|
|
556
|
+
getABIMethodParams(method) {
|
|
557
|
+
if (!method.includes('(')) {
|
|
558
|
+
const methods = this.appSpec.contract.methods.filter((m) => m.name === method);
|
|
559
|
+
if (methods.length > 1) {
|
|
560
|
+
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
|
|
561
|
+
.map(getABIMethodSignature)
|
|
562
|
+
.join(', ')}`);
|
|
563
|
+
}
|
|
564
|
+
return methods[0];
|
|
565
|
+
}
|
|
566
|
+
return this.appSpec.contract.methods.find((m) => getABIMethodSignature(m) === method);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Returns the ABI Method for the given method name string for the app represented by this application client instance
|
|
570
|
+
* @param method Either the name of the method or the ABI method spec definition string
|
|
571
|
+
* @returns The ABI method for the given method
|
|
572
|
+
*/
|
|
573
|
+
getABIMethod(method) {
|
|
574
|
+
const methodParams = this.getABIMethodParams(method);
|
|
575
|
+
return methodParams ? new ABIMethod(methodParams) : undefined;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Gets the reference information for the current application instance.
|
|
579
|
+
* `appId` will be 0 if it can't find an app.
|
|
580
|
+
* @returns The app reference, or if deployed using the `deploy` method, the app metadata too
|
|
581
|
+
*/
|
|
582
|
+
async getAppReference() {
|
|
583
|
+
if (!this.existingDeployments && this._creator) {
|
|
584
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
585
|
+
this.existingDeployments = await getCreatorAppsByName(this._creator, this.indexer);
|
|
586
|
+
}
|
|
587
|
+
if (this.existingDeployments && this._appId === 0) {
|
|
588
|
+
const app = this.existingDeployments.apps[this._appName];
|
|
589
|
+
if (!app) {
|
|
590
|
+
return {
|
|
591
|
+
appId: 0,
|
|
592
|
+
appAddress: getApplicationAddress(0),
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
return app;
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
appId: this._appId,
|
|
599
|
+
appAddress: this._appAddress,
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* 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.
|
|
604
|
+
* This is automatically used within `ApplicationClient` but if you pass `skipSending: true` e.g. if doing a group transaction
|
|
605
|
+
* then you can use this in a try/catch block to get better debugging information.
|
|
606
|
+
* @param e The error to parse
|
|
607
|
+
* @param isClear Whether or not the code was running the clear state program
|
|
608
|
+
* @returns The new error, or if there was no logic error or source map then the wrapped error with source details
|
|
609
|
+
*/
|
|
610
|
+
exposeLogicError(e, isClear) {
|
|
611
|
+
if ((!isClear && this._approvalSourceMap == undefined) || (isClear && this._clearSourceMap == undefined))
|
|
612
|
+
return e;
|
|
613
|
+
const errorDetails = LogicError.parseLogicError(e);
|
|
614
|
+
if (errorDetails !== undefined)
|
|
615
|
+
return new LogicError(errorDetails, Buffer.from(isClear ? this.appSpec.source.clear : this.appSpec.source.approval, 'base64')
|
|
616
|
+
.toString()
|
|
617
|
+
.split('\n'),
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
619
|
+
isClear ? this._clearSourceMap : this._approvalSourceMap);
|
|
620
|
+
else
|
|
621
|
+
return e;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
//# 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,OAAO,OAAO,EAAE,EACd,SAAS,EAKT,yBAAyB,EACzB,qBAAqB,EACrB,OAAO,EAEP,SAAS,GAEV,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EACL,OAAO,EACP,WAAW,EACX,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,GACV,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAA;AAC5H,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAaL,uBAAuB,EAKvB,uBAAuB,GACxB,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAqL1C;;;;;;;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,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