Class: Route
Represents a list of pools through which a swap can occur
Type parameters
| Name | Type | Description |
|---|---|---|
TInput | extends Currency | The input token |
TOutput | extends Currency | The output token |
Table of contents
Constructors
Properties
Accessors
Constructors
constructor
new Route <TInput, TOutput> (pools, input, output)
Creates an instance of route.
Type parameters
| Name | Type |
|---|---|
TInput | extends Currency |
TOutput | extends Currency |
Parameters
| Name | Type | Description |
|---|---|---|
pools | Pool[] | An array of Pool objects, ordered by the route the swap will take |
input | TInput | The input token |
output | TOutput | The output token |
Defined in
Properties
_midPrice
Private _midPrice: null | Price <TInput, TOutput> = null
Defined in
input
Readonly input: TInput
Defined in
output
Readonly output: TOutput
Defined in
pools
Readonly pools: Pool[]
Defined in
tokenPath
Readonly tokenPath: Token[]
Defined in
Accessors
chainId
get chainId(): number
Returns
number
Defined in
midPrice
get midPrice(): Price <TInput, TOutput>
Returns the mid price of the route
Returns
Price <TInput, TOutput>