ChainWriteChannelOperations

Trait ChainWriteChannelOperations 

Source
pub trait ChainWriteChannelOperations {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn open_channel<'a, 'async_trait>(
        &'a self,
        dst: &'a Address,
        amount: Balance<WxHOPR>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(HashBase<CoreWrapper<Keccak256Core>>, HashBase<CoreWrapper<Keccak256Core>>), Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
       where 'a: 'async_trait,
             Self: 'async_trait;
    fn fund_channel<'a, 'async_trait>(
        &'a self,
        channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>,
        amount: Balance<WxHOPR>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
       where 'a: 'async_trait,
             Self: 'async_trait;
    fn close_channel<'a, 'async_trait>(
        &'a self,
        channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
       where 'a: 'async_trait,
             Self: 'async_trait;
}
Expand description

On-chain write operations regarding channels.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn open_channel<'a, 'async_trait>( &'a self, dst: &'a Address, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(HashBase<CoreWrapper<Keccak256Core>>, HashBase<CoreWrapper<Keccak256Core>>), Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Opens a channel with dst and amount.

Source

fn fund_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Funds an existing channel.

Source

fn close_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Closes an existing channel.

Implementations on Foreign Types§

Source§

impl<'b, T> ChainWriteChannelOperations for &'b T

Source§

type Error = <T as ChainWriteChannelOperations>::Error

Source§

fn open_channel<'a, 'async_trait>( &'a self, dst: &'a Address, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(HashBase<CoreWrapper<Keccak256Core>>, HashBase<CoreWrapper<Keccak256Core>>), <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: 'async_trait,

Source§

fn fund_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: 'async_trait,

Source§

fn close_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: 'async_trait,

Source§

impl<T> ChainWriteChannelOperations for Box<T>

Source§

type Error = <T as ChainWriteChannelOperations>::Error

Source§

fn open_channel<'a, 'async_trait>( &'a self, dst: &'a Address, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(HashBase<CoreWrapper<Keccak256Core>>, HashBase<CoreWrapper<Keccak256Core>>), <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: 'async_trait,

Source§

fn fund_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: 'async_trait,

Source§

fn close_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: 'async_trait,

Source§

impl<T> ChainWriteChannelOperations for Arc<T>

Source§

type Error = <T as ChainWriteChannelOperations>::Error

Source§

fn open_channel<'a, 'async_trait>( &'a self, dst: &'a Address, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<(HashBase<CoreWrapper<Keccak256Core>>, HashBase<CoreWrapper<Keccak256Core>>), <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: 'async_trait,

Source§

fn fund_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, amount: Balance<WxHOPR>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: 'async_trait,

Source§

fn close_channel<'a, 'async_trait>( &'a self, channel_id: &'a HashBase<CoreWrapper<Keccak256Core>>, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Future<Output = Result<HashBase<CoreWrapper<Keccak256Core>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: 'async_trait,

Implementors§