pub struct VaultTransfer { /* private fields */ }Implementations§
Source§impl VaultTransfer
impl VaultTransfer
Sourcepub fn deposit(vault: Address, usdc: Dec) -> Result<VaultTransfer, BadUnits>
pub fn deposit(vault: Address, usdc: Dec) -> Result<VaultTransfer, BadUnits>
USDC from the perp balance into vault, at most six places: refused
rather than rounded when finer.
Sourcepub fn withdraw(vault: Address, usdc: Dec) -> Result<VaultTransfer, BadUnits>
pub fn withdraw(vault: Address, usdc: Dec) -> Result<VaultTransfer, BadUnits>
USDC out of vault once its lockup has passed. A whole equity runs
past six places; cut it first (crate::utils::cut_units) or take
maxWithdrawable from crate::earn::vaults::vault_details.
Sourcepub const fn from_micros(
vault: Address,
is_deposit: bool,
usd: u64,
) -> VaultTransfer
pub const fn from_micros( vault: Address, is_deposit: bool, usd: u64, ) -> VaultTransfer
From a count of millionths already made.
pub const fn usd(&self) -> u64
pub const fn vault(&self) -> Address
Trait Implementations§
Source§impl Clone for VaultTransfer
impl Clone for VaultTransfer
impl Copy for VaultTransfer
Source§impl Debug for VaultTransfer
impl Debug for VaultTransfer
impl Eq for VaultTransfer
Source§impl L1Action for VaultTransfer
impl L1Action for VaultTransfer
Source§fn action(&self) -> Map
fn action(&self) -> Map
The action’s keys and values in wire order, which is the hashed order.
fn msgpack(&self) -> Vec<u8> ⓘ
fn connection_id(&self, nonce: u64, vault: Option<Address>) -> [u8; 32]
fn typed( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> TypedStruct<'static>
fn digest( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> [u8; 32]
Source§fn wallet_json(
&self,
nonce: u64,
vault: Option<Address>,
network: Network,
) -> String
fn wallet_json( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> String
For a master wallet signing in the browser. It needs chain 1337.
fn body( &self, nonce: u64, signature: &Signature, vault: Option<Address>, ) -> String
Source§impl PartialEq for VaultTransfer
impl PartialEq for VaultTransfer
impl StructuralPartialEq for VaultTransfer
Auto Trait Implementations§
impl Freeze for VaultTransfer
impl RefUnwindSafe for VaultTransfer
impl Send for VaultTransfer
impl Sync for VaultTransfer
impl Unpin for VaultTransfer
impl UnsafeUnpin for VaultTransfer
impl UnwindSafe for VaultTransfer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.