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: HoprBalance,
    ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<(ChannelId, ChainReceipt), Self::Error>>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn fund_channel<'a, 'async_trait>(
        &'a self,
        channel_id: &'a ChannelId,
        amount: HoprBalance,
    ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<ChainReceipt, Self::Error>>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait;
    fn close_channel<'a, 'async_trait>(
        &'a self,
        channel_id: &'a ChannelId,
    ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<(ChannelStatus, ChainReceipt), Self::Error>>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: '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: HoprBalance, ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<(ChannelId, ChainReceipt), Self::Error>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Opens a channel with dst and amount.

Source

fn fund_channel<'a, 'async_trait>( &'a self, channel_id: &'a ChannelId, amount: HoprBalance, ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<ChainReceipt, Self::Error>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Funds an existing channel.

Source

fn close_channel<'a, 'async_trait>( &'a self, channel_id: &'a ChannelId, ) -> Pin<Box<dyn Future<Output = Result<BoxFuture<'a, Result<(ChannelStatus, ChainReceipt), Self::Error>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

Closes an existing channel.

Implementors§