This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.

CoinMarketCap.Request

Handles HTTP requests to coinmarketcap

getCryptos : Cmd Msg

Gets a list of all crypto currencies

module CoinMarketCap.Request exposing (..)

{-| Handles HTTP requests to coinmarketcap

@docs getCryptos
-}

import Http
import CoinMarketCap.Models exposing (Crypto, decodeCryptos)
import CoinMarketCap.Msg exposing (..)

{-| Gets a list of all crypto currencies
-}
getCryptos : Cmd Msg
getCryptos =
    let
        url =
            "https://api.coinmarketcap.com/v1/ticker/?limit=0"

        request =
            Http.get url decodeCryptos
    in
        Http.send ReceiveCryptos request