@algorandfoundation/algokit-utils 9.2.0-beta.1 → 9.2.0-beta.11
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/package.json +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +3 -3
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/transaction/transaction.d.ts +1 -1
- package/transaction/transaction.js +27 -4
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +27 -4
- package/transaction/transaction.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +12 -2
- package/types/algorand-client-transaction-creator.js +8 -0
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +8 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +108 -16
- package/types/algorand-client-transaction-sender.js +8 -0
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +8 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/app-client.d.ts +74 -37
- package/types/app-deployer.js +3 -3
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +3 -3
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +36 -18
- package/types/app-manager.d.ts +11 -13
- package/types/app-manager.js +1 -26
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +3 -27
- package/types/app-manager.mjs.map +1 -1
- package/types/composer.d.ts +12 -2
- package/types/composer.js +39 -3
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +40 -4
- package/types/composer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +1 -0
- package/types/kmd-account-manager.js +33 -14
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +33 -14
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/testing.d.ts +2 -2
package/types/composer.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import algosdk, { Address } from 'algosdk';
|
|
|
2
2
|
import { Config } from '../config.mjs';
|
|
3
3
|
import { encodeLease, sendAtomicTransactionComposer, getABIReturnValue } from '../transaction/transaction.mjs';
|
|
4
4
|
import { calculateExtraProgramPages, asJson } from '../util.mjs';
|
|
5
|
-
import { AppManager
|
|
5
|
+
import { AppManager } from './app-manager.mjs';
|
|
6
6
|
import { EventType } from './lifecycle-events.mjs';
|
|
7
7
|
import { genesisIdIsLocalNet } from './network-client.mjs';
|
|
8
8
|
|
|
@@ -410,6 +410,7 @@ class TransactionComposer {
|
|
|
410
410
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
411
411
|
* // already specified, but here for completeness
|
|
412
412
|
* maxFee: (3000).microAlgo(),
|
|
413
|
+
* rejectVersion: 1,
|
|
413
414
|
* // Signer only needed if you want to provide one,
|
|
414
415
|
* // generally you'd register it with AlgorandClient
|
|
415
416
|
* // against the sender and not need to pass it in
|
|
@@ -456,6 +457,7 @@ class TransactionComposer {
|
|
|
456
457
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
457
458
|
* // already specified, but here for completeness
|
|
458
459
|
* maxFee: (3000).microAlgo(),
|
|
460
|
+
* rejectVersion: 1,
|
|
459
461
|
*})
|
|
460
462
|
* ```
|
|
461
463
|
*/
|
|
@@ -494,6 +496,7 @@ class TransactionComposer {
|
|
|
494
496
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
495
497
|
* // already specified, but here for completeness
|
|
496
498
|
* maxFee: (3000).microAlgo(),
|
|
499
|
+
* rejectVersion: 1,
|
|
497
500
|
*})
|
|
498
501
|
* ```
|
|
499
502
|
*/
|
|
@@ -534,6 +537,7 @@ class TransactionComposer {
|
|
|
534
537
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
535
538
|
* // already specified, but here for completeness
|
|
536
539
|
* maxFee: (3000).microAlgo(),
|
|
540
|
+
* rejectVersion: 1,
|
|
537
541
|
*})
|
|
538
542
|
* ```
|
|
539
543
|
*/
|
|
@@ -593,6 +597,7 @@ class TransactionComposer {
|
|
|
593
597
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
594
598
|
* // already specified, but here for completeness
|
|
595
599
|
* maxFee: (3000).microAlgo(),
|
|
600
|
+
* rejectVersion: 1,
|
|
596
601
|
*})
|
|
597
602
|
* ```
|
|
598
603
|
*/
|
|
@@ -645,6 +650,7 @@ class TransactionComposer {
|
|
|
645
650
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
646
651
|
* // already specified, but here for completeness
|
|
647
652
|
* maxFee: (3000).microAlgo(),
|
|
653
|
+
* rejectVersion: 1,
|
|
648
654
|
*})
|
|
649
655
|
* ```
|
|
650
656
|
*/
|
|
@@ -695,6 +701,7 @@ class TransactionComposer {
|
|
|
695
701
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
696
702
|
* // already specified, but here for completeness
|
|
697
703
|
* maxFee: (3000).microAlgo(),
|
|
704
|
+
* rejectVersion: 1,
|
|
698
705
|
*})
|
|
699
706
|
* ```
|
|
700
707
|
*/
|
|
@@ -745,6 +752,7 @@ class TransactionComposer {
|
|
|
745
752
|
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
746
753
|
* // already specified, but here for completeness
|
|
747
754
|
* maxFee: (3000).microAlgo(),
|
|
755
|
+
* rejectVersion: 1,
|
|
748
756
|
*})
|
|
749
757
|
* ```
|
|
750
758
|
*/
|
|
@@ -1018,7 +1026,7 @@ class TransactionComposer {
|
|
|
1018
1026
|
appForeignApps: params.appReferences?.map((x) => Number(x)),
|
|
1019
1027
|
appForeignAssets: params.assetReferences?.map((x) => Number(x)),
|
|
1020
1028
|
boxes: params.boxReferences?.map(AppManager.getBoxReference),
|
|
1021
|
-
access: params.accessReferences?.map(
|
|
1029
|
+
access: params.accessReferences?.map(getResourceReference),
|
|
1022
1030
|
approvalProgram,
|
|
1023
1031
|
clearProgram: clearStateProgram,
|
|
1024
1032
|
extraPages: appId === 0
|
|
@@ -1049,6 +1057,7 @@ class TransactionComposer {
|
|
|
1049
1057
|
return arg;
|
|
1050
1058
|
})
|
|
1051
1059
|
.reverse(),
|
|
1060
|
+
rejectVersion: params.rejectVersion,
|
|
1052
1061
|
// note, lease, and rekeyTo are set in the common build step
|
|
1053
1062
|
note: undefined,
|
|
1054
1063
|
lease: undefined,
|
|
@@ -1158,9 +1167,10 @@ class TransactionComposer {
|
|
|
1158
1167
|
foreignApps: params.appReferences?.map((x) => Number(x)),
|
|
1159
1168
|
foreignAssets: params.assetReferences?.map((x) => Number(x)),
|
|
1160
1169
|
boxes: params.boxReferences?.map(AppManager.getBoxReference),
|
|
1161
|
-
access: params.accessReferences?.map(
|
|
1170
|
+
access: params.accessReferences?.map(getResourceReference),
|
|
1162
1171
|
approvalProgram,
|
|
1163
1172
|
clearProgram: clearStateProgram,
|
|
1173
|
+
rejectVersion: params.rejectVersion,
|
|
1164
1174
|
};
|
|
1165
1175
|
if (appId === 0n) {
|
|
1166
1176
|
if (sdkParams.approvalProgram === undefined || sdkParams.clearProgram === undefined) {
|
|
@@ -1330,7 +1340,8 @@ class TransactionComposer {
|
|
|
1330
1340
|
});
|
|
1331
1341
|
this.atc['methodCalls'] = methodCalls;
|
|
1332
1342
|
}
|
|
1333
|
-
|
|
1343
|
+
const transactions = this.atc.buildGroup();
|
|
1344
|
+
return { atc: this.atc, transactions, methodCalls: this.atc['methodCalls'] };
|
|
1334
1345
|
}
|
|
1335
1346
|
/**
|
|
1336
1347
|
* Rebuild the group, discarding any previously built transactions.
|
|
@@ -1467,6 +1478,31 @@ class TransactionComposer {
|
|
|
1467
1478
|
}
|
|
1468
1479
|
/** Signer used to represent a lack of signer */
|
|
1469
1480
|
TransactionComposer.NULL_SIGNER = algosdk.makeEmptyTransactionSigner();
|
|
1481
|
+
/**
|
|
1482
|
+
* Returns an `algosdk.TransactionResourceReference` given a `ResourceReference`.
|
|
1483
|
+
*/
|
|
1484
|
+
function getResourceReference(accessReference) {
|
|
1485
|
+
return {
|
|
1486
|
+
address: typeof accessReference.address === 'string' ? Address.fromString(accessReference.address) : accessReference.address,
|
|
1487
|
+
appIndex: accessReference.appId,
|
|
1488
|
+
assetIndex: accessReference.assetId,
|
|
1489
|
+
holding: accessReference.holding ? getHoldingReference(accessReference.holding) : undefined,
|
|
1490
|
+
locals: accessReference.locals ? getLocalsReference(accessReference.locals) : undefined,
|
|
1491
|
+
box: accessReference.box ? AppManager.getBoxReference(accessReference.box) : undefined,
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
function getHoldingReference(holdingReference) {
|
|
1495
|
+
return {
|
|
1496
|
+
assetIndex: holdingReference.assetId,
|
|
1497
|
+
address: typeof holdingReference.address === 'string' ? Address.fromString(holdingReference.address) : holdingReference.address,
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
function getLocalsReference(localsReference) {
|
|
1501
|
+
return {
|
|
1502
|
+
appIndex: localsReference.appId,
|
|
1503
|
+
address: typeof localsReference.address === 'string' ? Address.fromString(localsReference.address) : localsReference.address,
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1470
1506
|
|
|
1471
1507
|
export { MAX_TRANSACTION_GROUP_SIZE, TransactionComposer };
|
|
1472
1508
|
//# sourceMappingURL=composer.mjs.map
|