@algorandfoundation/algokit-utils 9.2.0 → 9.2.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/_rolldown/runtime.js +33 -0
- package/_virtual/_rolldown/runtime.mjs +13 -0
- package/account/account.d.ts +25 -30
- package/account/account.js +151 -146
- package/account/account.js.map +1 -1
- package/account/account.mjs +149 -144
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +7 -2
- package/account/get-account-config-from-environment.js +19 -21
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs +19 -19
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +14 -12
- package/account/get-account.js +56 -59
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +56 -57
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +9 -5
- package/account/get-dispenser-account.js +20 -18
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +20 -16
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/mnemonic-account.d.ts +7 -3
- package/account/mnemonic-account.js +17 -17
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +15 -15
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +40 -35
- package/amount.js +33 -34
- package/amount.js.map +1 -1
- package/amount.mjs +33 -32
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +10 -6
- package/app-client.js +91 -86
- package/app-client.js.map +1 -1
- package/app-client.mjs +91 -84
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +26 -24
- package/app-deploy.js +235 -253
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +233 -251
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +45 -46
- package/app.js +253 -271
- package/app.js.map +1 -1
- package/app.mjs +249 -267
- package/app.mjs.map +1 -1
- package/asset.d.ts +16 -12
- package/asset.js +116 -122
- package/asset.js.map +1 -1
- package/asset.mjs +116 -120
- package/asset.mjs.map +1 -1
- package/config.d.ts +7 -2
- package/config.js +5 -7
- package/config.js.map +1 -1
- package/config.mjs +5 -4
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +5 -1
- package/debugging/debugging.js +11 -11
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +11 -9
- package/debugging/debugging.mjs.map +1 -1
- package/dispenser-client.d.ts +7 -2
- package/dispenser-client.js +23 -24
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +23 -22
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +27 -18
- package/index.js +140 -143
- package/index.mjs +27 -29
- package/indexer-lookup.d.ts +18 -11
- package/indexer-lookup.js +112 -120
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs +105 -118
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +9 -7
- package/localnet/get-kmd-wallet-account.js +28 -26
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +28 -24
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +7 -5
- package/localnet/get-localnet-dispenser-account.js +17 -15
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +17 -13
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +10 -8
- package/localnet/get-or-create-kmd-wallet-account.js +28 -26
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +28 -24
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/is-localnet.d.ts +7 -3
- package/localnet/is-localnet.js +9 -10
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +9 -8
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +17 -15
- package/network-client.js +115 -116
- package/network-client.js.map +1 -1
- package/network-client.mjs +115 -114
- package/network-client.mjs.map +1 -1
- package/package.json +12 -3
- package/testing/account.d.ts +11 -9
- package/testing/account.js +31 -33
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +29 -31
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +7 -2
- package/testing/fixtures/algokit-log-capture-fixture.js +36 -41
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs +36 -39
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +9 -4
- package/testing/fixtures/algorand-fixture.js +67 -62
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +66 -59
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/index.d.ts +7 -5
- package/testing/index.js +13 -18
- package/testing/index.mjs +7 -7
- package/testing/indexer.d.ts +5 -1
- package/testing/indexer.js +28 -37
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs +28 -35
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +41 -36
- package/testing/test-logger.js +71 -76
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +71 -74
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +30 -27
- package/testing/transaction-logger.js +77 -93
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs +74 -90
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/legacy-bridge.js +100 -111
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +97 -108
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +7 -5
- package/transaction/perform-atomic-transaction-composer-simulate.js +31 -36
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +28 -33
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +34 -35
- package/transaction/transaction.js +716 -914
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +713 -911
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +9 -5
- package/transfer/transfer-algos.js +26 -27
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +26 -25
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +11 -8
- package/transfer/transfer.js +94 -100
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +94 -98
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +432 -429
- package/types/account-manager.js +591 -602
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +587 -599
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +192 -202
- package/types/account.js +91 -88
- package/types/account.js.map +1 -1
- package/types/account.mjs +88 -86
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +15 -10
- package/types/algo-http-client-with-retry.js +70 -92
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs +69 -90
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +778 -771
- package/types/algorand-client-transaction-creator.js +733 -732
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +732 -730
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +1090 -1360
- package/types/algorand-client-transaction-sender.js +930 -961
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +927 -959
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +239 -236
- package/types/algorand-client.js +322 -320
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +321 -318
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +47 -43
- package/types/amount.js +66 -70
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +63 -68
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +235 -272
- package/types/app-arc56.js +124 -170
- package/types/app-arc56.js.map +1 -1
- package/types/app-arc56.mjs +121 -168
- package/types/app-arc56.mjs.map +1 -1
- package/types/app-client.d.ts +1128 -2009
- package/types/app-client.js +1633 -1791
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1624 -1783
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +139 -141
- package/types/app-deployer.js +344 -384
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +341 -382
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +762 -932
- package/types/app-factory.js +496 -488
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs +491 -484
- package/types/app-factory.mjs.map +1 -1
- package/types/app-manager.d.ts +304 -310
- package/types/app-manager.js +422 -475
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +419 -473
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +118 -117
- package/types/app-spec.js +125 -135
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +121 -132
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +229 -241
- package/types/app.js +36 -28
- package/types/app.js.map +1 -1
- package/types/app.mjs +33 -26
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +204 -199
- package/types/asset-manager.js +165 -174
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +164 -172
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +95 -91
- package/types/asset.js +0 -3
- package/types/asset.mjs +0 -2
- package/types/async-event-emitter.d.ts +18 -13
- package/types/async-event-emitter.js +37 -49
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs +36 -47
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +453 -451
- package/types/client-manager.js +602 -598
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +597 -594
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1211 -1258
- package/types/composer.js +1436 -1498
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +1430 -1493
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +53 -48
- package/types/config.js +78 -77
- package/types/config.js.map +1 -1
- package/types/config.mjs +77 -75
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +25 -23
- package/types/debugging.js +9 -11
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +8 -9
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +57 -52
- package/types/dispenser-client.js +120 -141
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +119 -139
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +5 -3
- package/types/expand.js +0 -3
- package/types/expand.mjs +0 -2
- package/types/indexer.d.ts +104 -100
- package/types/indexer.js +36 -31
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs +32 -30
- package/types/indexer.mjs.map +1 -1
- package/types/instance-of.d.ts +5 -3
- package/types/instance-of.js +0 -3
- package/types/instance-of.mjs +0 -2
- package/types/kmd-account-manager.d.ts +75 -70
- package/types/kmd-account-manager.js +150 -184
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +147 -182
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +13 -8
- package/types/lifecycle-events.js +10 -7
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs +9 -7
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/logging.d.ts +15 -11
- package/types/logging.js +30 -31
- package/types/logging.js.map +1 -1
- package/types/logging.mjs +29 -29
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +33 -29
- package/types/logic-error.js +50 -49
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +49 -47
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +32 -27
- package/types/network-client.js +10 -9
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -7
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +131 -132
- package/types/testing.js +0 -3
- package/types/testing.mjs +0 -2
- package/types/transaction.d.ts +110 -110
- package/types/transaction.js +0 -3
- package/types/transaction.mjs +0 -2
- package/types/transfer.d.ts +70 -66
- package/types/transfer.js +0 -3
- package/types/transfer.mjs +0 -2
- package/util.js +73 -118
- package/util.js.map +1 -1
- package/util.mjs +73 -116
- package/util.mjs.map +1 -1
- package/account/index.d.ts +0 -5
- package/debugging/index.d.ts +0 -1
- package/index.js.map +0 -1
- package/index.mjs.map +0 -1
- package/localnet/index.d.ts +0 -4
- package/testing/_asset.d.ts +0 -3
- package/testing/fixtures/index.d.ts +0 -2
- package/testing/index.js.map +0 -1
- package/testing/index.mjs.map +0 -1
- package/transaction/index.d.ts +0 -2
- package/transaction/legacy-bridge.d.ts +0 -35
- package/transfer/index.d.ts +0 -2
- package/types/asset.js.map +0 -1
- package/types/asset.mjs.map +0 -1
- package/types/expand.js.map +0 -1
- package/types/expand.mjs.map +0 -1
- package/types/instance-of.js.map +0 -1
- package/types/instance-of.mjs.map +0 -1
- package/types/testing.js.map +0 -1
- package/types/testing.mjs.map +0 -1
- package/types/transaction.js.map +0 -1
- package/types/transaction.mjs.map +0 -1
- package/types/transfer.js.map +0 -1
- package/types/transfer.mjs.map +0 -1
- package/util.d.ts +0 -48
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var modelsv2 = algosdk.modelsv2;
|
|
1
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let algosdk = require("algosdk");
|
|
3
|
+
algosdk = require_runtime.__toESM(algosdk);
|
|
4
|
+
//#region src/transaction/perform-atomic-transaction-composer-simulate.ts
|
|
5
|
+
var modelsv2 = algosdk.default.modelsv2;
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
* Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.
|
|
8
|
+
* Uses empty transaction signers for all transactions.
|
|
9
|
+
*
|
|
10
|
+
* @param atc The AtomicTransactionComposer with transaction(s) loaded.
|
|
11
|
+
* @param algod An Algod client to perform the simulation.
|
|
12
|
+
* @returns The simulation result, which includes various details about how the transactions would be processed.
|
|
13
|
+
*/
|
|
14
14
|
async function performAtomicTransactionComposerSimulate(atc, algod, options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
txns: decodedSignedTransactions.map((txn) => algosdk.decodeMsgpack(txn, algosdk.SignedTransaction)),
|
|
32
|
-
}),
|
|
33
|
-
],
|
|
34
|
-
});
|
|
35
|
-
const simulateResult = await algod.simulateTransactions(simulateRequest).do();
|
|
36
|
-
return simulateResult;
|
|
15
|
+
const decodedSignedTransactions = atc.buildGroup().map((ts) => algosdk.default.encodeUnsignedSimulateTransaction(ts.txn));
|
|
16
|
+
const simulateRequest = new modelsv2.SimulateRequest({
|
|
17
|
+
...options ?? {
|
|
18
|
+
allowEmptySignatures: true,
|
|
19
|
+
fixSigners: true,
|
|
20
|
+
allowMoreLogging: true,
|
|
21
|
+
execTraceConfig: new modelsv2.SimulateTraceConfig({
|
|
22
|
+
enable: true,
|
|
23
|
+
scratchChange: true,
|
|
24
|
+
stackChange: true,
|
|
25
|
+
stateChange: true
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
txnGroups: [new modelsv2.SimulateRequestTransactionGroup({ txns: decodedSignedTransactions.map((txn) => (0, algosdk.decodeMsgpack)(txn, algosdk.SignedTransaction)) })]
|
|
29
|
+
});
|
|
30
|
+
return await algod.simulateTransactions(simulateRequest).do();
|
|
37
31
|
}
|
|
38
|
-
|
|
32
|
+
//#endregion
|
|
39
33
|
exports.performAtomicTransactionComposerSimulate = performAtomicTransactionComposerSimulate;
|
|
40
|
-
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=perform-atomic-transaction-composer-simulate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perform-atomic-transaction-composer-simulate.js","sources":["../../src/transaction/perform-atomic-transaction-composer-simulate.ts"],"sourcesContent":["import algosdk, { SignedTransaction, decodeMsgpack } from 'algosdk'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.\n * Uses empty transaction signers for all transactions.\n *\n * @param atc The AtomicTransactionComposer with transaction(s) loaded.\n * @param algod An Algod client to perform the simulation.\n * @returns The simulation result, which includes various details about how the transactions would be processed.\n */\nexport async function performAtomicTransactionComposerSimulate(\n atc: AtomicTransactionComposer,\n algod: Algodv2,\n options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>,\n) {\n const unsignedTransactionsSigners = atc.buildGroup()\n const decodedSignedTransactions = unsignedTransactionsSigners.map((ts) => algosdk.encodeUnsignedSimulateTransaction(ts.txn))\n\n const simulateRequest = new modelsv2.SimulateRequest({\n ...(options ?? {\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: new modelsv2.SimulateTraceConfig({\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n }),\n }),\n txnGroups: [\n new modelsv2.SimulateRequestTransactionGroup({\n txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)),\n }),\n ],\n })\n const simulateResult = await algod.simulateTransactions(simulateRequest).do()\n return simulateResult\n}\n"],"
|
|
1
|
+
{"version":3,"file":"perform-atomic-transaction-composer-simulate.js","names":["SignedTransaction"],"sources":["../../src/transaction/perform-atomic-transaction-composer-simulate.ts"],"sourcesContent":["import algosdk, { SignedTransaction, decodeMsgpack } from 'algosdk'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.\n * Uses empty transaction signers for all transactions.\n *\n * @param atc The AtomicTransactionComposer with transaction(s) loaded.\n * @param algod An Algod client to perform the simulation.\n * @returns The simulation result, which includes various details about how the transactions would be processed.\n */\nexport async function performAtomicTransactionComposerSimulate(\n atc: AtomicTransactionComposer,\n algod: Algodv2,\n options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>,\n) {\n const unsignedTransactionsSigners = atc.buildGroup()\n const decodedSignedTransactions = unsignedTransactionsSigners.map((ts) => algosdk.encodeUnsignedSimulateTransaction(ts.txn))\n\n const simulateRequest = new modelsv2.SimulateRequest({\n ...(options ?? {\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: new modelsv2.SimulateTraceConfig({\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n }),\n }),\n txnGroups: [\n new modelsv2.SimulateRequestTransactionGroup({\n txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)),\n }),\n ],\n })\n const simulateResult = await algod.simulateTransactions(simulateRequest).do()\n return simulateResult\n}\n"],"mappings":";;;;AAGO,IAAA,WAAW,QAAA,QAAQ;;;;;;;;;AAU1B,eAAsB,yCACpB,KACA,OACA,SACA;CAEA,MAAM,4BAD8B,IAAI,WACoB,CAAC,CAAC,KAAK,OAAO,QAAA,QAAQ,kCAAkC,GAAG,GAAG,CAAC;CAE3H,MAAM,kBAAkB,IAAI,SAAS,gBAAgB;EACnD,GAAI,WAAW;GACb,sBAAsB;GACtB,YAAY;GACZ,kBAAkB;GAClB,iBAAiB,IAAI,SAAS,oBAAoB;IAChD,QAAQ;IACR,eAAe;IACf,aAAa;IACb,aAAa;GACf,CAAC;EACH;EACA,WAAW,CACT,IAAI,SAAS,gCAAgC,EAC3C,MAAM,0BAA0B,KAAK,SAAA,GAAA,QAAA,cAAA,CAAsB,KAAKA,QAAAA,iBAAiB,CAAC,EACpF,CAAC,CACH;CACF,CAAC;CAED,OAAO,MADsB,MAAM,qBAAqB,eAAe,CAAC,CAAC,GAAG;AAE9E"}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
import algosdk, {
|
|
2
|
-
|
|
1
|
+
import algosdk, { SignedTransaction, decodeMsgpack } from "algosdk";
|
|
2
|
+
//#region src/transaction/perform-atomic-transaction-composer-simulate.ts
|
|
3
3
|
var modelsv2 = algosdk.modelsv2;
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
* Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.
|
|
6
|
+
* Uses empty transaction signers for all transactions.
|
|
7
|
+
*
|
|
8
|
+
* @param atc The AtomicTransactionComposer with transaction(s) loaded.
|
|
9
|
+
* @param algod An Algod client to perform the simulation.
|
|
10
|
+
* @returns The simulation result, which includes various details about how the transactions would be processed.
|
|
11
|
+
*/
|
|
12
12
|
async function performAtomicTransactionComposerSimulate(atc, algod, options) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)),
|
|
30
|
-
}),
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
|
-
const simulateResult = await algod.simulateTransactions(simulateRequest).do();
|
|
34
|
-
return simulateResult;
|
|
13
|
+
const decodedSignedTransactions = atc.buildGroup().map((ts) => algosdk.encodeUnsignedSimulateTransaction(ts.txn));
|
|
14
|
+
const simulateRequest = new modelsv2.SimulateRequest({
|
|
15
|
+
...options ?? {
|
|
16
|
+
allowEmptySignatures: true,
|
|
17
|
+
fixSigners: true,
|
|
18
|
+
allowMoreLogging: true,
|
|
19
|
+
execTraceConfig: new modelsv2.SimulateTraceConfig({
|
|
20
|
+
enable: true,
|
|
21
|
+
scratchChange: true,
|
|
22
|
+
stackChange: true,
|
|
23
|
+
stateChange: true
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
txnGroups: [new modelsv2.SimulateRequestTransactionGroup({ txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)) })]
|
|
27
|
+
});
|
|
28
|
+
return await algod.simulateTransactions(simulateRequest).do();
|
|
35
29
|
}
|
|
36
|
-
|
|
30
|
+
//#endregion
|
|
37
31
|
export { performAtomicTransactionComposerSimulate };
|
|
38
|
-
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=perform-atomic-transaction-composer-simulate.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perform-atomic-transaction-composer-simulate.mjs","sources":["../../src/transaction/perform-atomic-transaction-composer-simulate.ts"],"sourcesContent":["import algosdk, { SignedTransaction, decodeMsgpack } from 'algosdk'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.\n * Uses empty transaction signers for all transactions.\n *\n * @param atc The AtomicTransactionComposer with transaction(s) loaded.\n * @param algod An Algod client to perform the simulation.\n * @returns The simulation result, which includes various details about how the transactions would be processed.\n */\nexport async function performAtomicTransactionComposerSimulate(\n atc: AtomicTransactionComposer,\n algod: Algodv2,\n options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>,\n) {\n const unsignedTransactionsSigners = atc.buildGroup()\n const decodedSignedTransactions = unsignedTransactionsSigners.map((ts) => algosdk.encodeUnsignedSimulateTransaction(ts.txn))\n\n const simulateRequest = new modelsv2.SimulateRequest({\n ...(options ?? {\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: new modelsv2.SimulateTraceConfig({\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n }),\n }),\n txnGroups: [\n new modelsv2.SimulateRequestTransactionGroup({\n txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)),\n }),\n ],\n })\n const simulateResult = await algod.simulateTransactions(simulateRequest).do()\n return simulateResult\n}\n"],"
|
|
1
|
+
{"version":3,"file":"perform-atomic-transaction-composer-simulate.mjs","names":[],"sources":["../../src/transaction/perform-atomic-transaction-composer-simulate.ts"],"sourcesContent":["import algosdk, { SignedTransaction, decodeMsgpack } from 'algosdk'\nimport Algodv2 = algosdk.Algodv2\nimport AtomicTransactionComposer = algosdk.AtomicTransactionComposer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.\n * Uses empty transaction signers for all transactions.\n *\n * @param atc The AtomicTransactionComposer with transaction(s) loaded.\n * @param algod An Algod client to perform the simulation.\n * @returns The simulation result, which includes various details about how the transactions would be processed.\n */\nexport async function performAtomicTransactionComposerSimulate(\n atc: AtomicTransactionComposer,\n algod: Algodv2,\n options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>,\n) {\n const unsignedTransactionsSigners = atc.buildGroup()\n const decodedSignedTransactions = unsignedTransactionsSigners.map((ts) => algosdk.encodeUnsignedSimulateTransaction(ts.txn))\n\n const simulateRequest = new modelsv2.SimulateRequest({\n ...(options ?? {\n allowEmptySignatures: true,\n fixSigners: true,\n allowMoreLogging: true,\n execTraceConfig: new modelsv2.SimulateTraceConfig({\n enable: true,\n scratchChange: true,\n stackChange: true,\n stateChange: true,\n }),\n }),\n txnGroups: [\n new modelsv2.SimulateRequestTransactionGroup({\n txns: decodedSignedTransactions.map((txn) => decodeMsgpack(txn, SignedTransaction)),\n }),\n ],\n })\n const simulateResult = await algod.simulateTransactions(simulateRequest).do()\n return simulateResult\n}\n"],"mappings":";;AAGO,IAAA,WAAW,QAAQ;;;;;;;;;AAU1B,eAAsB,yCACpB,KACA,OACA,SACA;CAEA,MAAM,4BAD8B,IAAI,WACoB,CAAC,CAAC,KAAK,OAAO,QAAQ,kCAAkC,GAAG,GAAG,CAAC;CAE3H,MAAM,kBAAkB,IAAI,SAAS,gBAAgB;EACnD,GAAI,WAAW;GACb,sBAAsB;GACtB,YAAY;GACZ,kBAAkB;GAClB,iBAAiB,IAAI,SAAS,oBAAoB;IAChD,QAAQ;IACR,eAAe;IACf,aAAa;IACb,aAAa;GACf,CAAC;EACH;EACA,WAAW,CACT,IAAI,SAAS,gCAAgC,EAC3C,MAAM,0BAA0B,KAAK,QAAQ,cAAc,KAAK,iBAAiB,CAAC,EACpF,CAAC,CACH;CACF,CAAC;CAED,OAAO,MADsB,MAAM,qBAAqB,eAAe,CAAC,CAAC,GAAG;AAE9E"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import TransactionWithSigner = algosdk.TransactionWithSigner;
|
|
11
|
-
export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
|
|
12
|
-
export declare const MAX_APP_CALL_FOREIGN_REFERENCES = 8;
|
|
13
|
-
export declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
|
|
1
|
+
import { AlgoAmount } from "../types/amount.js";
|
|
2
|
+
import { ABIReturn } from "../types/app.js";
|
|
3
|
+
import { AdditionalAtomicTransactionComposerContext, AtomicTransactionComposerToSend, SendAtomicTransactionComposerResults, SendParams, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionGroupToSend, TransactionNote, TransactionToSign } from "../types/transaction.js";
|
|
4
|
+
import algosdk, { ABIReturnType } from "algosdk";
|
|
5
|
+
|
|
6
|
+
//#region src/transaction/transaction.d.ts
|
|
7
|
+
declare const MAX_TRANSACTION_GROUP_SIZE = 16;
|
|
8
|
+
declare const MAX_APP_CALL_FOREIGN_REFERENCES = 8;
|
|
9
|
+
declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
|
|
14
10
|
/**
|
|
15
11
|
* @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `TransactionComposer.arc2Note`.
|
|
16
12
|
*
|
|
@@ -26,7 +22,7 @@ export declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
|
|
|
26
22
|
* * Arc2TransactionNote object: ARC-0002 compatible transaction note
|
|
27
23
|
* * Else: The object/value converted into a JSON string representation
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
declare function encodeTransactionNote(note?: TransactionNote): Uint8Array | undefined;
|
|
30
26
|
/** Encodes a transaction lease into a 32-byte array ready to be included in an Algorand transaction.
|
|
31
27
|
*
|
|
32
28
|
* @param lease The transaction lease as a string or binary array or null/undefined if there is no lease
|
|
@@ -35,7 +31,7 @@ export declare function encodeTransactionNote(note?: TransactionNote): Uint8Arra
|
|
|
35
31
|
* @example algokit.encodeLease('UNIQUE_ID')
|
|
36
32
|
* @example algokit.encodeLease(new Uint8Array([1, 2, 3]))
|
|
37
33
|
*/
|
|
38
|
-
|
|
34
|
+
declare function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined;
|
|
39
35
|
/**
|
|
40
36
|
* @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address
|
|
41
37
|
* and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead.
|
|
@@ -44,7 +40,7 @@ export declare function encodeLease(lease?: string | Uint8Array): Uint8Array | u
|
|
|
44
40
|
* @param sender A transaction sender
|
|
45
41
|
* @returns The public address
|
|
46
42
|
*/
|
|
47
|
-
|
|
43
|
+
declare const getSenderAddress: (sender: string | SendTransactionFrom) => string;
|
|
48
44
|
/**
|
|
49
45
|
* @deprecated Use `AlgorandClient` / `TransactionComposer` to construct transactions instead or
|
|
50
46
|
* construct an `algosdk.TransactionWithSigner` manually instead.
|
|
@@ -58,7 +54,7 @@ export declare const getSenderAddress: (sender: string | SendTransactionFrom) =>
|
|
|
58
54
|
* include a signer.
|
|
59
55
|
* @returns A TransactionWithSigner object.
|
|
60
56
|
*/
|
|
61
|
-
|
|
57
|
+
declare const getTransactionWithSigner: (transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>, defaultSender?: SendTransactionFrom) => Promise<TransactionWithSigner>;
|
|
62
58
|
/**
|
|
63
59
|
* @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use
|
|
64
60
|
* `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`.
|
|
@@ -68,7 +64,7 @@ export declare const getTransactionWithSigner: (transaction: TransactionWithSign
|
|
|
68
64
|
* @param sender A transaction sender
|
|
69
65
|
* @returns A transaction signer
|
|
70
66
|
*/
|
|
71
|
-
|
|
67
|
+
declare const getSenderTransactionSigner: (val: SendTransactionFrom) => algosdk.TransactionSigner;
|
|
72
68
|
/**
|
|
73
69
|
* @deprecated Use `AlgorandClient` / `TransactionComposer` to sign transactions
|
|
74
70
|
* or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject`
|
|
@@ -79,7 +75,7 @@ export declare const getSenderTransactionSigner: (val: SendTransactionFrom) => a
|
|
|
79
75
|
* @param signer The signer to sign
|
|
80
76
|
* @returns The signed transaction as a `Uint8Array`
|
|
81
77
|
*/
|
|
82
|
-
|
|
78
|
+
declare const signTransaction: (transaction: Transaction, signer: SendTransactionFrom) => Promise<Uint8Array<ArrayBufferLike>>;
|
|
83
79
|
/**
|
|
84
80
|
* @deprecated Use `AlgorandClient` / `TransactionComposer` to send transactions.
|
|
85
81
|
*
|
|
@@ -93,10 +89,10 @@ export declare const signTransaction: (transaction: Transaction, signer: SendTra
|
|
|
93
89
|
*
|
|
94
90
|
* @returns An object with transaction (`transaction`) and (if `skipWaiting` is `false` or `undefined`) confirmation (`confirmation`)
|
|
95
91
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
declare const sendTransaction: (send: {
|
|
93
|
+
transaction: Transaction;
|
|
94
|
+
from: SendTransactionFrom;
|
|
95
|
+
sendParams?: SendTransactionParams;
|
|
100
96
|
}, algod: Algodv2) => Promise<SendTransactionResult>;
|
|
101
97
|
/**
|
|
102
98
|
* Take an existing Atomic Transaction Composer and return a new one with the required
|
|
@@ -115,7 +111,7 @@ export declare const sendTransaction: (send: {
|
|
|
115
111
|
* See https://github.com/algorand/go-algorand/pull/5684
|
|
116
112
|
*
|
|
117
113
|
*/
|
|
118
|
-
|
|
114
|
+
declare function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2): Promise<algosdk.AtomicTransactionComposer>;
|
|
119
115
|
/**
|
|
120
116
|
* Take an existing Atomic Transaction Composer and return a new one with changes applied to the transactions
|
|
121
117
|
* based on the supplied sendParams to prepare it for sending.
|
|
@@ -131,20 +127,20 @@ export declare function populateAppCallResources(atc: algosdk.AtomicTransactionC
|
|
|
131
127
|
* Parts of this function will eventually be implemented in algod. Namely:
|
|
132
128
|
* - Simulate will return information on how to populate reference arrays, see https://github.com/algorand/go-algorand/pull/6015
|
|
133
129
|
*/
|
|
134
|
-
|
|
130
|
+
declare function prepareGroupForSending(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2, sendParams: SendParams, additionalAtcContext?: AdditionalAtomicTransactionComposerContext): Promise<algosdk.AtomicTransactionComposer>;
|
|
135
131
|
/**
|
|
136
132
|
* Signs and sends transactions that have been collected by an `AtomicTransactionComposer`.
|
|
137
133
|
* @param atcSend The parameters controlling the send, including `atc` The `AtomicTransactionComposer` and params to control send behaviour
|
|
138
134
|
* @param algod An algod client
|
|
139
135
|
* @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)
|
|
140
136
|
*/
|
|
141
|
-
|
|
137
|
+
declare const sendAtomicTransactionComposer: (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) => Promise<SendAtomicTransactionComposerResults>;
|
|
142
138
|
/**
|
|
143
139
|
* Takes an algosdk `ABIResult` and converts it to an `ABIReturn`.
|
|
144
140
|
* Converts `bigint`'s for Uint's < 64 to `number` for easier use.
|
|
145
141
|
* @param result The `ABIReturn`
|
|
146
142
|
*/
|
|
147
|
-
|
|
143
|
+
declare function getABIReturnValue(result: algosdk.ABIResult, type: ABIReturnType): ABIReturn;
|
|
148
144
|
/**
|
|
149
145
|
* @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.
|
|
150
146
|
*
|
|
@@ -156,7 +152,7 @@ export declare function getABIReturnValue(result: algosdk.ABIResult, type: ABIRe
|
|
|
156
152
|
* @param algod An algod client
|
|
157
153
|
* @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)
|
|
158
154
|
*/
|
|
159
|
-
|
|
155
|
+
declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend, algod: Algodv2) => Promise<Omit<SendAtomicTransactionComposerResults, "returns">>;
|
|
160
156
|
/**
|
|
161
157
|
* Wait until the transaction is confirmed or rejected, or until `timeout`
|
|
162
158
|
* number of rounds have passed.
|
|
@@ -168,7 +164,7 @@ export declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend
|
|
|
168
164
|
* @return Pending transaction information
|
|
169
165
|
* @throws Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds
|
|
170
166
|
*/
|
|
171
|
-
|
|
167
|
+
declare const waitForConfirmation: (transactionId: string, maxRoundsToWait: number | bigint, algod: Algodv2) => Promise<modelsv2.PendingTransactionResponse>;
|
|
172
168
|
/**
|
|
173
169
|
* @deprecated Use `TransactionComposer` and the `maxFee` field in the transaction params instead.
|
|
174
170
|
*
|
|
@@ -178,7 +174,7 @@ export declare const waitForConfirmation: (transactionId: string, maxRoundsToWai
|
|
|
178
174
|
* @param transaction The transaction to cap or suggested params object about to be used to create a transaction
|
|
179
175
|
* @param maxAcceptableFee The maximum acceptable fee to pay
|
|
180
176
|
*/
|
|
181
|
-
|
|
177
|
+
declare function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount): void;
|
|
182
178
|
/**
|
|
183
179
|
* @deprecated Use `TransactionComposer` and the `maxFee` and `staticFee` fields in the transaction params instead.
|
|
184
180
|
*
|
|
@@ -186,9 +182,9 @@ export declare function capTransactionFee(transaction: algosdk.Transaction | Sug
|
|
|
186
182
|
* @param transaction The transaction or suggested params
|
|
187
183
|
* @param feeControl The fee control parameters
|
|
188
184
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
declare function controlFees<T extends SuggestedParams | Transaction>(transaction: T, feeControl: {
|
|
186
|
+
fee?: AlgoAmount;
|
|
187
|
+
maxFee?: AlgoAmount;
|
|
192
188
|
}): T;
|
|
193
189
|
/**
|
|
194
190
|
* @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead
|
|
@@ -198,7 +194,7 @@ export declare function controlFees<T extends SuggestedParams | Transaction>(tra
|
|
|
198
194
|
* @param algod Algod algod
|
|
199
195
|
* @returns The suggested transaction parameters
|
|
200
196
|
*/
|
|
201
|
-
|
|
197
|
+
declare function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams>;
|
|
202
198
|
/**
|
|
203
199
|
* @deprecated Use `atc.clone().buildGroup()` instead.
|
|
204
200
|
*
|
|
@@ -206,4 +202,7 @@ export declare function getTransactionParams(params: SuggestedParams | undefined
|
|
|
206
202
|
* @param atc The atomic transaction composer
|
|
207
203
|
* @returns The array of transactions with signers
|
|
208
204
|
*/
|
|
209
|
-
|
|
205
|
+
declare function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer): algosdk.TransactionWithSigner[];
|
|
206
|
+
//#endregion
|
|
207
|
+
export { MAX_APP_CALL_ACCOUNT_REFERENCES, MAX_APP_CALL_FOREIGN_REFERENCES, MAX_TRANSACTION_GROUP_SIZE, capTransactionFee, controlFees, encodeLease, encodeTransactionNote, getABIReturnValue, getAtomicTransactionComposerTransactions, getSenderAddress, getSenderTransactionSigner, getTransactionParams, getTransactionWithSigner, populateAppCallResources, prepareGroupForSending, sendAtomicTransactionComposer, sendGroupOfTransactions, sendTransaction, signTransaction, waitForConfirmation };
|
|
208
|
+
//# sourceMappingURL=transaction.d.ts.map
|