getResolvedInstructionAccountAsTransactionSigner

function getResolvedInstructionAccountAsTransactionSigner<T>(
    inputName,
    value,
): TransactionSigner<T>;

Extracts a TransactionSigner from a resolved instruction account.

This function validates that the resolved account is a transaction signer — or an AccountSignerMeta carrying one — and returns the signer. Use this when you need the resolved account to be a signer.

Type Parameters

Type ParameterDefault typeDescription
T extends stringstringThe address type, defaults to string.

Parameters

ParameterTypeDescription
inputNamestringThe name of the instruction input, used in error messages.
value| InstructionAccountInput<T> | InstructionSignerInput<T> | null | undefinedThe resolved account value expected to be a signer.

Returns

TransactionSigner<T>

The transaction signer.

Throws

Throws a SolanaError if the value is not a TransactionSigner.

Example

const signer = getResolvedInstructionAccountAsTransactionSigner('authority', resolvedAuthority.value);

On this page