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

Hierarchy

  • NFT

Implements

Properties

bump: number
collection: PublicKey
creator: PublicKey
lastClaim: bignum
lastStakedAt: bignum
lastUnstakedAt: bignum
mint: PublicKey
stakedAt: bignum
staker: PublicKey
stakingPool: PublicKey

Accessors

  • get byteSize(): number
  • Returns the byteSize of a Buffer holding the serialized data of NFT

    Returns number

Methods

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

    Returns {
        bump: number;
        collection: string;
        creator: string;
        lastClaim: number | {
            toNumber: (() => number);
        };
        lastStakedAt: number | {
            toNumber: (() => number);
        };
        lastUnstakedAt: number | {
            toNumber: (() => number);
        };
        mint: string;
        stakedAt: number | {
            toNumber: (() => number);
        };
        staker: string;
        stakingPool: string;
    }

    • bump: number
    • collection: string
    • creator: string
    • lastClaim: number | {
          toNumber: (() => number);
      }
    • lastStakedAt: number | {
          toNumber: (() => number);
      }
    • lastUnstakedAt: number | {
          toNumber: (() => number);
      }
    • mint: string
    • stakedAt: number | {
          toNumber: (() => number);
      }
    • staker: string
    • stakingPool: string
  • Serializes the NFT into a Buffer.

    Returns [Buffer, number]

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

  • Deserializes the NFT from the provided data Buffer.

    Parameters

    • buf: Buffer
    • Optional offset: number

    Returns [NFT, number]

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

  • Retrieves the account info from the provided address and deserializes the NFT from its data.

    Parameters

    • connection: Connection
    • address: PublicKey
    • Optional commitmentOrConfig: Commitment | GetAccountInfoConfig

    Returns Promise<NFT>

    Throws

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

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

    Parameters

    • accountInfo: AccountInfo<Buffer>
    • Optional offset: number

    Returns [NFT, number]

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

  • Creates a NFT instance from the provided args.

    Parameters

    Returns NFT

  • Fetches the minimum balance needed to exempt an account holding NFT 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

    • Optional programId: PublicKey

      the program that owns the accounts we are filtering

    Returns GpaBuilder<{
        accountDiscriminator: any;
        bump: any;
        collection: any;
        creator: any;
        lastClaim: any;
        lastStakedAt: any;
        lastUnstakedAt: any;
        mint: any;
        stakedAt: any;
        staker: any;
        stakingPool: any;
    }>

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

    Parameters

    • buf: Buffer
    • Optional offset: number

    Returns boolean

Generated using TypeDoc