spinamp-sdk
  • About
  • Installation
  • Usage
  • Reference
    • API Reference
      • Types
        • IConfig
        • IArtist
        • IArtistProfile
        • ITrack
        • ICollectionTrack
        • INft
        • ITrackNft
        • IMusicPlatformData
        • IPlaylist
        • IApiListQueryParams
        • IApiListQueryResponse
      • Tracks
      • Artists
      • Collection
      • NFTs
      • Platforms
      • Playlists
      • Utilities
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Playlists

PreviousPlatformsNextUtilities

Last updated 2 years ago

fetchFeaturedPlaylists(): Promise<[]>

Returns list of playlists, which are currently marked as featured on spinamp.

fetchPlaylistById(playlistId: string): Promise<{playlist: [], playlistTracks: []}>

Gets playlist by provided playlist id. Returns playlist object and list of full tracks belonging to this playlist.

fetchCollectorPlaylists(collectorAddress: string): Promise<[]>

Returns list of playlists created by user with provided address.

createPlaylist(playlist: Omit<, 'id'>, signer: ): Promise<{id: string}>

Creates a new playlist and returns the playlist id

An ethers signer object is required for API authentication

  const wallet = ethers.Wallet.createRandom();
  const vibeyPlaylist = {
    title: 'vibey',
    trackIds: ['ethereum/0xd5b2c770dc0a9677cf672d53f554f6f806e75e07/1'],
  };

  const {id} = await createPlaylist(vibeyPlaylist, wallet);

Updates a playlist and returns the new values

Only the signer that created the playlist is able to update it

  const wallet = ethers.Wallet.createRandom();
  const vibeyPlaylist = {
    id: 'kfF8MuFHmW6MwHIWNKQF',
    title: 'super vibey',
    trackIds: ['ethereum/0xd5b2c770dc0a9677cf672d53f554f6f806e75e07/1'],
  };

  const playlist = await updatePlaylist(vibeyPlaylist.id, vibeyPlaylist, wallet);

updatePlaylist(id: string, playlist: Partial<>, signer: ): Promise<{id: string; title: string: trackIds: string[] }>

Signer
Signer
IPlaylist
IPlaylist
ITrack
IPlaylist
IPlaylist
IPlaylist