Options
All
  • Public
  • Public/Protected
  • All
Menu

Entrypoint to interact with the marginfi contract.

Hierarchy

  • MarginfiClient

Index

Properties

program: Program<MarginfiIdl>
programId: PublicKey

Accessors

Methods

  • Create a new marginfi account under the authority of the user.

    Returns Promise<MarginfiAccount>

    MarginfiAccount instance

  • getAllMarginfiAccountAddresses(): Promise<PublicKey[]>
  • Retrieves the addresses of all marginfi accounts in the udnerlying group.

    Returns Promise<PublicKey[]>

    Account addresses

  • Retrieves all marginfi accounts in the underlying group.

    Returns Promise<MarginfiAccount[]>

    MarginfiAccount instances

  • getAllProgramAccountAddresses(type: AccountType): Promise<PublicKey[]>
  • Retrieves the addresses of all accounts owned by the marginfi program.

    Parameters

    Returns Promise<PublicKey[]>

    Account addresses

  • Retrieves all marginfi accounts under the authority of the user.

    Returns Promise<MarginfiAccount[]>

    MarginfiAccount instances

  • MarginfiClient factory

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

    Parameters

    • config: MarginfiConfig

      marginfi config

    • wallet: Wallet

      User wallet (used to pay fees and sign transations)

    • connection: Connection

      Solana web.js Connection object

    • Optional opts: ConfirmOptions

      Solana web.js ConfirmOptions object

    Returns Promise<MarginfiClient>

    MarginfiClient instance

  • fromEnv(overrides?: Partial<{ connection: Connection; env: Environment; marginfiGroup: PublicKey; programId: PublicKey; wallet: Wallet }>): Promise<MarginfiClient>

Generated using TypeDoc