pub struct ApprovalParams { /* private fields */ }Expand description
Parameters for FyndClient::approval.
Implementations§
Source§impl ApprovalParams
impl ApprovalParams
Sourcepub fn new(
token: Bytes,
amount: BigUint,
allowance_check: AllowanceCheck,
) -> Self
pub fn new( token: Bytes, amount: BigUint, allowance_check: AllowanceCheck, ) -> Self
Create approval parameters for the given token and amount.
Defaults to a standard ERC-20 approval against the router contract.
Use with_transfer_type to approve the Permit2 contract
instead.
Sourcepub fn with_transfer_type(self, transfer_type: UserTransferType) -> Self
pub fn with_transfer_type(self, transfer_type: UserTransferType) -> Self
Override the transfer type (and thus the spender contract).
UserTransferType::TransferFrom → router (default).
UserTransferType::TransferFromPermit2 → Permit2.
UserTransferType::UseVaultsFunds → FyndClient::approval returns None immediately.
Trait Implementations§
Source§impl Clone for ApprovalParams
impl Clone for ApprovalParams
Source§fn clone(&self) -> ApprovalParams
fn clone(&self) -> ApprovalParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ApprovalParams
impl RefUnwindSafe for ApprovalParams
impl Send for ApprovalParams
impl Sync for ApprovalParams
impl Unpin for ApprovalParams
impl UnsafeUnpin for ApprovalParams
impl UnwindSafe for ApprovalParams
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