Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "comptroller"

Index

Functions

enterMarkets

  • enterMarkets(markets?: any, options?: any): Promise<any>
  • Enters the user's address into Compound Protocol markets.

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

    Parameters

    • Default value markets: any = []

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

    • Default value options: any = {}

    Returns Promise<any>

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

exitMarket

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

    example
    const compound = new Compound(window.ethereum);
    
    (async function () {
      const trx = await compound.exitMarket(Compound.ETH);
      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: any = {}

    Returns Promise<any>

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