UNPKG

@martins-finance/venus-js

Version:

A JavaScript SDK for Ethereum and the Venus Protocol.

56 lines (55 loc) 2.4 kB
import { CallOptions, TrxResponse } from './types'; /** * Enters the user's address into Venus 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 venus = new Venus(window.ethereum); * * (async function () { * const trx = await venus.enterMarkets(Venus.SXP); // Use [] for multiple * bnbt'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 Venus 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 venus = new Venus(window.ethereum); * * (async function () { * const trx = await venus.exitMarket(Venus.SXP); * bnbt'Ethers.js transaction object', trx); * })().catch(console.error); * ``` */ export declare function exitMarket(market: string, options?: CallOptions): Promise<TrxResponse>; export declare function getAssetsIn(account: string): Promise<Array<any>>; export declare function checkMembership(account: string, token_address: string): Promise<TrxResponse>; export declare function liquidateBorrowAllowed(vTokenBorrowed: string, vTokenCollateral: string, liquidator: string, borrower: string, repayAmount: number, options?: CallOptions): Promise<TrxResponse>; export declare function getAccountLiquidity(account: string, options?: CallOptions): Promise<string>; export declare function closeFactor(): Promise<string>; export declare function liquidationIncentive(): Promise<string>; export declare function onMarketEntered(fromBlock: number, toBlock?: number): Promise<string>;