Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrapper class around a specific marginfi group.

Hierarchy

  • MarginfiGroup

Index

Constructors

Properties

_admin: PublicKey
_banks: Map<string, Bank>
_program: MarginfiProgram
publicKey: PublicKey

Accessors

  • get admin(): PublicKey
  • Marginfi account authority address

    Returns PublicKey

  • get banks(): Map<string, Bank>

Methods

  • getBankByLabel(label: string): null | Bank
  • Get bank by label.

    Parameters

    • label: string

    Returns null | Bank

  • getBankByMint(mint: PublicKey): null | Bank
  • getBankByPk(publicKey: Address): null | Bank
  • Update instance data by fetching and storing the latest on-chain state.

    Parameters

    • publicKey: Address

    Returns null | Bank

  • reload(commitment?: Commitment): Promise<void>
  • Update instance data by fetching and storing the latest on-chain state.

    Parameters

    • Optional commitment: Commitment

    Returns Promise<void>

  • Fetch marginfi group account data according to the config. Check sanity against provided config.

    Parameters

    • config: MarginfiConfig

      marginfi config

    • program: MarginfiProgram

      marginfi Anchor program

    • Optional commitment: Commitment

      Commitment level override

    Returns Promise<MarginfiGroupData>

    Decoded marginfi group account data struct

  • Decode marginfi group account data according to the Anchor IDL.

    Parameters

    • encoded: Buffer

      Raw data buffer

    Returns MarginfiGroupData

    Decoded marginfi group account data struct

  • Encode marginfi group account data according to the Anchor IDL.

    Parameters

    Returns Promise<Buffer>

    Raw data buffer

  • MarginfiGroup network factory

    Fetch account data according to the config and instantiate the corresponding MarginfiGroup.

    Parameters

    • config: MarginfiConfig

      marginfi config

    • program: MarginfiProgram

      marginfi Anchor program

    • Optional commitment: Commitment

      Commitment level override

    Returns Promise<MarginfiGroup>

    MarginfiGroup instance

  • MarginfiGroup local factory (decoded)

    Instantiate a MarginfiGroup according to the provided decoded data. Check sanity against provided config.

    Parameters

    Returns MarginfiGroup

    MarginfiGroup instance

  • MarginfiGroup local factory (encoded)

    Instantiate a MarginfiGroup according to the provided encoded data. Check sanity against provided config.

    Parameters

    Returns MarginfiGroup

    MarginfiGroup instance

Generated using TypeDoc