Options
All
  • Public
  • Public/Protected
  • All
Menu

Entrypoint to interact with the marginfi contract.

Hierarchy

  • MarginfiClient

Index

Constructors

Properties

programId: PublicKey
wallet: Wallet

Accessors

  • get provider(): AnchorProvider

Methods

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

    Parameters

    • Optional opts: TransactionOptions

    Returns Promise<MarginfiAccount>

    MarginfiAccount instance

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

    Returns Promise<PublicKey[]>

    Account addresses

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

    Parameters

    Returns Promise<PublicKey[]>

    Account addresses

  • getMarginfiAccountsForAuthority(authority?: Address): Promise<MarginfiAccount[]>
  • Retrieves all marginfi accounts under the specified authority.

    Parameters

    • Optional authority: Address

    Returns Promise<MarginfiAccount[]>

    MarginfiAccount instances

  • makeCreateMarginfiAccountIx(marginfiAccountKeypair?: Keypair): Promise<InstructionsWrapper>
  • Create transaction instruction to create a new marginfi account under the authority of the user.

    Parameters

    • Optional marginfiAccountKeypair: Keypair

    Returns Promise<InstructionsWrapper>

    transaction instruction

  • processTransaction(transaction: Transaction, signers?: Signer[], opts?: TransactionOptions): Promise<string>
  • Parameters

    • transaction: Transaction
    • Optional signers: Signer[]
    • Optional opts: TransactionOptions

    Returns Promise<string>

  • 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 transactions)

    • 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: Address; programId: Address; wallet: Wallet }>): Promise<MarginfiClient>
  • Parameters

    • Optional overrides: Partial<{ connection: Connection; env: Environment; marginfiGroup: Address; programId: Address; wallet: Wallet }>

    Returns Promise<MarginfiClient>

Generated using TypeDoc