@algorandfoundation/algokit-utils 7.0.0-beta.2 → 7.0.0-beta.21
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 +3 -25
- package/account/account.d.ts +1 -2
- package/account/account.js +6 -4
- package/account/account.js.map +1 -1
- package/account/account.mjs +6 -4
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +0 -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.d.ts +0 -1
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +0 -1
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/index.d.ts +0 -1
- package/account/mnemonic-account.d.ts +0 -1
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +14 -5
- package/amount.js +6 -0
- package/amount.js.map +1 -1
- package/amount.mjs +6 -0
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +15 -1
- package/app-client.js +15 -0
- package/app-client.js.map +1 -1
- package/app-client.mjs +15 -0
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +0 -1
- package/app-deploy.js +4 -6
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +7 -9
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +10 -11
- package/app.js +15 -11
- package/app.js.map +1 -1
- package/app.mjs +15 -11
- package/app.mjs.map +1 -1
- package/asset.d.ts +3 -4
- package/asset.js +3 -6
- package/asset.js.map +1 -1
- package/asset.mjs +3 -6
- package/asset.mjs.map +1 -1
- package/config.d.ts +0 -1
- package/config.js.map +1 -1
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +3 -5
- package/debugging/debugging.js +4 -128
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +4 -109
- package/debugging/debugging.mjs.map +1 -1
- package/debugging/index.d.ts +0 -2
- package/dispenser-client.d.ts +0 -1
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +6 -5
- package/index.js +48 -38
- package/index.js.map +1 -1
- package/index.mjs +6 -5
- package/index.mjs.map +1 -1
- package/indexer-lookup.d.ts +0 -1
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +0 -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.d.ts +0 -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.d.ts +0 -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/index.d.ts +0 -1
- package/localnet/is-localnet.d.ts +0 -1
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +0 -1
- package/network-client.js.map +1 -1
- package/network-client.mjs.map +1 -1
- package/package.json +2 -2
- package/testing/_asset.d.ts +0 -1
- package/testing/account.d.ts +0 -1
- package/testing/account.js.map +1 -1
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -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 +0 -1
- package/testing/fixtures/algorand-fixture.js +1 -1
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/fixtures/index.d.ts +0 -1
- package/testing/index.d.ts +0 -1
- package/testing/indexer.d.ts +0 -1
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +0 -1
- package/testing/test-logger.js +1 -3
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +1 -3
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +0 -1
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/index.d.ts +0 -1
- package/transaction/legacy-bridge.d.ts +5 -6
- package/transaction/legacy-bridge.js +1 -1
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +4 -4
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +41 -6
- package/transaction/transaction.js +113 -61
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +113 -62
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/index.d.ts +0 -1
- package/transfer/transfer-algos.d.ts +1 -2
- package/transfer/transfer-algos.js +1 -1
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +1 -1
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +1 -2
- package/transfer/transfer.js +3 -3
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +3 -3
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +15 -7
- package/types/account-manager.js +27 -11
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +29 -13
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +9 -1
- package/types/account.js.map +1 -1
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +0 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-interface.d.ts +28 -0
- package/types/algorand-client-interface.js +3 -0
- package/types/algorand-client-interface.js.map +1 -0
- package/types/algorand-client-interface.mjs +2 -0
- package/types/algorand-client-interface.mjs.map +1 -0
- package/types/algorand-client-transaction-creator.d.ts +33 -34
- package/types/algorand-client-transaction-creator.js +31 -31
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +31 -31
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +31 -32
- package/types/algorand-client-transaction-sender.js +25 -9
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +25 -9
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +13 -13
- package/types/algorand-client.js +10 -10
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +12 -12
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +10 -11
- package/types/amount.js +7 -7
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +7 -7
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +359 -0
- package/types/app-arc56.js +184 -0
- package/types/app-arc56.js.map +1 -0
- package/types/app-arc56.mjs +175 -0
- package/types/app-arc56.mjs.map +1 -0
- package/types/app-client.d.ts +1494 -8
- package/types/app-client.js +1009 -19
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1009 -20
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +19 -14
- package/types/app-deployer.js +25 -25
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +27 -27
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +846 -0
- package/types/app-factory.js +409 -0
- package/types/app-factory.js.map +1 -0
- package/types/app-factory.mjs +407 -0
- package/types/app-factory.mjs.map +1 -0
- package/types/app-manager.d.ts +12 -3
- package/types/app-manager.js +13 -15
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +13 -15
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +2 -1
- package/types/app-spec.js +127 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +126 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +14 -9
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +7 -7
- package/types/asset-manager.js +5 -6
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +5 -6
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +0 -1
- package/types/async-event-emitter.d.ts +14 -0
- package/types/async-event-emitter.js +50 -0
- package/types/async-event-emitter.js.map +1 -0
- package/types/async-event-emitter.mjs +48 -0
- package/types/async-event-emitter.mjs.map +1 -0
- package/types/client-manager.d.ts +131 -51
- package/types/client-manager.js +143 -23
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +144 -24
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +110 -37
- package/types/composer.js +139 -26
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +140 -27
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +3 -6
- package/types/config.js +5 -44
- package/types/config.js.map +1 -1
- package/types/config.mjs +5 -27
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +29 -101
- package/types/debugging.js +16 -109
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -107
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +1 -2
- package/types/dispenser-client.js +6 -5
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +6 -5
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +0 -1
- package/types/indexer.d.ts +0 -1
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +0 -1
- package/types/kmd-account-manager.js +2 -2
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +4 -4
- 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.d.ts +0 -1
- package/types/logging.js.map +1 -1
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +2 -4
- 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 +13 -1
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +3 -4
- package/types/transaction.d.ts +14 -4
- package/types/transfer.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.js +1 -1
- package/types/urlTokenBaseHTTPClient.js.map +1 -1
- package/types/urlTokenBaseHTTPClient.mjs +1 -1
- package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
- package/util.d.ts +2 -2
- package/util.js +11 -10
- package/util.js.map +1 -1
- package/util.mjs +11 -10
- package/util.mjs.map +1 -1
- package/account/account.d.ts.map +0 -1
- package/account/get-account-config-from-environment.d.ts.map +0 -1
- package/account/get-account.d.ts.map +0 -1
- package/account/get-dispenser-account.d.ts.map +0 -1
- package/account/index.d.ts.map +0 -1
- package/account/mnemonic-account.d.ts.map +0 -1
- package/amount.d.ts.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app.d.ts.map +0 -1
- package/asset.d.ts.map +0 -1
- package/config.d.ts.map +0 -1
- package/debugging/debugging.d.ts.map +0 -1
- package/debugging/index.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.d.ts +0 -20
- package/debugging/simulate-and-persist-response.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.js +0 -108
- package/debugging/simulate-and-persist-response.js.map +0 -1
- package/debugging/simulate-and-persist-response.mjs +0 -89
- package/debugging/simulate-and-persist-response.mjs.map +0 -1
- package/dispenser-client.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/index.d.ts.map +0 -1
- package/localnet/is-localnet.d.ts.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/testing/_asset.d.ts.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
- package/testing/fixtures/index.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/indexer.d.ts.map +0 -1
- package/testing/test-logger.d.ts.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/transaction/index.d.ts.map +0 -1
- package/transaction/legacy-bridge.d.ts.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
- package/transaction/transaction.d.ts.map +0 -1
- package/transfer/index.d.ts.map +0 -1
- package/transfer/transfer-algos.d.ts.map +0 -1
- package/transfer/transfer.d.ts.map +0 -1
- package/types/account-manager.d.ts.map +0 -1
- package/types/account.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algorand-client-transaction-creator.d.ts.map +0 -1
- package/types/algorand-client-transaction-sender.d.ts.map +0 -1
- package/types/algorand-client.d.ts.map +0 -1
- package/types/amount.d.ts.map +0 -1
- package/types/app-client.d.ts.map +0 -1
- package/types/app-deployer.d.ts.map +0 -1
- package/types/app-manager.d.ts.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.d.ts.map +0 -1
- package/types/asset-manager.d.ts.map +0 -1
- package/types/asset.d.ts.map +0 -1
- package/types/client-manager.d.ts.map +0 -1
- package/types/composer.d.ts.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/debugging.d.ts.map +0 -1
- package/types/dispenser-client.d.ts.map +0 -1
- package/types/expand.d.ts.map +0 -1
- package/types/indexer.d.ts.map +0 -1
- package/types/kmd-account-manager.d.ts.map +0 -1
- package/types/logging.d.ts.map +0 -1
- package/types/logic-error.d.ts.map +0 -1
- package/types/network-client.d.ts.map +0 -1
- package/types/testing.d.ts.map +0 -1
- package/types/transaction.d.ts.map +0 -1
- package/types/transfer.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/util.d.ts.map +0 -1
|
@@ -2,8 +2,8 @@ import algosdk from 'algosdk';
|
|
|
2
2
|
import { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app';
|
|
3
3
|
import { AppManager } from './app-manager';
|
|
4
4
|
import { AssetManager } from './asset-manager';
|
|
5
|
-
import
|
|
6
|
-
import { SendSingleTransactionResult } from './transaction';
|
|
5
|
+
import TransactionComposer, { AssetCreateParams, AssetOptOutParams } from './composer';
|
|
6
|
+
import { SendParams, SendSingleTransactionResult } from './transaction';
|
|
7
7
|
/** Orchestrates sending transactions for `AlgorandClient`. */
|
|
8
8
|
export declare class AlgorandClientTransactionSender {
|
|
9
9
|
private _newGroup;
|
|
@@ -11,11 +11,11 @@ export declare class AlgorandClientTransactionSender {
|
|
|
11
11
|
private _appManager;
|
|
12
12
|
/**
|
|
13
13
|
* Creates a new `AlgorandClientSender`
|
|
14
|
-
* @param newGroup A lambda that starts a new `
|
|
14
|
+
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
15
15
|
* @param assetManager An `AssetManager` instance
|
|
16
16
|
*/
|
|
17
|
-
constructor(newGroup: () =>
|
|
18
|
-
newGroup():
|
|
17
|
+
constructor(newGroup: () => TransactionComposer, assetManager: AssetManager, appManager: AppManager);
|
|
18
|
+
newGroup(): TransactionComposer;
|
|
19
19
|
private _send;
|
|
20
20
|
private _sendAppCall;
|
|
21
21
|
private _sendAppUpdateCall;
|
|
@@ -65,7 +65,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
65
65
|
receiver: string;
|
|
66
66
|
amount: import("./amount").AlgoAmount;
|
|
67
67
|
closeRemainderTo?: string | undefined;
|
|
68
|
-
} &
|
|
68
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
69
69
|
/**
|
|
70
70
|
* Create a new Algorand Standard Asset.
|
|
71
71
|
*
|
|
@@ -113,7 +113,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
113
113
|
* ```
|
|
114
114
|
* @returns The result of the transaction and the transaction that was sent
|
|
115
115
|
*/
|
|
116
|
-
assetCreate: (params: AssetCreateParams &
|
|
116
|
+
assetCreate: (params: AssetCreateParams & SendParams) => Promise<{
|
|
117
117
|
assetId: bigint;
|
|
118
118
|
groupId: string;
|
|
119
119
|
txIds: string[];
|
|
@@ -171,7 +171,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
171
171
|
reserve?: string | undefined;
|
|
172
172
|
freeze?: string | undefined;
|
|
173
173
|
clawback?: string | undefined;
|
|
174
|
-
} &
|
|
174
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
175
175
|
/**
|
|
176
176
|
* Freeze or unfreeze an Algorand Standard Asset for an account.
|
|
177
177
|
*
|
|
@@ -212,7 +212,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
212
212
|
assetId: bigint;
|
|
213
213
|
account: string;
|
|
214
214
|
frozen: boolean;
|
|
215
|
-
} &
|
|
215
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
216
216
|
/**
|
|
217
217
|
* Destroys an Algorand Standard Asset.
|
|
218
218
|
*
|
|
@@ -253,7 +253,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
253
253
|
*/
|
|
254
254
|
assetDestroy: (params: import("./composer").CommonTransactionParams & {
|
|
255
255
|
assetId: bigint;
|
|
256
|
-
} &
|
|
256
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
257
257
|
/**
|
|
258
258
|
* Transfer an Algorand Standard Asset.
|
|
259
259
|
*
|
|
@@ -299,7 +299,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
299
299
|
receiver: string;
|
|
300
300
|
clawbackTarget?: string | undefined;
|
|
301
301
|
closeAssetTo?: string | undefined;
|
|
302
|
-
} &
|
|
302
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
303
303
|
/**
|
|
304
304
|
* Opt an account into an Algorand Standard Asset.
|
|
305
305
|
*
|
|
@@ -336,7 +336,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
336
336
|
*/
|
|
337
337
|
assetOptIn: (params: import("./composer").CommonTransactionParams & {
|
|
338
338
|
assetId: bigint;
|
|
339
|
-
} &
|
|
339
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
340
340
|
/**
|
|
341
341
|
* Opt an account out of an Algorand Standard Asset.
|
|
342
342
|
*
|
|
@@ -391,7 +391,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
391
391
|
* If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.
|
|
392
392
|
*/
|
|
393
393
|
ensureZeroBalance: boolean;
|
|
394
|
-
} &
|
|
394
|
+
} & SendParams) => Promise<{
|
|
395
395
|
groupId: string;
|
|
396
396
|
txIds: string[];
|
|
397
397
|
returns?: import("./app").ABIReturn[] | undefined;
|
|
@@ -476,7 +476,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
476
476
|
localByteSlices: number;
|
|
477
477
|
} | undefined;
|
|
478
478
|
extraProgramPages?: number | undefined;
|
|
479
|
-
} &
|
|
479
|
+
} & SendParams) => Promise<SendAppCreateTransactionResult>;
|
|
480
480
|
/**
|
|
481
481
|
* Update a smart contract.
|
|
482
482
|
*
|
|
@@ -539,7 +539,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
539
539
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
540
540
|
approvalProgram: string | Uint8Array;
|
|
541
541
|
clearStateProgram: string | Uint8Array;
|
|
542
|
-
} &
|
|
542
|
+
} & SendParams) => Promise<SendAppUpdateTransactionResult>;
|
|
543
543
|
/**
|
|
544
544
|
* Delete a smart contract.
|
|
545
545
|
*
|
|
@@ -589,7 +589,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
589
589
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
590
590
|
} & {
|
|
591
591
|
onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
|
|
592
|
-
} &
|
|
592
|
+
} & SendParams) => Promise<SendAppTransactionResult>;
|
|
593
593
|
/**
|
|
594
594
|
* Call a smart contract.
|
|
595
595
|
*
|
|
@@ -639,7 +639,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
639
639
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
640
640
|
} & {
|
|
641
641
|
onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.ClearStateOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
|
|
642
|
-
} &
|
|
642
|
+
} & SendParams) => Promise<SendAppTransactionResult>;
|
|
643
643
|
/**
|
|
644
644
|
* Create a smart contract via an ABI method.
|
|
645
645
|
*
|
|
@@ -729,7 +729,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
729
729
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
730
730
|
} & {
|
|
731
731
|
method: algosdk.ABIMethod;
|
|
732
|
-
args?: (algosdk.
|
|
732
|
+
args?: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
|
|
733
733
|
lease?: string | Uint8Array | undefined;
|
|
734
734
|
note?: string | Uint8Array | undefined;
|
|
735
735
|
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
@@ -777,8 +777,8 @@ export declare class AlgorandClientTransactionSender {
|
|
|
777
777
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
778
778
|
approvalProgram: string | Uint8Array;
|
|
779
779
|
clearStateProgram: string | Uint8Array;
|
|
780
|
-
}> | import("./composer").AppMethodCall<
|
|
781
|
-
} &
|
|
780
|
+
}> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
|
|
781
|
+
} & SendParams) => Promise<SendAppCreateTransactionResult>;
|
|
782
782
|
/**
|
|
783
783
|
* Update a smart contract via an ABI method.
|
|
784
784
|
*
|
|
@@ -854,7 +854,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
854
854
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
855
855
|
} & {
|
|
856
856
|
method: algosdk.ABIMethod;
|
|
857
|
-
args?: (algosdk.
|
|
857
|
+
args?: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
|
|
858
858
|
lease?: string | Uint8Array | undefined;
|
|
859
859
|
note?: string | Uint8Array | undefined;
|
|
860
860
|
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
@@ -902,8 +902,8 @@ export declare class AlgorandClientTransactionSender {
|
|
|
902
902
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
903
903
|
approvalProgram: string | Uint8Array;
|
|
904
904
|
clearStateProgram: string | Uint8Array;
|
|
905
|
-
}> | import("./composer").AppMethodCall<
|
|
906
|
-
} &
|
|
905
|
+
}> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
|
|
906
|
+
} & SendParams) => Promise<SendAppUpdateTransactionResult>;
|
|
907
907
|
/**
|
|
908
908
|
* Delete a smart contract via an ABI method.
|
|
909
909
|
*
|
|
@@ -975,7 +975,7 @@ export declare class AlgorandClientTransactionSender {
|
|
|
975
975
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
976
976
|
} & {
|
|
977
977
|
method: algosdk.ABIMethod;
|
|
978
|
-
args?: (algosdk.
|
|
978
|
+
args?: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
|
|
979
979
|
lease?: string | Uint8Array | undefined;
|
|
980
980
|
note?: string | Uint8Array | undefined;
|
|
981
981
|
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
@@ -1023,8 +1023,8 @@ export declare class AlgorandClientTransactionSender {
|
|
|
1023
1023
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
1024
1024
|
approvalProgram: string | Uint8Array;
|
|
1025
1025
|
clearStateProgram: string | Uint8Array;
|
|
1026
|
-
}> | import("./composer").AppMethodCall<
|
|
1027
|
-
} &
|
|
1026
|
+
}> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
|
|
1027
|
+
} & SendParams) => Promise<SendAppTransactionResult>;
|
|
1028
1028
|
/**
|
|
1029
1029
|
* Call a smart contract via an ABI method.
|
|
1030
1030
|
*
|
|
@@ -1089,14 +1089,14 @@ export declare class AlgorandClientTransactionSender {
|
|
|
1089
1089
|
validityWindow?: number | undefined;
|
|
1090
1090
|
firstValidRound?: bigint | undefined;
|
|
1091
1091
|
lastValidRound?: bigint | undefined;
|
|
1092
|
-
onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.
|
|
1092
|
+
onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
|
|
1093
1093
|
accountReferences?: string[] | undefined;
|
|
1094
1094
|
appReferences?: bigint[] | undefined;
|
|
1095
1095
|
assetReferences?: bigint[] | undefined;
|
|
1096
1096
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
1097
1097
|
} & {
|
|
1098
1098
|
method: algosdk.ABIMethod;
|
|
1099
|
-
args?: (algosdk.
|
|
1099
|
+
args?: (algosdk.Transaction | algosdk.ABIValue | algosdk.TransactionWithSigner | Promise<algosdk.Transaction> | import("./composer").AppMethodCall<{
|
|
1100
1100
|
lease?: string | Uint8Array | undefined;
|
|
1101
1101
|
note?: string | Uint8Array | undefined;
|
|
1102
1102
|
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
@@ -1144,8 +1144,8 @@ export declare class AlgorandClientTransactionSender {
|
|
|
1144
1144
|
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
1145
1145
|
approvalProgram: string | Uint8Array;
|
|
1146
1146
|
clearStateProgram: string | Uint8Array;
|
|
1147
|
-
}> | import("./composer").AppMethodCall<
|
|
1148
|
-
} &
|
|
1147
|
+
}> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
|
|
1148
|
+
} & SendParams) => Promise<SendAppTransactionResult>;
|
|
1149
1149
|
/** Register an online key. */
|
|
1150
1150
|
onlineKeyRegistration: (params: import("./composer").CommonTransactionParams & {
|
|
1151
1151
|
voteKey: Uint8Array;
|
|
@@ -1154,6 +1154,5 @@ export declare class AlgorandClientTransactionSender {
|
|
|
1154
1154
|
voteLast: bigint;
|
|
1155
1155
|
voteKeyDilution: bigint;
|
|
1156
1156
|
stateProofKey?: Uint8Array | undefined;
|
|
1157
|
-
} &
|
|
1157
|
+
} & SendParams) => Promise<SendSingleTransactionResult>;
|
|
1158
1158
|
}
|
|
1159
|
-
//# sourceMappingURL=algorand-client-transaction-sender.d.ts.map
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
|
+
var buffer = require('buffer');
|
|
4
5
|
var config = require('../config.js');
|
|
5
6
|
var types_appManager = require('./app-manager.js');
|
|
6
7
|
|
|
8
|
+
const getMethodCallForLog = ({ method, args }) => {
|
|
9
|
+
return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v)) : a))})`;
|
|
10
|
+
};
|
|
7
11
|
/** Orchestrates sending transactions for `AlgorandClient`. */
|
|
8
12
|
class AlgorandClientTransactionSender {
|
|
9
13
|
/**
|
|
10
14
|
* Creates a new `AlgorandClientSender`
|
|
11
|
-
* @param newGroup A lambda that starts a new `
|
|
15
|
+
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
12
16
|
* @param assetManager An `AssetManager` instance
|
|
13
17
|
*/
|
|
14
18
|
constructor(newGroup, assetManager, appManager) {
|
|
@@ -364,7 +368,7 @@ class AlgorandClientTransactionSender {
|
|
|
364
368
|
const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId);
|
|
365
369
|
balance = accountAssetInfo.balance;
|
|
366
370
|
}
|
|
367
|
-
catch
|
|
371
|
+
catch {
|
|
368
372
|
throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`);
|
|
369
373
|
}
|
|
370
374
|
if (balance !== 0n) {
|
|
@@ -469,7 +473,9 @@ class AlgorandClientTransactionSender {
|
|
|
469
473
|
*})
|
|
470
474
|
* ```
|
|
471
475
|
*/
|
|
472
|
-
this.appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate
|
|
476
|
+
this.appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {
|
|
477
|
+
postLog: (params, result) => `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
478
|
+
});
|
|
473
479
|
/**
|
|
474
480
|
* Delete a smart contract.
|
|
475
481
|
*
|
|
@@ -509,7 +515,9 @@ class AlgorandClientTransactionSender {
|
|
|
509
515
|
*})
|
|
510
516
|
* ```
|
|
511
517
|
*/
|
|
512
|
-
this.appDelete = this._sendAppCall((c) => c.addAppDelete
|
|
518
|
+
this.appDelete = this._sendAppCall((c) => c.addAppDelete, {
|
|
519
|
+
postLog: (params, result) => `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
520
|
+
});
|
|
513
521
|
/**
|
|
514
522
|
* Call a smart contract.
|
|
515
523
|
*
|
|
@@ -549,7 +557,9 @@ class AlgorandClientTransactionSender {
|
|
|
549
557
|
*})
|
|
550
558
|
* ```
|
|
551
559
|
*/
|
|
552
|
-
this.appCall = this._sendAppCall((c) => c.addAppCall
|
|
560
|
+
this.appCall = this._sendAppCall((c) => c.addAppCall, {
|
|
561
|
+
postLog: (params, result) => `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => buffer.Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
562
|
+
});
|
|
553
563
|
/**
|
|
554
564
|
* Create a smart contract via an ABI method.
|
|
555
565
|
*
|
|
@@ -667,7 +677,9 @@ class AlgorandClientTransactionSender {
|
|
|
667
677
|
*})
|
|
668
678
|
* ```
|
|
669
679
|
*/
|
|
670
|
-
this.appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall
|
|
680
|
+
this.appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {
|
|
681
|
+
postLog: (params, result) => `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
682
|
+
});
|
|
671
683
|
/**
|
|
672
684
|
* Delete a smart contract via an ABI method.
|
|
673
685
|
*
|
|
@@ -719,7 +731,9 @@ class AlgorandClientTransactionSender {
|
|
|
719
731
|
*})
|
|
720
732
|
* ```
|
|
721
733
|
*/
|
|
722
|
-
this.appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall
|
|
734
|
+
this.appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {
|
|
735
|
+
postLog: (params, result) => `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
736
|
+
});
|
|
723
737
|
/**
|
|
724
738
|
* Call a smart contract via an ABI method.
|
|
725
739
|
*
|
|
@@ -771,7 +785,9 @@ class AlgorandClientTransactionSender {
|
|
|
771
785
|
*})
|
|
772
786
|
* ```
|
|
773
787
|
*/
|
|
774
|
-
this.appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall
|
|
788
|
+
this.appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {
|
|
789
|
+
postLog: (params, result) => `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
790
|
+
});
|
|
775
791
|
/** Register an online key. */
|
|
776
792
|
this.onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {
|
|
777
793
|
preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,
|
|
@@ -792,7 +808,7 @@ class AlgorandClientTransactionSender {
|
|
|
792
808
|
const transaction = (await composer.build()).transactions.at(-1).txn;
|
|
793
809
|
config.Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction));
|
|
794
810
|
}
|
|
795
|
-
const rawResult = await composer.
|
|
811
|
+
const rawResult = await composer.send(params);
|
|
796
812
|
const result = {
|
|
797
813
|
// Last item covers when a group is created by an app call with ABI transaction parameters
|
|
798
814
|
transaction: rawResult.transactions.at(-1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algorand-client-transaction-sender.js","sources":["../../src/types/algorand-client-transaction-sender.ts"],"sourcesContent":[null],"names":["Config","AppManager"],"mappings":";;;;;;AAqBA;MACa,+BAA+B,CAAA;AAK1C;;;;AAIG;AACH,IAAA,WAAA,CAAY,QAA+B,EAAE,YAA0B,EAAE,UAAsB,EAAA;AA0G/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE;YACxC,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,KAC1B,CAAA,QAAA,EAAW,MAAM,CAAC,MAAM,CAAC,SAAS,CAAA,YAAA,EAAe,MAAM,CAAC,MAAM,CAAA,IAAA,EAAO,MAAM,CAAC,QAAQ,CAAA,iBAAA,EAAoB,WAAW,CAAC,IAAI,EAAE,CAAE,CAAA;AAC/H,SAAA,CAAC,CAAA;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,OAAO,MAAyC,KAAI;AAChE,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE;AACvD,gBAAA,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KACtB,CAAA,aAAA,EAAgB,MAAM,CAAC,SAAS,GAAG,CAAA,CAAA,EAAI,MAAM,CAAC,SAAS,CAAA,CAAE,GAAG,EAAE,CAAA,EAAG,MAAM,CAAC,QAAQ,GAAG,CAAA,EAAA,EAAK,MAAM,CAAC,QAAQ,CAAG,CAAA,CAAA,GAAG,E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,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;AAC5H,SAAC,CAAA;KACF;IAEO,kBAAkB,CACxB,CAAyD,EACzD,GAGC,EAAA;AAED,QAAA,OAAO,OAAO,MAAM,KAAI;AACtB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;YAEtD,MAAM,gBAAgB,GACpB,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;YACxH,MAAM,aAAa,GACjB,OAAO,MAAM,CAAC,iBAAiB,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;YAE5H,OAAO,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAA;AACvD,SAAC,CAAA;KACF;IAEO,kBAAkB,CACxB,CAAyD,EACzD,GAGC,EAAA;AAED,QAAA,OAAO,OAAO,MAAM,KAAI;AACtB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;YAE5D,OAAO;AACL,gBAAA,GAAG,MAAM;gBACT,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;gBACpD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;aACjF,CAAA;AACH,SAAC,CAAA;KACF;AAyxBF;;;;"}
|
|
1
|
+
{"version":3,"file":"algorand-client-transaction-sender.js","sources":["../../src/types/algorand-client-transaction-sender.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Buffer } from 'buffer'\nimport { Config } from '../config'\nimport { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app'\nimport { AppManager } from './app-manager'\nimport { AssetManager } from './asset-manager'\nimport TransactionComposer, {\n AppCallMethodCall,\n AppCallParams,\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n AssetCreateParams,\n AssetOptOutParams,\n} from './composer'\nimport { SendParams, SendSingleTransactionResult } from './transaction'\nimport Transaction = algosdk.Transaction\n\nconst getMethodCallForLog = ({ method, args }: { method: algosdk.ABIMethod; args?: unknown[] }) => {\n return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v)) : a))})`\n}\n\n/** Orchestrates sending transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionSender {\n private _newGroup: () => TransactionComposer\n private _assetManager: AssetManager\n private _appManager: AppManager\n\n /**\n * Creates a new `AlgorandClientSender`\n * @param newGroup A lambda that starts a new `TransactionComposer` transaction group\n * @param assetManager An `AssetManager` instance\n */\n constructor(newGroup: () => TransactionComposer, assetManager: AssetManager, appManager: AppManager) {\n this._newGroup = newGroup\n this._assetManager = assetManager\n this._appManager = appManager\n }\n\n newGroup() {\n return this._newGroup()\n }\n\n private _send<T>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendSingleTransactionResult> {\n return async (params) => {\n const composer = this._newGroup()\n\n // Ensure `this` is properly populated\n c(composer).apply(composer, [params])\n\n if (log?.preLog) {\n const transaction = (await composer.build()).transactions.at(-1)!.txn\n Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction))\n }\n\n const rawResult = await composer.send(params)\n const result = {\n // Last item covers when a group is created by an app call with ABI transaction parameters\n transaction: rawResult.transactions.at(-1)!,\n confirmation: rawResult.confirmations.at(-1)!,\n txId: rawResult.txIds.at(-1)!,\n ...rawResult,\n }\n\n if (log?.postLog) {\n Config.getLogger(params?.suppressLog).debug(log.postLog(params, result))\n }\n\n return result\n }\n }\n\n private _sendAppCall<\n T extends\n | AppCreateParams\n | AppUpdateParams\n | AppCallParams\n | AppDeleteParams\n | AppCreateMethodCall\n | AppUpdateMethodCall\n | AppCallMethodCall\n | AppDeleteMethodCall,\n >(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppTransactionResult> {\n return async (params) => {\n const result = await this._send(c, log)(params)\n\n return { ...result, return: AppManager.getABIReturn(result.confirmation, 'method' in params ? params.method : undefined) }\n }\n }\n\n private _sendAppUpdateCall<T extends AppCreateParams | AppUpdateParams | AppCreateMethodCall | AppUpdateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppUpdateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppCall(c, log)(params)\n\n const compiledApproval =\n typeof params.approvalProgram === 'string' ? this._appManager.getCompilationResult(params.approvalProgram) : undefined\n const compiledClear =\n typeof params.clearStateProgram === 'string' ? this._appManager.getCompilationResult(params.clearStateProgram) : undefined\n\n return { ...result, compiledApproval, compiledClear }\n }\n }\n\n private _sendAppCreateCall<T extends AppCreateParams | AppCreateMethodCall>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n log?: {\n preLog?: (params: T, transaction: Transaction) => string\n postLog?: (params: T, result: SendSingleTransactionResult) => string\n },\n ): (params: T & SendParams) => Promise<SendAppCreateTransactionResult> {\n return async (params) => {\n const result = await this._sendAppUpdateCall(c, log)(params)\n\n return {\n ...result,\n appId: BigInt(result.confirmation.applicationIndex!),\n appAddress: algosdk.getApplicationAddress(result.confirmation.applicationIndex!),\n }\n }\n }\n\n /**\n * Send a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n *\n * @returns The result of the transaction and the transaction that was sent\n */\n payment = this._send((c) => c.addPayment, {\n preLog: (params, transaction) =>\n `Sending ${params.amount.microAlgo} µALGO from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Create a new Algorand Standard Asset.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetCreate = async (params: AssetCreateParams & SendParams) => {\n const result = await this._send((c) => c.addAssetCreate, {\n postLog: (params, result) =>\n `Created asset${params.assetName ? ` ${params.assetName}` : ''}${params.unitName ? ` (${params.unitName})` : ''} with ${params.total} units and ${params.decimals ?? 0} decimals created by ${params.sender} with ID ${result.confirmation.assetIndex} via transaction ${result.txIds.at(-1)}`,\n })(params)\n return { ...result, assetId: BigInt(result.confirmation.assetIndex ?? 0) }\n }\n /**\n * Configure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetConfig = this._send((c) => c.addAssetConfig, {\n preLog: (params, transaction) => `Configuring asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Freeze or unfreeze an Algorand Standard Asset for an account.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetFreeze = this._send((c) => c.addAssetFreeze, {\n preLog: (params, transaction) => `Freezing asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Destroys an Algorand Standard Asset.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetDestroy = this._send((c) => c.addAssetDestroy, {\n preLog: (params, transaction) => `Destroying asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Transfer an Algorand Standard Asset.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.send.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetTransfer = this._send((c) => c.addAssetTransfer, {\n preLog: (params, transaction) =>\n `Transferring ${params.amount} units of asset with ID ${params.assetId} from ${params.sender} to ${params.receiver} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account into an Algorand Standard Asset.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.send.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptIn = this._send((c) => c.addAssetOptIn, {\n preLog: (params, transaction) => `Opting in ${params.sender} to asset with ID ${params.assetId} via transaction ${transaction.txID()}`,\n })\n /**\n * Opt an account out of an Algorand Standard Asset.\n *\n * *Note:* If the account has a balance of the asset,\n * it will not be able to opt-out unless `ensureZeroBalance`\n * is set to `false` (but then the account will lose the assets).\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example (without creator, will be retrieved from algod)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Basic example (with creator)\n * ```typescript\n * await algorand.send.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.assetOptOut({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n * })\n * ```\n * @returns The result of the transaction and the transaction that was sent\n */\n assetOptOut = async (\n params: Omit<AssetOptOutParams, 'creator'> & {\n /** Optional asset creator account address; if not specified it will be retrieved from algod */\n creator?: string\n /** Whether or not to check if the account has a zero balance first or not.\n *\n * If this is set to `true` and the account has an asset balance it will throw an error.\n *\n * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.\n */\n ensureZeroBalance: boolean\n } & SendParams,\n ) => {\n if (params.ensureZeroBalance) {\n let balance = 0n\n try {\n const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId)\n balance = accountAssetInfo.balance\n } catch {\n throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`)\n }\n if (balance !== 0n) {\n throw new Error(`Account ${params.sender} does not have a zero balance for Asset ${params.assetId}; can't opt-out.`)\n }\n }\n\n params.creator = params.creator ?? (await this._assetManager.getById(params.assetId)).creator\n\n return await this._send((c) => c.addAssetOptOut, {\n preLog: (params, transaction) =>\n `Opting ${params.sender} out of asset with ID ${params.assetId} to creator ${params.creator} via transaction ${transaction.txID()}`,\n })(params as AssetOptOutParams & SendParams)\n }\n /**\n * Create a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._sendAppCreateCall((c) => c.addAppCreate, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {\n postLog: (params, result) =>\n `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._sendAppCall((c) => c.addAppDelete, {\n postLog: (params, result) =>\n `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.send.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.send.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._sendAppCall((c) => c.addAppCall, {\n postLog: (params, result) =>\n `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Create a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.send.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._sendAppCreateCall((c) => c.addAppCreateMethodCall, {\n postLog: (params, result) =>\n `App created by ${params.sender} with ID ${result.confirmation.applicationIndex} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Update a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Delete a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /**\n * Call a smart contract via an ABI method.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.send.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {\n postLog: (params, result) =>\n `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,\n })\n\n /** Register an online key. */\n onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {\n preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,\n })\n}\n"],"names":["Buffer","Config","AppManager"],"mappings":";;;;;;;AAqBA,MAAM,mBAAmB,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAmD,KAAI;AAChG,IAAA,OAAO,CAAG,EAAA,MAAM,CAAC,IAAI,CAAI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MAAM,gBAAgB,GACpB,OAAO,MAAM,CAAC,eAAe,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,SAAS,CAAA;YACxH,MAAM,aAAa,GACjB,OAAO,MAAM,CAAC,iBAAiB,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;YAE5H,OAAO,EAAE,GAAG,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAA;AACvD,SAAC,CAAA;KACF;IAEO,kBAAkB,CACxB,CAAiE,EACjE,GAGC,EAAA;AAED,QAAA,OAAO,OAAO,MAAM,KAAI;AACtB,YAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;YAE5D,OAAO;AACL,gBAAA,GAAG,MAAM;gBACT,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;gBACpD,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAiB,CAAC;aACjF,CAAA;AACH,SAAC,CAAA;KACF;AA2yBF;;;;"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
2
3
|
import { Config } from '../config.mjs';
|
|
3
4
|
import { AppManager } from './app-manager.mjs';
|
|
4
5
|
|
|
6
|
+
const getMethodCallForLog = ({ method, args }) => {
|
|
7
|
+
return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v)) : a))})`;
|
|
8
|
+
};
|
|
5
9
|
/** Orchestrates sending transactions for `AlgorandClient`. */
|
|
6
10
|
class AlgorandClientTransactionSender {
|
|
7
11
|
/**
|
|
8
12
|
* Creates a new `AlgorandClientSender`
|
|
9
|
-
* @param newGroup A lambda that starts a new `
|
|
13
|
+
* @param newGroup A lambda that starts a new `TransactionComposer` transaction group
|
|
10
14
|
* @param assetManager An `AssetManager` instance
|
|
11
15
|
*/
|
|
12
16
|
constructor(newGroup, assetManager, appManager) {
|
|
@@ -362,7 +366,7 @@ class AlgorandClientTransactionSender {
|
|
|
362
366
|
const accountAssetInfo = await this._assetManager.getAccountInformation(params.sender, params.assetId);
|
|
363
367
|
balance = accountAssetInfo.balance;
|
|
364
368
|
}
|
|
365
|
-
catch
|
|
369
|
+
catch {
|
|
366
370
|
throw new Error(`Account ${params.sender} is not opted-in to Asset ${params.assetId}; can't opt-out.`);
|
|
367
371
|
}
|
|
368
372
|
if (balance !== 0n) {
|
|
@@ -467,7 +471,9 @@ class AlgorandClientTransactionSender {
|
|
|
467
471
|
*})
|
|
468
472
|
* ```
|
|
469
473
|
*/
|
|
470
|
-
this.appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate
|
|
474
|
+
this.appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, {
|
|
475
|
+
postLog: (params, result) => `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
476
|
+
});
|
|
471
477
|
/**
|
|
472
478
|
* Delete a smart contract.
|
|
473
479
|
*
|
|
@@ -507,7 +513,9 @@ class AlgorandClientTransactionSender {
|
|
|
507
513
|
*})
|
|
508
514
|
* ```
|
|
509
515
|
*/
|
|
510
|
-
this.appDelete = this._sendAppCall((c) => c.addAppDelete
|
|
516
|
+
this.appDelete = this._sendAppCall((c) => c.addAppDelete, {
|
|
517
|
+
postLog: (params, result) => `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
518
|
+
});
|
|
511
519
|
/**
|
|
512
520
|
* Call a smart contract.
|
|
513
521
|
*
|
|
@@ -547,7 +555,9 @@ class AlgorandClientTransactionSender {
|
|
|
547
555
|
*})
|
|
548
556
|
* ```
|
|
549
557
|
*/
|
|
550
|
-
this.appCall = this._sendAppCall((c) => c.addAppCall
|
|
558
|
+
this.appCall = this._sendAppCall((c) => c.addAppCall, {
|
|
559
|
+
postLog: (params, result) => `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
560
|
+
});
|
|
551
561
|
/**
|
|
552
562
|
* Create a smart contract via an ABI method.
|
|
553
563
|
*
|
|
@@ -665,7 +675,9 @@ class AlgorandClientTransactionSender {
|
|
|
665
675
|
*})
|
|
666
676
|
* ```
|
|
667
677
|
*/
|
|
668
|
-
this.appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall
|
|
678
|
+
this.appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, {
|
|
679
|
+
postLog: (params, result) => `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
680
|
+
});
|
|
669
681
|
/**
|
|
670
682
|
* Delete a smart contract via an ABI method.
|
|
671
683
|
*
|
|
@@ -717,7 +729,9 @@ class AlgorandClientTransactionSender {
|
|
|
717
729
|
*})
|
|
718
730
|
* ```
|
|
719
731
|
*/
|
|
720
|
-
this.appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall
|
|
732
|
+
this.appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, {
|
|
733
|
+
postLog: (params, result) => `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
734
|
+
});
|
|
721
735
|
/**
|
|
722
736
|
* Call a smart contract via an ABI method.
|
|
723
737
|
*
|
|
@@ -769,7 +783,9 @@ class AlgorandClientTransactionSender {
|
|
|
769
783
|
*})
|
|
770
784
|
* ```
|
|
771
785
|
*/
|
|
772
|
-
this.appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall
|
|
786
|
+
this.appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, {
|
|
787
|
+
postLog: (params, result) => `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`,
|
|
788
|
+
});
|
|
773
789
|
/** Register an online key. */
|
|
774
790
|
this.onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {
|
|
775
791
|
preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,
|
|
@@ -790,7 +806,7 @@ class AlgorandClientTransactionSender {
|
|
|
790
806
|
const transaction = (await composer.build()).transactions.at(-1).txn;
|
|
791
807
|
Config.getLogger(params?.suppressLog).debug(log.preLog(params, transaction));
|
|
792
808
|
}
|
|
793
|
-
const rawResult = await composer.
|
|
809
|
+
const rawResult = await composer.send(params);
|
|
794
810
|
const result = {
|
|
795
811
|
// Last item covers when a group is created by an app call with ABI transaction parameters
|
|
796
812
|
transaction: rawResult.transactions.at(-1),
|