pub struct HoprChannelsInstance<P, N = Ethereum> { /* private fields */ }
Expand description
A HoprChannels
instance.
Contains type-safe methods for interacting with an on-chain instance of the
HoprChannels
contract located at a given address
, using a given
provider P
.
If the contract bytecode is available (see the sol!
documentation on how to provide it), the deploy
and deploy_builder
methods can
be used to deploy a new instance of the contract.
See the module-level documentation for all the available methods.
Implementations§
Source§impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Instantiation and getters/setters.
impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Instantiation and getters/setters.
Sourcepub const fn new(address: Address, provider: P) -> Self
pub const fn new(address: Address, provider: P) -> Self
Creates a new wrapper around an on-chain HoprChannels
contract instance.
See the wrapper’s documentation for more details.
Sourcepub async fn deploy(
provider: P,
_token: Address,
_noticePeriodChannelClosure: <Timestamp as SolType>::RustType,
_safeRegistry: Address,
) -> Result<HoprChannelsInstance<P, N>>
pub async fn deploy( provider: P, _token: Address, _noticePeriodChannelClosure: <Timestamp as SolType>::RustType, _safeRegistry: Address, ) -> Result<HoprChannelsInstance<P, N>>
Deploys this contract using the given provider
and constructor arguments, if any.
Returns a new instance of the contract, if the deployment was successful.
For more fine-grained control over the deployment process, use deploy_builder
instead.
Sourcepub fn deploy_builder(
provider: P,
_token: Address,
_noticePeriodChannelClosure: <Timestamp as SolType>::RustType,
_safeRegistry: Address,
) -> RawCallBuilder<P, N>
pub fn deploy_builder( provider: P, _token: Address, _noticePeriodChannelClosure: <Timestamp as SolType>::RustType, _safeRegistry: Address, ) -> RawCallBuilder<P, N>
Creates a RawCallBuilder
for deploying this contract using the given provider
and constructor arguments, if any.
This is a simple wrapper around creating a RawCallBuilder
with the data set to
the bytecode concatenated with the constructor’s ABI-encoded arguments.
Sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
Source§impl<P: Clone, N> HoprChannelsInstance<&P, N>
impl<P: Clone, N> HoprChannelsInstance<&P, N>
Sourcepub fn with_cloned_provider(self) -> HoprChannelsInstance<P, N>
pub fn with_cloned_provider(self) -> HoprChannelsInstance<P, N>
Clones the provider and returns a new instance with the cloned provider.
Source§impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Function calls.
impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Function calls.
Sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
Creates a new call builder using this contract instance’s provider and address.
Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.
Sourcepub fn ERC777_HOOK_FUND_CHANNEL_MULTI_SIZE(
&self,
) -> SolCallBuilder<&P, ERC777_HOOK_FUND_CHANNEL_MULTI_SIZECall, N>
pub fn ERC777_HOOK_FUND_CHANNEL_MULTI_SIZE( &self, ) -> SolCallBuilder<&P, ERC777_HOOK_FUND_CHANNEL_MULTI_SIZECall, N>
Creates a new call builder for the [ERC777_HOOK_FUND_CHANNEL_MULTI_SIZE
] function.
Sourcepub fn ERC777_HOOK_FUND_CHANNEL_SIZE(
&self,
) -> SolCallBuilder<&P, ERC777_HOOK_FUND_CHANNEL_SIZECall, N>
pub fn ERC777_HOOK_FUND_CHANNEL_SIZE( &self, ) -> SolCallBuilder<&P, ERC777_HOOK_FUND_CHANNEL_SIZECall, N>
Creates a new call builder for the [ERC777_HOOK_FUND_CHANNEL_SIZE
] function.
Sourcepub fn LEDGER_VERSION(&self) -> SolCallBuilder<&P, LEDGER_VERSIONCall, N>
pub fn LEDGER_VERSION(&self) -> SolCallBuilder<&P, LEDGER_VERSIONCall, N>
Creates a new call builder for the [LEDGER_VERSION
] function.
Sourcepub fn MAX_USED_BALANCE(&self) -> SolCallBuilder<&P, MAX_USED_BALANCECall, N>
pub fn MAX_USED_BALANCE(&self) -> SolCallBuilder<&P, MAX_USED_BALANCECall, N>
Creates a new call builder for the [MAX_USED_BALANCE
] function.
Sourcepub fn MIN_USED_BALANCE(&self) -> SolCallBuilder<&P, MIN_USED_BALANCECall, N>
pub fn MIN_USED_BALANCE(&self) -> SolCallBuilder<&P, MIN_USED_BALANCECall, N>
Creates a new call builder for the [MIN_USED_BALANCE
] function.
Sourcepub fn TOKENS_RECIPIENT_INTERFACE_HASH(
&self,
) -> SolCallBuilder<&P, TOKENS_RECIPIENT_INTERFACE_HASHCall, N>
pub fn TOKENS_RECIPIENT_INTERFACE_HASH( &self, ) -> SolCallBuilder<&P, TOKENS_RECIPIENT_INTERFACE_HASHCall, N>
Creates a new call builder for the [TOKENS_RECIPIENT_INTERFACE_HASH
] function.
Sourcepub fn VERSION(&self) -> SolCallBuilder<&P, VERSIONCall, N>
pub fn VERSION(&self) -> SolCallBuilder<&P, VERSIONCall, N>
Creates a new call builder for the [VERSION
] function.
Sourcepub fn _currentBlockTimestamp(
&self,
) -> SolCallBuilder<&P, _currentBlockTimestampCall, N>
pub fn _currentBlockTimestamp( &self, ) -> SolCallBuilder<&P, _currentBlockTimestampCall, N>
Creates a new call builder for the [_currentBlockTimestamp
] function.
Sourcepub fn _getChannelId(
&self,
source: Address,
destination: Address,
) -> SolCallBuilder<&P, _getChannelIdCall, N>
pub fn _getChannelId( &self, source: Address, destination: Address, ) -> SolCallBuilder<&P, _getChannelIdCall, N>
Creates a new call builder for the [_getChannelId
] function.
Sourcepub fn _getTicketHash(
&self,
redeemable: <RedeemableTicket as SolType>::RustType,
) -> SolCallBuilder<&P, _getTicketHashCall, N>
pub fn _getTicketHash( &self, redeemable: <RedeemableTicket as SolType>::RustType, ) -> SolCallBuilder<&P, _getTicketHashCall, N>
Creates a new call builder for the [_getTicketHash
] function.
Sourcepub fn _isWinningTicket(
&self,
ticketHash: FixedBytes<32>,
redeemable: <RedeemableTicket as SolType>::RustType,
params: <VRFParameters as SolType>::RustType,
) -> SolCallBuilder<&P, _isWinningTicketCall, N>
pub fn _isWinningTicket( &self, ticketHash: FixedBytes<32>, redeemable: <RedeemableTicket as SolType>::RustType, params: <VRFParameters as SolType>::RustType, ) -> SolCallBuilder<&P, _isWinningTicketCall, N>
Creates a new call builder for the [_isWinningTicket
] function.
Sourcepub fn canImplementInterfaceForAddress(
&self,
interfaceHash: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, canImplementInterfaceForAddressCall, N>
pub fn canImplementInterfaceForAddress( &self, interfaceHash: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, canImplementInterfaceForAddressCall, N>
Creates a new call builder for the [canImplementInterfaceForAddress
] function.
Sourcepub fn channels(
&self,
_0: FixedBytes<32>,
) -> SolCallBuilder<&P, channelsCall, N>
pub fn channels( &self, _0: FixedBytes<32>, ) -> SolCallBuilder<&P, channelsCall, N>
Creates a new call builder for the [channels
] function.
Sourcepub fn closeIncomingChannel(
&self,
source: Address,
) -> SolCallBuilder<&P, closeIncomingChannelCall, N>
pub fn closeIncomingChannel( &self, source: Address, ) -> SolCallBuilder<&P, closeIncomingChannelCall, N>
Creates a new call builder for the [closeIncomingChannel
] function.
Sourcepub fn closeIncomingChannelSafe(
&self,
selfAddress: Address,
source: Address,
) -> SolCallBuilder<&P, closeIncomingChannelSafeCall, N>
pub fn closeIncomingChannelSafe( &self, selfAddress: Address, source: Address, ) -> SolCallBuilder<&P, closeIncomingChannelSafeCall, N>
Creates a new call builder for the [closeIncomingChannelSafe
] function.
Sourcepub fn domainSeparator(&self) -> SolCallBuilder<&P, domainSeparatorCall, N>
pub fn domainSeparator(&self) -> SolCallBuilder<&P, domainSeparatorCall, N>
Creates a new call builder for the [domainSeparator
] function.
Sourcepub fn finalizeOutgoingChannelClosure(
&self,
destination: Address,
) -> SolCallBuilder<&P, finalizeOutgoingChannelClosureCall, N>
pub fn finalizeOutgoingChannelClosure( &self, destination: Address, ) -> SolCallBuilder<&P, finalizeOutgoingChannelClosureCall, N>
Creates a new call builder for the [finalizeOutgoingChannelClosure
] function.
Sourcepub fn finalizeOutgoingChannelClosureSafe(
&self,
selfAddress: Address,
destination: Address,
) -> SolCallBuilder<&P, finalizeOutgoingChannelClosureSafeCall, N>
pub fn finalizeOutgoingChannelClosureSafe( &self, selfAddress: Address, destination: Address, ) -> SolCallBuilder<&P, finalizeOutgoingChannelClosureSafeCall, N>
Creates a new call builder for the [finalizeOutgoingChannelClosureSafe
] function.
Sourcepub fn fundChannel(
&self,
account: Address,
amount: <Balance as SolType>::RustType,
) -> SolCallBuilder<&P, fundChannelCall, N>
pub fn fundChannel( &self, account: Address, amount: <Balance as SolType>::RustType, ) -> SolCallBuilder<&P, fundChannelCall, N>
Creates a new call builder for the [fundChannel
] function.
Sourcepub fn fundChannelSafe(
&self,
selfAddress: Address,
account: Address,
amount: <Balance as SolType>::RustType,
) -> SolCallBuilder<&P, fundChannelSafeCall, N>
pub fn fundChannelSafe( &self, selfAddress: Address, account: Address, amount: <Balance as SolType>::RustType, ) -> SolCallBuilder<&P, fundChannelSafeCall, N>
Creates a new call builder for the [fundChannelSafe
] function.
Sourcepub fn initiateOutgoingChannelClosure(
&self,
destination: Address,
) -> SolCallBuilder<&P, initiateOutgoingChannelClosureCall, N>
pub fn initiateOutgoingChannelClosure( &self, destination: Address, ) -> SolCallBuilder<&P, initiateOutgoingChannelClosureCall, N>
Creates a new call builder for the [initiateOutgoingChannelClosure
] function.
Sourcepub fn initiateOutgoingChannelClosureSafe(
&self,
selfAddress: Address,
destination: Address,
) -> SolCallBuilder<&P, initiateOutgoingChannelClosureSafeCall, N>
pub fn initiateOutgoingChannelClosureSafe( &self, selfAddress: Address, destination: Address, ) -> SolCallBuilder<&P, initiateOutgoingChannelClosureSafeCall, N>
Creates a new call builder for the [initiateOutgoingChannelClosureSafe
] function.
Sourcepub fn ledgerDomainSeparator(
&self,
) -> SolCallBuilder<&P, ledgerDomainSeparatorCall, N>
pub fn ledgerDomainSeparator( &self, ) -> SolCallBuilder<&P, ledgerDomainSeparatorCall, N>
Creates a new call builder for the [ledgerDomainSeparator
] function.
Sourcepub fn multicall(
&self,
data: Vec<Bytes>,
) -> SolCallBuilder<&P, multicallCall, N>
pub fn multicall( &self, data: Vec<Bytes>, ) -> SolCallBuilder<&P, multicallCall, N>
Creates a new call builder for the [multicall
] function.
Sourcepub fn noticePeriodChannelClosure(
&self,
) -> SolCallBuilder<&P, noticePeriodChannelClosureCall, N>
pub fn noticePeriodChannelClosure( &self, ) -> SolCallBuilder<&P, noticePeriodChannelClosureCall, N>
Creates a new call builder for the [noticePeriodChannelClosure
] function.
Sourcepub fn redeemTicket(
&self,
redeemable: <RedeemableTicket as SolType>::RustType,
params: <VRFParameters as SolType>::RustType,
) -> SolCallBuilder<&P, redeemTicketCall, N>
pub fn redeemTicket( &self, redeemable: <RedeemableTicket as SolType>::RustType, params: <VRFParameters as SolType>::RustType, ) -> SolCallBuilder<&P, redeemTicketCall, N>
Creates a new call builder for the [redeemTicket
] function.
Sourcepub fn redeemTicketSafe(
&self,
selfAddress: Address,
redeemable: <RedeemableTicket as SolType>::RustType,
params: <VRFParameters as SolType>::RustType,
) -> SolCallBuilder<&P, redeemTicketSafeCall, N>
pub fn redeemTicketSafe( &self, selfAddress: Address, redeemable: <RedeemableTicket as SolType>::RustType, params: <VRFParameters as SolType>::RustType, ) -> SolCallBuilder<&P, redeemTicketSafeCall, N>
Creates a new call builder for the [redeemTicketSafe
] function.
Sourcepub fn token(&self) -> SolCallBuilder<&P, tokenCall, N>
pub fn token(&self) -> SolCallBuilder<&P, tokenCall, N>
Creates a new call builder for the [token
] function.
Sourcepub fn tokensReceived(
&self,
_0: Address,
from: Address,
to: Address,
amount: U256,
userData: Bytes,
_5: Bytes,
) -> SolCallBuilder<&P, tokensReceivedCall, N>
pub fn tokensReceived( &self, _0: Address, from: Address, to: Address, amount: U256, userData: Bytes, _5: Bytes, ) -> SolCallBuilder<&P, tokensReceivedCall, N>
Creates a new call builder for the [tokensReceived
] function.
Sourcepub fn updateDomainSeparator(
&self,
) -> SolCallBuilder<&P, updateDomainSeparatorCall, N>
pub fn updateDomainSeparator( &self, ) -> SolCallBuilder<&P, updateDomainSeparatorCall, N>
Creates a new call builder for the [updateDomainSeparator
] function.
Sourcepub fn updateLedgerDomainSeparator(
&self,
) -> SolCallBuilder<&P, updateLedgerDomainSeparatorCall, N>
pub fn updateLedgerDomainSeparator( &self, ) -> SolCallBuilder<&P, updateLedgerDomainSeparatorCall, N>
Creates a new call builder for the [updateLedgerDomainSeparator
] function.
Source§impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Event filters.
impl<P: Provider<N>, N: Network> HoprChannelsInstance<P, N>
Event filters.
Sourcepub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
Creates a new event filter using this contract instance’s provider and address.
Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.
Sourcepub fn ChannelBalanceDecreased_filter(
&self,
) -> Event<&P, ChannelBalanceDecreased, N>
pub fn ChannelBalanceDecreased_filter( &self, ) -> Event<&P, ChannelBalanceDecreased, N>
Creates a new event filter for the ChannelBalanceDecreased
event.
Sourcepub fn ChannelBalanceIncreased_filter(
&self,
) -> Event<&P, ChannelBalanceIncreased, N>
pub fn ChannelBalanceIncreased_filter( &self, ) -> Event<&P, ChannelBalanceIncreased, N>
Creates a new event filter for the ChannelBalanceIncreased
event.
Sourcepub fn ChannelClosed_filter(&self) -> Event<&P, ChannelClosed, N>
pub fn ChannelClosed_filter(&self) -> Event<&P, ChannelClosed, N>
Creates a new event filter for the ChannelClosed
event.
Sourcepub fn ChannelOpened_filter(&self) -> Event<&P, ChannelOpened, N>
pub fn ChannelOpened_filter(&self) -> Event<&P, ChannelOpened, N>
Creates a new event filter for the ChannelOpened
event.
Sourcepub fn DomainSeparatorUpdated_filter(
&self,
) -> Event<&P, DomainSeparatorUpdated, N>
pub fn DomainSeparatorUpdated_filter( &self, ) -> Event<&P, DomainSeparatorUpdated, N>
Creates a new event filter for the DomainSeparatorUpdated
event.
Sourcepub fn LedgerDomainSeparatorUpdated_filter(
&self,
) -> Event<&P, LedgerDomainSeparatorUpdated, N>
pub fn LedgerDomainSeparatorUpdated_filter( &self, ) -> Event<&P, LedgerDomainSeparatorUpdated, N>
Creates a new event filter for the LedgerDomainSeparatorUpdated
event.
Sourcepub fn OutgoingChannelClosureInitiated_filter(
&self,
) -> Event<&P, OutgoingChannelClosureInitiated, N>
pub fn OutgoingChannelClosureInitiated_filter( &self, ) -> Event<&P, OutgoingChannelClosureInitiated, N>
Creates a new event filter for the OutgoingChannelClosureInitiated
event.
Sourcepub fn TicketRedeemed_filter(&self) -> Event<&P, TicketRedeemed, N>
pub fn TicketRedeemed_filter(&self) -> Event<&P, TicketRedeemed, N>
Creates a new event filter for the TicketRedeemed
event.
Trait Implementations§
Source§impl<P: Clone, N: Clone> Clone for HoprChannelsInstance<P, N>
impl<P: Clone, N: Clone> Clone for HoprChannelsInstance<P, N>
Source§fn clone(&self) -> HoprChannelsInstance<P, N>
fn clone(&self) -> HoprChannelsInstance<P, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<P, N> Freeze for HoprChannelsInstance<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for HoprChannelsInstance<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for HoprChannelsInstance<P, N>
impl<P, N> Sync for HoprChannelsInstance<P, N>
impl<P, N> Unpin for HoprChannelsInstance<P, N>
impl<P, N> UnwindSafe for HoprChannelsInstance<P, N>where
P: UnwindSafe,
N: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more