@lightprotocol/compressed-token - v0.22.1-alpha.2
    Preparing search index...

    Class CompressedTokenProgram

    Index

    Properties

    programId: PublicKey = ...

    Public key that identifies the CompressedPda program

    Methods

    • Set a custom programId via PublicKey or base58 encoded string. This method is not required for regular usage.

      Use this only if you know what you are doing.

      Parameters

      • programId: string | PublicKey

      Returns void

    • Derive the token pool pda. To derive the token pool pda with bump, use deriveTokenPoolPdaWithIndex.

      Parameters

      • mint: PublicKey

        The mint of the token pool

      Returns PublicKey

      The token pool pda

    • Find the index and bump for a given token pool pda and mint.

      Parameters

      • poolPda: PublicKey

        The token pool pda to find the index and bump for

      • mint: PublicKey

        The mint of the token pool

      Returns [number, number]

      The index and bump number.

    • Derive the token pool pda with index.

      Parameters

      • mint: PublicKey

        The mint of the token pool

      • index: number

        Index. starts at 0. The Protocol supports 4 indexes aka token pools per mint.

      Returns [PublicKey, number]

      The token pool pda and bump.

    • Construct createMint instruction for compressed tokens.

      Parameters

      Returns Promise<TransactionInstruction[]>

      [createMintAccountInstruction, initializeMintInstruction, createTokenPoolInstruction]

      Note that createTokenPoolInstruction must be executed after initializeMintInstruction.

    • Enable compression for an existing SPL mint, creating an omnibus account. For new mints, use CompressedTokenProgram.createMint.

      Parameters

      Returns Promise<TransactionInstruction>

      The createTokenPool instruction

    • Construct mintTo instruction for compressed tokens

      Parameters

      Returns Promise<TransactionInstruction>

      The mintTo instruction

    • Mint tokens from registered SPL mint account to a compressed account

      Parameters

      Returns Promise<TransactionInstruction[]>

      The mintTo instruction

    • Construct transfer instruction for compressed tokens

      Parameters

      Returns Promise<TransactionInstruction>

      The transfer instruction

    • Create lookup table instructions for the token program's default accounts.

      Parameters

      Returns Promise<{ instructions: TransactionInstruction[]; address: PublicKey }>

      [createInstruction, extendInstruction, option(extendInstruction2)]

    • Create compress instruction

      Parameters

      Returns Promise<TransactionInstruction>

      The compress instruction

    • Construct decompress instruction

      Parameters

      Returns Promise<TransactionInstruction>

      The decompress instruction

    • Get the program ID for a mint

      Parameters

      • mint: PublicKey

        SPL Token mint address.

      • connection: Connection

        Connection.

      Returns Promise<PublicKey | undefined>

      program ID

    • Create approve instruction to delegate compressed tokens.

      Parameters

      Returns Promise<TransactionInstruction>

      instruction

    • Create revoke instruction to revoke delegation of compressed tokens.

      Parameters

      Returns Promise<TransactionInstruction>

      instruction