{"id":19508034,"url":"https://github.com/airalab/hs-web3","last_synced_at":"2025-05-16T18:07:03.184Z","repository":{"id":11505282,"uuid":"69875468","full_name":"airalab/hs-web3","owner":"airalab","description":"Web3 API for Haskell","archived":false,"fork":false,"pushed_at":"2024-10-25T10:43:26.000Z","size":1794,"stargazers_count":194,"open_issues_count":11,"forks_count":68,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-08T05:41:50.034Z","etag":null,"topics":["ethereum","haskell","ipfs","kusama","polkadot","web3"],"latest_commit_sha":null,"homepage":"http://hackage.haskell.org/package/web3","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/airalab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-03T13:56:19.000Z","updated_at":"2025-04-28T17:39:49.000Z","dependencies_parsed_at":"2024-10-25T13:33:41.234Z","dependency_job_id":"65793f74-da46-40b7-80d7-06f8aae46910","html_url":"https://github.com/airalab/hs-web3","commit_stats":{"total_commits":544,"total_committers":32,"mean_commits":17.0,"dds":0.5091911764705883,"last_synced_commit":"620c774f81d0d09d4b1265f8e4f7482d5c35ffd2"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airalab%2Fhs-web3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airalab%2Fhs-web3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airalab%2Fhs-web3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airalab%2Fhs-web3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airalab","download_url":"https://codeload.github.com/airalab/hs-web3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582905,"owners_count":22095518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","haskell","ipfs","kusama","polkadot","web3"],"created_at":"2024-11-10T23:02:59.837Z","updated_at":"2025-05-16T18:07:03.164Z","avatar_url":"https://github.com/airalab.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Web3 API for Haskell\n====================\n\nThis library implements Haskell API client for popular Web3 platforms.\n\n[![Documentation Status](https://readthedocs.org/projects/hs-web3/badge/?version=latest)](https://hs-web3.readthedocs.io/en/latest/?badge=latest)\n[![CI](https://github.com/airalab/hs-web3/workflows/CI/badge.svg)](https://github.com/airalab/hs-web3/actions)\n[![Hackage](https://img.shields.io/hackage/v/web3.svg)](http://hackage.haskell.org/package/web3)\n[![LTS-22](http://stackage.org/package/web3/badge/lts-22)](http://stackage.org/lts-22/package/web3)\n[![nightly](http://stackage.org/package/web3/badge/nightly)](http://stackage.org/nightly/package/web3)\n[![Code Triagers](https://www.codetriage.com/airalab/hs-web3/badges/users.svg)](https://www.codetriage.com/airalab/hs-web3)\n\nInstall\n-------\n\n`stack install web3`\n\nUsage\n-----\n\n```haskell\n{-# LANGUAGE OverloadedStrings #-}\n\nmodule Main where\n\n-- Basic imports\nimport           Network.Ethereum\nimport           Network.Web3\n\n-- Eth API support\nimport qualified Network.Ethereum.Api.Eth   as Eth\nimport           Network.Ethereum.Api.Types\n\n-- ENS support\nimport qualified Network.Ethereum.Ens       as Ens\n\n-- Lens to simple param setting\nimport           Lens.Micro                 ((.~))\n\nmain :: IO ()\nmain = do\n    -- Use default provider on http://localhost:8545\n    ret \u003c- runWeb3 $ do\n\n        -- Get address of default account\n        me \u003c- head \u003c$\u003e Eth.accounts\n\n        -- Get balance of default account on latest block\n        myBalance \u003c- Eth.getBalance me Latest\n\n        -- Get half of balance\n        let halfBalance = fromWei (myBalance / 2)\n\n        -- Use default account\n        withAccount () $ do\n            -- Get Ethereum address via ENS\n            alice \u003c- Ens.resolve \"alice.address.on.eth\"\n            bob   \u003c- Ens.resolve \"bob.address.on.eth\"\n\n            -- Send transaction with value\n            withParam (value .~ halfBalance) $ do\n\n                -- Send transaction to alice account\n                withParam (to .~ alice) $ send ()\n\n                -- Send transaction to bob account\n                withParam (to .~ bob) $ send ()\n\n        -- Return sended value\n        return halfBalance\n\n    -- Web3 error handling\n    case ret of\n        Left e  -\u003e error $ show e\n        Right v -\u003e print (v :: Ether)  -- Print returned value in ethers\n```\n\n---\n\nRead more in the [documentation on ReadTheDocs](https://hs-web3.readthedocs.io).\n\nLicense\n-------\n\n* `Network.Polkadot` and `Codec.Scale` is licensed under [Apache 2.0](https://github.com/airalab/hs-web3/blob/master/LICENSE-APACHE2)\n* All other source is licensed under [BSD-3-Clause](https://github.com/airalab/hs-web3/blob/master/LICENSE-BSD3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairalab%2Fhs-web3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairalab%2Fhs-web3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairalab%2Fhs-web3/lists"}