isSendableTransaction

function isSendableTransaction<TTransaction>(
    transaction,
): transaction is FullySignedTransaction &
    TransactionWithinSizeLimit &
    TTransaction;

Checks if a transaction has all the required conditions to be sent to the network.

Type Parameters

Type Parameter
TTransaction extends Readonly<{ messageBytes: TransactionMessageBytes; signatures: SignaturesMap; }>

Parameters

ParameterType
transactionTTransaction

Returns

transaction is FullySignedTransaction & TransactionWithinSizeLimit & TTransaction

Example

import { isSendableTransaction } from '@solana/transactions';
 
const transaction = getTransactionDecoder().decode(transactionBytes);
if (isSendableTransaction(transaction)) {
  // At this point we know that the transaction can be sent to the network.
}

See

assertIsSendableTransaction

On this page