Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "comptroller"

Index

Functions

enterMarkets

  • enterMarkets(markets?: string | string[], options?: CallOptions): Promise<TrxResponse>
  • Enters the user's address into Venus Protocol markets.

    example
    const venus = new Venus(window.ethereum);
    
    (async function () {
      const trx = await venus.enterMarkets(Venus.SXP); // Use [] for multiple
      console.log('Ethers.js transaction object', trx);
    })().catch(console.error);

    Parameters

    • Default value markets: string | string[] = []

      An array of strings of markets to enter, meaning use those supplied assets as collateral.

    • Default value options: CallOptions = {}

    Returns Promise<TrxResponse>

    Returns an Ethers.js transaction object of the enterMarkets transaction.

exitMarket

  • exitMarket(market: string, options?: CallOptions): Promise<TrxResponse>
  • Exits the user's address from a Venus Protocol market.

    example
    const venus = new Venus(window.ethereum);
    
    (async function () {
      const trx = await venus.exitMarket(Venus.SXP);
      console.log('Ethers.js transaction object', trx);
    })().catch(console.error);

    Parameters

    • market: string

      A string of the symbol of the market to exit.

    • Default value options: CallOptions = {}

    Returns Promise<TrxResponse>

    Returns an Ethers.js transaction object of the exitMarket transaction.