[][src]Struct cw20_bonding::curves::DecimalPlaces

pub struct DecimalPlaces {
    pub supply: u32,
    pub reserve: u32,
}

DecimalPlaces should be passed into curve constructors

Fields

supply: u32

Number of decimal places for the supply token (this is what was passed in cw20-base init

reserve: u32

Number of decimal places for the reserve token (eg. 6 for uatom, 9 for nstep, 18 for wei)

Implementations

impl DecimalPlaces[src]

pub fn new(supply: u8, reserve: u8) -> Self[src]

pub fn to_reserve(&self, reserve: Decimal) -> Uint128[src]

pub fn to_supply(&self, supply: Decimal) -> Uint128[src]

pub fn from_supply(&self, supply: Uint128) -> Decimal[src]

pub fn from_reserve(&self, reserve: Uint128) -> Decimal[src]

Trait Implementations

impl Clone for DecimalPlaces[src]

impl Copy for DecimalPlaces[src]

impl Debug for DecimalPlaces[src]

impl Default for DecimalPlaces[src]

impl<'de> Deserialize<'de> for DecimalPlaces[src]

impl JsonSchema for DecimalPlaces[src]

impl PartialEq<DecimalPlaces> for DecimalPlaces[src]

impl Serialize for DecimalPlaces[src]

impl StructuralPartialEq for DecimalPlaces[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.