• Returns a function that you can call to send a blockhash-based transaction to the network and to wait until it has been confirmed.

    Parameters

    • config: SendAndConfirmTransactionWithBlockhashLifetimeFactoryConfig<"devnet">

    Returns SendAndConfirmTransactionWithBlockhashLifetimeFunction

    import { isSolanaError, sendAndConfirmTransactionFactory, SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED } from '@solana/kit';

    const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });

    try {
    await sendAndConfirmTransaction(transaction, { commitment: 'confirmed' });
    } catch (e) {
    if (isSolanaError(e, SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED)) {
    console.error('This transaction depends on a blockhash that has expired');
    } else {
    throw e;
    }
    }
  • Parameters

    • __namedParameters: SendAndConfirmTransactionWithBlockhashLifetimeFactoryConfig<"testnet">

    Returns SendAndConfirmTransactionWithBlockhashLifetimeFunction

  • Parameters

    • __namedParameters: SendAndConfirmTransactionWithBlockhashLifetimeFactoryConfig<"mainnet">

    Returns SendAndConfirmTransactionWithBlockhashLifetimeFunction