pub struct TransferArgs { /* private fields */ }Expand description
Arguments for a transfer. amount, fee, recipient address, from record
Implementations§
Source§impl TransferArgs
impl TransferArgs
Sourcepub fn from(
amount: u64,
recipient_address: Address,
priority_fee: u64,
fee_record: Option<PlaintextRecord>,
transfer_type: TransferType,
) -> Self
pub fn from( amount: u64, recipient_address: Address, priority_fee: u64, fee_record: Option<PlaintextRecord>, transfer_type: TransferType, ) -> Self
Create a new transfer argument.
§Arguments
amount- The amount to be transferred.recipient_address- The address of the recipient.priority_fee- The fee for the transfer.fee_record- An optional record of the fee.transfer_type- The type of transfer.
§Returns
A TransferArgs - The transfer arguments.
§Example
use std::str::FromStr;
use aleo_agent::{Address, MICROCREDITS};
use aleo_agent::agent::{TransferArgs, TransferType};
let recipient_address = Address::zero();
let amount = 10 * MICROCREDITS; // 10 credit
let priority_fee = 0;
let transfer_args = TransferArgs::from(amount, recipient_address, priority_fee, None, TransferType::Public);Trait Implementations§
Source§impl Clone for TransferArgs
impl Clone for TransferArgs
Source§fn clone(&self) -> TransferArgs
fn clone(&self) -> TransferArgs
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 moreAuto Trait Implementations§
impl !Freeze for TransferArgs
impl RefUnwindSafe for TransferArgs
impl Send for TransferArgs
impl Sync for TransferArgs
impl Unpin for TransferArgs
impl UnwindSafe for TransferArgs
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,
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>
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