Options
All
  • Public
  • Public/Protected
  • All
Menu

Account type representing Switchboard global program state.

Hierarchy

  • ProgramStateAccount

Index

Constructors

Properties

keypair?: Keypair
program: Program<Idl>
publicKey: PublicKey

Methods

  • getTokenMint(): Promise<Token>
  • Fetch the Switchboard token mint specified in the program state account.

    Returns Promise<Token>

    Switchboard token mint.

  • loadData(): Promise<any>
  • Load and parse ProgramStateAccount state based on the program IDL.

    Returns Promise<any>

    ProgramStateAccount data parsed in accordance with the Switchboard IDL.

  • size(): number
  • Returns number

    account size of the global ProgramStateAccount.

  • Transfer N tokens from the program vault to a specified account.

    Parameters

    • to: PublicKey

      The recipient of the vault tokens.

    • authority: Keypair

      The vault authority required to sign the transfer tx.

    • params: VaultTransferParams

      specifies the amount to transfer.

    Returns Promise<string>

    TransactionSignature

  • Create and initialize the ProgramStateAccount.

    Parameters

    • program: Program<Idl>

      Switchboard program representation holding connection and IDL.

    • params: ProgramInitParams

    Returns Promise<ProgramStateAccount>

    newly generated ProgramStateAccount.

  • Constructs ProgramStateAccount from the static seed from which it was generated.

    Parameters

    • program: Program<Idl>

    Returns [ProgramStateAccount, number]

    ProgramStateAccount and PDA bump tuple.

Generated using TypeDoc