@algorandfoundation/algokit-utils 10.0.0-alpha.25 → 10.0.0-alpha.27
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/packages/transact/src/logicsig.js +1 -0
- package/packages/transact/src/logicsig.js.map +1 -1
- package/packages/transact/src/logicsig.mjs +2 -1
- package/packages/transact/src/logicsig.mjs.map +1 -1
- package/packages/transact/src/multisig.js +4 -1
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +5 -2
- package/packages/transact/src/multisig.mjs.map +1 -1
- package/packages/transact/src/signer.js +5 -1
- package/packages/transact/src/signer.js.map +1 -1
- package/packages/transact/src/signer.mjs +6 -2
- package/packages/transact/src/signer.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +13 -13
- package/types/algorand-client-transaction-sender.d.ts +13 -13
- package/types/app-client.d.ts +34 -34
- package/types/app-factory.d.ts +17 -17
- package/types/composer.d.ts +2 -2
- package/types/composer.js +9 -12
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +10 -13
- package/types/composer.mjs.map +1 -1
package/types/app-factory.d.ts
CHANGED
|
@@ -246,7 +246,8 @@ declare class AppFactory {
|
|
|
246
246
|
sender: Address;
|
|
247
247
|
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
248
248
|
method: ABIMethod;
|
|
249
|
-
args: (Transaction |
|
|
249
|
+
args: (Transaction | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
250
|
+
args?: Uint8Array[] | undefined;
|
|
250
251
|
sender: SendingAddress;
|
|
251
252
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
252
253
|
rekeyTo?: ReadableAddress | undefined;
|
|
@@ -259,7 +260,6 @@ declare class AppFactory {
|
|
|
259
260
|
firstValidRound?: bigint | undefined;
|
|
260
261
|
lastValidRound?: bigint | undefined;
|
|
261
262
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication | undefined;
|
|
262
|
-
args?: Uint8Array[] | undefined;
|
|
263
263
|
accountReferences?: ReadableAddress[] | undefined;
|
|
264
264
|
appReferences?: bigint[] | undefined;
|
|
265
265
|
assetReferences?: bigint[] | undefined;
|
|
@@ -299,7 +299,7 @@ declare class AppFactory {
|
|
|
299
299
|
rejectVersion?: number | undefined;
|
|
300
300
|
approvalProgram: string | Uint8Array;
|
|
301
301
|
clearStateProgram: string | Uint8Array;
|
|
302
|
-
}> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
|
|
302
|
+
}> | AppMethodCall<AppMethodCallParams> | Promise<Transaction> | undefined)[] | undefined;
|
|
303
303
|
onComplete: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication;
|
|
304
304
|
}>;
|
|
305
305
|
/** Return params for a deployment update ABI call */
|
|
@@ -349,7 +349,8 @@ declare class AppFactory {
|
|
|
349
349
|
sender: Address;
|
|
350
350
|
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
351
351
|
method: ABIMethod;
|
|
352
|
-
args: (Transaction |
|
|
352
|
+
args: (Transaction | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
353
|
+
args?: Uint8Array[] | undefined;
|
|
353
354
|
sender: SendingAddress;
|
|
354
355
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
355
356
|
rekeyTo?: ReadableAddress | undefined;
|
|
@@ -362,7 +363,6 @@ declare class AppFactory {
|
|
|
362
363
|
firstValidRound?: bigint | undefined;
|
|
363
364
|
lastValidRound?: bigint | undefined;
|
|
364
365
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication | undefined;
|
|
365
|
-
args?: Uint8Array[] | undefined;
|
|
366
366
|
accountReferences?: ReadableAddress[] | undefined;
|
|
367
367
|
appReferences?: bigint[] | undefined;
|
|
368
368
|
assetReferences?: bigint[] | undefined;
|
|
@@ -402,7 +402,7 @@ declare class AppFactory {
|
|
|
402
402
|
rejectVersion?: number | undefined;
|
|
403
403
|
approvalProgram: string | Uint8Array;
|
|
404
404
|
clearStateProgram: string | Uint8Array;
|
|
405
|
-
}> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
|
|
405
|
+
}> | AppMethodCall<AppMethodCallParams> | Promise<Transaction> | undefined)[] | undefined;
|
|
406
406
|
onComplete: OnApplicationComplete.UpdateApplication;
|
|
407
407
|
};
|
|
408
408
|
/** Return params for a deployment delete ABI call */
|
|
@@ -452,7 +452,8 @@ declare class AppFactory {
|
|
|
452
452
|
sender: Address;
|
|
453
453
|
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
454
454
|
method: ABIMethod;
|
|
455
|
-
args: (Transaction |
|
|
455
|
+
args: (Transaction | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
456
|
+
args?: Uint8Array[] | undefined;
|
|
456
457
|
sender: SendingAddress;
|
|
457
458
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
458
459
|
rekeyTo?: ReadableAddress | undefined;
|
|
@@ -465,7 +466,6 @@ declare class AppFactory {
|
|
|
465
466
|
firstValidRound?: bigint | undefined;
|
|
466
467
|
lastValidRound?: bigint | undefined;
|
|
467
468
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication | undefined;
|
|
468
|
-
args?: Uint8Array[] | undefined;
|
|
469
469
|
accountReferences?: ReadableAddress[] | undefined;
|
|
470
470
|
appReferences?: bigint[] | undefined;
|
|
471
471
|
assetReferences?: bigint[] | undefined;
|
|
@@ -505,12 +505,13 @@ declare class AppFactory {
|
|
|
505
505
|
rejectVersion?: number | undefined;
|
|
506
506
|
approvalProgram: string | Uint8Array;
|
|
507
507
|
clearStateProgram: string | Uint8Array;
|
|
508
|
-
}> | AppMethodCall<AppMethodCallParams> | undefined)[] | undefined;
|
|
508
|
+
}> | AppMethodCall<AppMethodCallParams> | Promise<Transaction> | undefined)[] | undefined;
|
|
509
509
|
onComplete: OnApplicationComplete.DeleteApplication;
|
|
510
510
|
};
|
|
511
511
|
bare: {
|
|
512
512
|
/** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */
|
|
513
513
|
create: (params?: {
|
|
514
|
+
args?: Uint8Array[] | undefined;
|
|
514
515
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
515
516
|
rekeyTo?: ReadableAddress | undefined;
|
|
516
517
|
note?: string | Uint8Array | undefined;
|
|
@@ -521,7 +522,6 @@ declare class AppFactory {
|
|
|
521
522
|
validityWindow?: number | bigint | undefined;
|
|
522
523
|
firstValidRound?: bigint | undefined;
|
|
523
524
|
lastValidRound?: bigint | undefined;
|
|
524
|
-
args?: Uint8Array[] | undefined;
|
|
525
525
|
accountReferences?: ReadableAddress[] | undefined;
|
|
526
526
|
appReferences?: bigint[] | undefined;
|
|
527
527
|
assetReferences?: bigint[] | undefined;
|
|
@@ -560,6 +560,7 @@ declare class AppFactory {
|
|
|
560
560
|
/** The number of byte slices saved in local state. */
|
|
561
561
|
localByteSlices: number;
|
|
562
562
|
};
|
|
563
|
+
args?: Uint8Array[] | undefined;
|
|
563
564
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
564
565
|
rekeyTo?: ReadableAddress | undefined;
|
|
565
566
|
note?: string | Uint8Array | undefined;
|
|
@@ -570,7 +571,6 @@ declare class AppFactory {
|
|
|
570
571
|
validityWindow?: number | bigint | undefined;
|
|
571
572
|
firstValidRound?: bigint | undefined;
|
|
572
573
|
lastValidRound?: bigint | undefined;
|
|
573
|
-
args?: Uint8Array[] | undefined;
|
|
574
574
|
accountReferences?: ReadableAddress[] | undefined;
|
|
575
575
|
appReferences?: bigint[] | undefined;
|
|
576
576
|
assetReferences?: bigint[] | undefined;
|
|
@@ -589,6 +589,7 @@ declare class AppFactory {
|
|
|
589
589
|
}>;
|
|
590
590
|
/** Return params for a deployment update bare call */
|
|
591
591
|
deployUpdate: (params?: {
|
|
592
|
+
args?: Uint8Array[] | undefined;
|
|
592
593
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
593
594
|
rekeyTo?: ReadableAddress | undefined;
|
|
594
595
|
note?: string | Uint8Array | undefined;
|
|
@@ -599,7 +600,6 @@ declare class AppFactory {
|
|
|
599
600
|
validityWindow?: number | bigint | undefined;
|
|
600
601
|
firstValidRound?: bigint | undefined;
|
|
601
602
|
lastValidRound?: bigint | undefined;
|
|
602
|
-
args?: Uint8Array[] | undefined;
|
|
603
603
|
accountReferences?: ReadableAddress[] | undefined;
|
|
604
604
|
appReferences?: bigint[] | undefined;
|
|
605
605
|
assetReferences?: bigint[] | undefined;
|
|
@@ -608,6 +608,7 @@ declare class AppFactory {
|
|
|
608
608
|
rejectVersion?: number | undefined;
|
|
609
609
|
sender?: ReadableAddress | undefined;
|
|
610
610
|
} | undefined) => {
|
|
611
|
+
args?: Uint8Array[] | undefined;
|
|
611
612
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
612
613
|
rekeyTo?: ReadableAddress | undefined;
|
|
613
614
|
note?: string | Uint8Array | undefined;
|
|
@@ -618,7 +619,6 @@ declare class AppFactory {
|
|
|
618
619
|
validityWindow?: number | bigint | undefined;
|
|
619
620
|
firstValidRound?: bigint | undefined;
|
|
620
621
|
lastValidRound?: bigint | undefined;
|
|
621
|
-
args?: Uint8Array[] | undefined;
|
|
622
622
|
accountReferences?: ReadableAddress[] | undefined;
|
|
623
623
|
appReferences?: bigint[] | undefined;
|
|
624
624
|
assetReferences?: bigint[] | undefined;
|
|
@@ -633,6 +633,7 @@ declare class AppFactory {
|
|
|
633
633
|
};
|
|
634
634
|
/** Return params for a deployment delete bare call */
|
|
635
635
|
deployDelete: (params?: {
|
|
636
|
+
args?: Uint8Array[] | undefined;
|
|
636
637
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
637
638
|
rekeyTo?: ReadableAddress | undefined;
|
|
638
639
|
note?: string | Uint8Array | undefined;
|
|
@@ -643,7 +644,6 @@ declare class AppFactory {
|
|
|
643
644
|
validityWindow?: number | bigint | undefined;
|
|
644
645
|
firstValidRound?: bigint | undefined;
|
|
645
646
|
lastValidRound?: bigint | undefined;
|
|
646
|
-
args?: Uint8Array[] | undefined;
|
|
647
647
|
accountReferences?: ReadableAddress[] | undefined;
|
|
648
648
|
appReferences?: bigint[] | undefined;
|
|
649
649
|
assetReferences?: bigint[] | undefined;
|
|
@@ -652,6 +652,7 @@ declare class AppFactory {
|
|
|
652
652
|
rejectVersion?: number | undefined;
|
|
653
653
|
sender?: ReadableAddress | undefined;
|
|
654
654
|
} | undefined) => {
|
|
655
|
+
args?: Uint8Array[] | undefined;
|
|
655
656
|
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
656
657
|
rekeyTo?: ReadableAddress | undefined;
|
|
657
658
|
note?: string | Uint8Array | undefined;
|
|
@@ -662,7 +663,6 @@ declare class AppFactory {
|
|
|
662
663
|
validityWindow?: number | bigint | undefined;
|
|
663
664
|
firstValidRound?: bigint | undefined;
|
|
664
665
|
lastValidRound?: bigint | undefined;
|
|
665
|
-
args?: Uint8Array[] | undefined;
|
|
666
666
|
accountReferences?: ReadableAddress[] | undefined;
|
|
667
667
|
appReferences?: bigint[] | undefined;
|
|
668
668
|
assetReferences?: bigint[] | undefined;
|
|
@@ -802,7 +802,6 @@ declare class AppFactory {
|
|
|
802
802
|
compiledApproval?: CompiledTeal | undefined;
|
|
803
803
|
compiledClear?: CompiledTeal | undefined;
|
|
804
804
|
operationPerformed: "create";
|
|
805
|
-
version: string;
|
|
806
805
|
updatable?: boolean | undefined;
|
|
807
806
|
deletable?: boolean | undefined;
|
|
808
807
|
createdRound: bigint;
|
|
@@ -810,6 +809,7 @@ declare class AppFactory {
|
|
|
810
809
|
createdMetadata: AppDeployMetadata;
|
|
811
810
|
deleted: boolean;
|
|
812
811
|
name: string;
|
|
812
|
+
version: string;
|
|
813
813
|
groupId: string | undefined;
|
|
814
814
|
txIds: string[];
|
|
815
815
|
returns?: ABIReturn[] | undefined;
|
|
@@ -848,7 +848,6 @@ declare class AppFactory {
|
|
|
848
848
|
compiledApproval?: CompiledTeal | undefined;
|
|
849
849
|
compiledClear?: CompiledTeal | undefined;
|
|
850
850
|
operationPerformed: "replace";
|
|
851
|
-
version: string;
|
|
852
851
|
updatable?: boolean | undefined;
|
|
853
852
|
deletable?: boolean | undefined;
|
|
854
853
|
createdRound: bigint;
|
|
@@ -856,6 +855,7 @@ declare class AppFactory {
|
|
|
856
855
|
createdMetadata: AppDeployMetadata;
|
|
857
856
|
deleted: boolean;
|
|
858
857
|
name: string;
|
|
858
|
+
version: string;
|
|
859
859
|
groupId: string | undefined;
|
|
860
860
|
txIds: string[];
|
|
861
861
|
returns?: ABIReturn[] | undefined;
|
package/types/composer.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { ReadableAddress } from "../packages/common/src/address.js";
|
|
|
2
2
|
import { Expand } from "../packages/common/src/expand.js";
|
|
3
3
|
import { ABIMethod } from "../packages/abi/src/abi-method.js";
|
|
4
4
|
import { Transaction } from "../packages/transact/src/transactions/transaction.js";
|
|
5
|
-
import { SignedTransaction } from "../packages/transact/src/transactions/signed-transaction.js";
|
|
6
5
|
import { TransactionSigner } from "../packages/transact/src/signer.js";
|
|
7
6
|
import { SimulateRequest } from "../packages/algod_client/src/models/simulate-request.js";
|
|
8
7
|
import { SimulateResponse } from "../packages/algod_client/src/models/simulate-response.js";
|
|
@@ -21,6 +20,7 @@ import { Arc2TransactionNote, SendParams, SendTransactionComposerResults } from
|
|
|
21
20
|
import { TransactionWithSigner } from "../transaction/transaction.js";
|
|
22
21
|
|
|
23
22
|
//#region src/types/composer.d.ts
|
|
23
|
+
|
|
24
24
|
/** Options to control a simulate request, that does not require transaction signing */
|
|
25
25
|
type SkipSignaturesSimulateOptions = Expand<Omit<RawSimulateOptions, 'fixSigners' | 'allowEmptySignatures'> & {
|
|
26
26
|
/** Whether or not to skip signatures for all built transactions and use an empty signer instead.
|
|
@@ -937,7 +937,7 @@ declare class TransactionComposer {
|
|
|
937
937
|
* @returns The binary encoded transaction note
|
|
938
938
|
*/
|
|
939
939
|
static arc2Note(note: Arc2TransactionNote): Uint8Array;
|
|
940
|
-
gatherSignatures(): Promise<
|
|
940
|
+
gatherSignatures(): Promise<Uint8Array[]>;
|
|
941
941
|
private signTransactions;
|
|
942
942
|
private parseAbiReturnValues;
|
|
943
943
|
setMaxFees(maxFees: Map<number, AlgoAmount>): void;
|
package/types/composer.js
CHANGED
|
@@ -1397,15 +1397,14 @@ var TransactionComposer = class TransactionComposer {
|
|
|
1397
1397
|
},
|
|
1398
1398
|
resultOnFailure: true
|
|
1399
1399
|
});
|
|
1400
|
-
const group = this.
|
|
1400
|
+
const group = this.transactionsWithSigners[0].txn.group;
|
|
1401
1401
|
let waitRounds = params?.maxRoundsToWaitForConfirmation;
|
|
1402
1402
|
if (waitRounds === void 0) {
|
|
1403
1403
|
const firstRound = (await this.getSuggestedParams()).firstValid;
|
|
1404
|
-
const lastRound = this.
|
|
1404
|
+
const lastRound = this.transactionsWithSigners.reduce((max, txn) => txn.txn.lastValid > max ? txn.txn.lastValid : max, 0n);
|
|
1405
1405
|
waitRounds = Number(lastRound - firstRound) + 1;
|
|
1406
1406
|
}
|
|
1407
|
-
|
|
1408
|
-
await this.algod.sendRawTransaction(encodedTxns);
|
|
1407
|
+
await this.algod.sendRawTransaction(this.signedTransactions);
|
|
1409
1408
|
if (transactionsToSend.length > 1 && group) require_config.Config.getLogger(params?.suppressLog).verbose(`Group transaction (${buffer.Buffer.from(group).toString("base64")}) sent with ${transactionsToSend.length} transactions`);
|
|
1410
1409
|
else require_config.Config.getLogger(params?.suppressLog).verbose(`Sent transaction ID ${transactionsToSend[0].txId()} ${transactionsToSend[0].type} from ${transactionsToSend[0].sender}`);
|
|
1411
1410
|
let confirmations = new Array();
|
|
@@ -1433,7 +1432,7 @@ var TransactionComposer = class TransactionComposer {
|
|
|
1433
1432
|
txn,
|
|
1434
1433
|
signer: require_signer.makeEmptyTransactionSigner()
|
|
1435
1434
|
}));
|
|
1436
|
-
const signedTransactions = await this.signTransactions(transactionsWithEmptySigners);
|
|
1435
|
+
const signedTransactions = require_signed_transaction.decodeSignedTransactions(await this.signTransactions(transactionsWithEmptySigners));
|
|
1437
1436
|
const simulateResponse = await this.algod.simulateTransactions({
|
|
1438
1437
|
txnGroups: [{ txns: signedTransactions }],
|
|
1439
1438
|
allowEmptySignatures: true,
|
|
@@ -1478,7 +1477,7 @@ var TransactionComposer = class TransactionComposer {
|
|
|
1478
1477
|
}));
|
|
1479
1478
|
const transactions = transactionsWithSigner.map((e) => e.txn);
|
|
1480
1479
|
const simulateRequest = {
|
|
1481
|
-
txnGroups: [{ txns: await this.signTransactions(transactionsWithSigner) }],
|
|
1480
|
+
txnGroups: [{ txns: require_signed_transaction.decodeSignedTransactions(await this.signTransactions(transactionsWithSigner)) }],
|
|
1482
1481
|
...rawOptions,
|
|
1483
1482
|
...require_config.Config.debug ? {
|
|
1484
1483
|
allowEmptySignatures: true,
|
|
@@ -1540,18 +1539,16 @@ var TransactionComposer = class TransactionComposer {
|
|
|
1540
1539
|
});
|
|
1541
1540
|
const signerEntries = Array.from(signerGroups);
|
|
1542
1541
|
const signedGroups = await Promise.all(signerEntries.map(([signer, indexes]) => signer(transactions, indexes)));
|
|
1543
|
-
const
|
|
1542
|
+
const encodedSignedTransactions = new Array(transactionsWithSigners.length).fill(null);
|
|
1544
1543
|
signerEntries.forEach(([, indexes], signerIndex) => {
|
|
1545
1544
|
const stxs = signedGroups[signerIndex];
|
|
1546
1545
|
indexes.forEach((txIndex, stxIndex) => {
|
|
1547
|
-
|
|
1548
|
-
require_signed_transaction.validateSignedTransaction(stxn);
|
|
1549
|
-
signedTransactions[txIndex] = stxn;
|
|
1546
|
+
encodedSignedTransactions[txIndex] = stxs[stxIndex] ?? null;
|
|
1550
1547
|
});
|
|
1551
1548
|
});
|
|
1552
|
-
const unsignedIndexes =
|
|
1549
|
+
const unsignedIndexes = encodedSignedTransactions.map((stxn, index) => stxn == null ? index : null).filter((index) => index !== null);
|
|
1553
1550
|
if (unsignedIndexes.length > 0) throw new Error(`Transactions at indexes [${unsignedIndexes.join(", ")}] were not signed`);
|
|
1554
|
-
return
|
|
1551
|
+
return encodedSignedTransactions;
|
|
1555
1552
|
}
|
|
1556
1553
|
parseAbiReturnValues(confirmations) {
|
|
1557
1554
|
const abiReturns = new Array();
|