coinbase adapter: default WS_API_ENDPOINT wss://ws-feed.pro.coinbase.com no longer accepts connections

Aperta Adatta ai principianti
#5,651 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Inizia da packages/sources/coinbase/src/config/index.ts, poi cerca il valore predefinito di WS_API_ENDPOINT in schemas/env.json e nella tabella del README. Aggiorna i valori predefiniti affinché usino l’host WebSocket di Coinbase Exchange descritto nell’issue e verifica che la sottoscrizione WebSocket dell’adattatore usi ancora il canale ticker e il payload indicati. Il lavoro è completato quando tutti e tre i valori predefiniti coincidono e il changeset è incluso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The coinbase source adapter still defaults its WebSocket URL to the Coinbase Pro host:

packages/sources/coinbase/src/config/index.ts

export const DEFAULT_WS_API_ENDPOINT = 'wss://ws-feed.pro.coinbase.com'

(also the default in schemas/env.json and the README table)

That host is retired. The WebSocket handshake fails (close 1006), a plain HTTPS request to it returns 530, and api.pro.coinbase.com answers 503 "Coinbase Pro API is deprecated." So with WS enabled and no WS_API_ENDPOINT override, the adapter never receives a ticker over the socket.

The same feed lives on the Exchange host, with the same subscribe message and the same ticker payload (type, product_id, price, ...), so makeWSHandler should work unchanged with:

export const DEFAULT_WS_API_ENDPOINT = 'wss://ws-feed.exchange.coinbase.com'

Repro (Node 22+, global WebSocket), sending the adapter's own subscription:

const sub = { type: 'subscribe', channels: ['ticker'], product_ids: ['BTC-USD', 'ETH-USD'] };
const run = (url) => new Promise((resolve) => {
  let tickers = 0, first = '', err = '';
  const ws = new WebSocket(url);
  ws.onopen = () => ws.send(JSON.stringify(sub));
  ws.onmessage = (e) => { const m = JSON.parse(e.data); if (m.type === 'ticker') { tickers++; if (!first) first = `${m.product_id} price=${m.price}`; } };
  ws.onerror = () => { err = 'error event'; };
  ws.onclose = (e) => { err += ` (close ${e.code})`; };
  setTimeout(() => { try { ws.close(); } catch {} resolve(`${url}: ${tickers} ticker messages ${first} ${err}`.trim()); }, 10000);
});
for (const u of ['wss://ws-feed.pro.coinbase.com', 'wss://ws-feed.exchange.coinbase.com']) console.log(await run(u));

Output on 28 Nov 2026, 03:49 UTC:

wss://ws-feed.pro.coinbase.com: 0 ticker messages error event (close 1006)
wss://ws-feed.exchange.coinbase.com: 55 ticker messages BTC-USD price=59874.05

Deployments that already set WS_API_ENDPOINT are not affected. I help maintain a Coinbase SDK for Node.js (Siebly) and ran into the old host while checking our own defaults. Happy to send a PR with the config, schema and README change plus a changeset if that is easier.

Lingua principale
TypeScript
Stelle
288
Fork
263
Merge medio
1g 8h
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di smartcontractkit/external-adapters-js

Tutte le issue di smartcontractkit/external-adapters-js

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.