Skip to content

Commit 4baad78

Browse files
committed
Merge branch 'task/g112_sign_with_cosignatories' of github.com:rg911/nem2-sdk-typescript-javascript into task/g112_sign_with_cosignatories
2 parents 1249d54 + b59194f commit 4baad78

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/model/transaction/AggregateTransaction.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ export class AggregateTransaction extends Transaction {
161161
this.type, this.networkType);
162162
}
163163

164+
/**
165+
* @internal
166+
* Sign transaction with cosignatories collected from cosigned transactions and creating a new SignedTransaction
167+
* For off chain Aggregated Complete Transaction co-signing.
168+
* @param initiatorAccount - Initiator account
169+
* @param {CosignatureSignedTransaction[]} cosignatureSignedTransactions - Array of cosigned transaction
170+
* @return {SignedTransaction}
171+
*/
172+
public signTransactionGivenSignatures(initiatorAccount: Account,
173+
cosignatureSignedTransactions: CosignatureSignedTransaction[]) {
174+
const aggregateTransaction = this.buildTransaction();
175+
const signedTransactionRaw = aggregateTransaction.signTransactionGivenSignatures(initiatorAccount,
176+
cosignatureSignedTransactions);
177+
return new SignedTransaction(signedTransactionRaw.payload, signedTransactionRaw.hash, initiatorAccount.publicKey,
178+
this.type, this.networkType);
179+
}
180+
164181
/**
165182
* Check if account has signed transaction
166183
* @param publicAccount - Signer public account

0 commit comments

Comments
 (0)