@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/composer.d.ts
ADDED
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
import { ReadableAddress } from "./packages/common/src/address.js";
|
|
2
|
+
import { Expand } from "./packages/common/src/expand.js";
|
|
3
|
+
import { ABIMethod } from "./packages/abi/src/abi-method.js";
|
|
4
|
+
import { Transaction } from "./packages/transact/src/transactions/transaction.js";
|
|
5
|
+
import { TransactionSigner } from "./packages/transact/src/signer.js";
|
|
6
|
+
import { SimulateRequest } from "./packages/algod_client/src/models/simulate-request.js";
|
|
7
|
+
import { SimulateResponse } from "./packages/algod_client/src/models/simulate-response.js";
|
|
8
|
+
import { SuggestedParams } from "./packages/algod_client/src/models/suggested-params.js";
|
|
9
|
+
import { AlgodClient } from "./packages/algod_client/src/client.js";
|
|
10
|
+
import { AlgoAmount } from "./amount.js";
|
|
11
|
+
import { Arc2TransactionNote, SendParams, SendTransactionComposerResults } from "./transaction/types.js";
|
|
12
|
+
import { TransactionWithSigner } from "./transaction/transaction.js";
|
|
13
|
+
import { AppManager } from "./app-manager.js";
|
|
14
|
+
import { CommonTransactionParams } from "./transactions/common.js";
|
|
15
|
+
import { AppCallParams, AppCreateParams, AppDeleteParams, AppMethodCallParams, AppUpdateParams, CommonAppCallParams } from "./transactions/app-call.js";
|
|
16
|
+
import { AssetOptInParams, AssetOptOutParams, AssetTransferParams } from "./transactions/asset-transfer.js";
|
|
17
|
+
import { AssetConfigParams, AssetCreateParams, AssetDestroyParams, AssetFreezeParams } from "./transactions/asset-config.js";
|
|
18
|
+
import { OfflineKeyRegistrationParams, OnlineKeyRegistrationParams } from "./transactions/key-registration.js";
|
|
19
|
+
import { AppCallMethodCall, AppCreateMethodCall, AppDeleteMethodCall, AppMethodCall, AppMethodCallTransactionArgument, AppUpdateMethodCall, ProcessedAppCallMethodCall, ProcessedAppCreateMethodCall, ProcessedAppUpdateMethodCall } from "./transactions/method-call.js";
|
|
20
|
+
import { PaymentParams } from "./transactions/payment.js";
|
|
21
|
+
|
|
22
|
+
//#region src/composer.d.ts
|
|
23
|
+
|
|
24
|
+
/** Options to control a simulate request, that does not require transaction signing */
|
|
25
|
+
type SkipSignaturesSimulateOptions = Expand<Omit<RawSimulateOptions, 'fixSigners' | 'allowEmptySignatures'> & {
|
|
26
|
+
/** Whether or not to skip signatures for all built transactions and use an empty signer instead.
|
|
27
|
+
* This will set `fixSigners` and `allowEmptySignatures` when sending the request to the algod API.
|
|
28
|
+
*/
|
|
29
|
+
skipSignatures: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
/** The raw API options to control a simulate request.
|
|
32
|
+
* See algod API docs for more information: https://dev.algorand.co/reference/rest-apis/algod/#simulatetransaction
|
|
33
|
+
*/
|
|
34
|
+
type RawSimulateOptions = Expand<Omit<SimulateRequest, 'txnGroups'>> & {
|
|
35
|
+
/** Whether or not to return the result on simulation failure instead of throwing an error */
|
|
36
|
+
resultOnFailure?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/** All options to control a simulate request */
|
|
39
|
+
type SimulateOptions = Expand<Partial<SkipSignaturesSimulateOptions> & RawSimulateOptions>;
|
|
40
|
+
/**
|
|
41
|
+
* A function that transforms an error into a new error.
|
|
42
|
+
*
|
|
43
|
+
* In most cases, an ErrorTransformer should first check if it can or should transform the error
|
|
44
|
+
* and return the input error if it cannot or should not transform it.
|
|
45
|
+
*/
|
|
46
|
+
type ErrorTransformer = (error: Error) => Promise<Error>;
|
|
47
|
+
type TransactionComposerConfig = {
|
|
48
|
+
coverAppCallInnerTransactionFees: boolean;
|
|
49
|
+
populateAppCallResources: boolean;
|
|
50
|
+
};
|
|
51
|
+
/** Parameters to create an `TransactionComposer`. */
|
|
52
|
+
type TransactionComposerParams = {
|
|
53
|
+
/** The algod client to use to get suggestedParams and send the transaction group */
|
|
54
|
+
algod: AlgodClient;
|
|
55
|
+
/** The function used to get the TransactionSigner for a given address */
|
|
56
|
+
getSigner: (address: ReadableAddress) => TransactionSigner;
|
|
57
|
+
/** The method used to get SuggestedParams for transactions in the group */
|
|
58
|
+
getSuggestedParams?: () => Promise<SuggestedParams>;
|
|
59
|
+
/** How many rounds a transaction should be valid for by default; if not specified
|
|
60
|
+
* then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet).
|
|
61
|
+
*/
|
|
62
|
+
defaultValidityWindow?: bigint;
|
|
63
|
+
/** An existing `AppManager` to use to manage app compilation and cache compilation results.
|
|
64
|
+
*
|
|
65
|
+
* If not specified then an ephemeral one will be created.
|
|
66
|
+
*/
|
|
67
|
+
appManager?: AppManager;
|
|
68
|
+
/**
|
|
69
|
+
* An array of error transformers to use when an error is caught in simulate or execute
|
|
70
|
+
* callbacks can later be registered with `registerErrorTransformer`
|
|
71
|
+
*/
|
|
72
|
+
errorTransformers?: ErrorTransformer[];
|
|
73
|
+
composerConfig?: TransactionComposerConfig;
|
|
74
|
+
};
|
|
75
|
+
/** Set of transactions built by `TransactionComposer`. */
|
|
76
|
+
interface BuiltTransactions {
|
|
77
|
+
/** The built transactions */
|
|
78
|
+
transactions: Transaction[];
|
|
79
|
+
/** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */
|
|
80
|
+
methodCalls: Map<number, ABIMethod>;
|
|
81
|
+
/** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */
|
|
82
|
+
signers: Map<number, TransactionSigner>;
|
|
83
|
+
}
|
|
84
|
+
/** TransactionComposer helps you compose and execute transactions as a transaction group. */
|
|
85
|
+
declare class TransactionComposer {
|
|
86
|
+
/** Transactions that have not yet been composed */
|
|
87
|
+
private txns;
|
|
88
|
+
/** The algod client used by the composer. */
|
|
89
|
+
private algod;
|
|
90
|
+
/** An async function that will return suggested params for the transaction. */
|
|
91
|
+
private getSuggestedParams;
|
|
92
|
+
/** A function that takes in an address and return a signer function for that address. */
|
|
93
|
+
private getSigner;
|
|
94
|
+
/** The default transaction validity window */
|
|
95
|
+
private defaultValidityWindow;
|
|
96
|
+
/** Whether the validity window was explicitly set on construction */
|
|
97
|
+
private defaultValidityWindowIsExplicit;
|
|
98
|
+
private appManager;
|
|
99
|
+
private errorTransformers;
|
|
100
|
+
private composerConfig;
|
|
101
|
+
private transactionsWithSigners?;
|
|
102
|
+
private signedTransactions?;
|
|
103
|
+
private rawBuildTransactions?;
|
|
104
|
+
private transformError;
|
|
105
|
+
private validateReferenceParams;
|
|
106
|
+
/**
|
|
107
|
+
* Create a `TransactionComposer`.
|
|
108
|
+
* @param params The configuration for this composer
|
|
109
|
+
* @returns The `TransactionComposer` instance
|
|
110
|
+
*/
|
|
111
|
+
constructor(params: TransactionComposerParams);
|
|
112
|
+
private cloneTransaction;
|
|
113
|
+
private push;
|
|
114
|
+
clone(composerConfig?: TransactionComposerConfig): TransactionComposer;
|
|
115
|
+
/**
|
|
116
|
+
* Register a function that will be used to transform an error caught when simulating or executing
|
|
117
|
+
*
|
|
118
|
+
* @returns The composer so you can chain method calls
|
|
119
|
+
*/
|
|
120
|
+
registerErrorTransformer(transformer: ErrorTransformer): this;
|
|
121
|
+
/**
|
|
122
|
+
* Add a pre-built transaction to the transaction group.
|
|
123
|
+
* @param transaction The pre-built transaction
|
|
124
|
+
* @param signer Optional signer override for the transaction
|
|
125
|
+
* @returns The composer so you can chain method calls
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* composer.addTransaction(txn)
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
addTransaction(transaction: Transaction, signer?: TransactionSigner): TransactionComposer;
|
|
132
|
+
/**
|
|
133
|
+
* Add another transaction composer to the current transaction composer.
|
|
134
|
+
* The transaction params of the input transaction composer will be added.
|
|
135
|
+
* If the input transaction composer is updated, it won't affect the current transaction composer.
|
|
136
|
+
* @param composer The transaction composer to add
|
|
137
|
+
* @returns The composer so you can chain method calls
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const innerComposer = algorand.newGroup()
|
|
141
|
+
* .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (1).algo() })
|
|
142
|
+
* .addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (2).algo() })
|
|
143
|
+
*
|
|
144
|
+
* composer.addTransactionComposer(innerComposer)
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
addTransactionComposer(composer: TransactionComposer): TransactionComposer;
|
|
148
|
+
/**
|
|
149
|
+
* Add a payment transaction to the transaction group.
|
|
150
|
+
* @param params The payment transaction parameters
|
|
151
|
+
* @returns The composer so you can chain method calls
|
|
152
|
+
* @example Basic example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* composer.addPayment({
|
|
155
|
+
* sender: 'SENDERADDRESS',
|
|
156
|
+
* receiver: 'RECEIVERADDRESS',
|
|
157
|
+
* amount: (4).algo(),
|
|
158
|
+
* })
|
|
159
|
+
* ```
|
|
160
|
+
* @example Advanced example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* composer.addPayment({
|
|
163
|
+
* amount: (4).algo(),
|
|
164
|
+
* receiver: 'RECEIVERADDRESS',
|
|
165
|
+
* sender: 'SENDERADDRESS',
|
|
166
|
+
* closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',
|
|
167
|
+
* lease: 'lease',
|
|
168
|
+
* note: 'note',
|
|
169
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
170
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
171
|
+
* // You wouldn't normally set this field
|
|
172
|
+
* firstValidRound: 1000n,
|
|
173
|
+
* validityWindow: 10,
|
|
174
|
+
* extraFee: (1000).microAlgo(),
|
|
175
|
+
* staticFee: (1000).microAlgo(),
|
|
176
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
177
|
+
* // already specified, but here for completeness
|
|
178
|
+
* maxFee: (3000).microAlgo(),
|
|
179
|
+
* })
|
|
180
|
+
*/
|
|
181
|
+
addPayment(params: PaymentParams): TransactionComposer;
|
|
182
|
+
/**
|
|
183
|
+
* Add an asset create transaction to the transaction group.
|
|
184
|
+
* @param params The asset create transaction parameters
|
|
185
|
+
* @returns The composer so you can chain method calls
|
|
186
|
+
* @example Basic example
|
|
187
|
+
* ```typescript
|
|
188
|
+
* composer.addAssetCreate({ sender: "CREATORADDRESS", total: 100n})
|
|
189
|
+
* ```
|
|
190
|
+
* @example Advanced example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* composer.addAssetCreate({
|
|
193
|
+
* sender: 'CREATORADDRESS',
|
|
194
|
+
* total: 100n,
|
|
195
|
+
* decimals: 2,
|
|
196
|
+
* assetName: 'asset',
|
|
197
|
+
* unitName: 'unit',
|
|
198
|
+
* url: 'url',
|
|
199
|
+
* metadataHash: 'metadataHash',
|
|
200
|
+
* defaultFrozen: false,
|
|
201
|
+
* manager: 'MANAGERADDRESS',
|
|
202
|
+
* reserve: 'RESERVEADDRESS',
|
|
203
|
+
* freeze: 'FREEZEADDRESS',
|
|
204
|
+
* clawback: 'CLAWBACKADDRESS',
|
|
205
|
+
* lease: 'lease',
|
|
206
|
+
* note: 'note',
|
|
207
|
+
* // You wouldn't normally set this field
|
|
208
|
+
* firstValidRound: 1000n,
|
|
209
|
+
* validityWindow: 10,
|
|
210
|
+
* extraFee: (1000).microAlgo(),
|
|
211
|
+
* staticFee: (1000).microAlgo(),
|
|
212
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
213
|
+
* // already specified, but here for completeness
|
|
214
|
+
* maxFee: (3000).microAlgo(),
|
|
215
|
+
* })
|
|
216
|
+
*/
|
|
217
|
+
addAssetCreate(params: AssetCreateParams): TransactionComposer;
|
|
218
|
+
/**
|
|
219
|
+
* Add an asset config transaction to the transaction group.
|
|
220
|
+
* @param params The asset config transaction parameters
|
|
221
|
+
* @returns The composer so you can chain method calls
|
|
222
|
+
* @example Basic example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* composer.addAssetConfig({ sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
225
|
+
* ```
|
|
226
|
+
* @example Advanced example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* composer.addAssetConfig({
|
|
229
|
+
* sender: 'MANAGERADDRESS',
|
|
230
|
+
* assetId: 123456n,
|
|
231
|
+
* manager: 'MANAGERADDRESS',
|
|
232
|
+
* reserve: 'RESERVEADDRESS',
|
|
233
|
+
* freeze: 'FREEZEADDRESS',
|
|
234
|
+
* clawback: 'CLAWBACKADDRESS',
|
|
235
|
+
* lease: 'lease',
|
|
236
|
+
* note: 'note',
|
|
237
|
+
* // You wouldn't normally set this field
|
|
238
|
+
* firstValidRound: 1000n,
|
|
239
|
+
* validityWindow: 10,
|
|
240
|
+
* extraFee: (1000).microAlgo(),
|
|
241
|
+
* staticFee: (1000).microAlgo(),
|
|
242
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
243
|
+
* // already specified, but here for completeness
|
|
244
|
+
* maxFee: (3000).microAlgo(),
|
|
245
|
+
* })
|
|
246
|
+
*/
|
|
247
|
+
addAssetConfig(params: AssetConfigParams): TransactionComposer;
|
|
248
|
+
/**
|
|
249
|
+
* Add an asset freeze transaction to the transaction group.
|
|
250
|
+
* @param params The asset freeze transaction parameters
|
|
251
|
+
* @returns The composer so you can chain method calls
|
|
252
|
+
* @example Basic example
|
|
253
|
+
* ```typescript
|
|
254
|
+
* composer.addAssetFreeze({ sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
255
|
+
* ```
|
|
256
|
+
* @example Advanced example
|
|
257
|
+
* ```typescript
|
|
258
|
+
* composer.addAssetFreeze({
|
|
259
|
+
* sender: 'MANAGERADDRESS',
|
|
260
|
+
* assetId: 123456n,
|
|
261
|
+
* account: 'ACCOUNTADDRESS',
|
|
262
|
+
* frozen: true,
|
|
263
|
+
* lease: 'lease',
|
|
264
|
+
* note: 'note',
|
|
265
|
+
* // You wouldn't normally set this field
|
|
266
|
+
* firstValidRound: 1000n,
|
|
267
|
+
* validityWindow: 10,
|
|
268
|
+
* extraFee: (1000).microAlgo(),
|
|
269
|
+
* staticFee: (1000).microAlgo(),
|
|
270
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
271
|
+
* // already specified, but here for completeness
|
|
272
|
+
* maxFee: (3000).microAlgo(),
|
|
273
|
+
* })
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
addAssetFreeze(params: AssetFreezeParams): TransactionComposer;
|
|
277
|
+
/**
|
|
278
|
+
* Add an asset destroy transaction to the transaction group.
|
|
279
|
+
* @param params The asset destroy transaction parameters
|
|
280
|
+
* @returns The composer so you can chain method calls
|
|
281
|
+
* @example Basic example
|
|
282
|
+
* ```typescript
|
|
283
|
+
* composer.addAssetDestroy({ sender: "MANAGERADDRESS", assetId: 123456n })
|
|
284
|
+
* ```
|
|
285
|
+
* @example Advanced example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* composer.addAssetDestroy({
|
|
288
|
+
* sender: 'MANAGERADDRESS',
|
|
289
|
+
* assetId: 123456n,
|
|
290
|
+
* lease: 'lease',
|
|
291
|
+
* note: 'note',
|
|
292
|
+
* // You wouldn't normally set this field
|
|
293
|
+
* firstValidRound: 1000n,
|
|
294
|
+
* validityWindow: 10,
|
|
295
|
+
* extraFee: (1000).microAlgo(),
|
|
296
|
+
* staticFee: (1000).microAlgo(),
|
|
297
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
298
|
+
* // already specified, but here for completeness
|
|
299
|
+
* maxFee: (3000).microAlgo(),
|
|
300
|
+
* })
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
addAssetDestroy(params: AssetDestroyParams): TransactionComposer;
|
|
304
|
+
/**
|
|
305
|
+
* Add an asset transfer transaction to the transaction group.
|
|
306
|
+
* @param params The asset transfer transaction parameters
|
|
307
|
+
* @returns The composer so you can chain method calls
|
|
308
|
+
* @example Basic example
|
|
309
|
+
* ```typescript
|
|
310
|
+
* composer.addAssetTransfer({ sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
311
|
+
* ```
|
|
312
|
+
* @example Advanced example (with clawback)
|
|
313
|
+
* ```typescript
|
|
314
|
+
* composer.addAssetTransfer({
|
|
315
|
+
* sender: 'CLAWBACKADDRESS',
|
|
316
|
+
* assetId: 123456n,
|
|
317
|
+
* amount: 1n,
|
|
318
|
+
* receiver: 'RECEIVERADDRESS',
|
|
319
|
+
* clawbackTarget: 'HOLDERADDRESS',
|
|
320
|
+
* // This field needs to be used with caution
|
|
321
|
+
* closeAssetTo: 'ADDRESSTOCLOSETO'
|
|
322
|
+
* lease: 'lease',
|
|
323
|
+
* note: 'note',
|
|
324
|
+
* // You wouldn't normally set this field
|
|
325
|
+
* firstValidRound: 1000n,
|
|
326
|
+
* validityWindow: 10,
|
|
327
|
+
* extraFee: (1000).microAlgo(),
|
|
328
|
+
* staticFee: (1000).microAlgo(),
|
|
329
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
330
|
+
* // already specified, but here for completeness
|
|
331
|
+
* maxFee: (3000).microAlgo(),
|
|
332
|
+
* })
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
addAssetTransfer(params: AssetTransferParams): TransactionComposer;
|
|
336
|
+
/**
|
|
337
|
+
* Add an asset opt-in transaction to the transaction group.
|
|
338
|
+
* @param params The asset opt-in transaction parameters
|
|
339
|
+
* @returns The composer so you can chain method calls
|
|
340
|
+
* @example Basic example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* composer.addAssetOptIn({ sender: "SENDERADDRESS", assetId: 123456n })
|
|
343
|
+
* ```
|
|
344
|
+
* @example Advanced example
|
|
345
|
+
* ```typescript
|
|
346
|
+
* composer.addAssetOptIn({
|
|
347
|
+
* sender: 'SENDERADDRESS',
|
|
348
|
+
* assetId: 123456n,
|
|
349
|
+
* lease: 'lease',
|
|
350
|
+
* note: 'note',
|
|
351
|
+
* // You wouldn't normally set this field
|
|
352
|
+
* firstValidRound: 1000n,
|
|
353
|
+
* validityWindow: 10,
|
|
354
|
+
* extraFee: (1000).microAlgo(),
|
|
355
|
+
* staticFee: (1000).microAlgo(),
|
|
356
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
357
|
+
* // already specified, but here for completeness
|
|
358
|
+
* maxFee: (3000).microAlgo(),
|
|
359
|
+
* })
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
addAssetOptIn(params: AssetOptInParams): TransactionComposer;
|
|
363
|
+
/**
|
|
364
|
+
* Add an asset opt-out transaction to the transaction group.
|
|
365
|
+
* @param params The asset opt-out transaction parameters
|
|
366
|
+
* @returns The composer so you can chain method calls
|
|
367
|
+
* @example Basic example (without creator, will be retrieved from algod)
|
|
368
|
+
* ```typescript
|
|
369
|
+
* composer.addAssetOptOut({ sender: "SENDERADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
370
|
+
* ```
|
|
371
|
+
* @example Basic example (with creator)
|
|
372
|
+
* ```typescript
|
|
373
|
+
* composer.addAssetOptOut({ sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n, ensureZeroBalance: true })
|
|
374
|
+
* ```
|
|
375
|
+
* @example Advanced example
|
|
376
|
+
* ```typescript
|
|
377
|
+
* composer.addAssetOptOut({
|
|
378
|
+
* sender: 'SENDERADDRESS',
|
|
379
|
+
* assetId: 123456n,
|
|
380
|
+
* creator: 'CREATORADDRESS',
|
|
381
|
+
* ensureZeroBalance: true,
|
|
382
|
+
* lease: 'lease',
|
|
383
|
+
* note: 'note',
|
|
384
|
+
* // You wouldn't normally set this field
|
|
385
|
+
* firstValidRound: 1000n,
|
|
386
|
+
* validityWindow: 10,
|
|
387
|
+
* extraFee: (1000).microAlgo(),
|
|
388
|
+
* staticFee: (1000).microAlgo(),
|
|
389
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
390
|
+
* // already specified, but here for completeness
|
|
391
|
+
* maxFee: (3000).microAlgo(),
|
|
392
|
+
* })
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
addAssetOptOut(params: AssetOptOutParams): TransactionComposer;
|
|
396
|
+
/**
|
|
397
|
+
* Add an application create transaction to the transaction group.
|
|
398
|
+
*
|
|
399
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
400
|
+
* @param params The application create transaction parameters
|
|
401
|
+
* @returns The composer so you can chain method calls
|
|
402
|
+
* @example Basic example
|
|
403
|
+
* ```typescript
|
|
404
|
+
* composer.addAppCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
405
|
+
* ```
|
|
406
|
+
* @example Advanced example
|
|
407
|
+
* ```typescript
|
|
408
|
+
* composer.addAppCreate({
|
|
409
|
+
* sender: 'CREATORADDRESS',
|
|
410
|
+
* approvalProgram: "TEALCODE",
|
|
411
|
+
* clearStateProgram: "TEALCODE",
|
|
412
|
+
* schema: {
|
|
413
|
+
* globalInts: 1,
|
|
414
|
+
* globalByteSlices: 2,
|
|
415
|
+
* localInts: 3,
|
|
416
|
+
* localByteSlices: 4
|
|
417
|
+
* },
|
|
418
|
+
* extraProgramPages: 1,
|
|
419
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
420
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
421
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
422
|
+
* appReferences: [123n, 1234n]
|
|
423
|
+
* assetReferences: [12345n]
|
|
424
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
425
|
+
* accessReferences: [{ appId: 1234n }]
|
|
426
|
+
* lease: 'lease',
|
|
427
|
+
* note: 'note',
|
|
428
|
+
* // You wouldn't normally set this field
|
|
429
|
+
* firstValidRound: 1000n,
|
|
430
|
+
* validityWindow: 10,
|
|
431
|
+
* extraFee: (1000).microAlgo(),
|
|
432
|
+
* staticFee: (1000).microAlgo(),
|
|
433
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
434
|
+
* // already specified, but here for completeness
|
|
435
|
+
* maxFee: (3000).microAlgo(),
|
|
436
|
+
* rejectVersion: 1,
|
|
437
|
+
* // Signer only needed if you want to provide one,
|
|
438
|
+
* // generally you'd register it with AlgorandClient
|
|
439
|
+
* // against the sender and not need to pass it in
|
|
440
|
+
* signer: transactionSigner,
|
|
441
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
442
|
+
* suppressLog: true,
|
|
443
|
+
*})
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
addAppCreate(params: AppCreateParams): TransactionComposer;
|
|
447
|
+
/**
|
|
448
|
+
* Add an application update transaction to the transaction group.
|
|
449
|
+
*
|
|
450
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
451
|
+
* @param params The application update transaction parameters
|
|
452
|
+
* @returns The composer so you can chain method calls
|
|
453
|
+
* @example Basic example
|
|
454
|
+
* ```typescript
|
|
455
|
+
* composer.addAppUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
456
|
+
* ```
|
|
457
|
+
* @example Advanced example
|
|
458
|
+
* ```typescript
|
|
459
|
+
* composer.addAppUpdate({
|
|
460
|
+
* sender: 'CREATORADDRESS',
|
|
461
|
+
* approvalProgram: "TEALCODE",
|
|
462
|
+
* clearStateProgram: "TEALCODE",
|
|
463
|
+
* onComplete: OnApplicationComplete.UpdateApplication,
|
|
464
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
465
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
466
|
+
* appReferences: [123n, 1234n]
|
|
467
|
+
* assetReferences: [12345n]
|
|
468
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
469
|
+
* accessReferences: [{ appId: 1234n }]
|
|
470
|
+
* lease: 'lease',
|
|
471
|
+
* note: 'note',
|
|
472
|
+
* // You wouldn't normally set this field
|
|
473
|
+
* firstValidRound: 1000n,
|
|
474
|
+
* validityWindow: 10,
|
|
475
|
+
* extraFee: (1000).microAlgo(),
|
|
476
|
+
* staticFee: (1000).microAlgo(),
|
|
477
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
478
|
+
* // already specified, but here for completeness
|
|
479
|
+
* maxFee: (3000).microAlgo(),
|
|
480
|
+
* rejectVersion: 1,
|
|
481
|
+
*})
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
addAppUpdate(params: AppUpdateParams): TransactionComposer;
|
|
485
|
+
/**
|
|
486
|
+
* Add an application delete transaction to the transaction group.
|
|
487
|
+
*
|
|
488
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
489
|
+
* @param params The application delete transaction parameters
|
|
490
|
+
* @returns The composer so you can chain method calls
|
|
491
|
+
* @example Basic example
|
|
492
|
+
* ```typescript
|
|
493
|
+
* composer.addAppDelete({ sender: 'CREATORADDRESS' })
|
|
494
|
+
* ```
|
|
495
|
+
* @example Advanced example
|
|
496
|
+
* ```typescript
|
|
497
|
+
* composer.addAppDelete({
|
|
498
|
+
* sender: 'CREATORADDRESS',
|
|
499
|
+
* onComplete: OnApplicationComplete.DeleteApplication,
|
|
500
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
501
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
502
|
+
* appReferences: [123n, 1234n]
|
|
503
|
+
* assetReferences: [12345n]
|
|
504
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
505
|
+
* accessReferences: [{ appId: 1234n }]
|
|
506
|
+
* lease: 'lease',
|
|
507
|
+
* note: 'note',
|
|
508
|
+
* // You wouldn't normally set this field
|
|
509
|
+
* firstValidRound: 1000n,
|
|
510
|
+
* validityWindow: 10,
|
|
511
|
+
* extraFee: (1000).microAlgo(),
|
|
512
|
+
* staticFee: (1000).microAlgo(),
|
|
513
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
514
|
+
* // already specified, but here for completeness
|
|
515
|
+
* maxFee: (3000).microAlgo(),
|
|
516
|
+
* rejectVersion: 1,
|
|
517
|
+
*})
|
|
518
|
+
* ```
|
|
519
|
+
*/
|
|
520
|
+
addAppDelete(params: AppDeleteParams): TransactionComposer;
|
|
521
|
+
/**
|
|
522
|
+
* Add an application call transaction to the transaction group.
|
|
523
|
+
*
|
|
524
|
+
* If you want to create or update an app use `addAppCreate` or `addAppUpdate`.
|
|
525
|
+
*
|
|
526
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
527
|
+
* @param params The application call transaction parameters
|
|
528
|
+
* @returns The composer so you can chain method calls
|
|
529
|
+
* @example Basic example
|
|
530
|
+
* ```typescript
|
|
531
|
+
* composer.addAppCall({ sender: 'CREATORADDRESS' })
|
|
532
|
+
* ```
|
|
533
|
+
* @example Advanced example
|
|
534
|
+
* ```typescript
|
|
535
|
+
* composer.addAppCall({
|
|
536
|
+
* sender: 'CREATORADDRESS',
|
|
537
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
538
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
539
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
540
|
+
* appReferences: [123n, 1234n]
|
|
541
|
+
* assetReferences: [12345n]
|
|
542
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
543
|
+
* accessReferences: [{ appId: 1234n }]
|
|
544
|
+
* lease: 'lease',
|
|
545
|
+
* note: 'note',
|
|
546
|
+
* // You wouldn't normally set this field
|
|
547
|
+
* firstValidRound: 1000n,
|
|
548
|
+
* validityWindow: 10,
|
|
549
|
+
* extraFee: (1000).microAlgo(),
|
|
550
|
+
* staticFee: (1000).microAlgo(),
|
|
551
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
552
|
+
* // already specified, but here for completeness
|
|
553
|
+
* maxFee: (3000).microAlgo(),
|
|
554
|
+
* rejectVersion: 1,
|
|
555
|
+
*})
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
addAppCall(params: AppCallParams): TransactionComposer;
|
|
559
|
+
/**
|
|
560
|
+
* Add an ABI method create application call transaction to the transaction group.
|
|
561
|
+
*
|
|
562
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
563
|
+
* @param params The ABI create method application call transaction parameters
|
|
564
|
+
* @returns The composer so you can chain method calls
|
|
565
|
+
* @example Basic example
|
|
566
|
+
* ```typescript
|
|
567
|
+
* const method = new ABIMethod({
|
|
568
|
+
* name: 'method',
|
|
569
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
570
|
+
* returns: { type: 'string' },
|
|
571
|
+
* })
|
|
572
|
+
* composer.addAppCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
573
|
+
* ```
|
|
574
|
+
* @example Advanced example
|
|
575
|
+
* ```typescript
|
|
576
|
+
* const method = new ABIMethod({
|
|
577
|
+
* name: 'method',
|
|
578
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
579
|
+
* returns: { type: 'string' },
|
|
580
|
+
* })
|
|
581
|
+
* composer.addAppCreateMethodCall({
|
|
582
|
+
* sender: 'CREATORADDRESS',
|
|
583
|
+
* method: method,
|
|
584
|
+
* args: ["arg1_value"],
|
|
585
|
+
* approvalProgram: "TEALCODE",
|
|
586
|
+
* clearStateProgram: "TEALCODE",
|
|
587
|
+
* schema: {
|
|
588
|
+
* globalInts: 1,
|
|
589
|
+
* globalByteSlices: 2,
|
|
590
|
+
* localInts: 3,
|
|
591
|
+
* localByteSlices: 4
|
|
592
|
+
* },
|
|
593
|
+
* extraProgramPages: 1,
|
|
594
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
595
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
596
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
597
|
+
* appReferences: [123n, 1234n]
|
|
598
|
+
* assetReferences: [12345n]
|
|
599
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
600
|
+
* accessReferences: [{ appId: 1234n }]
|
|
601
|
+
* lease: 'lease',
|
|
602
|
+
* note: 'note',
|
|
603
|
+
* // You wouldn't normally set this field
|
|
604
|
+
* firstValidRound: 1000n,
|
|
605
|
+
* validityWindow: 10,
|
|
606
|
+
* extraFee: (1000).microAlgo(),
|
|
607
|
+
* staticFee: (1000).microAlgo(),
|
|
608
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
609
|
+
* // already specified, but here for completeness
|
|
610
|
+
* maxFee: (3000).microAlgo(),
|
|
611
|
+
* rejectVersion: 1,
|
|
612
|
+
*})
|
|
613
|
+
* ```
|
|
614
|
+
*/
|
|
615
|
+
addAppCreateMethodCall(params: AppCreateMethodCall): this;
|
|
616
|
+
/**
|
|
617
|
+
* Add an ABI method update application call transaction to the transaction group.
|
|
618
|
+
*
|
|
619
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
620
|
+
* @param params The ABI update method application call transaction parameters
|
|
621
|
+
* @returns The composer so you can chain method calls
|
|
622
|
+
* @example Basic example
|
|
623
|
+
* ```typescript
|
|
624
|
+
* const method = new ABIMethod({
|
|
625
|
+
* name: 'method',
|
|
626
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
627
|
+
* returns: { type: 'string' },
|
|
628
|
+
* })
|
|
629
|
+
* composer.addAppUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
630
|
+
* ```
|
|
631
|
+
* @example Advanced example
|
|
632
|
+
* ```typescript
|
|
633
|
+
* const method = new ABIMethod({
|
|
634
|
+
* name: 'method',
|
|
635
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
636
|
+
* returns: { type: 'string' },
|
|
637
|
+
* })
|
|
638
|
+
* composer.addAppUpdateMethodCall({
|
|
639
|
+
* sender: 'CREATORADDRESS',
|
|
640
|
+
* method: method,
|
|
641
|
+
* args: ["arg1_value"],
|
|
642
|
+
* approvalProgram: "TEALCODE",
|
|
643
|
+
* clearStateProgram: "TEALCODE",
|
|
644
|
+
* onComplete: OnApplicationComplete.UpdateApplication,
|
|
645
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
646
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
647
|
+
* appReferences: [123n, 1234n]
|
|
648
|
+
* assetReferences: [12345n]
|
|
649
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
650
|
+
* accessReferences: [{ appId: 1234n }]
|
|
651
|
+
* lease: 'lease',
|
|
652
|
+
* note: 'note',
|
|
653
|
+
* // You wouldn't normally set this field
|
|
654
|
+
* firstValidRound: 1000n,
|
|
655
|
+
* validityWindow: 10,
|
|
656
|
+
* extraFee: (1000).microAlgo(),
|
|
657
|
+
* staticFee: (1000).microAlgo(),
|
|
658
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
659
|
+
* // already specified, but here for completeness
|
|
660
|
+
* maxFee: (3000).microAlgo(),
|
|
661
|
+
* rejectVersion: 1,
|
|
662
|
+
*})
|
|
663
|
+
* ```
|
|
664
|
+
*/
|
|
665
|
+
addAppUpdateMethodCall(params: AppUpdateMethodCall): this;
|
|
666
|
+
/**
|
|
667
|
+
* Add an ABI method delete application call transaction to the transaction group.
|
|
668
|
+
*
|
|
669
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
670
|
+
* @param params The ABI delete method application call transaction parameters
|
|
671
|
+
* @returns The composer so you can chain method calls
|
|
672
|
+
* @example Basic example
|
|
673
|
+
* ```typescript
|
|
674
|
+
* const method = new ABIMethod({
|
|
675
|
+
* name: 'method',
|
|
676
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
677
|
+
* returns: { type: 'string' },
|
|
678
|
+
* })
|
|
679
|
+
* composer.addAppDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
680
|
+
* ```
|
|
681
|
+
* @example Advanced example
|
|
682
|
+
* ```typescript
|
|
683
|
+
* const method = new ABIMethod({
|
|
684
|
+
* name: 'method',
|
|
685
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
686
|
+
* returns: { type: 'string' },
|
|
687
|
+
* })
|
|
688
|
+
* composer.addAppDeleteMethodCall({
|
|
689
|
+
* sender: 'CREATORADDRESS',
|
|
690
|
+
* method: method,
|
|
691
|
+
* args: ["arg1_value"],
|
|
692
|
+
* onComplete: OnApplicationComplete.DeleteApplication,
|
|
693
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
694
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
695
|
+
* appReferences: [123n, 1234n]
|
|
696
|
+
* assetReferences: [12345n]
|
|
697
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
698
|
+
* accessReferences: [{ appId: 1234n }]
|
|
699
|
+
* lease: 'lease',
|
|
700
|
+
* note: 'note',
|
|
701
|
+
* // You wouldn't normally set this field
|
|
702
|
+
* firstValidRound: 1000n,
|
|
703
|
+
* validityWindow: 10,
|
|
704
|
+
* extraFee: (1000).microAlgo(),
|
|
705
|
+
* staticFee: (1000).microAlgo(),
|
|
706
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
707
|
+
* // already specified, but here for completeness
|
|
708
|
+
* maxFee: (3000).microAlgo(),
|
|
709
|
+
* rejectVersion: 1,
|
|
710
|
+
*})
|
|
711
|
+
* ```
|
|
712
|
+
*/
|
|
713
|
+
addAppDeleteMethodCall(params: AppDeleteMethodCall): this;
|
|
714
|
+
/**
|
|
715
|
+
* Add a non-create/non-update ABI method application call transaction to the transaction group.
|
|
716
|
+
*
|
|
717
|
+
* Note: we recommend using app clients to make it easier to make app calls.
|
|
718
|
+
* @param params The ABI method application call transaction parameters
|
|
719
|
+
* @returns The composer so you can chain method calls
|
|
720
|
+
* @example Basic example
|
|
721
|
+
* ```typescript
|
|
722
|
+
* const method = new ABIMethod({
|
|
723
|
+
* name: 'method',
|
|
724
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
725
|
+
* returns: { type: 'string' },
|
|
726
|
+
* })
|
|
727
|
+
* composer.addAppCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
728
|
+
* ```
|
|
729
|
+
* @example Advanced example
|
|
730
|
+
* ```typescript
|
|
731
|
+
* const method = new ABIMethod({
|
|
732
|
+
* name: 'method',
|
|
733
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
734
|
+
* returns: { type: 'string' },
|
|
735
|
+
* })
|
|
736
|
+
* composer.addAppCallMethodCall({
|
|
737
|
+
* sender: 'CREATORADDRESS',
|
|
738
|
+
* method: method,
|
|
739
|
+
* args: ["arg1_value"],
|
|
740
|
+
* onComplete: OnApplicationComplete.OptIn,
|
|
741
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
742
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
743
|
+
* appReferences: [123n, 1234n]
|
|
744
|
+
* assetReferences: [12345n]
|
|
745
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
746
|
+
* accessReferences: [{ appId: 1234n }]
|
|
747
|
+
* lease: 'lease',
|
|
748
|
+
* note: 'note',
|
|
749
|
+
* // You wouldn't normally set this field
|
|
750
|
+
* firstValidRound: 1000n,
|
|
751
|
+
* validityWindow: 10,
|
|
752
|
+
* extraFee: (1000).microAlgo(),
|
|
753
|
+
* staticFee: (1000).microAlgo(),
|
|
754
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
755
|
+
* // already specified, but here for completeness
|
|
756
|
+
* maxFee: (3000).microAlgo(),
|
|
757
|
+
* rejectVersion: 1,
|
|
758
|
+
*})
|
|
759
|
+
* ```
|
|
760
|
+
*/
|
|
761
|
+
addAppCallMethodCall(params: AppCallMethodCall): this;
|
|
762
|
+
/**
|
|
763
|
+
* Add an online key registration transaction to the transaction group.
|
|
764
|
+
* @param params The online key registration transaction parameters
|
|
765
|
+
* @returns The composer so you can chain method calls
|
|
766
|
+
* @example Basic example
|
|
767
|
+
* ```typescript
|
|
768
|
+
* composer.addOnlineKeyRegistration({
|
|
769
|
+
* sender: 'SENDERADDRESS',
|
|
770
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
771
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
772
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
773
|
+
* voteFirst: 1n,
|
|
774
|
+
* voteLast: 1000n,
|
|
775
|
+
* voteKeyDilution: 1n,
|
|
776
|
+
* })
|
|
777
|
+
* ```
|
|
778
|
+
* @example Advanced example
|
|
779
|
+
* ```typescript
|
|
780
|
+
* composer.addOnlineKeyRegistration({
|
|
781
|
+
* sender: 'SENDERADDRESS',
|
|
782
|
+
* voteKey: Uint8Array.from(Buffer.from("voteKeyBase64", 'base64')),
|
|
783
|
+
* selectionKey: Uint8Array.from(Buffer.from("selectionKeyBase64", 'base64')),
|
|
784
|
+
* stateProofKey: Uint8Array.from(Buffer.from("stateProofKeyBase64", 'base64')),
|
|
785
|
+
* voteFirst: 1n,
|
|
786
|
+
* voteLast: 1000n,
|
|
787
|
+
* voteKeyDilution: 1n,
|
|
788
|
+
* lease: 'lease',
|
|
789
|
+
* note: 'note',
|
|
790
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
791
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
792
|
+
* // You wouldn't normally set this field
|
|
793
|
+
* firstValidRound: 1000n,
|
|
794
|
+
* validityWindow: 10,
|
|
795
|
+
* extraFee: (1000).microAlgo(),
|
|
796
|
+
* staticFee: (1000).microAlgo(),
|
|
797
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
798
|
+
* // already specified, but here for completeness
|
|
799
|
+
* maxFee: (3000).microAlgo(),
|
|
800
|
+
* })
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
803
|
+
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): TransactionComposer;
|
|
804
|
+
/**
|
|
805
|
+
* Add an offline key registration transaction to the transaction group.
|
|
806
|
+
* @param params The offline key registration transaction parameters
|
|
807
|
+
* @returns The composer so you can chain method calls
|
|
808
|
+
* @example Basic example
|
|
809
|
+
* ```typescript
|
|
810
|
+
* composer.addOfflineKeyRegistration({
|
|
811
|
+
* sender: 'SENDERADDRESS',
|
|
812
|
+
* })
|
|
813
|
+
* ```
|
|
814
|
+
* @example Advanced example
|
|
815
|
+
* ```typescript
|
|
816
|
+
* composer.addOfflineKeyRegistration({
|
|
817
|
+
* sender: 'SENDERADDRESS',
|
|
818
|
+
* lease: 'lease',
|
|
819
|
+
* note: 'note',
|
|
820
|
+
* // Use this with caution, it's generally better to use algorand.account.rekeyAccount
|
|
821
|
+
* rekeyTo: 'REKEYTOADDRESS',
|
|
822
|
+
* // You wouldn't normally set this field
|
|
823
|
+
* firstValidRound: 1000n,
|
|
824
|
+
* validityWindow: 10,
|
|
825
|
+
* extraFee: (1000).microAlgo(),
|
|
826
|
+
* staticFee: (1000).microAlgo(),
|
|
827
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
828
|
+
* // already specified, but here for completeness
|
|
829
|
+
* maxFee: (3000).microAlgo(),
|
|
830
|
+
* })
|
|
831
|
+
* ```
|
|
832
|
+
*/
|
|
833
|
+
addOfflineKeyRegistration(params: OfflineKeyRegistrationParams): TransactionComposer;
|
|
834
|
+
/**
|
|
835
|
+
* Get the number of transactions currently added to this composer.
|
|
836
|
+
* @returns The number of transactions currently added to this composer
|
|
837
|
+
*/
|
|
838
|
+
count(): number;
|
|
839
|
+
/**
|
|
840
|
+
* Build the transaction composer.
|
|
841
|
+
*
|
|
842
|
+
* This method performs resource population and inner transaction fee coverage if these options are set in the composer.
|
|
843
|
+
*
|
|
844
|
+
* Once this method is called, no further transactions will be able to be added.
|
|
845
|
+
* You can safely call this method multiple times to get the same result.
|
|
846
|
+
* @returns The built transaction composer, the transactions and any corresponding method calls
|
|
847
|
+
* @example
|
|
848
|
+
* ```typescript
|
|
849
|
+
* const { transactions, methodCalls } = await composer.build()
|
|
850
|
+
* ```
|
|
851
|
+
*/
|
|
852
|
+
build(): Promise<{
|
|
853
|
+
transactions: TransactionWithSigner[];
|
|
854
|
+
methodCalls: Map<number, ABIMethod>;
|
|
855
|
+
}>;
|
|
856
|
+
private _buildTransactions;
|
|
857
|
+
/**
|
|
858
|
+
* Builds all transactions in the composer and returns them along with method calls and signers.
|
|
859
|
+
*
|
|
860
|
+
* Note: This method only builds the transactions as-is without resource population or automatic grouping.
|
|
861
|
+
* Use this when you need the raw transactions.
|
|
862
|
+
* @returns An object containing the array of built transactions, method calls, and signers
|
|
863
|
+
* @example
|
|
864
|
+
* ```typescript
|
|
865
|
+
* const { transactions, methodCalls, signers } = await composer.buildTransactions()
|
|
866
|
+
* ```
|
|
867
|
+
*/
|
|
868
|
+
buildTransactions(): Promise<BuiltTransactions>;
|
|
869
|
+
private populateTransactionAndGroupResources;
|
|
870
|
+
private analyzeGroupRequirements;
|
|
871
|
+
/**
|
|
872
|
+
* Rebuild the group, discarding any previously built transactions.
|
|
873
|
+
* This will potentially cause new signers and suggested params to be used if the callbacks return a new value compared to the first build.
|
|
874
|
+
* @returns The newly built transaction composer and the transactions
|
|
875
|
+
* @example
|
|
876
|
+
* ```typescript
|
|
877
|
+
* const { atc, transactions, methodCalls } = await composer.rebuild()
|
|
878
|
+
* ```
|
|
879
|
+
*/
|
|
880
|
+
rebuild(): Promise<{
|
|
881
|
+
transactions: TransactionWithSigner[];
|
|
882
|
+
methodCalls: Map<number, ABIMethod>;
|
|
883
|
+
}>;
|
|
884
|
+
private reset;
|
|
885
|
+
/**
|
|
886
|
+
* Compose the transaction group and send it to the network.
|
|
887
|
+
* @param params The parameters to control execution with
|
|
888
|
+
* @returns The execution result
|
|
889
|
+
* @example
|
|
890
|
+
* ```typescript
|
|
891
|
+
* const result = await composer.send()
|
|
892
|
+
* ```
|
|
893
|
+
*/
|
|
894
|
+
send(params?: SendParams): Promise<SendTransactionComposerResults>;
|
|
895
|
+
/**
|
|
896
|
+
* Compose the transaction group and simulate sending it to the network
|
|
897
|
+
* @returns The simulation result
|
|
898
|
+
* @example
|
|
899
|
+
* ```typescript
|
|
900
|
+
* const result = await composer.simulate()
|
|
901
|
+
* ```
|
|
902
|
+
*/
|
|
903
|
+
simulate(): Promise<SendTransactionComposerResults & {
|
|
904
|
+
simulateResponse: SimulateResponse;
|
|
905
|
+
}>;
|
|
906
|
+
/**
|
|
907
|
+
* Compose the transaction group and simulate sending it to the network
|
|
908
|
+
* @returns The simulation result
|
|
909
|
+
* @example
|
|
910
|
+
* ```typescript
|
|
911
|
+
* const result = await composer.simulate({
|
|
912
|
+
* skipSignatures: true,
|
|
913
|
+
* })
|
|
914
|
+
* ```
|
|
915
|
+
*/
|
|
916
|
+
simulate(options: SkipSignaturesSimulateOptions): Promise<SendTransactionComposerResults & {
|
|
917
|
+
simulateResponse: SimulateResponse;
|
|
918
|
+
}>;
|
|
919
|
+
/**
|
|
920
|
+
* Compose the transaction group and simulate sending it to the network
|
|
921
|
+
* @returns The simulation result
|
|
922
|
+
* @example
|
|
923
|
+
* ```typescript
|
|
924
|
+
* const result = await composer.simulate({
|
|
925
|
+
* extraOpcodeBudget: 1000,
|
|
926
|
+
* })
|
|
927
|
+
* ```
|
|
928
|
+
*/
|
|
929
|
+
simulate(options: RawSimulateOptions): Promise<SendTransactionComposerResults & {
|
|
930
|
+
simulateResponse: SimulateResponse;
|
|
931
|
+
}>;
|
|
932
|
+
/**
|
|
933
|
+
* Create an encoded transaction note that follows the ARC-2 spec.
|
|
934
|
+
*
|
|
935
|
+
* https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md
|
|
936
|
+
* @param note The ARC-2 transaction note data
|
|
937
|
+
* @returns The binary encoded transaction note
|
|
938
|
+
*/
|
|
939
|
+
static arc2Note(note: Arc2TransactionNote): Uint8Array;
|
|
940
|
+
gatherSignatures(): Promise<Uint8Array[]>;
|
|
941
|
+
private signTransactions;
|
|
942
|
+
private parseAbiReturnValues;
|
|
943
|
+
setMaxFees(maxFees: Map<number, AlgoAmount>): void;
|
|
944
|
+
}
|
|
945
|
+
//#endregion
|
|
946
|
+
export { type AppCallMethodCall, type AppCallParams, type AppCreateMethodCall, type AppCreateParams, type AppDeleteMethodCall, type AppDeleteParams, type AppMethodCall, type AppMethodCallParams, type AppMethodCallTransactionArgument, type AppUpdateMethodCall, type AppUpdateParams, type AssetConfigParams, type AssetCreateParams, type AssetDestroyParams, type AssetFreezeParams, type AssetOptInParams, type AssetOptOutParams, type AssetTransferParams, BuiltTransactions, type CommonAppCallParams, type CommonTransactionParams, ErrorTransformer, type OfflineKeyRegistrationParams, type OnlineKeyRegistrationParams, type PaymentParams, type ProcessedAppCallMethodCall, type ProcessedAppCreateMethodCall, type ProcessedAppUpdateMethodCall, RawSimulateOptions, SimulateOptions, SkipSignaturesSimulateOptions, TransactionComposer, TransactionComposerConfig, TransactionComposerParams };
|
|
947
|
+
//# sourceMappingURL=composer.d.ts.map
|