Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library

Overview

web3

Ethereum JSON-RPC multi-transport client. Rust implementation of Web3.js library.

Build Status Crates.io

Documentation: crates.io

Usage

First, add this to your Cargo.toml:

[dependencies]
web3 = "0.17.0"

Example

#[tokio::main]
async fn main() -> web3::Result<()> {
    let transport = web3::transports::Http::new("http://localhost:8545")?;
    let web3 = web3::Web3::new(transport);

    println!("Calling accounts.");
    let mut accounts = web3.eth().accounts().await?;
    println!("Accounts: {:?}", accounts);
    accounts.push("00a329c0648769a73afac7f9381e08fb43dbea72".parse().unwrap());

    println!("Calling balance.");
    for account in accounts {
        let balance = web3.eth().balance(account, None).await?;
        println!("Balance of {:?}: {}", account, balance);
    }

    Ok(())
}

If you want to deploy smart contracts you have written you can do something like this (make sure you have the solidity compiler installed):

solc -o build --bin --abi contracts/*.sol

The 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.

For more see examples folder.

Futures migration

  • Get rid of parking_lot (replace with async-aware locks if really needed).
  • Consider getting rid of Unpin requirements. (#361)
  • WebSockets: TLS support (#360)
  • WebSockets: Reconnecting & Pings
  • Consider using tokio instead of async-std for ws.rs transport (issue with test).
  • Restore IPC Transport

General

  • More flexible API (accept Into)
  • Contract calls (ABI encoding; debris/ethabi)
  • Batch Requests

Transports

  • HTTP transport
  • IPC transport
  • WebSockets transport

Types

  • Types for U256,H256,Address(H160)
  • Index type (numeric, encoded to hex)
  • Transaction type (Transaction from Parity)
  • Transaction receipt type (TransactionReceipt from Parity)
  • Block type (RichBlock from Parity)
  • Work type (Work from Parity)
  • Syncing type (SyncStats from Parity)

APIs

  • Eth: eth_*
  • Eth filters: eth_*
  • Eth pubsub: eth_*
  • net_*
  • web3_*
  • personal_*
  • traces_*

Parity-specific APIs

  • Parity read-only: parity_*

  • Parity accounts: parity_* (partially implemented)

  • Parity set: parity_*

  • signer_*

  • Own APIs (Extendable)

let web3 = Web3::new(transport);
web3.api::<CustomNamespace>().custom_method().wait().unwrap()

Installation on Windows

Currently, Windows does not support IPC, which is enabled in the library by default. To compile, you need to disable the IPC feature:

web3 = { version = "0.17.0", default-features = false, features = ["http"] }

Avoiding OpenSSL dependency

On Linux, native-tls is implemented using OpenSSL. To avoid that dependency for HTTPS use the corresponding feature.

web3 = { version = "0.17.0", default-features = false, features = ["http-rustls-tls"] }

Cargo Features

The library supports following features:

  • http - Enables HTTP transport (requires tokio runtime, because of hyper).
  • http-tls - Enables TLS support via reqwest/default-tls for HTTP transport (implies http; default).
  • http-native-tls - Enables TLS support via reqwest/native-tls for HTTP transport (implies http).
  • http-rustls-tls - Enables TLS support via reqwest/rustls-tls for HTTP transport (implies http).
  • ws-tokio - Enables WS transport using tokio runtime.
  • ws-tls-tokio - Enables TLS support for WS transport (implies ws-tokio; default).
  • ws-async-std - Enables WS transport using async-std runtime.
  • ws-tls-async-std - Enables TLS support for WS transport (implies ws-async-std).
  • ipc-tokio - Enables IPC transport using tokio runtime (default).
  • signing - Enable account namespace and local-signing support (default).
  • eip-1193 - Enable EIP-1193 support.
  • wasm - Compile for WASM (make sure to disable default features).
  • arbitrary_precision - Enable arbitrary_precision in serde_json.
Comments
  • ABIencoderV2/tuple support

    ABIencoderV2/tuple support

    I believe the error I am running into is around abi encoder V2 and contracts that use it.

    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(SerdeJson(Error("Error(InvalidName(\"tuple\"), State { next_error: None, backtrace: InternalBacktrace })", line: 1, column: 267)), State { next_error: None, backtrace: InternalBacktrace })', src/libcore/result.rs:999:5
    

    Happy to try to help, but I am brand new to the library.

    opened by brockelmore 14
  • Rust Client Returns

    Rust Client Returns "Abi error: Invalid data"

    I'm building a Rust client to interact with a smart contract on Ethereum. The contract works, but there seems to be an issue with the client.

    I am building from this example: https://github.com/tomusdrw/rust-web3/blob/master/examples/contract.rs

    The contract has been deployed to Ganache and prepared via truffle console to the proper state. Running the client script should print a value of 100 (or the Wei equivalent). Instead, I get this:

    Abi error: Invalid data.

    Here is the relevant portion of the ABI:

    // --snip--
      {
        "inputs": [],
        "name": "balance",
        "outputs": [
          {
            "internalType": "uint256",
            "name": "",
            "type": "uint256"
          }
        ],
        "stateMutability": "view",
        "type": "function"
      },
    // --snip--
    

    The entire ABI is here: https://gist.github.com/creese/5e50fac5ce680636bf969088fa4dd798

    Here is the code:

    // --snip--
    #[tokio::main]
    async fn get_balance(
        args: BalanceArgs,
        config_overrides: Option<Vec<(String, String)>>,
    ) -> Result<String, Box<dyn Error>> {
    
        let http = web3::transports::Http::new("http://127.0.0.1:7545")?;
        let web3 = web3::Web3::new(http);
    
        let from: Address = config_overrides
            .unwrap()
            .iter()
            .filter(|x| x.0 == "from")
            .collect::<Vec<_>>()[0]
            .1
            .parse()?;
    
        let to: Address = args.address.parse()?;
    
        let contract = Contract::from_json(
            web3.eth(),
            to,
            include_bytes!("../../target/contracts/abi/contract.abi"),
        )?;
    
        let result =
            contract.query("balance", (from,), None, Options::default(), None);
        let balance: U256 = result.await?;
    
        // The code never reaches here.
    
        Ok(balance.as_u32().to_string())
    }
    // --snip--
    

    The error appears to be generated at or after the await. Do you have any suggestions as to what might be happening or the best way to troubleshoot?

    opened by creese 13
  • Use reqwest as client library for WASM browser support

    Use reqwest as client library for WASM browser support

    Having a quick glance to the dependencies I see you depend on hyper directly, would it be a big effort to use reqwest instead? is one of the most used http clients this days and provides a nicer API, on top of that they already went through the effort of making it work with web assembly which seems like a major effort that this project doesn't look very motivated to take. Reqwest would act as the abstraction layer that makes the switch from a hyper backend to browser fetch at compile time.
    Nicer http api plus wasm support, sounds like a nice deal right?

    enhancement help wanted 
    opened by olanod 13
  • Put original Solidity/other code in examples

    Put original Solidity/other code in examples

    Trying out the deployment of a contract, and everything is going smoothly except for the format of the bytecode/solidity contracts are supposed to be in. I'm getting many 'invalid data' and JSON parse errors for a simple 'greeter' contract.

    I think it would help to include original solidity code, and maybe even a quick snippet with the process of compiling the solidity code to ABI + JSON with official solc compiler.

    opened by insipx 10
  • Need help fetching past and new events from a contract while also checking sync status

    Need help fetching past and new events from a contract while also checking sync status

    I am trying to subscribe to events on the uniswap contracts, but am having some trouble getting any logs.

    If I were using pyweb3, I would want something like https://www.reddit.com/r/UniSwap/comments/atddo2/effective_way_to_get_all_uniswap_exchange/ehp8w1z/

    from web3.auto import w3
    
    abi = [{"name": "NewExchange", "inputs": [{"type": "address", "name": "token", "indexed": True}, {"type": "address", "name": "exchange", "indexed": True}], "anonymous": False, "type": "event"}]
    
    uniswap = w3.eth.contract('0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95', abi=abi)
    events = uniswap.events.NewExchange.createFilter(fromBlock=6627917).get_all_entries()
    token_exchange = {e.args.token: e.args.exchange for e in events}
    
    for token, exchange in token_exchange.items():
        print(token, exchange)
    

    Except instead of printing, I want to subscribe to the events of that Exchange.

    I am able to get the pubsub example working, so I know my web3 connection is correct.

    I will push the code I have up to GitHub soon, but wanted to get this issue made now in case there is something simple I'm missing. Right now, my rust code prints the current block number and then prints my filter, but it never prints anything else.

    7376907
    factory_filter: Filter {
        from_block: Some(
            Number(
                6627917
            )
        ),
        to_block: None,
        address: Some(
            ValueOrArray(
                [
                    0xc0a47dfe034b400b47bdad5fecda2621de6c4d95
                ]
            )
        ),
        topics: Some(
            [
                Some(
                    ValueOrArray(
                        [
                            0x9d42cb017eb05bd8944ab536a8b35bc68085931dd5f4356489801453923953f9
                        ]
                    )
                )
            ]
        ),
        limit: None
    }
    

    I've tried with and without setting the topic to keccack256("NewExchange(address,address)")

    Should I be using create_logs_filter or subscribe_logs or something else? Any suggestions, or do I need a more complete example?

    opened by WyseNynja 9
  • Migrate from tokio_core

    Migrate from tokio_core

    any plans to migrate to tokio from tokio_core in the near-future? I haven't looked through the entire codebase yet, but it seems as if it may be a sizeable undertaking

    refactor 
    opened by insipx 9
  • add http-rustls feature

    add http-rustls feature

    The existing http-tls feature enables TLS support via hyper-tls which in turn pulls in OpenSSL on Linux via native-tls. OpenSSL is written in C and has a long history of vulnerabilities caused by memory corruption.

    The new http-rustls feature allows to choose a TLS implementation that is written in Rust.

    Depends on #454 being merged first. I'll rebase once that happens.

    opened by toxeus 8
  • What's the best way to make `execute()`s `params` dynamic?

    What's the best way to make `execute()`s `params` dynamic?

    This is probably more of a Rust language question than related to this library, but I'm having a hard time finding a solution to this...

    For example calling

    .execute(bytecode, U256::from(100), accounts[0]).unwrap()
    

    Works fine when the Smart Contract in the bytecode only expects one constructor argument. If it, let's say, expects 2 arguments, this call needs to be changed to sth. like this (the single value turns into a tuple of size 2):

    .execute(bytecode, (U256::from(100), U256::from(200)), accounts[0]).unwrap()
    

    This can be done with #n amount of arguments as long as it's no more than 16 (as far as I understand).

    However, what if I don't know the number of arguments at compile time? I'd like to call execute() for several bytecodes and the constructor args I only now at runtime.

    Is there a way to do this?

    opened by 0x-r4bbit 8
  • Dropping EventLoopHandle after running a request causes the program to hang.

    Dropping EventLoopHandle after running a request causes the program to hang.

    Dropping EventLoopHandle before dropping Web3<T> causes a hang if at least one request has been issued. Example code:

    extern crate web3;
    
    use web3::futures::Future;
    
    fn main() {
      let (eloop, http) = web3::transports::Http::new("http://localhost:8545").unwrap();
      let web3 = web3::Web3::new(http);
      let _accounts = web3.eth().accounts().wait().unwrap();
    
      drop(eloop);
    }
    

    This became an issue when I created a struct that owned both EventLoopHandle and Web3<T>. If my struct fields were in the wrong order, the program would hang when attempting to drop my struct. If I switched the order of the fields, the program would run to completion.

    bug 
    opened by abrodersen 8
  • Cannot connect to client: Transport(

    Cannot connect to client: Transport("SendError(\"...\")")

    With the simple example below I get an error like Transport("SendError(\"...\")"). It worked in the beginning but then stopped working. Any idea what could cause that?

    extern crate web3;
    
    use web3::futures::Future;
    
    fn main() {
        let (_, transport) = web3::transports::Http::new("http://localhost:8545").unwrap();
        let web3 = web3::Web3::new(transport);
        let accounts = web3.eth().accounts().wait().unwrap();
    
        println!("Accounts: {:#?}", accounts);
    
    thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Transport("SendError(\"...\")")', src/libcore/result.rs:906:4
    stack backtrace:
       0:        0x10ed1fee3 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::h311e4a395df9fc90
       1:        0x10ed1c410 - std::sys_common::backtrace::_print::hebb60342f79f20b6
       2:        0x10ed21ce3 - std::panicking::default_hook::{{closure}}::h09124cef4c2cbbd0
       3:        0x10ed219e2 - std::panicking::default_hook::hfa171ff8edf516fa
       4:        0x10ed221f2 - std::panicking::rust_panic_with_hook::h3c41fb7cc19bbec2
       5:        0x10ed220d4 - std::panicking::begin_panic::he2991ed22bf2bf67
       6:        0x10ed21fa2 - std::panicking::begin_panic_fmt::hfd4bc5f2019d8a77
       7:        0x10ed21f0a - rust_begin_unwind
       8:        0x10ed58ec3 - core::panicking::panic_fmt::hae6752e5f963f9a5
       9:        0x10eaccb49 - core::result::unwrap_failed::h229ca956bb43bfce
      10:        0x10eacbb8b - <core::result::Result<T, E>>::unwrap::h317bd1e8f61b9bdc
      11:        0x10ead42d7 - raiden_rs::main::h50693c2b3a30536b
      12:        0x10ed2d66c - __rust_maybe_catch_panic
      13:        0x10ed226f8 - std::rt::lang_start::heab07b9c4d3b2654
      14:        0x10ead4434 - main
    
    opened by palango 8
  • Example of sending a transaction on actual Eth network (eg via Infura)

    Example of sending a transaction on actual Eth network (eg via Infura)

    I've managed to successfully send a transaction on ganache using send_trandaction(). However, the same method panics when trying to do it on actual Ethereum via Infura. Which makes sense I guess since at no point did I use the private key or sign the transaction.

    From this thread I gather I need to use the raw transaction method instead. I also found this crate to sign transactions. But so far I'm struggling to pull the lego pieces together - nor can I find examples in the docs (my bad if they're there and I missed them).

    Could someone provide an example of how to send an actual eth transaction, or at the very least describe the order of methods I need to call?

    opened by ilmoi 7
  • Replace `JsValue::into/from_serde` with `serde-wasm-bindgen`

    Replace `JsValue::into/from_serde` with `serde-wasm-bindgen`

    wasm-bindgen::serde-serialize feature may lead to a cyclic package dependency like

    error: cyclic package dependency: package `wasm-bindgen v0.2.74` depends on itself. Cycle:
    package `wasm-bindgen v0.2.74`
        ... which is depended on by `js-sys v0.3.51`
        ... which is depended on by `getrandom v0.2.2`
        ... which is depended on by `ahash v0.7.4`
        ... which is depended on by `hashbrown v0.11.2`
        ... which is depended on by `indexmap v1.7.0`
        ... which is depended on by `serde_json v1.0.57`
        ... which is depended on by `wasm-bindgen v0.2.74`
        ... which is depended on by `getrandom v0.1.14`
        ... which is depended on by `const-random-macro v0.1.8`
        ... which is depended on by `const-random v0.1.8`
        ... which is depended on by `ahash v0.2.18`
    

    Due to this problem, JsValue::into_serde and JsValue::from_serde were deprecated at https://github.com/rustwasm/wasm-bindgen/pull/3031

    Motivation: https://github.com/KomodoPlatform/atomicDEX-API/issues/1042#issuecomment-1348375886

    opened by sergeyboyko0791 3
  • windows https/wss connection

    windows https/wss connection

    Hi!

    I beg for help.

    I am trying to connect web3 crate to https endpoint from windows and so far no success ;//

    from linux everything is perfect, I set http-tls as features but no success...

    wss no success too

    opened by yarsawyer 0
  • issues with  return value type - array of tuples

    issues with return value type - array of tuples

    Hey I am trying to query a contract returns an array of tuples

    let result : Vec<(&str, &str)> = contract.query("fn_name", (), None, web3::contract::Options::default(), None).await.unwrap();
    

    but I am getting this err

    the trait `TokenizableItem` is not implemented for `(&str, &str)`
    

    This also seems to happen when another function returns a tuple of tuples. How should I handle these?

    opened by fasteater 0
  • Update base64 requirement from 0.13 to 0.20

    Update base64 requirement from 0.13 to 0.20

    Updates the requirements on base64 to permit the latest version.

    Changelog

    Sourced from base64's changelog.

    0.20.0

    Breaking changes

    • Update MSRV to 1.57.0
    • Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require correct padding.
      • The NO_PAD config now requires that padding be absent when decoding.

    0.20.0-alpha.1

    Breaking changes

    • Extended the Config concept into the Engine abstraction, allowing the user to pick different encoding / decoding implementations.
      • What was formerly the only algorithm is now the FastPortable engine, so named because it's portable (works on any CPU) and relatively fast.
      • This opens the door to a portable constant-time implementation (#153, presumably ConstantTimePortable?) for security-sensitive applications that need side-channel resistance, and CPU-specific SIMD implementations for more speed.
      • Standard base64 per the RFC is available via DEFAULT_ENGINE. To use different alphabets or other settings (padding, etc), create your own engine instance.
    • CharacterSet is now Alphabet (per the RFC), and allows creating custom alphabets. The corresponding tables that were previously code-generated are now built dynamically.
    • Since there are already multiple breaking changes, various functions are renamed to be more consistent and discoverable.
    • MSRV is now 1.47.0 to allow various things to use const fn.
    • DecoderReader now owns its inner reader, and can expose it via into_inner(). For symmetry, EncoderWriter can do the same with its writer.
    • encoded_len is now public so you can size encode buffers precisely.

    0.13.1

    • More precise decode buffer sizing, avoiding unnecessary allocation in decode_config.

    0.13.0

    • Config methods are const
    • Added EncoderStringWriter to allow encoding directly to a String
    • EncoderWriter now owns its delegate writer rather than keeping a reference to it (though refs still work)
      • As a consequence, it is now possible to extract the delegate writer from an EncoderWriter via finish(), which returns Result<W> instead of Result<()>. If you were calling finish() explicitly, you will now need to use let _ = foo.finish() instead of just foo.finish() to avoid a warning about the unused value.
    • When decoding input that has both an invalid length and an invalid symbol as the last byte, InvalidByte will be emitted instead of InvalidLength to make the problem more obvious.

    0.12.2

    • Add BinHex alphabet

    0.12.1

    • Add Bcrypt alphabet

    0.12.0

    • A Read implementation (DecoderReader) to let users transparently decoded data from a b64 input source
    • IMAP's modified b64 alphabet
    • Relaxed type restrictions to just AsRef<[ut8]> for main encode*/decode* functions
    • A minor performance improvement in encoding

    0.11.0

    • Minimum rust version 1.34.0

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Update ethereum-types requirement from 0.13.0 to 0.14.1

    Update ethereum-types requirement from 0.13.0 to 0.14.1

    Updates the requirements on ethereum-types to permit the latest version.

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Update env_logger requirement from 0.9 to 0.10

    Update env_logger requirement from 0.9 to 0.10

    Updates the requirements on env_logger to permit the latest version.

    Changelog

    Sourced from env_logger's changelog.

    0.10.0 - 2022-11-24

    MSRV changed to 1.60 to hide optional dependencies

    Fixes

    • Resolved soundness issue by switching from atty to is-terminal

    Breaking Changes

    To open room for changing dependencies:

    • Renamed termcolor feature to color
    • Renamed atty feature to auto-color

    0.9.3 - 2022-11-07

    • Fix a regression from v0.9.2 where env_logger would fail to compile with the termcolor feature turned off.

    0.9.2 - 2022-11-07

    • Fix and un-deprecate Target::Pipe, which was basically not working at all before and deprecated in 0.9.1.

    0.9.0 -- 2022-07-14

    Breaking Changes

    • Default message format now prints the target instead of the module

    Improvements

    • Added a method to print the module instead of the target
    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v0.18.0)
  • v0.18.0(Feb 6, 2022)

    What's Changed

    • Initialize secp256k1 context only once by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/535
    • Use shared context for both verification & signing by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/537
    • EIP-1559 Support by @mdben1247 in https://github.com/tomusdrw/rust-web3/pull/533
    • Optional Provider by @SionoiS in https://github.com/tomusdrw/rust-web3/pull/548
    • Fix panic when MetaMask returns error by @dvec in https://github.com/tomusdrw/rust-web3/pull/549
    • Update ethabi and ethereum-types by @palango in https://github.com/tomusdrw/rust-web3/pull/554
    • Update arrayvec by @palango in https://github.com/tomusdrw/rust-web3/pull/555
    • Update soketto by @palango in https://github.com/tomusdrw/rust-web3/pull/556
    • eth_feeHistory implementation by @sunce86 in https://github.com/tomusdrw/rust-web3/pull/558
    • Fix decimals decoding test by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/571
    • Do not require effectiveGasPrice in TransactionReceipt, by @marmistrz in https://github.com/tomusdrw/rust-web3/pull/570
    • Adding eth_getProof eth_ JSON-RPC method by @lightyear15 in https://github.com/tomusdrw/rust-web3/pull/569
    • Ethereum Name Service by @SionoiS in https://github.com/tomusdrw/rust-web3/pull/562
    • eth_getProof balance and nonce to U256 by @lightyear15 in https://github.com/tomusdrw/rust-web3/pull/572
    • Update ethabi requirement from 15.0.0 to 16.0.0 by @dependabot in https://github.com/tomusdrw/rust-web3/pull/577
    • Dependabot/cargo/secp256k1 0.21 by @palango in https://github.com/tomusdrw/rust-web3/pull/589
    • Update the docs for BaseFilter to mention that the filter is not uninstalled on Drop by @marmistrz in https://github.com/tomusdrw/rust-web3/pull/584
    • Support personal_sign rpc by @eiz in https://github.com/tomusdrw/rust-web3/pull/561
    • Update parking_lot requirement from 0.11.0 to 0.12.0 by @dependabot in https://github.com/tomusdrw/rust-web3/pull/591
    • signed_call (without confirmations) by @dpuyosa in https://github.com/tomusdrw/rust-web3/pull/581
    • move Accounts::hash_message and make it static by @blackghost1987 in https://github.com/tomusdrw/rust-web3/pull/588
    • Expose ParseSignatureError from recovery module by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/592
    • Allow setting basic auth credentials in websocket url by @717a56e1 in https://github.com/tomusdrw/rust-web3/pull/590
    • Get rid of compilation warnings in case signing is disabled. by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/594
    • Report HTTP failure codes as RPC errors if returned for an RPC call by @marmistrz in https://github.com/tomusdrw/rust-web3/pull/585
    • ENS documentation by @SionoiS in https://github.com/tomusdrw/rust-web3/pull/587
    • Fix compilation after broken GH auto-merge. by @tomusdrw in https://github.com/tomusdrw/rust-web3/pull/596
    • Fix clippy warnings by @niclaslind in https://github.com/tomusdrw/rust-web3/pull/597

    New Contributors

    • @SionoiS made their first contribution in https://github.com/tomusdrw/rust-web3/pull/548
    • @dvec made their first contribution in https://github.com/tomusdrw/rust-web3/pull/549
    • @palango made their first contribution in https://github.com/tomusdrw/rust-web3/pull/554
    • @sunce86 made their first contribution in https://github.com/tomusdrw/rust-web3/pull/558
    • @marmistrz made their first contribution in https://github.com/tomusdrw/rust-web3/pull/570
    • @lightyear15 made their first contribution in https://github.com/tomusdrw/rust-web3/pull/569
    • @eiz made their first contribution in https://github.com/tomusdrw/rust-web3/pull/561
    • @dpuyosa made their first contribution in https://github.com/tomusdrw/rust-web3/pull/581
    • @blackghost1987 made their first contribution in https://github.com/tomusdrw/rust-web3/pull/588
    • @717a56e1 made their first contribution in https://github.com/tomusdrw/rust-web3/pull/590
    • @niclaslind made their first contribution in https://github.com/tomusdrw/rust-web3/pull/597

    Full Changelog: https://github.com/tomusdrw/rust-web3/compare/v0.17.0...v0.18.0

    Source code(tar.gz)
    Source code(zip)
  • v0.17.0(Jul 29, 2021)

    • Rewrite HTTP Transport (#497)
    • Fix Windows IPC issues (#521)
    • Add baseFeePerGas to support London HF (#531)
    • Add CallRequestBuilder (#529)
    • Bump deps and improve docs & examples.
    Source code(tar.gz)
    Source code(zip)
  • v0.16.0-1(May 24, 2021)

    • Switch to reqwest as HTTP client & add WASM/browser support (#491)
    • trace_callMany (#494)
    • AccessList support - EIP 2930 (#489)
    • Fix infura compatiblity (#484)
    • tokio 1.0 (#454)
    • Allow signing deployment transaction (#473)
    • parity_pendingTransactions (#451)
    • TLS cleanups (#450, #466)

    and regular deps bump + bug fixes (IPC transport).

    Huge thanks to all contributors!!!

    Source code(tar.gz)
    Source code(zip)
  • v0.15.0(Jan 11, 2021)

  • v0.14.0(Dec 10, 2020)

    • Support both tokio and async-std runtimes (#368)
    • Support for HTTP_PROXY variables (#370)
    • Support for uint8[] types (#377)
    • Add txpool namespace support (#382)
    • Rewrite internal code to async/await (#387, #388, #389, #394, #398, #399, #403)
    • Expose TestTransport (#402)
    • Re-export ethabi (#409)
    • EIP-234 support (#411)
    • EIP-1193 support (#414)
    • Support pending block without author/miner (#405)
    • TurboGeth uncle format support (#406)

    Huge thanks to all contributors!!! :tada:

    Source code(tar.gz)
    Source code(zip)
  • v0.13.0(Jul 13, 2020)

    This release changes the way you handle signing. It's now your responsibility to prevent SecretKeys from leaking copies on stack/heap, see #365 for more details, solutions and migration path.

    • Add support for wss (#360)
    • Rework transport features (TLS especially) (#363)
    • Isolate crypto stuff and avoid dealing with leaking SecretKey (#365)
    • added Transaction::raw (#366)
    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Jun 22, 2020)

    • Get rid of futures=0.1, make the library async/await friendly. :partying_face:

    • Add Contract::signed_call_with_confirmations (#352)

    • Contract calldata api (#349)

    • Make CallRequest's to field optional (#348)

    • Basic contract events parsing (https://github.com/tomusdrw/rust-web3/commit/91133a00f9d4d129bfc21d10d6ac9213fcd709e0)

    • Box zeroize to prevent leaving copies on move. (#358)

    Regressions:

    • TLS support for WebSocket client
    • No IPC (UDS) transport
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(May 18, 2020)

    1. Implement parity namespace (#318)
    2. Bump ethabi to v11.0.0 (#326)
    3. Reimplement transaction signing with license compatible crate (#325)
    4. Update base64 requirement from 0.11.0 to 0.12.0 (#330)
    5. Tokenize negative signed integers (#333)
    6. Update Index type to be U64, make tx_index consistent (#336)
    7. Update ethabi and ethereum-types to latest (#339)
    8. Make logs_bloom optional (#343)
    9. Add root field to transaction receipt (#340)
    10. Support eth_call by block hash (#345)
    11. Implement Serde Deserialize for Call and Transaction Requests (#346)

    Full list of changes: https://github.com/tomusdrw/rust-web3/compare/v0.10.0...v0.11.0

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Jan 28, 2020)

  • v0.9.0(Jan 18, 2020)

    • Support Infura Project secret (#239)
    • Fail deploy on failed status (#242)
    • Improve error for byte deserialization (#251)
    • Parse r/s values from signTransaction as U256 (#250)
    • Updated blocks numbers to use U64 (#253)
    • Add web3::contract::deploy::execute_no_unlock (#252)
    • Exported all the "pub" types that weren't (#259)
    • Fixes to tracing (#262, #261, #260)
    • Implemented From for TransactionId (#273)
    • Expose eth_subscribe (#274)
    • Fix tokenization for arrays and primitives (#277, #307)
    • EitherTransport implementation, to support transport-agnostic code (#297)
    • estimate_gas: do not serialize null block number (#291)
    • Add eth_chainId method (#293)
    • Custom signing methods (#287)
    • Add transaction signing with in accounts sub-namespace. (#279)
    • Updated dependencies (#232, #240, #268, #271, #272, #275) Full list of changes: https://github.com/tomusdrw/rust-web3/compare/v0.8.0...v0.9.0
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jul 12, 2019)

  • v0.7.0(Jun 11, 2019)

    • Update ethereum-types dependency (#211)
    • Migrate to edition=2018 (#206)
    • Fix Errors not implementing std::error::Error (#217)
    • Fix traces (#213)
    • Add netPeers (#199)
    • Support for truffles library linking (#209)
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Mar 6, 2019)

  • v0.5.1(Dec 4, 2018)

  • v0.5.0(Nov 13, 2018)

    • Parity's traces namespace
    • Update to latest hyper
    • Make block_number and block_hash optional in the receipt
    • Add Eq and Hash for Bytes.

    Full list of changes: https://github.com/tomusdrw/rust-web3/compare/v0.4.0...v0.5.0

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Sep 14, 2018)

  • v0.3.1(Jul 19, 2018)

    Notable fixes:

    • Support basic auth credentials for HTTP transport (kudos @blackbeam; #112)
    • Avoid waiting for confirmations if confirmations are not required (kudos @cheme; #110)
    • Fix sync status (kudos @mjkoo; #111)
    • Fix subscribe_logs (kudos @mjkoo; #118)
    • Set Block seal_fields to an empty vector if missing (kudos @Jannis; #136)
    • add support for eth_getLogs method (kudos @forrest-marshall; #122)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 22, 2018)

    • Logs contain removed flag and log_type (#100)
    • Call contract with confirmations (#102)
    • Status field in transaction receipt (#98)
    • WebSocket transport (#101)
    • PubSub support (#105)
    • TLS support for HTTP (#106)

    Big kudos to the contributors @akuanti, @Kmoneal and especially to @mjkoo ! :tada: Great work guys!

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Feb 7, 2018)

    • Use proper bignum types for U256 and fixed-hash
    • Implement Debug for Web3 and transports.
    • Rewrite errors using error-chain
    • Rework transports to avoid running into lifetime issues when using futures and nested calls
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Sep 29, 2017)

  • v0.0.5(Aug 23, 2017)

  • v0.0.3(Feb 16, 2017)

Owner
Tomasz Drwięga
tomusdrw.eth
Tomasz Drwięga
An ether-rs middleware to access reth's db directly, bypassing JSON-RPC

Octane A ether-rs middleware for reth that bypasses JSON-RPC allowing for faster db queries. Work in Progress! Please note that Octane is currently in

Sorella Labs 75 Jun 4, 2023
Substreams development kit for Ethereum chains, contains Firehose Block model and helpers as well as utilities for Ethereum ABI encoding/decoding.

Substreams Ethereum Substreams development kit for Ethereum chains, contains Rust Firehose Block model and helpers as well as utilities for Ethereum A

StreamingFast 15 Oct 25, 2022
Ethereum (and Ethereum like) indexer using P2P message to fetch blocks and transactions

Ethereum P2P indexer This project is an indexer for Ethereum and Ethereum forks. It takes advantage of the ETH (Ethereum Wire Protocol) to fetch block

null 5 Nov 10, 2023
Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture.

?? Martinez ?? Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture. Why run Martinez? Look at

Arthur·Thomas 23 Jul 3, 2022
Making Token Exchange program with Solana(Rust), Web3, and Vue

Escrow program for Solana blockchain Tech stack Program (Smart Contract) Rust crates: solana-program, spl-token Solana CLI for test validator UI Types

Hoon Wee 3 May 10, 2022
A Web3.0 forum implemented based on Substrate

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Daogang Tang 5 Mar 24, 2022
A Web3.0 forum implemented based on Substrate

Substrate Node Template A fresh FRAME-based Substrate node, ready for hacking ?? Getting Started Follow the steps below to get started with the Node T

Mike Tang 5 Mar 24, 2022
Summer Boot (web2&web3, the decentralized web framework)

Summer Boot The next generation decentralized web framework allows users to manage and share their own data. It will be a wide area and cross regional

Summer 111 Dec 1, 2022
CYFS:Next Generation Protocol Family to Build Web3

CYFS is the next-generation technology to build real Web3 by upgrading the basic protocol of Web (TCP/IP+DNS+HTTP). It has a subversive architectural design that everyone brings their own OOD (Owner Online Device) to form a truly decentralized network.

CYFS Core Dev Team 2k Jul 6, 2023
Rust Ethereum 2.0 Client

Lighthouse: Ethereum 2.0 An open-source Ethereum 2.0 client, written in Rust and maintained by Sigma Prime. Documentation Overview Lighthouse is: Read

Sigma Prime 2.1k Jan 6, 2023
Rust client to Opensea's APIs and Ethereum smart contracts

opensea.rs Rust bindings & CLI to the Opensea API and Contracts CLI Usage Run cargo r -- --help to get the top level help menu: opensea-cli 0.1.0 Choo

Georgios Konstantopoulos 226 Dec 27, 2022
Rust client to Seaport's APIs and Ethereum smart contracts(WIP)

Seaport-rs WIP - WORK IN PROGRESS. REFER TO https://github.com/Alcibiades-Capital/quay FOR PRODUCTION READY CODE I'm new to Rust and seek to be legend

Perelyn 21 Nov 29, 2022
The fast, light, and robust client for the Ethereum mainnet.

OpenEthereum Fast and feature-rich multi-network Ethereum client. » Download the latest release « Table of Contents Description Technical Overview Bui

OpenEthereum 1.6k Dec 28, 2022
The fast, light, and robust client for Ethereum-like networks.

The Fastest and most Advanced Ethereum Client. » Download the latest release « Table of Contents Description Technical Overview Building 3.1 Building

OpenEthereum 6.7k Dec 24, 2022
The Fastest and most Advanced Ethereum Client

The Fastest and most Advanced Ethereum Client. » Download the latest release « Table of Contents Description Technical Overview Building 3.1 Building

Jay Lee 6 Feb 17, 2022
A crate for working with Ethereum beacon chain light client protocol messages. `no_std` friendly!

eth-lightclient-rs A crate for working with Ethereum beacon chain light client protocol messages. no_std friendly! !! For hacking and experimentation

Willem Olding 12 Jan 6, 2023
An experimental fork of a16z's Helios Ethereum client which can run its network traffic over the Nym mixnet

Helios (Nym mixnet fork) Helios is a fully trustless, efficient, and portable Ethereum light client written in Rust. This fork of Helios includes nasc

Nym 4 Mar 3, 2023
This is a solana lite rpc which optimizes sending transactions and confirming transactions strategies.

Solana Lite RPC This project aims to create a lite rpc server which is responsible only for sending and confirming the transactions. The lite-rpc serv

Blockworks Foundation 7 Dec 24, 2022
RPC over mezzenger transports.

zzrpc RPC over mezzenger transports. https://crates.io/crates/zzrpc usage See zzrpc-tutorial. targeting WebAssembly See rust-webapp-template-api. furt

Daniel Zduniak 4 Dec 30, 2022