Options
All
  • Public
  • Public/Protected
  • All
Menu

A collection of utility functions when interacting with a TickArray.

Hierarchy

  • TickArrayUtil

Index

Constructors

Methods

  • getTickArrayPDAs(tick: number, tickSpacing: number, numOfTickArrays: number, programId: PublicKey, whirlpoolAddress: PublicKey, aToB: boolean): Promise<PDA[]>
  • Return a sequence of tick array pdas based on the sequence start index.

    Parameters

    • tick: number

      A tick in the first tick-array of your sequence

    • tickSpacing: number

      Tick spacing for the whirlpool

    • numOfTickArrays: number

      The number of TickArray PDAs to generate

    • programId: PublicKey

      Program Id of the whirlpool for these tick-arrays

    • whirlpoolAddress: PublicKey

      Address for the Whirlpool for these tick-arrays

    • aToB: boolean

    Returns Promise<PDA[]>

    TickArray PDAs for the sequence`

  • getUninitializedArrays(tickArrays: (null | TickArrayData)[]): number[]
  • Evaluate a list of tick-array data and return the array of indices which the tick-arrays are not initialized.

    Parameters

    • tickArrays: (null | TickArrayData)[]

      a list of TickArrayData or null objects from AccountFetcher.listTickArrays

    Returns number[]

    an array of array-index for the input tickArrays that requires initialization.

  • getUninitializedArraysPDAs(ticks: number[], programId: PublicKey, whirlpoolAddress: PublicKey, tickSpacing: number, fetcher: AccountFetcher, refresh: boolean): Promise<{ pda: PDA; startIndex: number }[]>
  • Parameters

    • ticks: number[]
    • programId: PublicKey
    • whirlpoolAddress: PublicKey
    • tickSpacing: number
    • fetcher: AccountFetcher
    • refresh: boolean

    Returns Promise<{ pda: PDA; startIndex: number }[]>

Generated using TypeDoc