NeoVier/elm-eos/1.0.0

Renamed to henriquecbuss/elm-eos. It is published under that name, and new versions come out there.

Versions published as NeoVier/elm-eos still install under that name. 1 version of 1 come from the new location (see their notes).

Rerouted (renamed, needs approval). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/henriquecbuss/elm-eos.

What we checked: The repo moved to github.com/henriquecbuss/elm-eos and tag 1.0.0 is there; its commit 12b679fbd416 is from 2022-11-04 12:13 UTC, after the version was published (2022-11-04 02:04 UTC); elm.json differs from package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one and nothing else confirms its contents.

We could not verify this copy against what was published, so the Lamdera compiler asks before using it (y/n). Without a terminal, as in CI, it stops with an error unless approved:

  • lamdera make --auto-approve-package-rerouting approves rerouted versions for that run,
  • LAMDERA_AUTO_APPROVE_PACKAGE_REROUTING=1 does the same for every run in that environment,
  • LAMDERA_CACHE=off skips the Lamdera package server altogether: packages come from package.elm-lang.org and GitHub only, as with elm, and a rerouted version then fails to download.

Details · package.elm-lang.org's zip: https://github.com/NeoVier/elm-eos/zipball/1.0.0/

Eos.Name

Name is a very fundamental basic type of EOSIO. It is used to identify accounts, permissions, actions, tables, etc.

type Name

Names are strings of up to 12 characters in length. They can include characters a-z, 1-5, and the dot character (except for the last character).

In order to generate a Name, you can use fromString or decoder.

To display a Name, use the toString function. You can also encode a Name

Converting to and from String

toString : Name -> String

Convert a Name to a regular String. This is useful if you want to display names in your application.

fromString "eosio.token"
    |> Result.map toString
--> Ok "eosio.token"
fromString : String -> Result Error Name

Convert a regular String into a Name. Since there are some restrictions on the possible names, this function can fail with an Error.

fromString "eosio.token"
    |> Result.map toString
--> Ok "eosio.token"


fromString "0123456789"
--> Err (InvalidCharacters ( '0', [ '6', '7', '8', '9' ] ))


fromString "eosio."
--> Err DotInLastPlace


fromString ""
--> Err TooShort


fromString "a.very.long.name"
--> Err TooLong
type Error
= InvalidCharacters ( Char, List Char )
| DotInLastPlace
| TooShort
| TooLong

The Error type represents all of the possible errors when converting a Name fromString.

fromString "0123456789"
--> Err (InvalidCharacters ( '0', [ '6', '7', '8', '9' ] ))


fromString "eosio."
--> Err DotInLastPlace


fromString ""
--> Err TooShort


fromString "a.very.long.name"
--> Err TooLong
errorToString : Error -> String

You can use this function to convert an Error into a human-readable String.

Dealing with JSON

encode : Name -> Value

Encode a Name into JSON. You can use this to send a Name to the blockchain or some server.

decoder : Decoder Name

Decode a Name from JSON. You can use this to receive a Name from the blockchain or some server. It already does all of the validation necessary to ensure the Name is valid.