pub struct UpdateLeverage { /* private fields */ }Expand description
updateLeverage: {type, asset, isCross, leverage}.
Implementations§
Source§impl UpdateLeverage
impl UpdateLeverage
Sourcepub fn new(
asset: Asset,
mode: MarginMode,
leverage: u32,
) -> Result<UpdateLeverage, TradeError>
pub fn new( asset: Asset, mode: MarginMode, leverage: u32, ) -> Result<UpdateLeverage, TradeError>
A whole number, at least 1. What the asset allows (its maxLeverage, whether it takes cross)
is checked by crate::trade::checked_leverage.
pub const fn leverage(&self) -> u32
pub const fn mode(&self) -> MarginMode
Trait Implementations§
Source§impl Clone for UpdateLeverage
impl Clone for UpdateLeverage
impl Copy for UpdateLeverage
Source§impl Debug for UpdateLeverage
impl Debug for UpdateLeverage
impl Eq for UpdateLeverage
Source§impl From<UpdateLeverage> for TradeAction
impl From<UpdateLeverage> for TradeAction
Source§fn from(action: UpdateLeverage) -> TradeAction
fn from(action: UpdateLeverage) -> TradeAction
Converts to this type from the input type.
Source§impl L1Action for UpdateLeverage
impl L1Action for UpdateLeverage
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 UpdateLeverage
impl PartialEq for UpdateLeverage
impl StructuralPartialEq for UpdateLeverage
Auto Trait Implementations§
impl Freeze for UpdateLeverage
impl RefUnwindSafe for UpdateLeverage
impl Send for UpdateLeverage
impl Sync for UpdateLeverage
impl Unpin for UpdateLeverage
impl UnsafeUnpin for UpdateLeverage
impl UnwindSafe for UpdateLeverage
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.