hopr_chain_actions::channels

Trait ChannelActions

Source
pub trait ChannelActions {
    // Required methods
    fn open_channel<'life0, 'async_trait>(
        &'life0 self,
        destination: Address,
        amount: Balance,
    ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fund_channel<'life0, 'async_trait>(
        &'life0 self,
        channel_id: Hash,
        amount: Balance,
    ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close_channel<'life0, 'async_trait>(
        &'life0 self,
        counterparty: Address,
        direction: ChannelDirection,
        redeem_before_close: bool,
    ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Gathers all channel related on-chain actions.

Required Methods§

Source

fn open_channel<'life0, 'async_trait>( &'life0 self, destination: Address, amount: Balance, ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Opens a channel to the given destination with the given amount staked.

Source

fn fund_channel<'life0, 'async_trait>( &'life0 self, channel_id: Hash, amount: Balance, ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Funds the given channel with the given amount

Source

fn close_channel<'life0, 'async_trait>( &'life0 self, counterparty: Address, direction: ChannelDirection, redeem_before_close: bool, ) -> Pin<Box<dyn Future<Output = Result<PendingAction>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes the channel to counterparty in the given direction. Optionally can issue redeeming of all tickets in that channel.

Implementors§

Source§

impl<Db> ChannelActions for ChainActions<Db>
where Db: HoprDbAllOperations + Clone + Send + Sync + Debug + 'static,