intrepidshape/elm-web3/1.0.0

NOTE: the latest version is 3.0.0

Rerouted (renamed, verified). 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/IntrepidShape/elm-web3.

What we checked: The repo moved to github.com/IntrepidShape/elm-web3 and tag 1.0.0 is there; its commit 9d919244f65e is from 2026-05-09 11:48 UTC, before the version was published (2026-05-09 11:58 UTC); elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip's SHA-1 is not the published one (GitHub's zip no longer comes out byte for byte the same), so the contents were checked instead.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

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

Web3.BigInt

Arbitrary-precision integers for EVM applications.

Supports the full uint256 range (0 to 2^256-1) and int256 range. Implemented as a base-10^7 digit list with no external dependencies.

All values crossing the port boundary are decimal strings — this module handles the conversion safely.

type BigInt

An arbitrary-precision integer.

fromInt : Int -> BigInt

Create a BigInt from an Elm Int.

fromString : String -> Maybe BigInt

Parse a decimal integer string. Returns Nothing for invalid input.

Accepts optional leading '-' or '+' sign. Rejects empty strings, non-digit characters, and floating-point notation.

fromString "0"                    == Just zero
fromString "-42"                  == Just (fromInt -42)
fromString "115792...9935"        -- uint256 max: Just <big>
fromString "abc"                  == Nothing
fromString ""                     == Nothing
fromIntString : String -> Maybe BigInt

Alias for fromString (decimal). Kept for API symmetry with fromHexString.

fromHexString : String -> Maybe BigInt

Parse a 0x-prefixed hexadecimal string as a non-negative BigInt. Returns Nothing for invalid input or empty hex body.

fromHexString "0x64"  == Just (fromInt 100)
fromHexString "0xFF"  == Just (fromInt 255)
fromHexString "0x"    == Nothing
fromHexString "0xgg"  == Nothing
toString : BigInt -> String

Convert to decimal string.

Add two BigInts.

Subtract.

Multiply.

div : BigInt -> BigInt -> Maybe BigInt

Divide. Returns Nothing if divisor is zero.

mod : BigInt -> BigInt -> Maybe BigInt

Remainder: a mod b. Returns Nothing if b is zero.

mod (fromInt 10) (fromInt 3) == Just (fromInt 1)
mod (fromInt 10) zero        == Nothing
compare : BigInt -> BigInt -> Order

Compare two BigInts.

eq : BigInt -> BigInt -> Bool

Equality.

lt : BigInt -> BigInt -> Bool

Less than.

lte : BigInt -> BigInt -> Bool

Less than or equal.

gt : BigInt -> BigInt -> Bool

Greater than.

gte : BigInt -> BigInt -> Bool

Greater than or equal.

Zero.

isZero : BigInt -> Bool

Is this BigInt zero?

decoder : Decoder BigInt

Decode a BigInt from a JSON decimal string.

D.decodeString BigInt.decoder "\"12345\"" == Ok (BigInt.fromInt 12345)