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): 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 PDA[]

    TickArray PDAs for the sequence`

  • getUninitializedArrays(tickArrays: readonly (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: readonly (null | TickArrayData)[]

      a list of TickArrayData or null objects from WhirlpoolAccountCacheInterface.getTickArrays

    Returns number[]

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

  • getUninitializedArraysPDAs(ticks: number[], programId: PublicKey, whirlpoolAddress: PublicKey, tickSpacing: number, fetcher: WhirlpoolAccountFetcherInterface, opts: SimpleAccountFetchOptions): Promise<{ pda: PDA; startIndex: number }[]>
  • Return a string containing all of the uninitialized arrays in the provided addresses. Useful for creating error messages.

    Parameters

    Returns Promise<null | string>

    A string of all uninitialized tick array addresses, delimited by ",". Falsy value if all arrays are initialized.

Generated using TypeDoc