UNPKG

fortress-js

Version:

A JavaScript SDK for Binance Smart Chain and the Fortress Protocol.

54 lines (53 loc) 1.87 kB
/** * @file Comptroller * @desc These methods facilitate interactions with the Comptroller smart * contract. */ import { CallOptions, TrxResponse } from './types'; /** * Enters the user's address into Fortress Protocol markets. * * @param {any[]} markets An array of strings of markets to enter, meaning use * those supplied assets as collateral. * @param {CallOptions} [options] Call options and Ethers.js overrides for the * transaction. A passed `gasLimit` will be used in both the `approve` (if * not supressed) and `mint` transactions. * * @returns {object} Returns an Ethers.js transaction object of the enterMarkets * transaction. * * @example * * ``` * const fortress = new Fortress(window.ethereum); * * (async function () { * const trx = await fortress.enterMarkets(Fortress.DAI); // Use [] for multiple * console.log('Ethers.js transaction object', trx); * })().catch(console.error); * ``` */ export declare function enterMarkets(markets?: string | string[], options?: CallOptions): Promise<TrxResponse>; /** * Exits the user's address from a Fortress Protocol market. * * @param {string} market A string of the symbol of the market to exit. * @param {CallOptions} [options] Call options and Ethers.js overrides for the * transaction. A passed `gasLimit` will be used in both the `approve` (if * not supressed) and `mint` transactions. * * @returns {object} Returns an Ethers.js transaction object of the exitMarket * transaction. * * @example * * ``` * const fortress = new Fortress(window.ethereum); * * (async function () { * const trx = await fortress.exitMarket(Fortress.DAI); * console.log('Ethers.js transaction object', trx); * })().catch(console.error); * ``` */ export declare function exitMarket(market: string, options?: CallOptions): Promise<TrxResponse>;