signTransaction method
Create a signed transaction from a LogicSignature and transaction. LogicSignature must be valid and verifiable against transaction sender field.
Returns a signed transaction from a given logic signature.
Implementation
Future<SignedTransaction> signTransaction({
required RawTransaction transaction,
}) async {
final sender = transaction.sender;
if (sender == null) {
throw AlgorandException(message: 'No sender specified');
}
// Verify lsig
final verified = await verify(sender);
if (!verified) {
throw AlgorandException(message: 'Verification failed');
}
// Create the signed transaction with logic signature
final signedTransaction = SignedTransaction(
transaction: transaction,
logicSignature: this,
);
return signedTransaction;
}