HTTP Example

The TX Stream API is designed for gRPC streaming and does not have direct HTTP endpoints. For HTTP-based integrations, use the existing NextBlock HTTP API endpoints.

Overview

Since the TX Stream API is gRPC-only, for HTTP-based trading bot integrations you should:

  1. Use the gRPC TX Stream API (recommended for real-time trading bot monitoring)

  2. Use existing HTTP API endpoints for transaction submission and tip floor monitoring

Recommendation

For trading bot applications that need fast transaction detection for sniping new DEX launches, the gRPC TX Stream API is strongly recommended due to its real-time streaming capabilities.

For trading bot transaction monitoring, use the gRPC TX Stream API with any of the language examples:

HTTP API Integration

You can use the existing NextBlock HTTP API endpoints for transaction submission:

# Submit transactions to NextBlock
curl -X POST http://frankfurt.nextblock.io/api/v2/submit \
  -H "Content-Type: application/json" \
  -H "Authorization: your-api-key-here" \
  -d '{
    "transaction": {
      "content": "base-64-encoded-transaction"
    }
  }'

# Get tip floor data for optimization
curl -X GET http://frankfurt.nextblock.io/api/v1/tip-floor \
  -H "Authorization: your-api-key-here"

Available HTTP Endpoints

For transaction submission and tip floor data:

  • Frankfurt: http://frankfurt.nextblock.io

  • Amsterdam: http://amsterdam.nextblock.io

  • London: http://london.nextblock.io

  • Singapore: http://singapore.nextblock.io

  • Tokyo: http://tokyo.nextblock.io

  • New York: http://ny.nextblock.io

  • Salt Lake City: http://slc.nextblock.io

Best Practices

  1. Use gRPC for real-time monitoring: The TX Stream API provides the fastest transaction detection for trading bots

  2. Use HTTP for submission: Submit your trading transactions via the HTTP API endpoints

  3. Monitor tip floors: Use the HTTP tip floor endpoint to optimize your transaction tips

  4. Choose optimal endpoint: Use the endpoint closest to your location for best latency

  5. Handle rate limits: Implement appropriate backoff for HTTP requests

Last updated