跳转到主要内容
WSS

SDK Example

import { Datastream } from '@solana-tracker/data-api';

const dataStream = new Datastream({
  wsUrl: 'wss://datastream.solanatracker.io/YOUR_API_KEY',
});

await dataStream.connect();

const sub = dataStream.subscribe.latest().on((data) => {
  console.log(data);
});

// sub.unsubscribe();
Messages
apiKey
type:httpApiKey

API key for authentication. Include your Datastream key in the connection URL: wss://datastream.solanatracker.io/{DATASTREAM_KEY}

joinLatest
type:object

Subscribe to new tokens/pools

leaveLatest
type:object

Unsubscribe from latest tokens

latestJoined
type:object

Subscription confirmed

latestMessage
type:object

New token/pool notification