pub trait BlockchainClient:
Sized
+ Send
+ Sync
+ 'static {
type MetadataParams: DeserializeOwned + Send + Sync + 'static;
type Metadata: Serialize;
Show 14 methods
// Required methods
fn create_config(network: &str) -> Result<BlockchainConfig>;
fn new<'life0, 'async_trait>(
config: BlockchainConfig,
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn config(&self) -> &BlockchainConfig;
fn genesis_block(&self) -> &BlockIdentifier;
fn node_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockIdentifier>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn balance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
block: &'life2 BlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn coins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
block: &'life2 BlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Vec<Coin>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn faucet<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
param: u128,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
public_key: &'life1 PublicKey,
params: &'life2 Self::MetadataParams,
) -> Pin<Box<dyn Future<Output = Result<Self::Metadata>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn submit<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn block<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 PartialBlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Block>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn block_transaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
block: &'life1 BlockIdentifier,
tx: &'life2 TransactionIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Transaction>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CallRequest,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Associated Types§
type MetadataParams: DeserializeOwned + Send + Sync + 'static
type Metadata: Serialize
Required Methods§
fn create_config(network: &str) -> Result<BlockchainConfig>
fn new<'life0, 'async_trait>(
config: BlockchainConfig,
addr: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn config(&self) -> &BlockchainConfig
fn genesis_block(&self) -> &BlockIdentifier
fn node_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn current_block<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockIdentifier>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn balance<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
block: &'life2 BlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<u128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn coins<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
address: &'life1 Address,
block: &'life2 BlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Vec<Coin>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn faucet<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
param: u128,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
public_key: &'life1 PublicKey,
params: &'life2 Self::MetadataParams,
) -> Pin<Box<dyn Future<Output = Result<Self::Metadata>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn submit<'life0, 'life1, 'async_trait>(
&'life0 self,
transaction: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn block<'life0, 'life1, 'async_trait>(
&'life0 self,
block: &'life1 PartialBlockIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Block>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn block_transaction<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
block: &'life1 BlockIdentifier,
tx: &'life2 TransactionIdentifier,
) -> Pin<Box<dyn Future<Output = Result<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 CallRequest,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.