[{"name":"Web3","comment":" Top-level Web3 module that composes wallet + transaction state.\n\nWire this into your Elm app's Model/update/subscriptions.\n\n    import Web3\n\n    type alias Model =\n        { web3 : Web3.Model\n        , ...\n        }\n\n    type Msg\n        = Web3Msg Web3.Msg\n        | ...\n\n    update msg model =\n        case msg of\n            Web3Msg subMsg ->\n                { model | web3 = Web3.update subMsg model.web3 }\n\n@docs Model, Msg\n@docs init, update, subscriptions\n\n","unions":[{"name":"Msg","comment":" Messages for wallet and transaction updates.\n","args":[],"cases":[["WalletMsg",["Web3.Wallet.Msg"]],["TxMsg",["String.String","Web3.Transaction.Msg"]]]}],"aliases":[{"name":"Model","comment":" Combined wallet + transaction state.\n","args":[],"type":"{ wallet : Web3.Wallet.State, expectedChain : Web3.Types.ChainId, transactions : List.List ( String.String, Web3.Transaction.Status ) }"}],"values":[{"name":"init","comment":" Initialize with the expected chain ID.\n","type":"Web3.Types.ChainId -> Web3.Model"},{"name":"subscriptions","comment":" Placeholder for port subscriptions. Wire your port decoder here.\n","type":"Web3.Model -> Platform.Sub.Sub Web3.Msg"},{"name":"update","comment":" Update wallet and transaction state from a port message.\n","type":"Web3.Msg -> Web3.Model -> Web3.Model"}],"binops":[]},{"name":"Web3.Abi.Decode","comment":" Helpers to decode contract return values from JSON\nreceived through ports from the JS Web3 layer.\n\n@docs address, uint256, int256, bool, string, bytes32\n@docs decodeRevertReason\n\n","unions":[],"aliases":[],"values":[{"name":"address","comment":" Decode an Address return value.\n","type":"Json.Decode.Decoder Web3.Types.Address"},{"name":"bool","comment":" Decode a bool return value.\n","type":"Json.Decode.Decoder Basics.Bool"},{"name":"bytes32","comment":" Decode a bytes32 hex string (e.g. an event topic). Expects a 0x-prefixed\n66-character hex string and returns it as-is.\n","type":"Json.Decode.Decoder String.String"},{"name":"decodeRevertReason","comment":" Attempt to decode an EVM revert reason from raw revert data.\n\nChecks for the Error(string) selector `0x08c379a2` and decodes the\nABI-encoded string that follows. Returns Nothing if the data is not\na standard Error(string) revert.\n\n    decodeRevertReason \"0x08c379a200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000011496e73756666696369656e742066756e647300000000000000000000000000\"\n    --> Just \"Insufficient funds\"\n\n","type":"String.String -> Maybe.Maybe String.String"},{"name":"int256","comment":" Decode an int256 return value as a BigInt.\n","type":"Json.Decode.Decoder Web3.BigInt.BigInt"},{"name":"string","comment":" Decode a string return value.\n","type":"Json.Decode.Decoder String.String"},{"name":"uint256","comment":" Decode a uint256 return value as a BigInt.\n","type":"Json.Decode.Decoder Web3.BigInt.BigInt"}],"binops":[]},{"name":"Web3.Abi.Encode","comment":" Helpers to encode contract call parameters to JSON values\nfor passing through ports to the JS Web3 layer.\n\n@docs address, uint256, int256, bool, string, bytes, bytes32\n\n","unions":[],"aliases":[],"values":[{"name":"address","comment":" Encode an Address argument.\n","type":"Web3.Types.Address -> Json.Encode.Value"},{"name":"bool","comment":" Encode a bool argument.\n","type":"Basics.Bool -> Json.Encode.Value"},{"name":"bytes","comment":" Encode raw bytes as a hex string.\n","type":"String.String -> Json.Encode.Value"},{"name":"bytes32","comment":" Encode a bytes32 value.\n","type":"String.String -> Json.Encode.Value"},{"name":"int256","comment":" Encode an int256 argument from a BigInt.\n","type":"Web3.BigInt.BigInt -> Json.Encode.Value"},{"name":"string","comment":" Encode a string argument.\n","type":"String.String -> Json.Encode.Value"},{"name":"uint256","comment":" Encode a uint256 argument from a BigInt.\n","type":"Web3.BigInt.BigInt -> Json.Encode.Value"}],"binops":[]},{"name":"Web3.BigInt","comment":" Arbitrary-precision integers for EVM applications.\n\nSupports the full uint256 range (0 to 2^256-1) and int256 range.\nImplemented as a base-10^7 digit list with no external dependencies.\n\nAll values crossing the port boundary are decimal strings — this module\nhandles the conversion safely.\n\n@docs BigInt\n@docs fromInt, fromString, toString\n@docs add, sub, mul, div\n@docs compare, eq, lt, lte, gt, gte\n@docs zero, isZero\n\n","unions":[{"name":"BigInt","comment":" An arbitrary-precision integer.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"add","comment":" Add two BigInts.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Web3.BigInt.BigInt"},{"name":"compare","comment":" Compare two BigInts.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Order"},{"name":"div","comment":" Divide. Returns Nothing if divisor is zero.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Maybe.Maybe Web3.BigInt.BigInt"},{"name":"eq","comment":" Equality.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Bool"},{"name":"fromInt","comment":" Create a BigInt from an Elm Int.\n","type":"Basics.Int -> Web3.BigInt.BigInt"},{"name":"fromString","comment":" Parse a decimal integer string. Returns Nothing for invalid input.\n\nAccepts optional leading '-' or '+' sign. Rejects empty strings,\nnon-digit characters, and floating-point notation.\n\n    fromString \"0\"                    == Just zero\n    fromString \"-42\"                  == Just (fromInt -42)\n    fromString \"115792...9935\"        -- uint256 max: Just <big>\n    fromString \"abc\"                  == Nothing\n    fromString \"\"                     == Nothing\n\n","type":"String.String -> Maybe.Maybe Web3.BigInt.BigInt"},{"name":"gt","comment":" Greater than.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Bool"},{"name":"gte","comment":" Greater than or equal.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Bool"},{"name":"isZero","comment":" Is this BigInt zero?\n","type":"Web3.BigInt.BigInt -> Basics.Bool"},{"name":"lt","comment":" Less than.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Bool"},{"name":"lte","comment":" Less than or equal.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Basics.Bool"},{"name":"mul","comment":" Multiply.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Web3.BigInt.BigInt"},{"name":"sub","comment":" Subtract.\n","type":"Web3.BigInt.BigInt -> Web3.BigInt.BigInt -> Web3.BigInt.BigInt"},{"name":"toString","comment":" Convert to decimal string.\n","type":"Web3.BigInt.BigInt -> String.String"},{"name":"zero","comment":" Zero.\n","type":"Web3.BigInt.BigInt"}],"binops":[]},{"name":"Web3.Chain","comment":" Chain definitions for EVM networks.\n\n@docs Chain\n@docs pulsechain, pulsechainTestnet, ethereum, sepolia, custom\n@docs chainId, name, rpcUrl, blockExplorer\n\n","unions":[],"aliases":[{"name":"Chain","comment":" An EVM chain definition.\n","args":[],"type":"{ chainId : Web3.Types.ChainId, name : String.String, rpcUrl : String.String, blockExplorer : String.String, nativeCurrency : String.String }"}],"values":[{"name":"blockExplorer","comment":" Get the block explorer URL.\n","type":"Web3.Chain.Chain -> String.String"},{"name":"chainId","comment":" Get the chain ID.\n","type":"Web3.Chain.Chain -> Web3.Types.ChainId"},{"name":"custom","comment":" Define a custom EVM chain.\n","type":"{ chainId : Basics.Int, name : String.String, rpcUrl : String.String, blockExplorer : String.String, nativeCurrency : String.String } -> Web3.Chain.Chain"},{"name":"ethereum","comment":" Ethereum mainnet (chain ID 1).\n","type":"Web3.Chain.Chain"},{"name":"name","comment":" Get the chain name.\n","type":"Web3.Chain.Chain -> String.String"},{"name":"pulsechain","comment":" PulseChain mainnet (chain ID 369).\n","type":"Web3.Chain.Chain"},{"name":"pulsechainTestnet","comment":" PulseChain testnet v4 (chain ID 943).\n","type":"Web3.Chain.Chain"},{"name":"rpcUrl","comment":" Get the RPC URL.\n","type":"Web3.Chain.Chain -> String.String"},{"name":"sepolia","comment":" Sepolia testnet (chain ID 11155111).\n","type":"Web3.Chain.Chain"}],"binops":[]},{"name":"Web3.Contract.Call","comment":" Type-safe contract read calls (eth\\_call).\n\nBuild a read call, encode it for the JS port, decode the response.\nThe code generator creates typed wrappers around these primitives.\n\n    -- Generated code uses this under the hood:\n    balanceOf : Address -> ReadCall String\n    balanceOf addr =\n        readCall\n            { contract = tokenAddress\n            , method = \"balanceOf\"\n            , args = [ Encode.address addr ]\n            , decoder = Decode.string\n            }\n\n@docs ReadCall\n@docs readCall, withBlock, encode, responseDecoder\n\n","unions":[{"name":"ReadCall","comment":" A read-only contract call with a typed return value.\n","args":["a"],"cases":[]}],"aliases":[],"values":[{"name":"encode","comment":" Encode a read call for the JS port.\n","type":"Web3.Contract.Call.ReadCall a -> Json.Encode.Value"},{"name":"readCall","comment":" Create a read call. The `id` is echoed back in the response so you can\nmatch responses to requests when multiple calls are in flight.\n","type":"{ contract : Web3.Types.Address, method : String.String, args : List.List Json.Encode.Value, decoder : Json.Decode.Decoder a, id : String.String } -> Web3.Contract.Call.ReadCall a"},{"name":"responseDecoder","comment":" Get the response decoder for a read call.\n","type":"Web3.Contract.Call.ReadCall a -> Json.Decode.Decoder a"},{"name":"withBlock","comment":" Set the block number for the call.\n","type":"Web3.Types.BlockNumber -> Web3.Contract.Call.ReadCall a -> Web3.Contract.Call.ReadCall a"}],"binops":[]},{"name":"Web3.Contract.Event","comment":" Contract event watching via port subscriptions.\n\n    -- Subscribe to Transfer events\n    subscriptions model =\n        Event.watchEvent\n            { contract = tokenAddress\n            , event = \"Transfer\"\n            , filter = []\n            }\n            |> Event.decoder transferDecoder\n            |> onContractEvent TransferReceived\n\n@docs EventFilter, EventLog, GetLogsQuery\n@docs watchEvent, encode, decoder\n@docs getLogs, logsDecoder\n\n","unions":[],"aliases":[{"name":"EventFilter","comment":" An event subscription filter.\n","args":[],"type":"{ contract : Web3.Types.Address, event : String.String, topics : List.List (Maybe.Maybe String.String) }"},{"name":"EventLog","comment":" A decoded event log.\n","args":["a"],"type":"{ data : a, blockNumber : Basics.Int, txHash : Web3.Types.TxHash, logIndex : Basics.Int }"},{"name":"GetLogsQuery","comment":" A query for getLogs with fromBlock/toBlock range.\n","args":[],"type":"{ contract : Web3.Types.Address, fromBlock : Web3.Types.BlockNumber, toBlock : Web3.Types.BlockNumber, topics : List.List (Maybe.Maybe String.String) }"}],"values":[{"name":"decoder","comment":" Decode an event log with a custom data decoder.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Web3.Contract.Event.EventLog a)"},{"name":"encode","comment":" Encode an event filter for the JS port.\n","type":"Web3.Contract.Event.EventFilter -> Json.Encode.Value"},{"name":"getLogs","comment":" Encode a getLogs query for the JS port.\n","type":"Web3.Contract.Event.GetLogsQuery -> Json.Encode.Value"},{"name":"logsDecoder","comment":" Decode a list of event logs with a custom data decoder.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (List.List (Web3.Contract.Event.EventLog a))"},{"name":"watchEvent","comment":" Create an event watch command.\n","type":"Web3.Contract.Event.EventFilter -> Json.Encode.Value"}],"binops":[]},{"name":"Web3.Contract.Send","comment":" Type-safe contract write calls (eth\\_sendTransaction).\n\n    -- Non-payable: approve\n    approve : Address -> BigInt -> WriteCall\n    approve spender amount =\n        writeCall { ... }\n\n    -- Payable: buy\n    buy : BigInt -> Wei -> WriteCall\n    buy minTokens value =\n        payableCall { ..., value = value }\n\n@docs WriteCall\n@docs writeCall, payableCall, withGasLimit, encode, estimateGas\n\n","unions":[{"name":"WriteCall","comment":" A write call to a contract.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"encode","comment":" Encode a write call for the JS port.\n","type":"Web3.Contract.Send.WriteCall -> Json.Encode.Value"},{"name":"estimateGas","comment":" Encode a write call as an estimateGas command for the JS port.\n\n    estimateGas myWriteCall\n    -- sends { tag: \"estimateGas\", contract: ..., method: ..., args: ..., value: ... }\n    -- JS responds with { tag: \"gasEstimate\", gas: \"21000\" }\n\n","type":"Web3.Contract.Send.WriteCall -> Json.Encode.Value"},{"name":"payableCall","comment":" Create a payable write call with a value.\n","type":"{ contract : Web3.Types.Address, method : String.String, args : List.List Json.Encode.Value, value : Web3.BigInt.BigInt } -> Web3.Contract.Send.WriteCall"},{"name":"withGasLimit","comment":" Set a gas limit.\n","type":"Basics.Int -> Web3.Contract.Send.WriteCall -> Web3.Contract.Send.WriteCall"},{"name":"writeCall","comment":" Create a non-payable write call.\n","type":"{ contract : Web3.Types.Address, method : String.String, args : List.List Json.Encode.Value } -> Web3.Contract.Send.WriteCall"}],"binops":[]},{"name":"Web3.Multicall","comment":" Batch multiple contract reads into a single eth\\_call via Multicall3.\n\nThe Multicall3 contract (0xcA11bde05977b3631167028862bE2a173976CA11) is\ndeployed on Ethereum, PulseChain, and most EVM networks. It lets you pack N\nread calls into one RPC round-trip.\n\n    import Web3.Multicall as Multicall\n    import Web3.Abi.Encode as Encode\n\n    let\n        req =\n            Multicall.batch \"balance-check\"\n                [ Multicall.callSpec tokenAddress \"balanceOf(address)\" [ Encode.address myAddr ]\n                , Multicall.callSpec tokenAddress \"totalSupply()\" []\n                ]\n    in\n    -- Outgoing port: web3Cmd (Multicall.encode req)\n    -- Incoming port: match on { tag = \"multicallResult\" } and apply responseDecoder\n\n@docs CallSpec, callSpec, MulticallRequest, CallResult\n@docs batch, encode, responseDecoder\n\n","unions":[{"name":"CallSpec","comment":" A single call specification for inclusion in a multicall batch.\n","args":[],"cases":[]},{"name":"MulticallRequest","comment":" A batched multicall request with a correlation id.\n","args":[],"cases":[]}],"aliases":[{"name":"CallResult","comment":" The result of a single call within a multicall batch.\n\n`data` is the raw ABI-encoded return value as a hex string (0x-prefixed).\nApply your specific decoder (e.g. from Web3.Abi.Decode) to parse it.\n\n","args":[],"type":"{ success : Basics.Bool, data : String.String }"}],"values":[{"name":"batch","comment":" Batch a list of call specs into a multicall request.\n\nThe `id` is echoed back in the `multicallResult` response so you can match\nresponses to requests when multiple batches are in flight.\n\n","type":"String.String -> List.List Web3.Multicall.CallSpec -> Web3.Multicall.MulticallRequest"},{"name":"callSpec","comment":" Build a CallSpec for a contract read.\n\n    Multicall.callSpec\n        pairAddress\n        \"getReserves()\"\n        []\n\n","type":"Web3.Types.Address -> String.String -> List.List Json.Encode.Value -> Web3.Multicall.CallSpec"},{"name":"encode","comment":" Encode a multicall request for the JS port.\n\nProduces:\n\n    { \"tag\": \"multicall\"\n    , \"id\": \"...\"\n    , \"calls\": [ { \"contract\": \"0x...\", \"method\": \"...\", \"args\": [...] }, ... ]\n    }\n\n","type":"Web3.Multicall.MulticallRequest -> Json.Encode.Value"},{"name":"responseDecoder","comment":" Decoder for the `multicallResult` port response.\n\nExpects:\n\n    { \"tag\": \"multicallResult\"\n    , \"id\": \"...\"\n    , \"results\": [ { \"success\": true, \"data\": \"0x...\" }, ... ]\n    }\n\nResults are in the same order as the original call specs.\n\n","type":"Json.Decode.Decoder (List.List Web3.Multicall.CallResult)"}],"binops":[]},{"name":"Web3.Sign","comment":" EIP-712 typed data signing.\n\nBuild a typed data request, encode it for the JS port, decode the signature response.\n\n    import Dict\n    import Json.Encode as E\n    import Web3.Sign as Sign\n\n    permitDomain : Sign.Domain\n    permitDomain =\n        { name = Just \"MyToken\"\n        , version = Just \"1\"\n        , chainId = Just 1\n        , verifyingContract = Just tokenAddress\n        , salt = Nothing\n        }\n\n    permitTypes : Dict.Dict String (List Sign.TypeField)\n    permitTypes =\n        Dict.fromList\n            [ ( \"Permit\"\n              , [ { name = \"owner\", typeName = \"address\" }\n                , { name = \"spender\", typeName = \"address\" }\n                , { name = \"value\", typeName = \"uint256\" }\n                , { name = \"nonce\", typeName = \"uint256\" }\n                , { name = \"deadline\", typeName = \"uint256\" }\n                ]\n              )\n            ]\n\n    permitRequest : Sign.TypedData\n    permitRequest =\n        Sign.typedData\n            { domain = permitDomain\n            , types = permitTypes\n            , primaryType = \"Permit\"\n            , message =\n                E.object\n                    [ ( \"owner\", E.string \"0x...\" )\n                    , ( \"spender\", E.string \"0x...\" )\n                    , ( \"value\", E.string \"1000000000000000000\" )\n                    , ( \"nonce\", E.int 0 )\n                    , ( \"deadline\", E.int 9999999999 )\n                    ]\n            }\n\n    -- Send via port:\n    --   web3Cmd (Sign.encode \"permit-1\" signerAddress permitRequest)\n    --\n    -- Receive via port:\n    --   D.decodeValue Sign.signatureDecoder incoming\n\n@docs TypedData, Domain, TypeField\n@docs typedData, encode, signatureDecoder\n\n","unions":[{"name":"TypedData","comment":" An EIP-712 typed data signing request.\n","args":[],"cases":[]}],"aliases":[{"name":"Domain","comment":" EIP-712 domain separator parameters. All fields are optional;\ninclude only those your contract's domain hash covers.\n","args":[],"type":"{ name : Maybe.Maybe String.String, version : Maybe.Maybe String.String, chainId : Maybe.Maybe Basics.Int, verifyingContract : Maybe.Maybe Web3.Types.Address, salt : Maybe.Maybe String.String }"},{"name":"TypeField","comment":" A single field in a struct type definition.\n","args":[],"type":"{ name : String.String, typeName : String.String }"}],"values":[{"name":"encode","comment":" Encode a TypedData request as a port command.\n\n    web3Cmd (Sign.encode \"my-id\" signerAddress request)\n\nThe `id` is echoed back in the `signed` response so you can match\nresponses to requests when multiple signing requests are in flight.\n\n","type":"String.String -> Web3.Types.Address -> Web3.Sign.TypedData -> Json.Encode.Value"},{"name":"signatureDecoder","comment":" Decode the `signed` response from the JS port.\n\n    case D.decodeValue Sign.signatureDecoder incoming of\n        Ok sig ->\n            -- sig : String — the 0x-prefixed signature\n        Err _ ->\n            -- handle decode error\n\n","type":"Json.Decode.Decoder String.String"},{"name":"typedData","comment":" Construct a TypedData value.\n","type":"{ domain : Web3.Sign.Domain, types : Dict.Dict String.String (List.List Web3.Sign.TypeField), primaryType : String.String, message : Json.Encode.Value } -> Web3.Sign.TypedData"}],"binops":[]},{"name":"Web3.Transaction","comment":" Transaction lifecycle state machine.\n\nEvery transaction goes through explicit states. Pattern matching\nforces you to handle every case — no \"transaction failed silently\"\nbugs.\n\n    case tx.status of\n        Idle ->\n            viewBuyButton\n\n        AwaitingSignature ->\n            viewSigningSpinner\n\n        Submitted hash ->\n            viewPendingWithHash hash\n\n        Confirmed receipt ->\n            viewSuccess receipt\n\n        Failed err ->\n            viewError err\n\n@docs Status, Msg, Receipt, EventLog\n@docs update, isTerminal, isPending\n@docs decoder, parseReceiptEvents\n\n","unions":[{"name":"Msg","comment":" Messages from the JS transaction port.\n","args":[],"cases":[["TxSubmitted",["String.String"]],["TxConfirmation",["String.String","Basics.Int"]],["TxConfirmed",["Web3.Transaction.ReceiptJson"]],["TxFailed",["String.String"]],["TxRejected",[]]]},{"name":"Status","comment":" Transaction lifecycle status. Cannot be in an invalid state.\n","args":[],"cases":[["Idle",[]],["AwaitingSignature",[]],["Submitted",["Web3.Types.TxHash"]],["Confirming",["Web3.Types.TxHash","Basics.Int"]],["Confirmed",["Web3.Transaction.Receipt"]],["Failed",["String.String"]],["Rejected",[]]]}],"aliases":[{"name":"EventLog","comment":" A single log entry emitted during a transaction.\n","args":[],"type":"{ address : Web3.Types.Address, topics : List.List String.String, data : String.String, blockNumber : Basics.Int, logIndex : Basics.Int }"},{"name":"Receipt","comment":" A confirmed transaction receipt, including emitted logs.\n","args":[],"type":"{ txHash : Web3.Types.TxHash, blockNumber : Basics.Int, gasUsed : String.String, status : Basics.Bool, logs : List.List Web3.Transaction.EventLog }"}],"values":[{"name":"decoder","comment":" Decode transaction messages from JS port.\n","type":"Json.Decode.Decoder Web3.Transaction.Msg"},{"name":"isPending","comment":" Is this status still pending?\n","type":"Web3.Transaction.Status -> Basics.Bool"},{"name":"isTerminal","comment":" Is this status terminal (no more updates expected)?\n","type":"Web3.Transaction.Status -> Basics.Bool"},{"name":"parseReceiptEvents","comment":" Apply a list of event decoders to the logs in a receipt, collecting\nall successfully decoded events.\n\n    type MyEvent\n        = Transfer { from : Address, to : Address, amount : BigInt }\n        | Approval { owner : Address, spender : Address, amount : BigInt }\n\n    decodeTransfer : EventLog -> Maybe MyEvent\n    decodeTransfer log =\n        -- match topic[0] to Transfer signature, then decode\n        ...\n\n    events : List MyEvent\n    events =\n        parseReceiptEvents [ decodeTransfer, decodeApproval ] receipt\n\n","type":"List.List (Web3.Transaction.EventLog -> Maybe.Maybe a) -> Web3.Transaction.Receipt -> List.List a"},{"name":"update","comment":" Update transaction status from a port message.\n\nTransitions are guarded to match the TLA+ GuardedNext specification:\n- Terminal states (Confirmed, Failed, Rejected) never transition out.\n- TxSubmitted is only accepted from AwaitingSignature.\n- TxConfirmation is only accepted from Submitted or Confirming.\n- TxFailed and TxRejected are accepted from any non-terminal state.\n","type":"Web3.Transaction.Msg -> Web3.Transaction.Status -> Web3.Transaction.Status"}],"binops":[]},{"name":"Web3.Types","comment":" Core types for EVM interaction.\n\nAll types are opaque — you can't accidentally pass a TxHash where an Address\nis expected. Construction validates format.\n\n@docs Address, TxHash, BlockNumber, ChainId, Wei, HexString\n@docs address, addressToString\n@docs txHash, txHashToString\n@docs chainId, chainIdToInt\n@docs hexString, hexStringToString\n\n","unions":[{"name":"Address","comment":" A validated Ethereum address (0x + 40 hex chars).\n","args":[],"cases":[]},{"name":"BlockNumber","comment":" A block number — specific or a tag.\n","args":[],"cases":[["BlockNum",["Basics.Int"]],["Latest",[]],["Pending",[]],["Earliest",[]]]},{"name":"ChainId","comment":" An EVM chain ID.\n","args":[],"cases":[]},{"name":"HexString","comment":" A raw hex string.\n","args":[],"cases":[]},{"name":"TxHash","comment":" A transaction hash (0x + 64 hex chars).\n","args":[],"cases":[]}],"aliases":[{"name":"Wei","comment":" Wei amount as a string (uint256 — too large for Int).\n","args":[],"type":"Web3.BigInt.BigInt"}],"values":[{"name":"address","comment":" Create an Address from a hex string. Returns Nothing if invalid.\n","type":"String.String -> Maybe.Maybe Web3.Types.Address"},{"name":"addressToString","comment":" Extract the string value of an Address.\n","type":"Web3.Types.Address -> String.String"},{"name":"chainId","comment":" Create a ChainId.\n","type":"Basics.Int -> Web3.Types.ChainId"},{"name":"chainIdToInt","comment":" Extract the integer value of a ChainId.\n","type":"Web3.Types.ChainId -> Basics.Int"},{"name":"hexString","comment":" Create a HexString.\n","type":"String.String -> Maybe.Maybe Web3.Types.HexString"},{"name":"hexStringToString","comment":" Extract the string value of a HexString.\n","type":"Web3.Types.HexString -> String.String"},{"name":"txHash","comment":" Create a TxHash from a hex string.\n","type":"String.String -> Maybe.Maybe Web3.Types.TxHash"},{"name":"txHashToString","comment":" Extract the string value of a TxHash.\n","type":"Web3.Types.TxHash -> String.String"}],"binops":[]},{"name":"Web3.Wallet","comment":" Wallet connection state machine.\n\nThe wallet is modeled as an explicit state — you can't accidentally\ncall a contract without a connected wallet because the compiler\nwon't give you an Address from a Disconnected state.\n\n    case model.wallet of\n        Connected info ->\n            -- info.address is available here\n            buy info.address amount\n\n        _ ->\n            -- can't buy, no address to use\n            showConnectButton\n\n@docs State, Msg, WalletCmd, WalletProvider\n@docs update\n@docs connect, disconnect, switchChain, selectWallet\n@docs isConnected, getAddress, getChainId\n@docs encode, decoder\n\n","unions":[{"name":"Msg","comment":" Messages from the JS wallet port.\n","args":[],"cases":[["WalletConnected",["String.String","Basics.Int"]],["WalletDisconnected",[]],["ChainChanged",["Basics.Int"]],["AccountChanged",["String.String"]],["WalletError",["String.String"]],["WalletsDiscovered",["List.List Web3.Wallet.WalletProvider"]]]},{"name":"State","comment":" Wallet connection state. Every possible state is explicit.\n","args":[],"cases":[["Disconnected",[]],["Connecting",[]],["Connected",["Web3.Wallet.ConnectedInfo"]],["WrongChain",["Web3.Wallet.ConnectedInfo","Web3.Types.ChainId"]],["Error",["String.String"]]]},{"name":"WalletCmd","comment":" Commands to send to JS via port.\n","args":[],"cases":[["RequestConnect",[]],["RequestDisconnect",[]],["RequestSwitchChain",["Basics.Int"]],["RequestSelectWallet",["String.String"]]]}],"aliases":[{"name":"WalletProvider","comment":" A wallet provider discovered via EIP-6963.\n","args":[],"type":"{ name : String.String, icon : String.String, rdns : String.String }"}],"values":[{"name":"connect","comment":" Command to request wallet connection.\n","type":"Web3.Wallet.WalletCmd"},{"name":"decoder","comment":" Decode a Msg from the JS wallet port.\n","type":"Json.Decode.Decoder Web3.Wallet.Msg"},{"name":"disconnect","comment":" Command to request wallet disconnection.\n","type":"Web3.Wallet.WalletCmd"},{"name":"encode","comment":" Encode a WalletCmd for the JS port.\n","type":"Web3.Wallet.WalletCmd -> Json.Encode.Value"},{"name":"getAddress","comment":" Extract the connected address, if any.\n","type":"Web3.Wallet.State -> Maybe.Maybe Web3.Types.Address"},{"name":"getChainId","comment":" Extract the connected chain ID, if any.\n","type":"Web3.Wallet.State -> Maybe.Maybe Web3.Types.ChainId"},{"name":"isConnected","comment":" True if the wallet is in the Connected state.\n","type":"Web3.Wallet.State -> Basics.Bool"},{"name":"selectWallet","comment":" Command to select a specific wallet by its RDNS identifier (EIP-6963).\n\n    selectWallet \"io.metamask\"\n\n","type":"String.String -> Web3.Wallet.WalletCmd"},{"name":"switchChain","comment":" Command to switch chain.\n","type":"Web3.Types.ChainId -> Web3.Wallet.WalletCmd"},{"name":"update","comment":" Update wallet state from a port message.\n","type":"Web3.Types.ChainId -> Web3.Wallet.Msg -> Web3.Wallet.State -> Web3.Wallet.State"}],"binops":[]}]