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

    Parameters

    • config: SendAndConfirmDurableNonceTransactionFactoryConfig<"devnet">

    Returns SendAndConfirmDurableNonceTransactionFunction

    import {
    isSolanaError,
    sendAndConfirmDurableNonceTransactionFactory,
    SOLANA_ERROR__INVALID_NONCE,
    SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND,
    } from '@solana/kit';

    const sendAndConfirmNonceTransaction = sendAndConfirmDurableNonceTransactionFactory({ rpc, rpcSubscriptions });

    try {
    await sendAndConfirmNonceTransaction(transaction, { commitment: 'confirmed' });
    } catch (e) {
    if (isSolanaError(e, SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND)) {
    console.error(
    'The lifetime specified by this transaction refers to a nonce account ' +
    `\`${e.context.nonceAccountAddress}\` that does not exist`,
    );
    } else if (isSolanaError(e, SOLANA_ERROR__INVALID_NONCE)) {
    console.error('This transaction depends on a nonce that is no longer valid');
    } else {
    throw e;
    }
    }
  • Parameters

    • __namedParameters: SendAndConfirmDurableNonceTransactionFactoryConfig<"testnet">

    Returns SendAndConfirmDurableNonceTransactionFunction

  • Parameters

    • __namedParameters: SendAndConfirmDurableNonceTransactionFactoryConfig<"mainnet">

    Returns SendAndConfirmDurableNonceTransactionFunction