forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1import axios from "axios";
2import { API_URL } from "../consts";
3import { Scrobble } from "../types/scrobble";
4
5export const getProfileByDid = async (did: string) => {
6 const response = await axios.get(`${API_URL}/users/${did}`);
7 return response.data;
8};
9
10export const getProfileStatsByDid = async (did: string) => {
11 const response = await axios.get(`${API_URL}/users/${did}/stats`);
12 return response.data;
13};
14
15export const getRecentTracksByDid = async (
16 did: string,
17 offset = 0,
18 size = 10,
19): Promise<Scrobble[]> => {
20 const response = await axios.get<Scrobble[]>(
21 `${API_URL}/users/${did}/scrobbles?size=${size}&offset=${offset}`,
22 );
23 return response.data;
24};