Skip to content

jereinhardt/snowcone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snowcone

Elixir API wrapper for the Frost API.

Installation

If available in Hex, the package can be installed by adding snowcone to your list of dependencies in mix.exs:

def deps do
  [
    {:snowcone, "~> 0.1.2"}
  ]
end

Configuration

You'll need to configure your api token and the service url you would like to use.

# config/config.exs

use Mix.Config

config :snowcone,
  service_url: "https://api.poetnetwork.net",
  api_token: "your api token"

Usage

The Snowcone modules allows you to interact Frost enpoints related to works.

  • get_works/0 - retrieves all works related to an account
  • get_work/1 - retrieves a single work related to an account
  • create_work/1 - create a work for an account
# Retrieve a list of all available works.

Snowcone.get_works
# ** {:ok, [%Frost.Work{...}]}


# Retrieve a work based on its id.

Snowcone.get_work("work_id")
# ** {:ok, %Frost.Work{...}}


# Create a work.  Returns a map with the work id.

Snowcone.create_work(work_params)
# ** {:ok, %{work_id: "work_id"}}


# Any API request that fails will return a tuple with the error message.

Snowcone.get_work("invalid_work_id")
# ** {:error, "Work not found."}

About

Elixir wrapper for the Frost API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages