{"id":13606122,"url":"https://github.com/tomusdrw/rust-web3","last_synced_at":"2025-05-13T21:07:34.685Z","repository":{"id":37677371,"uuid":"77491041","full_name":"tomusdrw/rust-web3","owner":"tomusdrw","description":"Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library.  ENS address: rust-web3.eth","archived":false,"fork":false,"pushed_at":"2024-09-11T14:51:07.000Z","size":2287,"stargazers_count":1483,"open_issues_count":100,"forks_count":473,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-28T12:09:52.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomusdrw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-12-28T00:40:20.000Z","updated_at":"2025-04-25T16:33:52.000Z","dependencies_parsed_at":"2023-12-19T15:08:06.366Z","dependency_job_id":"c51817c7-dddd-4fae-8017-c3b124ea3e03","html_url":"https://github.com/tomusdrw/rust-web3","commit_stats":{"total_commits":353,"total_committers":97,"mean_commits":"3.6391752577319587","dds":0.8101983002832861,"last_synced_commit":"68f2a6d908cec726ad557fdc5bebebc5bed4de9b"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-web3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-web3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-web3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomusdrw%2Frust-web3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomusdrw","download_url":"https://codeload.github.com/tomusdrw/rust-web3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569009,"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":[],"created_at":"2024-08-01T19:01:06.262Z","updated_at":"2025-04-28T12:09:58.838Z","avatar_url":"https://github.com/tomusdrw.png","language":"Rust","readme":"# web3\n\nEthereum JSON-RPC multi-transport client.\nRust implementation of Web3.js library.\n\n[![Build Status][ci-image]][ci-url] [![Crates.io](https://img.shields.io/crates/v/web3)](https://crates.io/crates/web3)\n\n[ci-image]: https://github.com/tomusdrw/rust-web3/workflows/Compilation%20and%20Testing%20Suite/badge.svg\n[ci-url]: https://github.com/tomusdrw/rust-web3/actions?query=workflow%3A%22Compilation+and+Testing+Suite%22\n[docs-rs-badge]: https://docs.rs/web3/badge.svg\n[docs-rs-url]: https://docs.rs/web3\n\nDocumentation: [crates.io][docs-rs-url]\n\n## Status\n\nNote this package is **barely maintained** and I am looking for an active maintainer (see #664).\nIf you are starting a new project, I'd recommend choosing https://github.com/gakonst/ethers-rs instead.\n\n## Usage\n\nFirst, add this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nweb3 = \"0.19.0\"\n```\n\n## Example\n```rust\n#[tokio::main]\nasync fn main() -\u003e web3::Result\u003c()\u003e {\n    let transport = web3::transports::Http::new(\"http://localhost:8545\")?;\n    let web3 = web3::Web3::new(transport);\n\n    println!(\"Calling accounts.\");\n    let mut accounts = web3.eth().accounts().await?;\n    println!(\"Accounts: {:?}\", accounts);\n    accounts.push(\"00a329c0648769a73afac7f9381e08fb43dbea72\".parse().unwrap());\n\n    println!(\"Calling balance.\");\n    for account in accounts {\n        let balance = web3.eth().balance(account, None).await?;\n        println!(\"Balance of {:?}: {}\", account, balance);\n    }\n\n    Ok(())\n}\n```\n\nIf you want to deploy smart contracts you have written you can do something like this (make sure you have the solidity compiler installed):\n\n`solc -o build --bin --abi contracts/*.sol`\n\nThe solidity compiler is generating the binary and abi code for the smart contracts in a directory called contracts and is being output to a directory called build.\n\nFor more see [examples folder](./examples).\n\n## Futures migration\n- [ ] Get rid of parking_lot (replace with async-aware locks if really needed).\n- [ ] Consider getting rid of `Unpin` requirements. (#361)\n- [x] WebSockets: TLS support (#360)\n- [ ] WebSockets: Reconnecting \u0026 Pings\n- [x] Consider using `tokio` instead of `async-std` for `ws.rs` transport (issue with test).\n- [x] Restore IPC Transport\n\n## General\n- [ ] More flexible API (accept `Into\u003cX\u003e`)\n- [x] Contract calls (ABI encoding; `debris/ethabi`)\n- [X] Batch Requests\n\n## Transports\n- [x] HTTP transport\n- [x] IPC transport\n- [x] WebSockets transport\n\n## Types\n- [x] Types for `U256,H256,Address(H160)`\n- [x] Index type (numeric, encoded to hex)\n- [x] Transaction type (`Transaction` from Parity)\n- [x] Transaction receipt type (`TransactionReceipt` from Parity)\n- [x] Block type (`RichBlock` from Parity)\n- [x] Work type (`Work` from Parity)\n- [X] Syncing type (`SyncStats` from Parity)\n\n## APIs\n- [x] Eth: `eth_*`\n- [x] Eth filters: `eth_*`\n- [x] Eth pubsub: `eth_*`\n- [x] `net_*`\n- [x] `web3_*`\n- [x] `personal_*`\n- [ ] `traces_*`\n\n### Parity-specific APIs\n- [ ] Parity read-only: `parity_*`\n- [ ] Parity accounts: `parity_*` (partially implemented)\n- [x] Parity set: `parity_*`\n- [ ] `signer_*`\n\n- [x] Own APIs (Extendable)\n```rust\nlet web3 = Web3::new(transport);\nweb3.api::\u003cCustomNamespace\u003e().custom_method().wait().unwrap()\n```\n\n# Installation on Windows\n\nCurrently, Windows does not support IPC, which is enabled in the library by default.\nTo compile, you need to disable the IPC feature:\n```toml\nweb3 = { version = \"_\", default-features = false, features = [\"http\"] }\n```\n\n# Avoiding OpenSSL dependency\n\nOn Linux, `native-tls` is implemented using OpenSSL. To avoid that dependency\nfor HTTPS or WSS use the corresponding features.\n```toml\nweb3 = { version = \"_\", default-features = false, features = [\"http-rustls-tls\", \"ws-rustls-tokio\"] }\n```\n\n_Note: To fully replicate the default features also add `signing` \u0026 `ipc-tokio` features_.\n\n# Cargo Features\n\nThe library supports following features:\n- `http` - Enables HTTP transport (requires `tokio` runtime, because of `hyper`).\n- `http-tls` - Enables TLS support via `reqwest/default-tls` for HTTP transport (implies `http`; default).\n- `http-native-tls` - Enables TLS support via `reqwest/native-tls` for HTTP transport (implies `http`).\n- `http-rustls-tls` - Enables TLS support via `reqwest/rustls-tls` for HTTP transport (implies `http`).\n- `ws-tokio` - Enables WS transport using `tokio` runtime.\n- `ws-tls-tokio` - Enables TLS support for WS transport (implies `ws-tokio`; default).\n- `ws-rustls-tokio` - Enables rustls TLS support for WS transport (implies `ws-tokio`).\n- `ws-async-std` - Enables WS transport using `async-std` runtime.\n- `ws-tls-async-std` - Enables TLS support for WS transport (implies `ws-async-std`).\n- `ipc-tokio` - Enables IPC transport using `tokio` runtime (default).\n- `signing` - Enable account namespace and local-signing support (default).\n- `eip-1193` - Enable EIP-1193 support.\n- `wasm` - Compile for WASM (make sure to disable default features).\n- `arbitrary_precision` - Enable `arbitrary_precision` in `serde_json`.\n- `allow-missing-fields` - Some response fields are mandatory in Ethereum but not present in\n  EVM-compatible chains such as Celo and Fantom. This feature enables compatibility by setting a\n  default value on those fields.\n","funding_links":[],"categories":["Rust","crypto","Roadmap","Core"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Frust-web3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomusdrw%2Frust-web3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomusdrw%2Frust-web3/lists"}