@uniswap/sdk-core / Exports / Price
Class: Price<TBase, TQuote>
Type parameters
| Name | Type |
|---|---|
TBase | extends Currency |
TQuote | extends Currency |
Hierarchy
-
↳
Price
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Price<TBase, TQuote>(...args)
Construct a price, either with the base and quote currency amount, or the
Type parameters
| Name | Type |
|---|---|
TBase | extends Currency |
TQuote | extends Currency |
Parameters
| Name | Type |
|---|---|
...args | [TBase, TQuote, BigintIsh, BigintIsh] | [{ baseAmount: CurrencyAmount<TBase> ; quoteAmount: CurrencyAmount<TQuote> }] |
Overrides
Defined in
entities/fractions/price.ts:18
Properties
baseCurrency
• Readonly baseCurrency: TBase
Defined in
entities/fractions/price.ts:10
denominator
• Readonly denominator: default
Inherited from
Defined in
entities/fractions/fraction.ts:26
numerator
• Readonly numerator: default
Inherited from
Defined in
entities/fractions/fraction.ts:25
quoteCurrency
• Readonly quoteCurrency: TQuote
Defined in
entities/fractions/price.ts:11
scalar
• Readonly scalar: Fraction
Defined in
entities/fractions/price.ts:12
Accessors
adjustedForDecimals
• Private get adjustedForDecimals(): Fraction
Get the value scaled by decimals for formatting
Returns
Defined in
entities/fractions/price.ts:77
asFraction
• get asFraction(): Fraction
Helper method for converting any super class back to a fraction
Returns
Inherited from
Fraction.asFraction
Defined in
entities/fractions/fraction.ts:154
quotient
• get quotient(): default
Returns
default
Inherited from
Fraction.quotient
Defined in
entities/fractions/fraction.ts:42
remainder
• get remainder(): Fraction
Returns
Inherited from
Fraction.remainder
Defined in
entities/fractions/fraction.ts:47
Methods
add
▸ add(other): Fraction
Parameters
| Name | Type |
|---|---|
other | BigintIsh | Fraction |
Returns
Inherited from
Defined in
entities/fractions/fraction.ts:55
divide
▸ divide(other): Fraction
Parameters
| Name | Type |
|---|---|
other | BigintIsh | Fraction |
Returns
Inherited from
Defined in
entities/fractions/fraction.ts:115
equalTo
▸ equalTo(other): boolean
Parameters
| Name | Type |
|---|---|
other | BigintIsh | Fraction |
Returns
boolean
Inherited from
Defined in
entities/fractions/fraction.ts:91
greaterThan
▸ greaterThan(other): boolean
Parameters
| Name | Type |
|---|---|
other | BigintIsh | Fraction |
Returns
boolean
Inherited from
Defined in
entities/fractions/fraction.ts:99
invert
▸ invert(): Price<TQuote, TBase>
Flip the price, switching the base and quote currency
Returns
Price<TQuote, TBase>
Overrides
Defined in
entities/fractions/price.ts:49
lessThan
▸ lessThan(other): boolean
Parameters
| Name | Type |
|---|---|
other | BigintIsh | Fraction |
Returns
boolean