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

    Function handleRelayerOperation

    • Universal handler for all relayer operations.

      This function processes both EIP-712 signed operations and direct operations, automatically routing to the appropriate SDK methods.

      Parameters

      Returns Promise<UnifiedRelayerResponse>

      Promise resolving to operation-specific response

      // In your server endpoint (Next.js example):
      import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';

      export async function POST(request: NextRequest) {
      try {
      const body = await request.json();
      const vana = getServerVanaInstance(); // Your server SDK instance

      // Explicit synchronous execution (Vana App model)
      const result = await handleRelayerOperation(vana, body, {
      execution: 'sync', // Explicit mode
      syncTimeout: 45000 // 45 second timeout
      });

      return NextResponse.json(result);
      } catch (error) {
      return NextResponse.json(
      { error: error.message },
      { status: 500 }
      );
      }
      }