1 unstable release

0.7.4 May 30, 2024

#54 in #parse-json

Download history 82/week @ 2024-07-22 105/week @ 2024-07-29 99/week @ 2024-08-05 118/week @ 2024-08-12 115/week @ 2024-08-19 166/week @ 2024-08-26 152/week @ 2024-09-02 278/week @ 2024-09-09 306/week @ 2024-09-16 302/week @ 2024-09-23 130/week @ 2024-09-30 156/week @ 2024-10-07 165/week @ 2024-10-14 309/week @ 2024-10-21 377/week @ 2024-10-28 563/week @ 2024-11-04

1,420 downloads per month
Used in 17 crates (6 directly)

MIT/Apache

510KB
11K SLoC

linera-alloy-json-abi

Full Ethereum JSON-ABI implementation.

This crate is a re-implementation of a part of ethabi's API, with a few main differences:

  • the Contract struct is now called JsonAbi and also contains the fallback and receive functions
  • the Param and EventParam structs only partially parse the type string instead of fully resolving it into a Solidity type

Examples

Parse a JSON ABI file into a JsonAbi struct:

use linera_alloy_json_abi::JsonAbi;

# stringify!(
let path = "path/to/abi.json";
let json = std::fs::read_to_string(path).unwrap();
# );
# let json = "[]";
let abi: JsonAbi = serde_json::from_str(&json).unwrap();
for item in abi.items() {
    println!("{item:?}");
}

Dependencies

~4.5–7.5MB
~143K SLoC