pub struct ApprovalParams { /* private fields */ }Expand description
Parameters for FyndClient::approval.
Implementations§
Source§impl ApprovalParams
impl ApprovalParams
Sourcepub fn new(token: Bytes, amount: BigUint, check_allowance: bool) -> Self
pub fn new(token: Bytes, amount: BigUint, check_allowance: bool) -> 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.
When check_allowance is true, FyndClient::approval checks the on-chain allowance
first and returns None if it is already sufficient.
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.
Auto 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> 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