Preparing search index...
The search index is not available
lootex - v0.2.0
lootex
utils
Price
Class Price<T1, T2>
Type Parameters
T1
extends
Token
=
Token
T2
extends
Token
=
Token
Hierarchy (
view full
)
Fraction
Price
UsdPrice
Index
Constructors
constructor
Properties
base
Currency
denominator
numerator
quote
Currency
scalar
Methods
add
divide
equal
To
greater
Than
invert
less
Than
multiply
quote
quotient
subtract
to
Fixed
to
Significant
from
Currency
Amounts
from
Decimal
is
Fraction
to
Fraction
Constructors
constructor
new
Price
<
T1
,
T2
>
(
baseCurrency
,
quoteCurrency
,
denominator
,
numerator
)
:
Price
<
T1
,
T2
>
Type Parameters
T1
extends
Token
=
Token
T2
extends
Token
=
Token
Parameters
baseCurrency
:
T1
quoteCurrency
:
T2
denominator
:
BigintIsh
numerator
:
BigintIsh
Returns
Price
<
T1
,
T2
>
Properties
Readonly
base
Currency
base
Currency
:
T1
Readonly
denominator
denominator
:
bigint
Readonly
numerator
numerator
:
bigint
Readonly
quote
Currency
quote
Currency
:
T2
Readonly
scalar
scalar
:
Fraction
Methods
add
add
(
other
)
:
Fraction
Parameters
other
:
BigintIsh
|
Fraction
Returns
Fraction
divide
divide
(
other
)
:
Fraction
Parameters
other
:
BigintIsh
|
Fraction
Returns
Fraction
equal
To
equal
To
(
other
)
:
boolean
Parameters
other
:
BigintIsh
|
Fraction
Returns
boolean
greater
Than
greater
Than
(
other
)
:
boolean
Parameters
other
:
BigintIsh
|
Fraction
Returns
boolean
invert
invert
(
)
:
Fraction
Returns
Fraction
less
Than
less
Than
(
other
)
:
boolean
Parameters
other
:
BigintIsh
|
Fraction
Returns
boolean
multiply
multiply
(
other
)
:
Fraction
Parameters
other
:
BigintIsh
|
Fraction
Returns
Fraction
quote
quote
(
baseCurrencyAmount
?
)
:
CurrencyAmount
<
T2
>
Parameters
baseCurrencyAmount
:
CurrencyAmount
<
Token
>
= ...
Returns
CurrencyAmount
<
T2
>
quotient
quotient
(
)
:
bigint
Returns
bigint
subtract
subtract
(
other
)
:
Fraction
Parameters
other
:
BigintIsh
|
Fraction
Returns
Fraction
to
Fixed
to
Fixed
(
decimalPlaces
?
,
rounding
?
)
:
string
Parameters
decimalPlaces
:
number
= 8
Optional
rounding
:
Rounding
Returns
string
to
Significant
to
Significant
(
significantDigits
?
,
rounding
?
)
:
string
Parameters
significantDigits
:
number
= 8
Optional
rounding
:
Rounding
Returns
string
Static
from
Currency
Amounts
from
Currency
Amounts
(
baseCurrencyAmount
,
quoteCurrencyAmount
)
:
Price
<
Token
,
Token
>
Parameters
baseCurrencyAmount
:
CurrencyAmount
<
Token
>
quoteCurrencyAmount
:
CurrencyAmount
<
Token
>
Returns
Price
<
Token
,
Token
>
Static
from
Decimal
from
Decimal
(
decimalStr
)
:
Fraction
Parameters
decimalStr
:
string
|
number
Returns
Fraction
Static
is
Fraction
is
Fraction
(
value
)
:
value
is
Fraction
Parameters
value
:
unknown
Returns
value
is
Fraction
Static
to
Fraction
to
Fraction
(
fractionish
)
:
Fraction
Parameters
fractionish
:
BigintIsh
|
Fraction
Returns
Fraction
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
base
Currency
denominator
numerator
quote
Currency
scalar
Methods
add
divide
equal
To
greater
Than
invert
less
Than
multiply
quote
quotient
subtract
to
Fixed
to
Significant
from
Currency
Amounts
from
Decimal
is
Fraction
to
Fraction
lootex - v0.2.0
Loading...