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, ) -> BasicPayloadGenerator
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 for BasicPayloadGenerator
impl PayloadGenerator for BasicPayloadGenerator
type TxRequest = TransactionRequest
Source§fn approve(
&self,
spender: Address,
amount: Balance<WxHOPR>,
) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn approve( &self, spender: Address, amount: Balance<WxHOPR>, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>where
C: Currency,
fn transfer<C>(
&self,
destination: Address,
amount: Balance<C>,
) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn announce( &self, announcement: AnnouncementData, key_binding_fee: Balance<WxHOPR>, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn fund_channel( &self, dest: Address, amount: Balance<WxHOPR>, ) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates the transaction payload to open a payment channel
Source§fn close_incoming_channel(
&self,
source: Address,
) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn close_incoming_channel( &self, source: Address, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn initiate_outgoing_channel_closure( &self, destination: Address, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn finalize_outgoing_channel_closure( &self, destination: Address, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn redeem_ticket( &self, acked_ticket: RedeemableTicket, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn register_safe_by_node( &self, safe_addr: Address, ) -> Result<<BasicPayloadGenerator 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<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn deregister_node_by_safe( &self, ) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates a transaction payload to remove the Safe instance. Once succeeded,
the node no longer manages the funds.
Source§fn deploy_safe(
&self,
balance: Balance<WxHOPR>,
admins: &[Address],
include_node: bool,
nonce: [u8; 64],
) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
fn deploy_safe( &self, balance: Balance<WxHOPR>, admins: &[Address], include_node: bool, nonce: [u8; 64], ) -> Result<<BasicPayloadGenerator as PayloadGenerator>::TxRequest, ChainTypesError>
Creates a transaction payload to deploy a new Safe instance with the initial
balance transferred from the signer and admins as Safe owners. Read moreimpl Copy for BasicPayloadGenerator
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