A string of the asset to borrow (must be a supported underlying asset).
A string, number, or BigNumber
object of the amount of an asset to borrow. Use the mantissa boolean in
the options parameter to indicate if this value is scaled up (so there
are no decimals) or in its natural scale.
Returns an Ethers.js transaction object of the borrow transaction.
Redeems the user's Binance Smart Chain asset from the Venus Protocol.
A string of the asset to redeem, or its vToken name.
A string, number, or BigNumber
object of the amount of an asset to redeem. Use the mantissa boolean in
the options parameter to indicate if this value is scaled up (so there
are no decimals) or in its natural scale. This can be an amount of
vTokens or underlying asset (use the asset parameter to specify).
Returns an Ethers.js transaction object of the redeem transaction.
Repays a borrowed Binance Smart Chain asset for the user or on behalf of another Binance Smart Chain address.
A string of the asset that was borrowed (must be a supported underlying asset).
A string, number, or BigNumber
object of the amount of an asset to borrow. Use the mantissa boolean in
the options parameter to indicate if this value is scaled up (so there
are no decimals) or in its natural scale.
Explicitly prevent this method from attempting an
ERC-20 approve transaction prior to sending the subsequent repayment
transaction.
Returns an Ethers.js transaction object of the repayBorrow or repayBorrowBehalf transaction.
Supplies the user's Binance Smart Chain asset to the Venus Protocol.
A string of the asset to supply.
A string, number, or BigNumber
object of the amount of an asset to supply. Use the mantissa boolean in
the options parameter to indicate if this value is scaled up (so there
are no decimals) or in its natural scale.
Explicitly prevent this method from attempting an
BEP-20 approve transaction prior to sending the mint transaction.
Returns an Ethers.js transaction object of the supply transaction.
Borrows an Binance Smart Chain asset from the Venus Protocol for the user. The user's address must first have supplied collateral and entered a corresponding market.
const venus = new Venus(window.ethereum); (async function() { const sxpScaledUp = '32000000000000000000'; const trxOptions = { mantissa: true }; console.log('Borrowing 32 SXP...'); const trx = await venus.borrow(Venus.SXP, sxpScaledUp, trxOptions); console.log('Ethers.js transaction object', trx); })().catch(console.error);