getResolvedInstructionAccountAsTransactionSigner function
Extracts a transaction signer from a resolved instruction account.
This function validates that the resolved account is a transaction signer and returns it. Use this when you need the resolved account to be a signer.
Throws a SolanaError if the value is not a transaction signer.
Implementation
Object getResolvedInstructionAccountAsTransactionSigner(
String inputName,
Object? value,
) {
if (!_isResolvedInstructionAccountSigner(value)) {
throw SolanaError(
SolanaErrorCode.programClientsUnexpectedResolvedInstructionInputType,
{'expectedType': 'TransactionSigner', 'inputName': inputName},
);
}
return value!;
}