@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_rolldown/runtime.js +33 -0
- package/_virtual/_rolldown/runtime.mjs +13 -0
- package/account/account.d.ts +25 -30
- package/account/account.js +151 -146
- package/account/account.js.map +1 -1
- package/account/account.mjs +149 -144
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +7 -2
- package/account/get-account-config-from-environment.js +19 -21
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs +19 -19
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +14 -12
- package/account/get-account.js +56 -59
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +56 -57
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +9 -5
- package/account/get-dispenser-account.js +20 -18
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +20 -16
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.d.ts +7 -3
- package/account/mnemonic-account.js +17 -17
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +15 -15
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +40 -35
- package/amount.js +33 -34
- package/amount.js.map +1 -1
- package/amount.mjs +33 -32
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +10 -6
- package/app-client.js +91 -86
- package/app-client.js.map +1 -1
- package/app-client.mjs +91 -84
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +26 -24
- package/app-deploy.js +235 -253
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +233 -251
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +45 -46
- package/app.js +253 -271
- package/app.js.map +1 -1
- package/app.mjs +249 -267
- package/app.mjs.map +1 -1
- package/asset.d.ts +16 -12
- package/asset.js +116 -122
- package/asset.js.map +1 -1
- package/asset.mjs +116 -120
- package/asset.mjs.map +1 -1
- package/config.d.ts +7 -2
- package/config.js +5 -7
- package/config.js.map +1 -1
- package/config.mjs +5 -4
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +5 -1
- package/debugging/debugging.js +11 -11
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +11 -9
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.d.ts +7 -2
- package/dispenser-client.js +23 -24
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +23 -22
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +27 -18
- package/index.js +140 -143
- package/index.mjs +27 -29
- package/indexer-lookup.d.ts +18 -11
- package/indexer-lookup.js +112 -120
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +105 -118
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +9 -7
- package/localnet/get-kmd-wallet-account.js +28 -26
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +28 -24
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +7 -5
- package/localnet/get-localnet-dispenser-account.js +17 -15
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +17 -13
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
- package/localnet/get-or-create-kmd-wallet-account.js +28 -26
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.d.ts +7 -3
- package/localnet/is-localnet.js +9 -10
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +9 -8
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +17 -15
- package/network-client.js +115 -116
- package/network-client.js.map +1 -1
- package/network-client.mjs +115 -114
- package/network-client.mjs.map +1 -1
- package/package.json +12 -3
- package/testing/account.d.ts +11 -9
- package/testing/account.js +31 -33
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +29 -31
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
- package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +9 -4
- package/testing/fixtures/algorand-fixture.js +67 -62
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +66 -59
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +7 -5
- package/testing/index.js +13 -18
- package/testing/index.mjs +7 -7
- package/testing/indexer.d.ts +5 -1
- package/testing/indexer.js +28 -37
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs +28 -35
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +41 -36
- package/testing/test-logger.js +71 -76
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +71 -74
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +30 -27
- package/testing/transaction-logger.js +77 -93
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs +74 -90
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +100 -111
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +97 -108
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
- package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +34 -35
- package/transaction/transaction.js +716 -914
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +713 -911
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +9 -5
- package/transfer/transfer-algos.js +26 -27
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +26 -25
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +11 -8
- package/transfer/transfer.js +94 -100
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +94 -98
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +432 -429
- package/types/account-manager.js +591 -602
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +587 -599
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +192 -202
- package/types/account.js +91 -88
- package/types/account.js.map +1 -1
- package/types/account.mjs +88 -86
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +15 -10
- package/types/algo-http-client-with-retry.js +70 -92
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +69 -90
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +778 -771
- package/types/algorand-client-transaction-creator.js +733 -732
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +732 -730
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +1090 -1360
- package/types/algorand-client-transaction-sender.js +930 -961
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +927 -959
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +239 -236
- package/types/algorand-client.js +322 -320
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +321 -318
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +47 -43
- package/types/amount.js +66 -70
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +63 -68
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +235 -272
- package/types/app-arc56.js +124 -170
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs +121 -168
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +1128 -2009
- package/types/app-client.js +1633 -1791
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1624 -1783
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +139 -141
- package/types/app-deployer.js +344 -384
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +341 -382
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +762 -932
- package/types/app-factory.js +496 -488
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +491 -484
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +304 -310
- package/types/app-manager.js +422 -475
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +419 -473
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +118 -117
- package/types/app-spec.js +125 -135
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +121 -132
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +229 -241
- package/types/app.js +36 -28
- package/types/app.js.map +1 -1
- package/types/app.mjs +33 -26
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +204 -199
- package/types/asset-manager.js +165 -174
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +164 -172
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +95 -91
- package/types/asset.js +0 -3
- package/types/asset.mjs +0 -2
- package/types/async-event-emitter.d.ts +18 -13
- package/types/async-event-emitter.js +37 -49
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +36 -47
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +453 -451
- package/types/client-manager.js +602 -598
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +597 -594
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1211 -1258
- package/types/composer.js +1436 -1498
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +1430 -1493
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +53 -48
- package/types/config.js +78 -77
- package/types/config.js.map +1 -1
- package/types/config.mjs +77 -75
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +25 -23
- package/types/debugging.js +9 -11
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +8 -9
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +57 -52
- package/types/dispenser-client.js +120 -141
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +119 -139
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +5 -3
- package/types/expand.js +0 -3
- package/types/expand.mjs +0 -2
- package/types/indexer.d.ts +104 -100
- package/types/indexer.js +36 -31
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +32 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +5 -3
- package/types/instance-of.js +0 -3
- package/types/instance-of.mjs +0 -2
- package/types/kmd-account-manager.d.ts +75 -70
- package/types/kmd-account-manager.js +150 -184
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +147 -182
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +13 -8
- package/types/lifecycle-events.js +10 -7
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +9 -7
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +15 -11
- package/types/logging.js +30 -31
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +29 -29
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +33 -29
- package/types/logic-error.js +50 -49
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +49 -47
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +32 -27
- package/types/network-client.js +10 -9
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -7
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +131 -132
- package/types/testing.js +0 -3
- package/types/testing.mjs +0 -2
- package/types/transaction.d.ts +110 -110
- package/types/transaction.js +0 -3
- package/types/transaction.mjs +0 -2
- package/types/transfer.d.ts +70 -66
- package/types/transfer.js +0 -3
- package/types/transfer.mjs +0 -2
- package/util.js +73 -118
- package/util.js.map +1 -1
- package/util.mjs +73 -116
- package/util.mjs.map +1 -1
- package/account/index.d.ts +0 -5
- package/debugging/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/localnet/index.d.ts +0 -4
- package/testing/_asset.d.ts +0 -3
- package/testing/fixtures/index.d.ts +0 -2
- package/testing/index.js.map +0 -1
- package/testing/index.mjs.map +0 -1
- package/transaction/index.d.ts +0 -2
- package/transaction/legacy-bridge.d.ts +0 -35
- package/transfer/index.d.ts +0 -2
- package/types/asset.js.map +0 -1
- package/types/asset.mjs.map +0 -1
- package/types/expand.js.map +0 -1
- package/types/expand.mjs.map +0 -1
- package/types/instance-of.js.map +0 -1
- package/types/instance-of.mjs.map +0 -1
- package/types/testing.js.map +0 -1
- package/types/testing.mjs.map +0 -1
- package/types/transaction.js.map +0 -1
- package/types/transaction.mjs.map +0 -1
- package/types/transfer.js.map +0 -1
- package/types/transfer.mjs.map +0 -1
- package/util.d.ts +0 -48
package/types/app.d.ts
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import ABIMethodParams = algosdk.ABIMethodParams;
|
|
7
|
-
import ABIType = algosdk.ABIType;
|
|
8
|
-
import ABIValue = algosdk.ABIValue;
|
|
9
|
-
import Address = algosdk.Address;
|
|
10
|
-
import OnApplicationComplete = algosdk.OnApplicationComplete;
|
|
11
|
-
import SourceMap = algosdk.ProgramSourceMap;
|
|
12
|
-
import SuggestedParams = algosdk.SuggestedParams;
|
|
13
|
-
import Transaction = algosdk.Transaction;
|
|
1
|
+
import { Expand } from "./expand.js";
|
|
2
|
+
import { SendSingleTransactionResult, SendTransactionFrom, SendTransactionParams, SendTransactionResult, SendTransactionResults, TransactionNote, TransactionToSign } from "./transaction.js";
|
|
3
|
+
import algosdk from "algosdk";
|
|
4
|
+
|
|
5
|
+
//#region src/types/app.d.ts
|
|
14
6
|
/** The name of the TEAL template variable for deploy-time immutability control */
|
|
15
|
-
|
|
7
|
+
declare const UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE";
|
|
16
8
|
/** The name of the TEAL template variable for deploy-time permanence control */
|
|
17
|
-
|
|
9
|
+
declare const DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE";
|
|
18
10
|
/** The app create/update [ARC-2](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) transaction note prefix */
|
|
19
|
-
|
|
11
|
+
declare const APP_DEPLOY_NOTE_DAPP = "ALGOKIT_DEPLOYER";
|
|
20
12
|
/** The maximum number of bytes in a single app code page */
|
|
21
|
-
|
|
13
|
+
declare const APP_PAGE_MAX_SIZE = 2048;
|
|
22
14
|
/** First 4 bytes of SHA-512/256 hash of "return" for retrieving ABI return values */
|
|
23
|
-
|
|
15
|
+
declare const ABI_RETURN_PREFIX: Uint8Array<ArrayBuffer>;
|
|
24
16
|
/** Information about an Algorand app */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
interface AppReference {
|
|
18
|
+
/** The id of the app */
|
|
19
|
+
appId: number | bigint;
|
|
20
|
+
/** The Algorand address of the account associated with the app */
|
|
21
|
+
appAddress: string;
|
|
30
22
|
}
|
|
31
23
|
/**
|
|
32
24
|
* @deprecated Use `types/app-manager/BoxReference` instead.
|
|
33
25
|
*
|
|
34
26
|
* A grouping of the app ID and name of the box in an Uint8Array
|
|
35
27
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
28
|
+
interface BoxReference {
|
|
29
|
+
/**
|
|
30
|
+
* A unique application id
|
|
31
|
+
*/
|
|
32
|
+
appId: number | bigint;
|
|
33
|
+
/**
|
|
34
|
+
* Name of box to reference
|
|
35
|
+
*/
|
|
36
|
+
name: BoxIdentifier;
|
|
45
37
|
}
|
|
46
38
|
/**
|
|
47
39
|
* @deprecated Use `types/app-manager/BoxIdentifier` instead.
|
|
@@ -51,86 +43,84 @@ export interface BoxReference {
|
|
|
51
43
|
* * `string` (that will be encoded to a Uint8Array)
|
|
52
44
|
* * `SendTransactionFrom` (encoded into the public key address of the corresponding account)
|
|
53
45
|
*/
|
|
54
|
-
|
|
46
|
+
type BoxIdentifier = string | Uint8Array | SendTransactionFrom;
|
|
55
47
|
/** Common app call arguments for ABI and non-ABI (raw) calls */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
48
|
+
interface CoreAppCallArgs {
|
|
49
|
+
/** The optional lease for the transaction */
|
|
50
|
+
lease?: string | Uint8Array;
|
|
51
|
+
/** Any box references to load */
|
|
52
|
+
boxes?: (algosdk.BoxReference | BoxReference | BoxIdentifier)[];
|
|
53
|
+
/** The address of any accounts to load in */
|
|
54
|
+
accounts?: (string | Address$1)[];
|
|
55
|
+
/** IDs of any apps to load into the foreignApps array */
|
|
56
|
+
apps?: number[];
|
|
57
|
+
/** IDs of any assets to load into the foreignAssets array */
|
|
58
|
+
assets?: number[];
|
|
59
|
+
/** Optional account / account address that should be authorised to transact on behalf of the from account the app call is sent from after this transaction.
|
|
60
|
+
*
|
|
61
|
+
* **Note:** Use with extreme caution and review the [official rekey guidance](https://dev.algorand.co/concepts/accounts/rekeying) first.
|
|
62
|
+
*/
|
|
63
|
+
rekeyTo?: SendTransactionFrom | string;
|
|
72
64
|
}
|
|
73
65
|
/**
|
|
74
66
|
* App call args with non-ABI (raw) values (minus some processing like encoding strings as binary)
|
|
75
67
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
interface RawAppCallArgs extends CoreAppCallArgs {
|
|
69
|
+
/** Any application arguments to pass through */
|
|
70
|
+
appArgs?: (Uint8Array | string)[];
|
|
71
|
+
/** Property to aid intellisense */
|
|
72
|
+
method?: undefined;
|
|
81
73
|
}
|
|
82
74
|
/** An argument for an ABI method, either a primitive value, or a transaction with or without signer, or the unawaited async return value of an algokit method that returns a `SendTransactionResult` */
|
|
83
|
-
|
|
75
|
+
type ABIAppCallArg = ABIArgument | TransactionToSign | Transaction | Promise<SendTransactionResult> | SendTransactionResult | undefined;
|
|
84
76
|
/**
|
|
85
77
|
* App call args for an ABI call
|
|
86
78
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/** The ABI method args to pass in */
|
|
91
|
-
methodArgs: ABIAppCallArg[];
|
|
79
|
+
type ABIAppCallArgs = CoreAppCallArgs & {
|
|
80
|
+
/** The ABI method to call */method: ABIMethodParams | ABIMethod; /** The ABI method args to pass in */
|
|
81
|
+
methodArgs: ABIAppCallArg[];
|
|
92
82
|
};
|
|
93
83
|
/** Arguments to pass to an app call either:
|
|
94
84
|
* * The raw app call values to pass through into the transaction (after processing); or
|
|
95
85
|
* * An ABI method definition (method and args)
|
|
96
86
|
**/
|
|
97
|
-
|
|
87
|
+
type AppCallArgs = RawAppCallArgs | ABIAppCallArgs;
|
|
98
88
|
/**
|
|
99
89
|
* @deprecated Use `TransactionComposer` to construct create app transactions instead.
|
|
100
90
|
*
|
|
101
91
|
* Base interface for common data passed to an app create or update.
|
|
102
92
|
*/
|
|
103
93
|
interface CreateOrUpdateAppParams extends SendTransactionParams {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
/** The account (with private key loaded) that will send the transaction */
|
|
95
|
+
from: SendTransactionFrom;
|
|
96
|
+
/** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
97
|
+
approvalProgram: Uint8Array | string;
|
|
98
|
+
/** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
99
|
+
clearStateProgram: Uint8Array | string;
|
|
100
|
+
/** Optional transaction parameters */
|
|
101
|
+
transactionParams?: SuggestedParams;
|
|
102
|
+
/** The (optional) transaction note */
|
|
103
|
+
note?: TransactionNote;
|
|
104
|
+
/** The arguments passed in to the app call */
|
|
105
|
+
args?: AppCallArgs;
|
|
116
106
|
}
|
|
117
107
|
/**
|
|
118
108
|
* @deprecated Use `TransactionComposer` to construct create app transactions instead.
|
|
119
109
|
*
|
|
120
110
|
* Parameters that are passed in when creating an app. */
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
interface CreateAppParams extends CreateOrUpdateAppParams {
|
|
112
|
+
/** The storage schema to request for the created app */
|
|
113
|
+
schema: AppStorageSchema;
|
|
114
|
+
/** Override the on-completion action for the create call; defaults to NoOp */
|
|
115
|
+
onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
|
|
126
116
|
}
|
|
127
117
|
/**
|
|
128
118
|
* @deprecated Use `TransactionComposer` to construct update app transactions instead.
|
|
129
119
|
*
|
|
130
120
|
* Parameters that are passed in when updating an app. */
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
interface UpdateAppParams extends CreateOrUpdateAppParams {
|
|
122
|
+
/** The id of the app to update */
|
|
123
|
+
appId: number | bigint;
|
|
134
124
|
}
|
|
135
125
|
/**
|
|
136
126
|
* @deprecated Use `algosdk.OnApplicationComplete` directly instead.
|
|
@@ -146,217 +136,215 @@ export interface UpdateAppParams extends CreateOrUpdateAppParams {
|
|
|
146
136
|
* * `update_application`: Update the smart contract
|
|
147
137
|
* * `delete_application`: Delete the smart contract
|
|
148
138
|
*/
|
|
149
|
-
|
|
139
|
+
type AppCallType = 'no_op' | 'opt_in' | 'close_out' | 'clear_state' | 'update_application' | 'delete_application';
|
|
150
140
|
/** Parameters representing a call to an app. */
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
141
|
+
interface AppCallParams extends SendTransactionParams {
|
|
142
|
+
/** The id of the app to call */
|
|
143
|
+
appId: number | bigint;
|
|
144
|
+
/** The type of call, everything except create (see `createApp`) and update (see `updateApp`) */
|
|
145
|
+
callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>;
|
|
146
|
+
/** The account to make the call from */
|
|
147
|
+
from: SendTransactionFrom;
|
|
148
|
+
/** Optional transaction parameters */
|
|
149
|
+
transactionParams?: SuggestedParams;
|
|
150
|
+
/** The (optional) transaction note */
|
|
151
|
+
note?: TransactionNote;
|
|
152
|
+
/** The arguments passed in to the app call */
|
|
153
|
+
args?: AppCallArgs;
|
|
164
154
|
}
|
|
165
155
|
/** Parameters representing the storage schema of an app. */
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
156
|
+
interface AppStorageSchema {
|
|
157
|
+
/** Restricts number of ints in per-user local state */
|
|
158
|
+
localInts: number;
|
|
159
|
+
/** Restricts number of byte slices in per-user local state */
|
|
160
|
+
localByteSlices: number;
|
|
161
|
+
/** Restricts number of ints in global state */
|
|
162
|
+
globalInts: number;
|
|
163
|
+
/** Restricts number of byte slices in global state */
|
|
164
|
+
globalByteSlices: number;
|
|
165
|
+
/** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */
|
|
166
|
+
extraPages?: number;
|
|
177
167
|
}
|
|
178
168
|
/** Information about a compiled teal program */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
169
|
+
interface CompiledTeal {
|
|
170
|
+
/** Original TEAL code */
|
|
171
|
+
teal: string;
|
|
172
|
+
/** The compiled code */
|
|
173
|
+
compiled: string;
|
|
174
|
+
/** The hash returned by the compiler */
|
|
175
|
+
compiledHash: string;
|
|
176
|
+
/** The base64 encoded code as a byte array */
|
|
177
|
+
compiledBase64ToBytes: Uint8Array;
|
|
178
|
+
/** Source map from the compilation */
|
|
179
|
+
sourceMap: SourceMap;
|
|
190
180
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
interface AppCallTransactionResultOfType<T> extends SendTransactionResults, SendTransactionResult {
|
|
182
|
+
/** If an ABI method was called the processed return value */
|
|
183
|
+
return?: T;
|
|
194
184
|
}
|
|
195
185
|
/** Result from calling an app */
|
|
196
|
-
|
|
186
|
+
type AppCallTransactionResult = AppCallTransactionResultOfType<ABIReturn>;
|
|
197
187
|
/** The return value of an ABI method call */
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
188
|
+
type ABIReturn = {
|
|
189
|
+
rawReturnValue: Uint8Array;
|
|
190
|
+
returnValue: ABIValue;
|
|
191
|
+
method: ABIMethod;
|
|
192
|
+
decodeError: undefined;
|
|
203
193
|
} | {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
194
|
+
rawReturnValue?: undefined;
|
|
195
|
+
returnValue?: undefined;
|
|
196
|
+
method?: undefined;
|
|
197
|
+
decodeError: Error;
|
|
208
198
|
};
|
|
209
199
|
/**
|
|
210
200
|
* The payload of the metadata to add to the transaction note when deploying an app, noting it will be prefixed with `APP_DEPLOY_NOTE_PREFIX`.
|
|
211
201
|
*/
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
202
|
+
interface AppDeployMetadata {
|
|
203
|
+
/** The unique name identifier of the app within the creator account */
|
|
204
|
+
name: string;
|
|
205
|
+
/** The version of app that is / will be deployed */
|
|
206
|
+
version: string;
|
|
207
|
+
/** Whether or not the app is deletable / permanent / unspecified */
|
|
208
|
+
deletable?: boolean;
|
|
209
|
+
/** Whether or not the app is updatable / immutable / unspecified */
|
|
210
|
+
updatable?: boolean;
|
|
221
211
|
}
|
|
222
212
|
/** The metadata that can be collected about a deployed app */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
213
|
+
interface AppMetadata extends AppReference, AppDeployMetadata {
|
|
214
|
+
/** The round the app was created */
|
|
215
|
+
createdRound: number;
|
|
216
|
+
/** The last round that the app was updated */
|
|
217
|
+
updatedRound: number;
|
|
218
|
+
/** The metadata when the app was created */
|
|
219
|
+
createdMetadata: AppDeployMetadata;
|
|
220
|
+
/** Whether or not the app is deleted */
|
|
221
|
+
deleted: boolean;
|
|
232
222
|
}
|
|
233
223
|
/** A lookup of name -> Algorand app for a creator */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
224
|
+
interface AppLookup {
|
|
225
|
+
creator: Readonly<string>;
|
|
226
|
+
apps: Readonly<{
|
|
227
|
+
[name: string]: AppMetadata;
|
|
228
|
+
}>;
|
|
239
229
|
}
|
|
240
230
|
/** Dictionary of deploy-time parameters to replace in a teal template.
|
|
241
231
|
*
|
|
242
232
|
* Note: Looks for `TMPL_{parameter}` for template replacements i.e. you can leave out the `TMPL_`.
|
|
243
233
|
*
|
|
244
234
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
235
|
+
interface TealTemplateParams {
|
|
236
|
+
[key: string]: string | bigint | number | Uint8Array;
|
|
247
237
|
}
|
|
248
238
|
/** What action to perform when deploying an app and an update is detected in the TEAL code */
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
239
|
+
declare enum OnUpdate {
|
|
240
|
+
/** Fail the deployment */
|
|
241
|
+
Fail = 0,
|
|
242
|
+
/** Update the app */
|
|
243
|
+
UpdateApp = 1,
|
|
244
|
+
/** Delete the app and create a new one in its place */
|
|
245
|
+
ReplaceApp = 2,
|
|
246
|
+
/** Create a new app */
|
|
247
|
+
AppendApp = 3
|
|
258
248
|
}
|
|
259
249
|
/** What action to perform when deploying an app and a breaking schema change is detected */
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
250
|
+
declare enum OnSchemaBreak {
|
|
251
|
+
/** Fail the deployment */
|
|
252
|
+
Fail = 0,
|
|
253
|
+
/** Delete the app and create a new one in its place */
|
|
254
|
+
ReplaceApp = 1,
|
|
255
|
+
/** Create a new app */
|
|
256
|
+
AppendApp = 2
|
|
267
257
|
}
|
|
268
258
|
/** The parameters to deploy an app */
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
259
|
+
interface AppDeploymentParams extends Omit<CreateAppParams, 'onCompleteAction' | 'args' | 'note' | 'skipSending' | 'skipWaiting' | 'atc'> {
|
|
260
|
+
/** The deployment metadata */
|
|
261
|
+
metadata: AppDeployMetadata;
|
|
262
|
+
/** Any deploy-time parameters to replace in the TEAL code */
|
|
263
|
+
deployTimeParams?: TealTemplateParams;
|
|
264
|
+
/** What action to perform if a schema break is detected */
|
|
265
|
+
onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak;
|
|
266
|
+
/** What action to perform if a TEAL update is detected */
|
|
267
|
+
onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate;
|
|
268
|
+
/** Optional cached value of the existing apps for the given creator */
|
|
269
|
+
existingDeployments?: AppLookup;
|
|
270
|
+
/** Any args to pass to any create transaction that is issued as part of deployment */
|
|
271
|
+
createArgs?: AppCallArgs;
|
|
272
|
+
/** Override the on-completion action for the create call; defaults to NoOp */
|
|
273
|
+
createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
|
|
274
|
+
/** Any args to pass to any update transaction that is issued as part of deployment */
|
|
275
|
+
updateArgs?: AppCallArgs;
|
|
276
|
+
/** Any args to pass to any delete transaction that is issued as part of deployment */
|
|
277
|
+
deleteArgs?: AppCallArgs;
|
|
288
278
|
}
|
|
289
279
|
/** The result of compiling the approval and clear state TEAL programs for an app */
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
280
|
+
interface AppCompilationResult {
|
|
281
|
+
/** The result of compiling the approval program */
|
|
282
|
+
compiledApproval: CompiledTeal;
|
|
283
|
+
/** The result of compiling the clear state program */
|
|
284
|
+
compiledClear: CompiledTeal;
|
|
295
285
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return?: TReturn;
|
|
286
|
+
type AppReturn<TReturn> = {
|
|
287
|
+
/** The ABI method call return value */return?: TReturn;
|
|
299
288
|
};
|
|
300
289
|
/** Result from sending a single app transaction. */
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
return?: ABIReturn;
|
|
290
|
+
type SendAppTransactionResult = Expand<SendSingleTransactionResult & {
|
|
291
|
+
/** If an ABI method was called the processed return value */return?: ABIReturn;
|
|
304
292
|
}>;
|
|
305
293
|
/** Result from sending a single app transaction. */
|
|
306
|
-
|
|
294
|
+
type SendAppUpdateTransactionResult = Expand<SendAppTransactionResult & Partial<AppCompilationResult>>;
|
|
307
295
|
/** Result from sending a single app transaction. */
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
/** The Algorand address of the account associated with the app */
|
|
312
|
-
appAddress: Address;
|
|
296
|
+
type SendAppCreateTransactionResult = Expand<SendAppUpdateTransactionResult & {
|
|
297
|
+
/** The id of the created app */appId: bigint; /** The Algorand address of the account associated with the app */
|
|
298
|
+
appAddress: Address$1;
|
|
313
299
|
}>;
|
|
314
300
|
/** Object holding app state values */
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
301
|
+
interface AppState {
|
|
302
|
+
[key: string]: {
|
|
303
|
+
value: bigint;
|
|
304
|
+
keyRaw: Uint8Array;
|
|
305
|
+
keyBase64: string;
|
|
306
|
+
} | {
|
|
307
|
+
value: string;
|
|
308
|
+
valueRaw: Uint8Array;
|
|
309
|
+
valueBase64: string;
|
|
310
|
+
keyRaw: Uint8Array;
|
|
311
|
+
keyBase64: string;
|
|
312
|
+
};
|
|
327
313
|
}
|
|
328
314
|
/**
|
|
329
315
|
* The name of a box storage box */
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
316
|
+
interface BoxName {
|
|
317
|
+
/** Name in UTF-8 */
|
|
318
|
+
name: string;
|
|
319
|
+
/** Name in binary bytes */
|
|
320
|
+
nameRaw: Uint8Array;
|
|
321
|
+
/** Name in Base64 */
|
|
322
|
+
nameBase64: string;
|
|
337
323
|
}
|
|
338
324
|
/**
|
|
339
325
|
* @deprecated Use `types/app-manager/BoxValueRequestParams` instead.
|
|
340
326
|
* Parameters to get and decode a box value as an ABI type.
|
|
341
327
|
*/
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
328
|
+
interface BoxValueRequestParams {
|
|
329
|
+
/** The ID of the app return box names for */
|
|
330
|
+
appId: number | bigint;
|
|
331
|
+
/** The name of the box to return either as a string, binary array or `BoxName` */
|
|
332
|
+
boxName: string | Uint8Array | BoxName;
|
|
333
|
+
/** The ABI type to decode the value using */
|
|
334
|
+
type: ABIType;
|
|
349
335
|
}
|
|
350
336
|
/**
|
|
351
337
|
* @deprecated Use `types/app-manager/BoxValuesRequestParams` instead.
|
|
352
338
|
* Parameters to get and decode a box value as an ABI type.
|
|
353
339
|
*/
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
340
|
+
interface BoxValuesRequestParams {
|
|
341
|
+
/** The ID of the app return box names for */
|
|
342
|
+
appId: number;
|
|
343
|
+
/** The names of the boxes to return either as a string, binary array or BoxName` */
|
|
344
|
+
boxNames: (string | Uint8Array | BoxName)[];
|
|
345
|
+
/** The ABI type to decode the value using */
|
|
346
|
+
type: ABIType;
|
|
361
347
|
}
|
|
362
|
-
|
|
348
|
+
//#endregion
|
|
349
|
+
export { ABIAppCallArg, ABIAppCallArgs, ABIReturn, ABI_RETURN_PREFIX, APP_DEPLOY_NOTE_DAPP, APP_PAGE_MAX_SIZE, AppCallArgs, AppCallParams, AppCallTransactionResult, AppCallTransactionResultOfType, AppCallType, AppCompilationResult, AppDeployMetadata, AppDeploymentParams, AppLookup, AppMetadata, AppReference, AppReturn, AppState, AppStorageSchema, BoxIdentifier, BoxName, BoxReference, BoxValueRequestParams, BoxValuesRequestParams, CompiledTeal, CoreAppCallArgs, CreateAppParams, DELETABLE_TEMPLATE_NAME, OnSchemaBreak, OnUpdate, RawAppCallArgs, SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult, TealTemplateParams, UPDATABLE_TEMPLATE_NAME, UpdateAppParams };
|
|
350
|
+
//# sourceMappingURL=app.d.ts.map
|