Skip to main content

ChainWriteChannelOperations

Trait ChainWriteChannelOperations 

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>>, 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§

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>>, Self::Error>> + Send + 'a>>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Opens a channel with dst and amount.

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.

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§

§

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

§

type Error = <T as ChainWriteChannelOperations>::Error

§

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>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: '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>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: '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>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <&'b T as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, &'b T: 'async_trait,

§

impl<T> ChainWriteChannelOperations for Box<T>

§

type Error = <T as ChainWriteChannelOperations>::Error

§

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>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: '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>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: '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>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Box<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Box<T>: 'async_trait,

§

impl<T> ChainWriteChannelOperations for Arc<T>

§

type Error = <T as ChainWriteChannelOperations>::Error

§

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>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: '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>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: '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>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'a>>, <Arc<T> as ChainWriteChannelOperations>::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Arc<T>: 'async_trait,

Implementors§