Holds the data for the TreeConfig Account and provides de/serialization functionality for that data

Hierarchy

  • TreeConfig

Implements

Properties

numMinted: bignum
totalMintCapacity: bignum
treeCreator: PublicKey
treeDelegate: PublicKey

Accessors

Methods

  • Returns a readable version of TreeConfig properties and can be used to convert to JSON and/or logging

    Returns {
        numMinted: number | {
            toNumber: (() => number);
        };
        totalMintCapacity: number | {
            toNumber: (() => number);
        };
        treeCreator: string;
        treeDelegate: string;
    }

    • numMinted: number | {
          toNumber: (() => number);
      }
    • totalMintCapacity: number | {
          toNumber: (() => number);
      }
    • treeCreator: string
    • treeDelegate: string
  • Retrieves the account info from the provided address and deserializes the TreeConfig from its data.

    Throws

    Error if no account info is found at the address or if deserialization fails

    Parameters

    • connection: Connection
    • address: PublicKey

    Returns Promise<TreeConfig>

  • Deserializes the TreeConfig from the data of the provided web3.AccountInfo.

    Returns

    a tuple of the account data and the offset up to which the buffer was read to obtain it.

    Parameters

    • accountInfo: AccountInfo<Buffer>
    • offset: number = 0

    Returns [TreeConfig, number]

  • Fetches the minimum balance needed to exempt an account holding TreeConfig data from rent

    Parameters

    • connection: Connection

      used to retrieve the rent exemption information

    • Optional commitment: Commitment

    Returns Promise<number>

  • Provides a web3.Connection.getProgramAccounts config builder, to fetch accounts matching filters that can be specified via that builder.

    Parameters

    • programId: PublicKey = ...

      the program that owns the accounts we are filtering

    Returns GpaBuilder<Object>

  • Determines if the provided Buffer has the correct byte size to hold TreeConfig data.

    Parameters

    • buf: Buffer
    • offset: number = 0

    Returns boolean

Generated using TypeDoc