1#![allow(
4 clippy::type_complexity,
5 clippy::wrong_self_convention,
6 clippy::single_match,
7 clippy::let_unit_value,
8 clippy::match_wild_err_arm
9)]
10#![warn(missing_docs)]
11#![recursion_limit = "256"]
13#![cfg_attr(not(any(feature = "std", feature = "test", test)), no_std)]
14
15#[cfg(test)]
16use jsonrpc_core as rpc;
17
18#[macro_use]
19extern crate alloc;
20
21pub use ethabi;
22#[macro_use]
25pub mod helpers;
26
27mod prelude {
28 pub(crate) use alloc::borrow::ToOwned as _;
29 pub(crate) use alloc::string::String;
30 pub(crate) use alloc::string::ToString as _;
31 pub(crate) use alloc::vec;
32 pub(crate) use alloc::vec::Vec;
33 #[cfg(not(any(feature = "std", feature = "test", test)))]
34 pub(crate) use core as std;
35}
36
37use prelude::*;
38
39#[macro_use]
41pub extern crate futures;
42
43pub mod api;
44pub mod confirm;
45pub mod contract;
46pub mod error;
47pub mod keys;
48pub mod signing;
49pub mod transports;
50pub mod types;
51
52pub use crate::{
53 api::{Accounts, Eth, Web3},
54 error::{Error, Result},
55};
56
57pub type RequestId = usize;
59
60type Value<'a> = &'a dyn erased_serde::Serialize;
61
62pub trait Transport: Clone {
66 type Out: core::future::Future<Output = Result<Vec<u8>>>;
68
69 fn execute(&self, method: &'static str, params: Vec<Value>) -> Self::Out;
71}
72
73impl<T: Transport> Transport for &T {
74 type Out = T::Out;
75
76 fn execute(&self, method: &'static str, params: Vec<Value>) -> Self::Out {
77 (*self).execute(method, params)
78 }
79}