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

Hierarchy

  • Ruleset

Implements

Properties

accountType: number[]
allowedPrograms: PublicKey[]
authority: PublicKey
disallowedAddresses: PublicKey[]
extensions: PublicKey[]
name: string
version: number

Methods

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

    Returns {
        accountType: number[];
        allowedPrograms: PublicKey[];
        authority: string;
        disallowedAddresses: PublicKey[];
        extensions: PublicKey[];
        name: string;
        version: number;
    }

    • accountType: number[]
    • allowedPrograms: PublicKey[]
    • authority: string
    • disallowedAddresses: PublicKey[]
    • extensions: PublicKey[]
    • name: string
    • version: number
  • Serializes the Ruleset into a Buffer.

    Returns

    a tuple of the created Buffer and the offset up to which the buffer was written to store it.

    Returns [Buffer, number]

  • Deserializes the Ruleset from the provided data Buffer.

    Returns

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

    Parameters

    • buf: Buffer
    • offset: number = 0

    Returns [Ruleset, number]

  • Retrieves the account info from the provided address and deserializes the Ruleset 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<Ruleset>

  • Deserializes the Ruleset 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 [Ruleset, number]

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

    Parameters

    • args: RulesetArgs

      need to be provided since the byte size for this account depends on them

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

Generated using TypeDoc