pub struct BasicPayloadGenerator { /* private fields */ }
Expand description
Generates transaction payloads that do not use Safe-compliant ABI
Implementations§
Source§impl BasicPayloadGenerator
impl BasicPayloadGenerator
pub fn new(me: Address, contract_addrs: ContractAddresses) -> Self
Trait Implementations§
Source§impl Clone for BasicPayloadGenerator
impl Clone for BasicPayloadGenerator
Source§fn clone(&self) -> BasicPayloadGenerator
fn clone(&self) -> BasicPayloadGenerator
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 BasicPayloadGenerator
impl Debug for BasicPayloadGenerator
Source§impl PayloadGenerator<TransactionRequest> for BasicPayloadGenerator
impl PayloadGenerator<TransactionRequest> for BasicPayloadGenerator
Source§fn approve(
&self,
spender: Address,
amount: HoprBalance,
) -> Result<TransactionRequest>
fn approve( &self, spender: Address, amount: HoprBalance, ) -> Result<TransactionRequest>
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: Currency>(
&self,
destination: Address,
amount: Balance<C>,
) -> Result<TransactionRequest>
fn transfer<C: Currency>( &self, destination: Address, amount: Balance<C>, ) -> Result<TransactionRequest>
Create a ERC20 transfer transaction payload
Source§fn announce(&self, announcement: AnnouncementData) -> Result<TransactionRequest>
fn announce(&self, announcement: AnnouncementData) -> Result<TransactionRequest>
Creates the transaction payload to announce a node on-chain.
Source§fn fund_channel(
&self,
dest: Address,
amount: HoprBalance,
) -> Result<TransactionRequest>
fn fund_channel( &self, dest: Address, amount: HoprBalance, ) -> Result<TransactionRequest>
Creates the transaction payload to open a payment channel
Source§fn close_incoming_channel(&self, source: Address) -> Result<TransactionRequest>
fn close_incoming_channel(&self, source: Address) -> Result<TransactionRequest>
Creates the transaction payload to immediately close an incoming payment channel
Source§fn initiate_outgoing_channel_closure(
&self,
destination: Address,
) -> Result<TransactionRequest>
fn initiate_outgoing_channel_closure( &self, destination: Address, ) -> Result<TransactionRequest>
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<TransactionRequest>
fn finalize_outgoing_channel_closure( &self, destination: Address, ) -> Result<TransactionRequest>
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<TransactionRequest>
fn redeem_ticket( &self, acked_ticket: RedeemableTicket, ) -> Result<TransactionRequest>
Used to create the payload to claim incentives for relaying a mixnet packet.
Source§fn register_safe_by_node(
&self,
safe_addr: Address,
) -> Result<TransactionRequest>
fn register_safe_by_node( &self, safe_addr: Address, ) -> Result<TransactionRequest>
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<TransactionRequest>
fn deregister_node_by_safe(&self) -> Result<TransactionRequest>
Creates a transaction payload to remove the Safe instance. Once succeeded,
the funds are no longer managed by the node.
Auto Trait Implementations§
impl Freeze for BasicPayloadGenerator
impl RefUnwindSafe for BasicPayloadGenerator
impl Send for BasicPayloadGenerator
impl Sync for BasicPayloadGenerator
impl Unpin for BasicPayloadGenerator
impl UnwindSafe for BasicPayloadGenerator
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