From 16d435cac0b3a72cf47f6eab682a5a073082da01 Mon Sep 17 00:00:00 2001 From: Joe Polny Date: Tue, 27 Jun 2023 19:58:05 -0400 Subject: [PATCH] addMethodCall, addTransaction returns this --- src/composer.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/composer.ts b/src/composer.ts index 2e9f03e9b..555c2eb40 100644 --- a/src/composer.ts +++ b/src/composer.ts @@ -169,7 +169,9 @@ export class AtomicTransactionComposer { * An error will be thrown if the transaction has a nonzero group ID, the composer's status is * not BUILDING, or if adding this transaction causes the current group to exceed MAX_GROUP_SIZE. */ - addTransaction(txnAndSigner: TransactionWithSigner): void { + addTransaction( + txnAndSigner: TransactionWithSigner + ): AtomicTransactionComposer { if (this.status !== AtomicTransactionComposerStatus.BUILDING) { throw new Error( 'Cannot add transactions when composer status is not BUILDING' @@ -187,6 +189,8 @@ export class AtomicTransactionComposer { } this.transactions.push(txnAndSigner); + + return this; } /** @@ -261,7 +265,7 @@ export class AtomicTransactionComposer { rekeyTo?: string; /** A transaction signer that can authorize this application call from sender */ signer: TransactionSigner; - }): void { + }): AtomicTransactionComposer { if (this.status !== AtomicTransactionComposerStatus.BUILDING) { throw new Error( 'Cannot add transactions when composer status is not BUILDING' @@ -483,6 +487,8 @@ export class AtomicTransactionComposer { this.transactions.push(...txnArgs, appCall); this.methodCalls.set(this.transactions.length - 1, method); + + return this; } /**