TickList
@pegasys-fi/v3-sdk / Exports / TickList
Class: TickList
Utility methods for interacting with sorted lists of ticks
Table of contents
Constructors
Methods
- binarySearch
- getTick
- isAtOrAboveLargest
- isBelowSmallest
- nextInitializedTick
- nextInitializedTickWithinOneWord
- validateList
Constructors
constructor
• Private
new TickList()
Cannot be constructed
Defined in
Methods
binarySearch
▸ Static
Private
binarySearch(ticks
, tick
): number
Finds the largest tick in the list of ticks that is less than or equal to tick
Parameters
Name | Type | Description |
---|---|---|
ticks | readonly Tick [] | list of ticks |
tick | number | tick to find the largest tick that is less than or equal to tick |
Returns
number
Defined in
getTick
▸ Static
getTick(ticks
, index
): Tick
Parameters
Name | Type |
---|---|
ticks | readonly Tick [] |
index | number |
Returns
Defined in
isAtOrAboveLargest
▸ Static
isAtOrAboveLargest(ticks
, tick
): boolean
Parameters
Name | Type |
---|---|
ticks | readonly Tick [] |
tick | number |
Returns
boolean
Defined in
isBelowSmallest
▸ Static
isBelowSmallest(ticks
, tick
): boolean
Parameters
Name | Type |
---|---|
ticks | readonly Tick [] |
tick | number |
Returns
boolean
Defined in
nextInitializedTick
▸ Static
nextInitializedTick(ticks
, tick
, lte
): Tick
Parameters
Name | Type |
---|---|
ticks | readonly Tick [] |
tick | number |
lte | boolean |
Returns
Defined in
nextInitializedTickWithinOneWord
▸ Static
nextInitializedTickWithinOneWord(ticks
, tick
, lte
, tickSpacing
): [number
, boolean
]
Parameters
Name | Type |
---|---|
ticks | readonly Tick [] |
tick | number |
lte | boolean |
tickSpacing | number |
Returns
[number
, boolean
]
Defined in
validateList
▸ Static
validateList(ticks
, tickSpacing
): void
Parameters
Name | Type |
---|---|
ticks | Tick [] |
tickSpacing | number |
Returns
void