@algorandfoundation/algokit-utils 7.0.0-beta.9 → 8.0.0-beta.1
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/LICENSE +21 -0
- package/README.md +21 -3
- package/account/account.d.ts +4 -1
- package/account/account.js +10 -7
- package/account/account.js.map +1 -1
- package/account/account.mjs +11 -8
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +1 -1
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +1 -0
- package/amount.js +3 -2
- package/amount.js.map +1 -1
- package/amount.mjs +3 -3
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +4 -4
- package/app-client.js +4 -4
- package/app-client.js.map +1 -1
- package/app-client.mjs +4 -4
- package/app-client.mjs.map +1 -1
- package/app-deploy.js +25 -15
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +27 -17
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +2 -2
- package/app.js +9 -6
- package/app.js.map +1 -1
- package/app.mjs +9 -6
- package/app.mjs.map +1 -1
- package/asset.js.map +1 -1
- package/asset.mjs.map +1 -1
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +7 -1
- package/index.js.map +1 -1
- package/index.mjs +3 -2
- package/index.mjs.map +1 -1
- package/indexer-lookup.d.ts +10 -8
- package/indexer-lookup.js +14 -10
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +14 -10
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +1 -7
- package/network-client.js +2 -9
- package/network-client.js.map +1 -1
- package/network-client.mjs +2 -9
- package/network-client.mjs.map +1 -1
- package/package.json +5 -5
- package/testing/_asset.d.ts +2 -1
- package/testing/account.d.ts +4 -3
- package/testing/account.js +8 -2
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +9 -3
- package/testing/account.mjs.map +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.js +5 -6
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +5 -6
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.js +7 -1
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +7 -1
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +2 -2
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +3 -3
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -1
- package/transaction/perform-atomic-transaction-composer-simulate.js +14 -9
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +15 -10
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +13 -22
- package/transaction/transaction.js +164 -110
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +163 -109
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.js +3 -1
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +3 -1
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +20 -20
- package/types/account-manager.js +36 -27
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +38 -29
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +17 -8
- package/types/account.js +2 -2
- package/types/account.js.map +1 -1
- package/types/account.mjs +3 -3
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +1 -2
- package/types/algo-http-client-with-retry.js +33 -3
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +32 -2
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-interface.d.ts +2 -2
- package/types/algorand-client-transaction-creator.d.ts +16 -14
- package/types/algorand-client-transaction-creator.js +3 -1
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +3 -1
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +109 -105
- package/types/algorand-client-transaction-sender.js +6 -2
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +6 -2
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +6 -7
- package/types/algorand-client.js +3 -6
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +5 -5
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.js.map +1 -1
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +31 -20
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +298 -286
- package/types/app-client.js +148 -41
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +147 -40
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +4 -4
- package/types/app-deployer.js +23 -24
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +25 -26
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +130 -130
- package/types/app-factory.js +4 -5
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +5 -6
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +5 -5
- package/types/app-manager.js +116 -38
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +117 -39
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.js +8 -2
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +8 -2
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +12 -11
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +9 -9
- package/types/asset-manager.js +10 -13
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +10 -13
- package/types/asset-manager.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +1 -10
- package/types/async-event-emitter.js +0 -5
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +1 -6
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +2 -9
- package/types/client-manager.js +11 -21
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +11 -21
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +58 -46
- package/types/composer.js +154 -105
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +156 -105
- package/types/composer.mjs.map +1 -1
- package/types/config.js.map +1 -1
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +1 -1
- package/types/debugging.js +1 -1
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +1 -1
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +2 -1
- package/types/dispenser-client.js +5 -1
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +5 -1
- package/types/dispenser-client.mjs.map +1 -1
- package/types/indexer.d.ts +74 -755
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +2 -2
- package/types/kmd-account-manager.js +1 -1
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +2 -2
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +10 -0
- package/types/lifecycle-events.js +8 -0
- package/types/lifecycle-events.js.map +1 -0
- package/types/lifecycle-events.mjs +8 -0
- package/types/lifecycle-events.mjs.map +1 -0
- package/types/logging.js.map +1 -1
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +2 -3
- package/types/logic-error.js +3 -3
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +3 -3
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +1 -1
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +6 -7
- package/util.js.map +1 -1
- package/util.mjs.map +1 -1
- package/types/urlTokenBaseHTTPClient.d.ts +0 -40
- package/types/urlTokenBaseHTTPClient.js +0 -153
- package/types/urlTokenBaseHTTPClient.js.map +0 -1
- package/types/urlTokenBaseHTTPClient.mjs +0 -151
- package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
package/types/composer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import algosdk from 'algosdk';
|
|
1
|
+
import algosdk, { Address } from 'algosdk';
|
|
2
2
|
import { TransactionSignerAccount } from './account';
|
|
3
3
|
import { AlgoAmount } from './amount';
|
|
4
4
|
import { AppManager, BoxIdentifier, BoxReference } from './app-manager';
|
|
@@ -18,7 +18,7 @@ export type SimulateOptions = Expand<Omit<ConstructorParameters<typeof modelsv2.
|
|
|
18
18
|
/** Common parameters for defining a transaction. */
|
|
19
19
|
export type CommonTransactionParams = {
|
|
20
20
|
/** The address of the account sending the transaction. */
|
|
21
|
-
sender: string;
|
|
21
|
+
sender: string | Address;
|
|
22
22
|
/** The function used to sign transaction(s); if not specified then
|
|
23
23
|
* an attempt will be made to find a registered signer for the
|
|
24
24
|
* given `sender` or use a default signer (if configured).
|
|
@@ -28,7 +28,7 @@ export type CommonTransactionParams = {
|
|
|
28
28
|
*
|
|
29
29
|
* **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).
|
|
30
30
|
*/
|
|
31
|
-
rekeyTo?: string;
|
|
31
|
+
rekeyTo?: string | Address;
|
|
32
32
|
/** Note to attach to the transaction. Max of 1000 bytes. */
|
|
33
33
|
note?: Uint8Array | string;
|
|
34
34
|
/** Prevent multiple transactions with the same lease being included within the validity window.
|
|
@@ -44,7 +44,7 @@ export type CommonTransactionParams = {
|
|
|
44
44
|
/** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
|
|
45
45
|
maxFee?: AlgoAmount;
|
|
46
46
|
/** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
|
|
47
|
-
validityWindow?: number;
|
|
47
|
+
validityWindow?: number | bigint;
|
|
48
48
|
/**
|
|
49
49
|
* Set the first round this transaction is valid.
|
|
50
50
|
* If left undefined, the value from algod will be used.
|
|
@@ -58,14 +58,14 @@ export type CommonTransactionParams = {
|
|
|
58
58
|
/** Parameters to define a payment transaction. */
|
|
59
59
|
export type PaymentParams = CommonTransactionParams & {
|
|
60
60
|
/** The address of the account that will receive the Algo */
|
|
61
|
-
receiver: string;
|
|
61
|
+
receiver: string | Address;
|
|
62
62
|
/** Amount to send */
|
|
63
63
|
amount: AlgoAmount;
|
|
64
64
|
/** If given, close the sender account and send the remaining balance to this address
|
|
65
65
|
*
|
|
66
66
|
* *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
67
67
|
*/
|
|
68
|
-
closeRemainderTo?: string;
|
|
68
|
+
closeRemainderTo?: string | Address;
|
|
69
69
|
};
|
|
70
70
|
/** Parameters to define an asset create transaction.
|
|
71
71
|
*
|
|
@@ -136,7 +136,7 @@ export type AssetCreateParams = CommonTransactionParams & {
|
|
|
136
136
|
*
|
|
137
137
|
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
|
|
138
138
|
*/
|
|
139
|
-
manager?: string;
|
|
139
|
+
manager?: string | Address;
|
|
140
140
|
/**
|
|
141
141
|
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
142
142
|
*
|
|
@@ -150,7 +150,7 @@ export type AssetCreateParams = CommonTransactionParams & {
|
|
|
150
150
|
*
|
|
151
151
|
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
152
152
|
*/
|
|
153
|
-
reserve?: string;
|
|
153
|
+
reserve?: string | Address;
|
|
154
154
|
/**
|
|
155
155
|
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
156
156
|
*
|
|
@@ -158,7 +158,7 @@ export type AssetCreateParams = CommonTransactionParams & {
|
|
|
158
158
|
*
|
|
159
159
|
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
160
160
|
*/
|
|
161
|
-
freeze?: string;
|
|
161
|
+
freeze?: string | Address;
|
|
162
162
|
/**
|
|
163
163
|
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
164
164
|
*
|
|
@@ -168,7 +168,7 @@ export type AssetCreateParams = CommonTransactionParams & {
|
|
|
168
168
|
*
|
|
169
169
|
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
170
170
|
*/
|
|
171
|
-
clawback?: string;
|
|
171
|
+
clawback?: string | Address;
|
|
172
172
|
};
|
|
173
173
|
/** Parameters to define an asset reconfiguration transaction.
|
|
174
174
|
*
|
|
@@ -185,7 +185,7 @@ export type AssetConfigParams = CommonTransactionParams & {
|
|
|
185
185
|
*
|
|
186
186
|
* If not set (`undefined` or `""`) the asset will become permanently immutable.
|
|
187
187
|
*/
|
|
188
|
-
manager: string | undefined;
|
|
188
|
+
manager: string | Address | undefined;
|
|
189
189
|
/**
|
|
190
190
|
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
191
191
|
*
|
|
@@ -199,7 +199,7 @@ export type AssetConfigParams = CommonTransactionParams & {
|
|
|
199
199
|
*
|
|
200
200
|
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
201
201
|
*/
|
|
202
|
-
reserve?: string;
|
|
202
|
+
reserve?: string | Address;
|
|
203
203
|
/**
|
|
204
204
|
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
205
205
|
*
|
|
@@ -207,7 +207,7 @@ export type AssetConfigParams = CommonTransactionParams & {
|
|
|
207
207
|
*
|
|
208
208
|
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
209
209
|
*/
|
|
210
|
-
freeze?: string;
|
|
210
|
+
freeze?: string | Address;
|
|
211
211
|
/**
|
|
212
212
|
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
213
213
|
*
|
|
@@ -217,14 +217,14 @@ export type AssetConfigParams = CommonTransactionParams & {
|
|
|
217
217
|
*
|
|
218
218
|
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
219
219
|
*/
|
|
220
|
-
clawback?: string;
|
|
220
|
+
clawback?: string | Address;
|
|
221
221
|
};
|
|
222
222
|
/** Parameters to define an asset freeze transaction. */
|
|
223
223
|
export type AssetFreezeParams = CommonTransactionParams & {
|
|
224
224
|
/** The ID of the asset to freeze/unfreeze */
|
|
225
225
|
assetId: bigint;
|
|
226
226
|
/** The address of the account to freeze or unfreeze */
|
|
227
|
-
account: string;
|
|
227
|
+
account: string | Address;
|
|
228
228
|
/** Whether the assets in the account should be frozen */
|
|
229
229
|
frozen: boolean;
|
|
230
230
|
};
|
|
@@ -243,19 +243,19 @@ export type AssetTransferParams = CommonTransactionParams & {
|
|
|
243
243
|
/** Amount of the asset to transfer (in smallest divisible (decimal) units). */
|
|
244
244
|
amount: bigint;
|
|
245
245
|
/** The address of the account that will receive the asset unit(s). */
|
|
246
|
-
receiver: string;
|
|
246
|
+
receiver: string | Address;
|
|
247
247
|
/** Optional address of an account to clawback the asset from.
|
|
248
248
|
*
|
|
249
249
|
* Requires the sender to be the clawback account.
|
|
250
250
|
*
|
|
251
251
|
* **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
|
|
252
252
|
*/
|
|
253
|
-
clawbackTarget?: string;
|
|
253
|
+
clawbackTarget?: string | Address;
|
|
254
254
|
/** Optional address of an account to close the asset position to.
|
|
255
255
|
*
|
|
256
256
|
* **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
257
257
|
*/
|
|
258
|
-
closeAssetTo?: string;
|
|
258
|
+
closeAssetTo?: string | Address;
|
|
259
259
|
};
|
|
260
260
|
/** Parameters to define an asset opt-in transaction. */
|
|
261
261
|
export type AssetOptInParams = CommonTransactionParams & {
|
|
@@ -270,7 +270,7 @@ export type AssetOptOutParams = CommonTransactionParams & {
|
|
|
270
270
|
* The address of the asset creator account to close the asset
|
|
271
271
|
* position to (any remaining asset units will be sent to this account).
|
|
272
272
|
*/
|
|
273
|
-
creator: string;
|
|
273
|
+
creator: string | Address;
|
|
274
274
|
};
|
|
275
275
|
/** Parameters to define an online key registration transaction. */
|
|
276
276
|
export type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
@@ -287,6 +287,11 @@ export type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
|
287
287
|
/** The 64 byte state proof public key commitment */
|
|
288
288
|
stateProofKey?: Uint8Array;
|
|
289
289
|
};
|
|
290
|
+
/** Parameters to define an offline key registration transaction. */
|
|
291
|
+
export type OfflineKeyRegistrationParams = CommonTransactionParams & {
|
|
292
|
+
/** Prevent this account from ever participating again. The account will also no longer earn rewards */
|
|
293
|
+
preventAccountFromEverParticipatingAgain?: boolean;
|
|
294
|
+
};
|
|
290
295
|
/** Common parameters for defining an application call transaction. */
|
|
291
296
|
export type CommonAppCallParams = CommonTransactionParams & {
|
|
292
297
|
/** ID of the application; 0 if the application is being created. */
|
|
@@ -296,7 +301,7 @@ export type CommonAppCallParams = CommonTransactionParams & {
|
|
|
296
301
|
/** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */
|
|
297
302
|
args?: Uint8Array[];
|
|
298
303
|
/** Any account addresses to add to the [accounts array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
299
|
-
accountReferences?: string[];
|
|
304
|
+
accountReferences?: (string | Address)[];
|
|
300
305
|
/** The ID of any apps to load to the [foreign apps array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
301
306
|
appReferences?: bigint[];
|
|
302
307
|
/** The ID of any assets to load to the [foreign assets array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). */
|
|
@@ -371,8 +376,9 @@ export type AppMethodCall<T> = Expand<Omit<T, 'args'>> & {
|
|
|
371
376
|
* * A transaction (where the signer will be automatically assigned)
|
|
372
377
|
* * An unawaited transaction (e.g. from algorand.createTransaction.{transactionType}())
|
|
373
378
|
* * Another method call (via method call params object)
|
|
379
|
+
* * undefined (this represents a placeholder transaction argument that is fulfilled by another method call argument)
|
|
374
380
|
*/
|
|
375
|
-
args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams>)[];
|
|
381
|
+
args?: (algosdk.ABIValue | TransactionWithSigner | Transaction | Promise<Transaction> | AppMethodCall<AppCreateParams> | AppMethodCall<AppUpdateParams> | AppMethodCall<AppMethodCallParams> | undefined)[];
|
|
376
382
|
};
|
|
377
383
|
export type Txn = (PaymentParams & {
|
|
378
384
|
type: 'pay';
|
|
@@ -392,7 +398,7 @@ export type Txn = (PaymentParams & {
|
|
|
392
398
|
type: 'assetOptOut';
|
|
393
399
|
}) | ((AppCallParams | AppCreateParams | AppUpdateParams) & {
|
|
394
400
|
type: 'appCall';
|
|
395
|
-
}) | (OnlineKeyRegistrationParams & {
|
|
401
|
+
}) | ((OnlineKeyRegistrationParams | OfflineKeyRegistrationParams) & {
|
|
396
402
|
type: 'keyReg';
|
|
397
403
|
}) | (algosdk.TransactionWithSigner & {
|
|
398
404
|
type: 'txnWithSigner';
|
|
@@ -402,25 +408,25 @@ export type Txn = (PaymentParams & {
|
|
|
402
408
|
} | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & {
|
|
403
409
|
type: 'methodCall';
|
|
404
410
|
});
|
|
405
|
-
/** Parameters to create an `
|
|
406
|
-
export type
|
|
411
|
+
/** Parameters to create an `TransactionComposer`. */
|
|
412
|
+
export type TransactionComposerParams = {
|
|
407
413
|
/** The algod client to use to get suggestedParams and send the transaction group */
|
|
408
414
|
algod: algosdk.Algodv2;
|
|
409
415
|
/** The function used to get the TransactionSigner for a given address */
|
|
410
|
-
getSigner: (address: string) => algosdk.TransactionSigner;
|
|
416
|
+
getSigner: (address: string | Address) => algosdk.TransactionSigner;
|
|
411
417
|
/** The method used to get SuggestedParams for transactions in the group */
|
|
412
418
|
getSuggestedParams?: () => Promise<algosdk.SuggestedParams>;
|
|
413
419
|
/** How many rounds a transaction should be valid for by default; if not specified
|
|
414
420
|
* then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
|
|
415
421
|
*/
|
|
416
|
-
defaultValidityWindow?:
|
|
422
|
+
defaultValidityWindow?: bigint;
|
|
417
423
|
/** An existing `AppManager` to use to manage app compilation and cache compilation results.
|
|
418
424
|
*
|
|
419
425
|
* If not specified than an ephemeral one will be created.
|
|
420
426
|
*/
|
|
421
427
|
appManager?: AppManager;
|
|
422
428
|
};
|
|
423
|
-
/** Set of transactions built by `
|
|
429
|
+
/** Set of transactions built by `TransactionComposer`. */
|
|
424
430
|
export interface BuiltTransactions {
|
|
425
431
|
/** The built transactions */
|
|
426
432
|
transactions: algosdk.Transaction[];
|
|
@@ -429,8 +435,8 @@ export interface BuiltTransactions {
|
|
|
429
435
|
/** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
|
|
430
436
|
signers: Map<number, algosdk.TransactionSigner>;
|
|
431
437
|
}
|
|
432
|
-
/**
|
|
433
|
-
export
|
|
438
|
+
/** TransactionComposer helps you compose and execute transactions as a transaction group. */
|
|
439
|
+
export declare class TransactionComposer {
|
|
434
440
|
/** Signer used to represent a lack of signer */
|
|
435
441
|
private static NULL_SIGNER;
|
|
436
442
|
/** The ATC used to compose the group */
|
|
@@ -451,65 +457,65 @@ export default class AlgoKitComposer {
|
|
|
451
457
|
private defaultValidityWindowIsExplicit;
|
|
452
458
|
private appManager;
|
|
453
459
|
/**
|
|
454
|
-
* Create
|
|
460
|
+
* Create a `TransactionComposer`.
|
|
455
461
|
* @param params The configuration for this composer
|
|
456
462
|
*/
|
|
457
|
-
constructor(params:
|
|
463
|
+
constructor(params: TransactionComposerParams);
|
|
458
464
|
/**
|
|
459
465
|
* Add a pre-built transaction to the transaction group.
|
|
460
466
|
* @param transaction The pre-built transaction
|
|
461
467
|
* @param signer Optional signer override for the transaction
|
|
462
468
|
* @returns The composer so you can chain method calls
|
|
463
469
|
*/
|
|
464
|
-
addTransaction(transaction: Transaction, signer?: TransactionSigner):
|
|
470
|
+
addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
|
|
465
471
|
/**
|
|
466
472
|
* Add a payment transaction to the transaction group.
|
|
467
473
|
* @param params The payment transaction parameters
|
|
468
474
|
* @returns The composer so you can chain method calls
|
|
469
475
|
*/
|
|
470
|
-
addPayment(params: PaymentParams):
|
|
476
|
+
addPayment(params: PaymentParams): TransactionComposer;
|
|
471
477
|
/**
|
|
472
478
|
* Add an asset create transaction to the transaction group.
|
|
473
479
|
* @param params The asset create transaction parameters
|
|
474
480
|
* @returns The composer so you can chain method calls
|
|
475
481
|
*/
|
|
476
|
-
addAssetCreate(params: AssetCreateParams):
|
|
482
|
+
addAssetCreate(params: AssetCreateParams): TransactionComposer;
|
|
477
483
|
/**
|
|
478
484
|
* Add an asset config transaction to the transaction group.
|
|
479
485
|
* @param params The asset config transaction parameters
|
|
480
486
|
* @returns The composer so you can chain method calls
|
|
481
487
|
*/
|
|
482
|
-
addAssetConfig(params: AssetConfigParams):
|
|
488
|
+
addAssetConfig(params: AssetConfigParams): TransactionComposer;
|
|
483
489
|
/**
|
|
484
490
|
* Add an asset freeze transaction to the transaction group.
|
|
485
491
|
* @param params The asset freeze transaction parameters
|
|
486
492
|
* @returns The composer so you can chain method calls
|
|
487
493
|
*/
|
|
488
|
-
addAssetFreeze(params: AssetFreezeParams):
|
|
494
|
+
addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
|
|
489
495
|
/**
|
|
490
496
|
* Add an asset destroy transaction to the transaction group.
|
|
491
497
|
* @param params The asset destroy transaction parameters
|
|
492
498
|
* @returns The composer so you can chain method calls
|
|
493
499
|
*/
|
|
494
|
-
addAssetDestroy(params: AssetDestroyParams):
|
|
500
|
+
addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
|
|
495
501
|
/**
|
|
496
502
|
* Add an asset transfer transaction to the transaction group.
|
|
497
503
|
* @param params The asset transfer transaction parameters
|
|
498
504
|
* @returns The composer so you can chain method calls
|
|
499
505
|
*/
|
|
500
|
-
addAssetTransfer(params: AssetTransferParams):
|
|
506
|
+
addAssetTransfer(params: AssetTransferParams): TransactionComposer;
|
|
501
507
|
/**
|
|
502
508
|
* Add an asset opt-in transaction to the transaction group.
|
|
503
509
|
* @param params The asset opt-in transaction parameters
|
|
504
510
|
* @returns The composer so you can chain method calls
|
|
505
511
|
*/
|
|
506
|
-
addAssetOptIn(params: AssetOptInParams):
|
|
512
|
+
addAssetOptIn(params: AssetOptInParams): TransactionComposer;
|
|
507
513
|
/**
|
|
508
514
|
* Add an asset opt-out transaction to the transaction group.
|
|
509
515
|
* @param params The asset opt-out transaction parameters
|
|
510
516
|
* @returns The composer so you can chain method calls
|
|
511
517
|
*/
|
|
512
|
-
addAssetOptOut(params: AssetOptOutParams):
|
|
518
|
+
addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
|
|
513
519
|
/**
|
|
514
520
|
* Add an application create transaction to the transaction group.
|
|
515
521
|
*
|
|
@@ -517,7 +523,7 @@ export default class AlgoKitComposer {
|
|
|
517
523
|
* @param params The application create transaction parameters
|
|
518
524
|
* @returns The composer so you can chain method calls
|
|
519
525
|
*/
|
|
520
|
-
addAppCreate(params: AppCreateParams):
|
|
526
|
+
addAppCreate(params: AppCreateParams): TransactionComposer;
|
|
521
527
|
/**
|
|
522
528
|
* Add an application update transaction to the transaction group.
|
|
523
529
|
*
|
|
@@ -525,7 +531,7 @@ export default class AlgoKitComposer {
|
|
|
525
531
|
* @param params The application update transaction parameters
|
|
526
532
|
* @returns The composer so you can chain method calls
|
|
527
533
|
*/
|
|
528
|
-
addAppUpdate(params: AppUpdateParams):
|
|
534
|
+
addAppUpdate(params: AppUpdateParams): TransactionComposer;
|
|
529
535
|
/**
|
|
530
536
|
* Add an application delete transaction to the transaction group.
|
|
531
537
|
*
|
|
@@ -533,7 +539,7 @@ export default class AlgoKitComposer {
|
|
|
533
539
|
* @param params The application delete transaction parameters
|
|
534
540
|
* @returns The composer so you can chain method calls
|
|
535
541
|
*/
|
|
536
|
-
addAppDelete(params: AppDeleteParams):
|
|
542
|
+
addAppDelete(params: AppDeleteParams): TransactionComposer;
|
|
537
543
|
/**
|
|
538
544
|
* Add an application call transaction to the transaction group.
|
|
539
545
|
*
|
|
@@ -543,7 +549,7 @@ export default class AlgoKitComposer {
|
|
|
543
549
|
* @param params The application call transaction parameters
|
|
544
550
|
* @returns The composer so you can chain method calls
|
|
545
551
|
*/
|
|
546
|
-
addAppCall(params: AppCallParams):
|
|
552
|
+
addAppCall(params: AppCallParams): TransactionComposer;
|
|
547
553
|
/**
|
|
548
554
|
* Add an ABI method create application call transaction to the transaction group.
|
|
549
555
|
*
|
|
@@ -581,13 +587,19 @@ export default class AlgoKitComposer {
|
|
|
581
587
|
* @param params The online key registration transaction parameters
|
|
582
588
|
* @returns The composer so you can chain method calls
|
|
583
589
|
*/
|
|
584
|
-
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams):
|
|
590
|
+
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
|
|
591
|
+
/**
|
|
592
|
+
* Add an offline key registration transaction to the transaction group.
|
|
593
|
+
* @param params The offline key registration transaction parameters
|
|
594
|
+
* @returns The composer so you can chain method calls
|
|
595
|
+
*/
|
|
596
|
+
addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer;
|
|
585
597
|
/**
|
|
586
598
|
* Add the transactions within an `AtomicTransactionComposer` to the transaction group.
|
|
587
599
|
* @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
|
|
588
600
|
* @returns The composer so you can chain method calls
|
|
589
601
|
*/
|
|
590
|
-
addAtc(atc: algosdk.AtomicTransactionComposer):
|
|
602
|
+
addAtc(atc: algosdk.AtomicTransactionComposer): TransactionComposer;
|
|
591
603
|
/** Build an ATC and return transactions ready to be incorporated into a broader set of transactions this composer is composing */
|
|
592
604
|
private buildAtc;
|
|
593
605
|
private commonTxnBuildStep;
|