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

Implements

Constructors

  • Parameters

    • multisig: PublicKey
    • createKey: PublicKey
    • vaultIndex: number
    • mint: PublicKey
    • amount: bignum
    • period: Period
    • remainingAmount: bignum
    • lastReset: bignum
    • bump: number
    • members: PublicKey[]
    • destinations: PublicKey[]

    Returns SpendingLimit

Properties

amount: bignum
bump: number
createKey: PublicKey
destinations: PublicKey[]
lastReset: bignum
members: PublicKey[]
mint: PublicKey
multisig: PublicKey
period: Period
remainingAmount: bignum
vaultIndex: number

Methods

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

    Returns {
        amount: number | {
            toNumber: (() => number);
        };
        bump: number;
        createKey: string;
        destinations: PublicKey[];
        lastReset: number | {
            toNumber: (() => number);
        };
        members: PublicKey[];
        mint: string;
        multisig: string;
        period: string;
        remainingAmount: number | {
            toNumber: (() => number);
        };
        vaultIndex: number;
    }

    • amount: number | {
          toNumber: (() => number);
      }
    • bump: number
    • createKey: string
    • destinations: PublicKey[]
    • lastReset: number | {
          toNumber: (() => number);
      }
    • members: PublicKey[]
    • mint: string
    • multisig: string
    • period: string
    • remainingAmount: number | {
          toNumber: (() => number);
      }
    • vaultIndex: number
  • Retrieves the account info from the provided address and deserializes the SpendingLimit from its data.

    Parameters

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

    Returns Promise<SpendingLimit>

    Throws

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

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

    Parameters

    • args: SpendingLimitArgs

      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<SpendingLimitArgs & {
        accountDiscriminator: number[];
    }>

Generated using TypeDoc