惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园_首页
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
The Cloudflare Blog
V
Visual Studio Blog
罗磊的独立博客
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
D
Docker
Last Week in AI
Last Week in AI
B
Blog RSS Feed
C
Check Point Blog
J
Java Code Geeks
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
博客园 - 聂微东
MongoDB | Blog
MongoDB | Blog
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Migrating Off Blocknative's Gas API Before June 19: A Cod...
LogicNodes · 2026-06-12 · via DEV Community

LogicNodes

Blocknative's Gas API and Gas Network shut down on June 19, 2026. If you have api.blocknative.com/gasprices/blockprices anywhere in your codebase, that call starts failing in days.

This is the code-level migration guide. We published the announcement earlier; this post covers the exact request/response mapping, what's identical, and — just as important — what's not.

The 30-second migration

Swap the base URL. Drop the auth header. That's it for the core endpoint.

- curl -H "Authorization: $BLOCKNATIVE_KEY" \
-   "https://api.blocknative.com/gasprices/blockprices?chainid=8453"
+ curl "https://logicnodes.io/gasprices/blockprices?chainid=8453"

No signup, no API key. Free tier is 100 calls/day per IP, tracked via the X-Free-Calls-Remaining-Today response header.

JavaScript:

// before
const r = await fetch(
  "https://api.blocknative.com/gasprices/blockprices?chainid=1",
  { headers: { Authorization: process.env.BN_KEY } }
);

// after
const r = await fetch(
  "https://logicnodes.io/gasprices/blockprices?chainid=1"
);
const { blockPrices } = await r.json();
const { maxFeePerGas, maxPriorityFeePerGas } =
  blockPrices[0].estimatedPrices.find(p => p.confidence === 95);

Python:

import requests

r = requests.get(
    "https://logicnodes.io/gasprices/blockprices",
    params={"chainid": 137},
    timeout=10,
)
est = r.json()["blockPrices"][0]["estimatedPrices"]
p95 = next(p for p in est if p["confidence"] == 95)
# p95["maxFeePerGas"], p95["maxPriorityFeePerGas"] — gwei floats

What you get back

Same shape your Blocknative parsing code already expects:

{
  "system": "base",
  "network": "main",
  "unit": "gwei",
  "maxPrice": 0.1131,
  "currentBlockNumber": 47211781,
  "msSinceLastBlock": 662,
  "blockPrices": [
    {
      "blockNumber": 47211782,
      "estimatedTransactionCount": 211,
      "baseFeePerGas": 0.005,
      "estimatedPrices": [
        { "confidence": 99, "price": 0.1126, "maxPriorityFeePerGas": 0.1076, "maxFeePerGas": 0.1131 },
        { "confidence": 95, "price": 0.017,  "maxPriorityFeePerGas": 0.012,  "maxFeePerGas": 0.0175 },
        { "confidence": 90, "price": 0.01,   "maxPriorityFeePerGas": 0.005,  "maxFeePerGas": 0.0105 },
        { "confidence": 80, "price": 0.0085, "maxPriorityFeePerGas": 0.0035, "maxFeePerGas": 0.009 },
        { "confidence": 70, "price": 0.0069, "maxPriorityFeePerGas": 0.0019, "maxFeePerGas": 0.0075 }
      ]
    }
  ]
}

All five confidence levels (99/95/90/80/70), gwei units, maxFeePerGas / maxPriorityFeePerGas per level — code that indexes into blockPrices[0].estimatedPrices works unchanged.

What's different (read this before you ship)

We'd rather you find out here than in production:

  • One pending block only. blockPrices always has exactly one entry (the next block). Blocknative could return several future blocks. If you read blockPrices[1+], that needs to go.
  • No estimatedBaseFees array. We don't return the multi-block base-fee forecast distribution.
  • Confidence is percentile math, not a simulation platform. Each confidence level maps to an eth_feeHistory reward percentile (99→p99, 95→p95, …) over the last 100 blocks; priority fee is the median of the most recent 20 blocks at that percentile, plus a base-fee headroom buffer derived from 100-block volatility. It's deterministic and you can recompute it from any node — but it is not Blocknative's mempool-simulation model.
  • estimatedTransactionCount is the latest block's transaction count, not a pending-pool prediction.

Supported chains — only these five

chainid network
1 Ethereum
137 Polygon
8453 Base
42161 Arbitrum One
10 Optimism

Any other chainid returns a 400 listing exactly what we serve — no silent fallbacks, no fake coverage. Blocknative served 40+ chains; we don't, and we won't pretend to. If you need a chain we're missing, email hello@logicnodes.io and we'll prioritize it.

Past the free tier

After 100 calls/day from one IP, the endpoint returns 402 with x402 payment instructions: $0.001 USDC per call on Base, passed via an X-Payment-Tx header. No account, no card, no sales call. Or just come back tomorrow.

Verify it yourself

Everything above is reproducible from a public node:

curl -s https://mainnet.base.org -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":["0x64","latest",[70,80,90,95,99]]}'

That's the entire upstream data source. The response header X-Data-Source: eth_feeHistory-100-blocks says so on every call.

Links

Eight days left. The URL swap takes less time than reading this post.