pub struct SafePayloadGenerator { /* private fields */ }Expand description
Payload generator that generates Safe-compliant ABI
Implementations§
Source§impl SafePayloadGenerator
impl SafePayloadGenerator
pub fn new( chain_keypair: &ChainKeypair, contract_addrs: ContractAddresses, module: Address, ) -> SafePayloadGenerator
Trait Implementations§
Source§impl Clone for SafePayloadGenerator
impl Clone for SafePayloadGenerator
Source§fn clone(&self) -> SafePayloadGenerator
fn clone(&self) -> SafePayloadGenerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SafePayloadGenerator
impl Debug for SafePayloadGenerator
Source§impl PayloadGenerator for SafePayloadGenerator
impl PayloadGenerator for SafePayloadGenerator
type TxRequest = TransactionRequest
Source§fn approve(
&self,
spender: Address,
amount: Balance<WxHOPR>,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn approve( &self, spender: Address, amount: Balance<WxHOPR>, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Create an ERC20 approve transaction payload. Pre-requisite to open payment channels.
The
spender address is typically the HOPR Channels contract address.Source§fn transfer<C>(
&self,
destination: Address,
amount: Balance<C>,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>where
C: Currency,
fn transfer<C>(
&self,
destination: Address,
amount: Balance<C>,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>where
C: Currency,
Create a ERC20 transfer transaction payload
Source§fn announce(
&self,
announcement: AnnouncementData,
key_binding_fee: Balance<WxHOPR>,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn announce( &self, announcement: AnnouncementData, key_binding_fee: Balance<WxHOPR>, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates the transaction payload to announce a node on-chain.
Source§fn fund_channel(
&self,
dest: Address,
amount: Balance<WxHOPR>,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn fund_channel( &self, dest: Address, amount: Balance<WxHOPR>, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates the transaction payload to open a payment channel
Source§fn close_incoming_channel(
&self,
source: Address,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn close_incoming_channel( &self, source: Address, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates the transaction payload to immediately close an incoming payment channel
Source§fn initiate_outgoing_channel_closure(
&self,
destination: Address,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn initiate_outgoing_channel_closure( &self, destination: Address, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates the transaction payload that initiates the closure of a payment channel.
Once the notice period is due, the funds can be withdrawn using a
finalizeChannelClosure transaction.
Source§fn finalize_outgoing_channel_closure(
&self,
destination: Address,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn finalize_outgoing_channel_closure( &self, destination: Address, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates a transaction payload that withdraws funds from
an outgoing payment channel. This will succeed once the closure
notice period is due.
Source§fn redeem_ticket(
&self,
acked_ticket: RedeemableTicket,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn redeem_ticket( &self, acked_ticket: RedeemableTicket, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Used to create the payload to claim incentives for relaying a mixnet packet.
Source§fn register_safe_by_node(
&self,
safe_addr: Address,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn register_safe_by_node( &self, safe_addr: Address, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates a transaction payload to register a Safe instance which is used
to manage the node’s funds
Source§fn deregister_node_by_safe(
&self,
) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn deregister_node_by_safe( &self, ) -> Result<<SafePayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates a transaction payload to remove the Safe instance. Once succeeded,
the node no longer manages the funds.
impl Copy for SafePayloadGenerator
Auto Trait Implementations§
impl Freeze for SafePayloadGenerator
impl RefUnwindSafe for SafePayloadGenerator
impl Send for SafePayloadGenerator
impl Sync for SafePayloadGenerator
impl Unpin for SafePayloadGenerator
impl UnwindSafe for SafePayloadGenerator
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
Mutably borrows from an owned value. Read more
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> 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>
Converts
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>
Converts
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