@algorandfoundation/algokit-utils 10.0.0-alpha.31 → 10.0.0-alpha.32
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/account-manager.d.ts +448 -0
- package/account-manager.js +623 -0
- package/account-manager.js.map +1 -0
- package/account-manager.mjs +620 -0
- package/account-manager.mjs.map +1 -0
- package/account.d.ts +156 -0
- package/account.js +10 -0
- package/account.js.map +1 -0
- package/account.mjs +9 -0
- package/account.mjs.map +1 -0
- package/algorand-client-transaction-creator.d.ts +1103 -0
- package/algorand-client-transaction-creator.js +735 -0
- package/algorand-client-transaction-creator.js.map +1 -0
- package/algorand-client-transaction-creator.mjs +734 -0
- package/algorand-client-transaction-creator.mjs.map +1 -0
- package/algorand-client-transaction-sender.d.ts +1317 -0
- package/algorand-client-transaction-sender.js +933 -0
- package/algorand-client-transaction-sender.js.map +1 -0
- package/algorand-client-transaction-sender.mjs +932 -0
- package/algorand-client-transaction-sender.mjs.map +1 -0
- package/algorand-client.d.ts +246 -0
- package/algorand-client.js +325 -0
- package/algorand-client.js.map +1 -0
- package/algorand-client.mjs +325 -0
- package/algorand-client.mjs.map +1 -0
- package/amount.d.ts +46 -3
- package/amount.js +92 -13
- package/amount.js.map +1 -1
- package/amount.mjs +80 -3
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +2130 -0
- package/app-client.js +909 -0
- package/app-client.js.map +1 -0
- package/app-client.mjs +908 -0
- package/app-client.mjs.map +1 -0
- package/app-deployer.d.ts +166 -0
- package/app-deployer.js +353 -0
- package/app-deployer.js.map +1 -0
- package/app-deployer.mjs +353 -0
- package/app-deployer.mjs.map +1 -0
- package/app-factory.d.ts +965 -0
- package/app-factory.js +448 -0
- package/app-factory.js.map +1 -0
- package/app-factory.mjs +448 -0
- package/app-factory.mjs.map +1 -0
- package/app-manager.d.ts +323 -0
- package/app-manager.js +468 -0
- package/app-manager.js.map +1 -0
- package/app-manager.mjs +468 -0
- package/app-manager.mjs.map +1 -0
- package/app-spec.d.ts +203 -0
- package/app-spec.js +137 -0
- package/app-spec.js.map +1 -0
- package/app-spec.mjs +137 -0
- package/app-spec.mjs.map +1 -0
- package/app.d.ts +257 -0
- package/app.js +49 -0
- package/app.js.map +1 -0
- package/app.mjs +42 -0
- package/app.mjs.map +1 -0
- package/asset-manager.d.ts +212 -0
- package/asset-manager.js +166 -0
- package/asset-manager.js.map +1 -0
- package/asset-manager.mjs +166 -0
- package/asset-manager.mjs.map +1 -0
- package/async-event-emitter.d.ts +16 -0
- package/async-event-emitter.js +38 -0
- package/async-event-emitter.js.map +1 -0
- package/async-event-emitter.mjs +37 -0
- package/async-event-emitter.mjs.map +1 -0
- package/client-manager.d.ts +475 -0
- package/client-manager.js +616 -0
- package/client-manager.js.map +1 -0
- package/client-manager.mjs +616 -0
- package/client-manager.mjs.map +1 -0
- package/composer.d.ts +947 -0
- package/composer.js +1584 -0
- package/composer.js.map +1 -0
- package/composer.mjs +1583 -0
- package/composer.mjs.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +2 -2
- package/config.js.map +1 -1
- package/config.mjs +1 -1
- package/config.mjs.map +1 -1
- package/debugging.d.ts +47 -0
- package/debugging.js +20 -0
- package/debugging.js.map +1 -0
- package/debugging.mjs +15 -0
- package/debugging.mjs.map +1 -0
- package/dispenser-client.d.ts +90 -0
- package/dispenser-client.js +127 -0
- package/dispenser-client.js.map +1 -0
- package/dispenser-client.mjs +127 -0
- package/dispenser-client.mjs.map +1 -0
- package/expand.d.ts +2 -0
- package/expand.js +0 -0
- package/expand.mjs +0 -0
- package/index.d.ts +6 -5
- package/index.js +4 -3
- package/index.mjs +5 -5
- package/indexer-client/indexer-lookup.d.ts +1 -1
- package/indexer-client/indexer-lookup.js.map +1 -1
- package/indexer-client/indexer-lookup.mjs.map +1 -1
- package/indexer.d.ts +40 -0
- package/indexer.js +38 -0
- package/indexer.js.map +1 -0
- package/indexer.mjs +35 -0
- package/indexer.mjs.map +1 -0
- package/instance-of.d.ts +8 -0
- package/kmd-account-manager.d.ts +74 -0
- package/kmd-account-manager.js +167 -0
- package/kmd-account-manager.js.map +1 -0
- package/kmd-account-manager.mjs +165 -0
- package/kmd-account-manager.mjs.map +1 -0
- package/lifecycle-events.d.ts +14 -0
- package/lifecycle-events.js +11 -0
- package/lifecycle-events.js.map +1 -0
- package/lifecycle-events.mjs +10 -0
- package/lifecycle-events.mjs.map +1 -0
- package/logging.d.ts +13 -0
- package/logging.js +47 -0
- package/logging.js.map +1 -0
- package/logging.mjs +42 -0
- package/logging.mjs.map +1 -0
- package/logic-error.d.ts +39 -0
- package/logic-error.js +54 -0
- package/logic-error.js.map +1 -0
- package/logic-error.mjs +53 -0
- package/logic-error.mjs.map +1 -0
- package/network-client.d.ts +43 -0
- package/network-client.js +14 -0
- package/network-client.js.map +1 -0
- package/network-client.mjs +13 -0
- package/network-client.mjs.map +1 -0
- package/package.json +11 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +1 -1
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +1 -1
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +2 -2
- package/testing/fixtures/algorand-fixture.js +2 -2
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +2 -2
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +2 -1
- package/testing/test-logger.d.ts +1 -1
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs.map +1 -1
- package/testing/types.d.ts +156 -0
- package/transaction/index.d.ts +4 -0
- package/transaction/index.js +9 -0
- package/transaction/index.mjs +4 -0
- package/transaction/perform-transaction-composer-simulate.d.ts +1 -1
- package/transaction/perform-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +2 -2
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs.map +1 -1
- package/transaction/types.d.ts +133 -0
- package/transactions/app-call.d.ts +1 -1
- package/transactions/app-call.js +1 -1
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +1 -1
- package/transactions/app-call.mjs.map +1 -1
- package/transactions/common.d.ts +1 -1
- package/transactions/common.js.map +1 -1
- package/transactions/common.mjs.map +1 -1
- package/transactions/method-call.d.ts +1 -1
- package/transactions/method-call.js +1 -1
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs +1 -1
- package/transactions/method-call.mjs.map +1 -1
- package/transactions/payment.d.ts +1 -1
- package/transactions/payment.js.map +1 -1
- package/transactions/payment.mjs.map +1 -1
- package/types/account-manager.d.ts +11 -442
- package/types/account-manager.js +5 -616
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +5 -614
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +8 -150
- package/types/account.js +3 -4
- package/types/account.js.map +1 -1
- package/types/account.mjs +4 -4
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +5 -1098
- package/types/algorand-client-transaction-creator.js +3 -729
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +4 -729
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +5 -1312
- package/types/algorand-client-transaction-sender.js +3 -927
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +3 -926
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +5 -241
- package/types/algorand-client.js +3 -319
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +3 -319
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +6 -45
- package/types/amount.js +3 -79
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +4 -79
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +75 -2125
- package/types/app-client.js +3 -903
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +3 -902
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +21 -161
- package/types/app-deployer.js +3 -347
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +3 -347
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +21 -960
- package/types/app-factory.js +3 -442
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +3 -442
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +15 -318
- package/types/app-manager.js +3 -462
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +3 -462
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +39 -198
- package/types/app-spec.js +3 -131
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +3 -131
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +62 -247
- package/types/app.js +15 -37
- package/types/app.js.map +1 -1
- package/types/app.mjs +16 -37
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +9 -207
- package/types/asset-manager.js +3 -160
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +3 -160
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +7 -11
- package/types/async-event-emitter.js +3 -32
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +4 -32
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +27 -470
- package/types/client-manager.js +3 -610
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +3 -610
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +79 -943
- package/types/composer.js +3 -1578
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +3 -1577
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +7 -52
- package/types/config.js +3 -74
- package/types/config.js.map +1 -1
- package/types/config.mjs +3 -74
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +12 -37
- package/types/debugging.js +11 -10
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -10
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +11 -85
- package/types/dispenser-client.js +3 -121
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +3 -121
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +8 -2
- package/types/indexer.d.ts +16 -36
- package/types/indexer.js +7 -30
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +8 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +4 -4
- package/types/kmd-account-manager.d.ts +5 -69
- package/types/kmd-account-manager.js +3 -161
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +3 -159
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +7 -9
- package/types/lifecycle-events.js +3 -5
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +4 -5
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +14 -9
- package/types/logging.js +11 -37
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +12 -37
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +8 -35
- package/types/logic-error.js +3 -48
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +4 -48
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +10 -39
- package/types/network-client.js +3 -8
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +4 -8
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +13 -151
- package/types/transaction.d.ts +33 -128
- package/updatable-config.d.ts +57 -0
- package/updatable-config.js +80 -0
- package/updatable-config.js.map +1 -0
- package/updatable-config.mjs +80 -0
- package/updatable-config.mjs.map +1 -0
- package/util.js +1 -1
- package/util.js.map +1 -1
- package/util.mjs +1 -1
- package/util.mjs.map +1 -1
package/app-manager.d.ts
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import { Address, ReadableAddress } from "./packages/common/src/address.js";
|
|
2
|
+
import { ABIValue } from "./packages/abi/src/abi-value.js";
|
|
3
|
+
import { ABIType } from "./packages/abi/src/abi-type.js";
|
|
4
|
+
import { ABIMethod, ABIReturn } from "./packages/abi/src/abi-method.js";
|
|
5
|
+
import { BoxReference as BoxReference$1 } from "./packages/transact/src/transactions/app-call.js";
|
|
6
|
+
import { AddressWithTransactionSigner } from "./packages/transact/src/signer.js";
|
|
7
|
+
import { TealValue } from "./packages/algod_client/src/models/teal-value.js";
|
|
8
|
+
import { EvalDelta } from "./packages/algod_client/src/models/eval-delta.js";
|
|
9
|
+
import { PendingTransactionResponse } from "./packages/algod_client/src/models/pending-transaction-response.js";
|
|
10
|
+
import { AlgodClient } from "./packages/algod_client/src/client.js";
|
|
11
|
+
import { AppState, BoxName, CompiledTeal, TealTemplateParams } from "./app.js";
|
|
12
|
+
|
|
13
|
+
//#region src/app-manager.d.ts
|
|
14
|
+
/** Information about an app. */
|
|
15
|
+
interface AppInformation {
|
|
16
|
+
/** The ID of the app. */
|
|
17
|
+
appId: bigint;
|
|
18
|
+
/** The escrow address that the app operates with. */
|
|
19
|
+
appAddress: Address;
|
|
20
|
+
/**
|
|
21
|
+
* Approval program.
|
|
22
|
+
*/
|
|
23
|
+
approvalProgram: Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* Clear state program.
|
|
26
|
+
*/
|
|
27
|
+
clearStateProgram: Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* The address that created this application. This is the address where the
|
|
30
|
+
* parameters and global state for this application can be found.
|
|
31
|
+
*/
|
|
32
|
+
creator: Address;
|
|
33
|
+
/**
|
|
34
|
+
* Current global state values.
|
|
35
|
+
*/
|
|
36
|
+
globalState: AppState;
|
|
37
|
+
/** The number of allocated ints in per-user local state. */
|
|
38
|
+
localInts: number;
|
|
39
|
+
/** The number of allocated byte slices in per-user local state. */
|
|
40
|
+
localByteSlices: number;
|
|
41
|
+
/** The number of allocated ints in global state. */
|
|
42
|
+
globalInts: number;
|
|
43
|
+
/** The number of allocated byte slices in global state. */
|
|
44
|
+
globalByteSlices: number;
|
|
45
|
+
/** Any extra pages that are needed for the smart contract. */
|
|
46
|
+
extraProgramPages?: number;
|
|
47
|
+
/** The number of updates to the application programs */
|
|
48
|
+
version?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Something that identifies an app box name - either a:
|
|
52
|
+
* * `Uint8Array` (the actual binary of the box name)
|
|
53
|
+
* * `string` (that will be encoded to a `Uint8Array`)
|
|
54
|
+
* * `AddressWithSigner` (that will be encoded into the
|
|
55
|
+
* public key address of the corresponding account)
|
|
56
|
+
*/
|
|
57
|
+
type BoxIdentifier = string | Uint8Array | AddressWithTransactionSigner;
|
|
58
|
+
/**
|
|
59
|
+
* A grouping of the app ID and name identifier to reference an app box.
|
|
60
|
+
*/
|
|
61
|
+
interface BoxReference {
|
|
62
|
+
/**
|
|
63
|
+
* A unique application id
|
|
64
|
+
*/
|
|
65
|
+
appId: bigint;
|
|
66
|
+
/**
|
|
67
|
+
* Identifier for a box name
|
|
68
|
+
*/
|
|
69
|
+
name: BoxIdentifier;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Parameters to get and decode a box value as an ABI type.
|
|
73
|
+
*/
|
|
74
|
+
interface BoxValueRequestParams {
|
|
75
|
+
/** The ID of the app return box names for */
|
|
76
|
+
appId: bigint;
|
|
77
|
+
/** The name of the box to return either as a string, binary array or `BoxName` */
|
|
78
|
+
boxName: BoxIdentifier;
|
|
79
|
+
/** The ABI type to decode the value using */
|
|
80
|
+
type: ABIType;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Parameters to get and decode a box value as an ABI type.
|
|
84
|
+
*/
|
|
85
|
+
interface BoxValuesRequestParams {
|
|
86
|
+
/** The ID of the app return box names for */
|
|
87
|
+
appId: bigint;
|
|
88
|
+
/** The names of the boxes to return either as a string, binary array or BoxName` */
|
|
89
|
+
boxNames: BoxIdentifier[];
|
|
90
|
+
/** The ABI type to decode the value using */
|
|
91
|
+
type: ABIType;
|
|
92
|
+
}
|
|
93
|
+
/** Allows management of application information. */
|
|
94
|
+
declare class AppManager {
|
|
95
|
+
private _algod;
|
|
96
|
+
private _compilationResults;
|
|
97
|
+
/**
|
|
98
|
+
* Creates an `AppManager`
|
|
99
|
+
* @param algod An algod instance
|
|
100
|
+
*/
|
|
101
|
+
constructor(algod: AlgodClient);
|
|
102
|
+
/**
|
|
103
|
+
* Compiles the given TEAL using algod and returns the result, including source map.
|
|
104
|
+
*
|
|
105
|
+
* The result of this compilation is also cached keyed by the TEAL
|
|
106
|
+
* code so it can be retrieved via `getCompilationResult`.
|
|
107
|
+
*
|
|
108
|
+
* This function is re-entrant; it will only compile the same code once.
|
|
109
|
+
*
|
|
110
|
+
* @param tealCode The TEAL code
|
|
111
|
+
* @returns The information about the compiled file
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* const compiled = await appManager.compileTeal(tealProgram)
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
compileTeal(tealCode: string): Promise<CompiledTeal>;
|
|
118
|
+
/**
|
|
119
|
+
* Performs template substitution of a teal template and compiles it, returning the compiled result.
|
|
120
|
+
*
|
|
121
|
+
* Looks for `TMPL_{parameter}` for template replacements and replaces AlgoKit deploy-time control parameters
|
|
122
|
+
* if deployment metadata is specified.
|
|
123
|
+
*
|
|
124
|
+
* * `TMPL_UPDATABLE` for updatability / immutability control
|
|
125
|
+
* * `TMPL_DELETABLE` for deletability / permanence control
|
|
126
|
+
*
|
|
127
|
+
* @param tealTemplateCode The TEAL logic to compile
|
|
128
|
+
* @param templateParams Any parameters to replace in the .teal file before compiling
|
|
129
|
+
* @param deploymentMetadata The deployment metadata the app will be deployed with
|
|
130
|
+
* @returns The information about the compiled code
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* const compiled = await appManager.compileTealTemplate(tealTemplate, { TMPL_APP_ID: 12345n }, { updatable: true, deletable: false })
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
compileTealTemplate(tealTemplateCode: string, templateParams?: TealTemplateParams, deploymentMetadata?: {
|
|
137
|
+
updatable?: boolean;
|
|
138
|
+
deletable?: boolean;
|
|
139
|
+
}): Promise<CompiledTeal>;
|
|
140
|
+
/**
|
|
141
|
+
* Returns a previous compilation result.
|
|
142
|
+
* @param tealCode The TEAL code
|
|
143
|
+
* @returns The information about the previously compiled file
|
|
144
|
+
* or `undefined` if that TEAL code wasn't previously compiled
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const compiled = appManager.getCompilationResult(tealProgram)
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
getCompilationResult(tealCode: string): CompiledTeal | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the current app information for the app with the given ID.
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const appInfo = await appManager.getById(12353n);
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* @param appId The ID of the app
|
|
160
|
+
* @returns The app information
|
|
161
|
+
*/
|
|
162
|
+
getById(appId: bigint): Promise<AppInformation>;
|
|
163
|
+
/**
|
|
164
|
+
* Returns the current global state values for the given app ID and account address
|
|
165
|
+
*
|
|
166
|
+
* @param appId The ID of the app to return global state for
|
|
167
|
+
* @returns The current global state for the given app
|
|
168
|
+
* @example
|
|
169
|
+
* ```typescript
|
|
170
|
+
* const globalState = await appManager.getGlobalState(12353n);
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
getGlobalState(appId: bigint): Promise<AppState>;
|
|
174
|
+
/**
|
|
175
|
+
* Returns the current local state values for the given app ID and account address
|
|
176
|
+
*
|
|
177
|
+
* @param appId The ID of the app to return local state for
|
|
178
|
+
* @param address The string address of the account to get local state for the given app
|
|
179
|
+
* @returns The current local state for the given (app, account) combination
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const localState = await appManager.getLocalState(12353n, 'ACCOUNTADDRESS');
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
getLocalState(appId: bigint, address: ReadableAddress): Promise<AppState>;
|
|
186
|
+
/**
|
|
187
|
+
* Returns the names of the current boxes for the given app.
|
|
188
|
+
* @param appId The ID of the app return box names for
|
|
189
|
+
* @returns The current box names
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* const boxNames = await appManager.getBoxNames(12353n);
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
getBoxNames(appId: bigint): Promise<BoxName[]>;
|
|
196
|
+
/**
|
|
197
|
+
* Returns the value of the given box name for the given app.
|
|
198
|
+
* @param appId The ID of the app return box names for
|
|
199
|
+
* @param boxName The name of the box to return either as a string, binary array or `BoxName`
|
|
200
|
+
* @returns The current box value as a byte array
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const boxValue = await appManager.getBoxValue(12353n, 'boxName');
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
getBoxValue(appId: bigint, boxName: BoxIdentifier | BoxName): Promise<Uint8Array>;
|
|
207
|
+
/**
|
|
208
|
+
* Returns the value of the given box names for the given app.
|
|
209
|
+
* @param appId The ID of the app return box names for
|
|
210
|
+
* @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`
|
|
211
|
+
* @returns The current box values as a byte array in the same order as the passed in box names
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* const boxValues = await appManager.getBoxValues(12353n, ['boxName1', 'boxName2']);
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
getBoxValues(appId: bigint, boxNames: (BoxIdentifier | BoxName)[]): Promise<Uint8Array[]>;
|
|
218
|
+
/**
|
|
219
|
+
* Returns the value of the given box name for the given app decoded based on the given ABI type.
|
|
220
|
+
* @param request The parameters for the box value request
|
|
221
|
+
* @returns The current box value as an ABI value
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* const boxValue = await appManager.getBoxValueFromABIType({ appId: 12353n, boxName: 'boxName', type: new ABIUintType(32) });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
getBoxValueFromABIType(request: BoxValueRequestParams): Promise<ABIValue>;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the value of the given box names for the given app decoded based on the given ABI type.
|
|
230
|
+
* @param request The parameters for the box value request
|
|
231
|
+
* @returns The current box values as an ABI value in the same order as the passed in box names
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const boxValues = await appManager.getBoxValuesFromABIType({ appId: 12353n, boxNames: ['boxName1', 'boxName2'], type: new ABIUintType(32) });
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
getBoxValuesFromABIType(request: BoxValuesRequestParams): Promise<ABIValue[]>;
|
|
238
|
+
/**
|
|
239
|
+
* Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.
|
|
240
|
+
* @param boxId The box to return a reference for
|
|
241
|
+
* @returns The box reference ready to pass into a `algosdk.Transaction`
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* const boxRef = AppManager.getBoxReference('boxName');
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
static getBoxReference(boxId: BoxIdentifier | BoxReference): BoxReference$1;
|
|
248
|
+
/**
|
|
249
|
+
* Converts an array of global/local state values from the algod api to a more friendly
|
|
250
|
+
* generic object keyed by the UTF-8 value of the key.
|
|
251
|
+
* @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`
|
|
252
|
+
* @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values
|
|
253
|
+
* @example
|
|
254
|
+
* ```typescript
|
|
255
|
+
* const stateValues = AppManager.decodeAppState(state);
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
static decodeAppState(state: {
|
|
259
|
+
key: Uint8Array;
|
|
260
|
+
value: TealValue | EvalDelta;
|
|
261
|
+
}[]): AppState;
|
|
262
|
+
/**
|
|
263
|
+
* Returns any ABI return values for the given app call arguments and transaction confirmation.
|
|
264
|
+
* @param confirmation The transaction confirmation from algod
|
|
265
|
+
* @param method The ABI method
|
|
266
|
+
* @returns The return value for the method call
|
|
267
|
+
* @example
|
|
268
|
+
* ```typescript
|
|
269
|
+
* const returnValue = AppManager.getABIReturn(confirmation, ABIMethod.fromSignature('hello(string)void'));
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
static getABIReturn(confirmation: PendingTransactionResponse | undefined, method: ABIMethod | undefined): ABIReturn | undefined;
|
|
273
|
+
private static hasAbiReturnPrefix;
|
|
274
|
+
/**
|
|
275
|
+
* Replaces AlgoKit deploy-time deployment control parameters within the given TEAL template code.
|
|
276
|
+
*
|
|
277
|
+
* * `TMPL_UPDATABLE` for updatability / immutability control
|
|
278
|
+
* * `TMPL_DELETABLE` for deletability / permanence control
|
|
279
|
+
*
|
|
280
|
+
* Note: If these values are defined, but the corresponding `TMPL_*` value
|
|
281
|
+
* isn't in the teal code it will throw an exception.
|
|
282
|
+
*
|
|
283
|
+
* @param tealTemplateCode The TEAL template code to substitute
|
|
284
|
+
* @param params The deploy-time deployment control parameter value to replace
|
|
285
|
+
* @returns The replaced TEAL code
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* const tealCode = AppManager.replaceTealTemplateDeployTimeControlParams(tealTemplate, { updatable: true, deletable: false });
|
|
289
|
+
* ```
|
|
290
|
+
*/
|
|
291
|
+
static replaceTealTemplateDeployTimeControlParams(tealTemplateCode: string, params: {
|
|
292
|
+
updatable?: boolean;
|
|
293
|
+
deletable?: boolean;
|
|
294
|
+
}): string;
|
|
295
|
+
/**
|
|
296
|
+
* Performs template substitution of a teal file.
|
|
297
|
+
*
|
|
298
|
+
* Looks for `TMPL_{parameter}` for template replacements.
|
|
299
|
+
*
|
|
300
|
+
* @param tealTemplateCode The TEAL template code to make parameter replacements in
|
|
301
|
+
* @param templateParams Any parameters to replace in the teal code
|
|
302
|
+
* @returns The TEAL code with replacements
|
|
303
|
+
* @example
|
|
304
|
+
* ```typescript
|
|
305
|
+
* const tealCode = AppManager.replaceTealTemplateParams(tealTemplate, { TMPL_APP_ID: 12345n });
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
static replaceTealTemplateParams(tealTemplateCode: string, templateParams?: TealTemplateParams): string;
|
|
309
|
+
/**
|
|
310
|
+
* Remove comments from TEAL code (useful to reduce code size before compilation).
|
|
311
|
+
*
|
|
312
|
+
* @param tealCode The TEAL logic to strip
|
|
313
|
+
* @returns The TEAL without comments
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const stripped = AppManager.stripTealComments(tealProgram);
|
|
317
|
+
* ```
|
|
318
|
+
*/
|
|
319
|
+
static stripTealComments(tealCode: string): string;
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
export { AppInformation, AppManager, BoxIdentifier, BoxReference, BoxValueRequestParams, BoxValuesRequestParams };
|
|
323
|
+
//# sourceMappingURL=app-manager.d.ts.map
|