assertIsTransactionSigner

function assertIsTransactionSigner<TAddress, TValue>(
    value,
): asserts value is TransactionSigner<TAddress> & TValue;

Asserts that the provided value implements the TransactionSigner interface.

Type Parameters

Type ParameterDescription
TAddress extends stringThe inferred type of the address provided.
TValue extends object-

Parameters

ParameterType
valueTValue

Returns

asserts value is TransactionSigner<TAddress> & TValue

Example

import { Address } from '@solana/addresses';
import { assertIsTransactionSigner } from '@solana/signers';
 
const address = '1234..5678' as Address<'1234..5678'>;
assertIsTransactionSigner({ address, signTransactions: async () => {} }); // void
assertIsTransactionSigner({ address, modifyAndSignTransactions: async () => {} }); // void
assertIsTransactionSigner({ address, signAndSendTransactions: async () => {} }); // void
assertIsTransactionSigner({ address }); // Throws an error.

See

isTransactionSigner

On this page