Vana SDK - v2.2.2
    Preparing search index...

    Class EnhancedTransactionResponse

    Enhanced transaction response that provides a fluent API for waiting.

    This class wraps a UnifiedRelayerResponse and provides a .wait() method that intelligently handles both submitted transactions (via hash) and pending operations (via operationId). It encapsulates the complexity of polling and event parsing, providing a clean developer experience.

    const response = await relayerClient.handleOperation(...);
    const enhanced = vana.enhanceRelayerResponse(response);
    if (enhanced) {
    const result = await enhanced.wait();
    console.log('Transaction confirmed:', result.hash);
    }
    Index

    Properties

    The underlying relayer response

    hash?: `0x${string}`

    The hash if this is a submitted transaction

    operationId?: string

    The operation ID if this is a pending operation

    context?: TransactionContext

    Transaction context for event parsing

    Methods

    • Waits for the transaction or operation to complete.

      Parameters

      • Optionaloptions: {
            onStatusUpdate?: (status: OperationStatus) => void;
            signal?: AbortSignal;
            timeout?: number;
        }

        Optional configuration for polling behavior

        • OptionalonStatusUpdate?: (status: OperationStatus) => void

          Callback for status updates during polling

        • Optionalsignal?: AbortSignal

          Abort signal for cancellation

        • Optionaltimeout?: number

          Timeout in milliseconds

      Returns Promise<any>

      Promise resolving to event results or transaction receipt

      This method provides intelligent handling based on the response type:

      • For 'submitted' responses with context: Uses waitForTransactionEvents for full event parsing
      • For 'submitted' responses without context: Waits for receipt only
      • For 'pending' responses: Uses PollingManager to track async operations
      • For 'confirmed' responses: Returns immediately with the receipt

      Error if the response type cannot be waited on

      // With context for event parsing
      const enhanced = new EnhancedTransactionResponse(response, vana);
      const result = await enhanced.wait();
      if (result.expectedEvents?.FileAdded) {
      console.log('File ID:', result.expectedEvents.FileAdded.fileId);
      }

      // For pending operations
      const result = await enhanced.wait({
      onStatusUpdate: (status) => console.log('Status:', status)
      });