Elm wrapper for the Urbit HTTP API
Go to file
2021-11-02 23:14:41 -05:00
example update dependencies 2021-10-31 00:39:28 -05:00
src Fixed BigInt bitwise functions 2021-11-02 23:10:49 -05:00
tests Fixed BigInt bitwise functions 2021-11-02 23:10:49 -05:00
.gitignore add phonemic encoding module 2021-07-14 15:11:37 -05:00
elm.json new release 2021-11-02 23:14:41 -05:00
LICENSE initial commit 2021-06-05 16:42:15 -05:00
package-lock.json update dependencies 2021-10-31 00:39:28 -05:00
package.json update dependencies 2021-10-26 14:43:48 -05:00
README.md fix README 2021-07-29 17:23:12 -05:00

Elm Urbit HTTP API

This is an Elm wrapper for the Urbit HTTP API, making it easy to interact with Urbit from any Elm application.

Examples

import Random
import Time
import Json.Encode
import Urbit

connect : Int -> Time.Posix -> Cmd Msg
connect entropy time =
    Urbit.connect
        { ship = zod
        , url = "http://localhost:8080"
        , channelId =
            Random.initialSeed entropy
                |> Random.step (Urbit.channelId time)
                |> Tuple.first
        , code = "lidlut-tabwed-pillex-ridrup"
        }
        GotConnection

poke : Urbit.Session -> ( Urbit.Session, Cmd Msg )
poke session =
    Urbit.poke
        { ship = zod
        , app = "hood"
        , mark = "helm-hi"
        , json = Json.Encode.string "opening airlock"
        }
        |> Urbit.send session PokedHood

See the example/ folder for a more complete example.

Ports Disclaimer

Because Elm does not support the EventSource API, some additional work is required to create the ports necessary for most functionality. See the Urbit.setupEventSource documentation for details.