@alcorexchange/alcor-swap-sdk
Version:
## Installation **npm** ``` npm i @alcorexchange/alcor-swap-sdk ``` **yarn** ``` yarn add @alcorexchange/alcor-swap-sdk ``` ## Usage ### Import:
24 lines (23 loc) • 1 kB
TypeScript
import { Tick } from "../entities/tick";
/**x
* Utility methods for interacting with sorted lists of ticks
*/
export declare abstract class TickList {
/**
* Cannot be constructed
*/
private constructor();
static validateList(ticks: Tick[], tickSpacing: number): void;
static isBelowSmallest(ticks: readonly Tick[], tick: number): boolean;
static isAtOrAboveLargest(ticks: readonly Tick[], tick: number): boolean;
static getTick(ticks: readonly Tick[], id: number): Tick;
/**
* Finds the largest tick in the list of ticks that is less than or equal to tick
* @param ticks list of ticks
* @param tick tick to find the largest tick that is less than or equal to tick
* @private
*/
private static binarySearch;
static nextInitializedTick(ticks: readonly Tick[], tick: number, lte: boolean): Tick;
static nextInitializedTickWithinOneWord(ticks: readonly Tick[], tick: number, lte: boolean, tickSpacing: number): [number, boolean];
}