A collection of utility functions when interacting with a TickArray.

Constructors

Methods

  • 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`

  • 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.

  • Parameters

    Returns 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.