Files
open-web-agent-rs/packages/core/market/index.ts
geoffsee 66d3c06230 init
2025-05-23 09:48:26 -04:00

14 lines
474 B
TypeScript

import {ApiResponse} from "./types";
export async function collect_gainers_losers(x: { apiKey: string, limit: number }): Promise<ApiResponse> {
const { apiKey, limit } = x;
//
const data: ApiResponse = await fetch(`https://pro-api.coinmarketcap.com/v1/cryptocurrency/trending/gainers-losers?limit=${limit}`, {
headers: {
"x-cmc_pro_api_key": apiKey
}
}).then((symbolDataRequest) => symbolDataRequest.json());
return data;
}