dexscreener-sdk
Version:
A TypeScript wrapper for the DEX Screener API, providing easy access to token profiles, boosts, orders, pairs, and more.
13 lines (12 loc) • 503 B
JavaScript
import axios from 'axios';
import { BASE_URL } from '../config.js';
import { TokenProfile } from '../models/TokenProfile.js';
/**
* Fetches the latest token profiles from the DEX Screener API.
* @returns A promise that resolves to an array of TokenProfile instances.
*/
export const getLatestTokenProfiles = async () => {
const url = `${BASE_URL}/token-profiles/latest/v1`;
const response = await axios.get(url);
return response.data.map((data) => new TokenProfile(data));
};