CToken
Properties
sdk
sdk
The sdk instance used by the cToken.
Type: MarketSDK
contract
contract
The raw web3 contract instance for the cToken.
Type: web3.eth.Contract
address
address
Contract address of the cToken.
Type: string
Methods
_acceptAdmin
_acceptAdmin
Accepts transfer of admin rights. msg.sender must be pendingAdmin.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_reduceReserves
_reduceReserves
Accrues interest and reduces reserves by transferring to admin.
Parameters:
reduceAmount: number | string | BN
- Amount of reduction to reserves.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_renounceReserves
_renounceReserves
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_renounceAdminRights
_renounceAdminRights
Renounce admin rights.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_renounceFuseAdminRights
_renounceFuseAdminRights
Renounce the Fuse admin rights.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setAdminFee
_setAdminFee
Accrues interest and sets a new admin fee for the protocol using _setAdminFeeFresh.
Parameters:
newAdminFeeMantissa: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setComptroller
_setComptroller
Sets a new comptroller for the market.
Parameters:
newComptroller:
Comptroller
| string
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setFuseFee
_setFuseFee
Accrues interest and sets a new Fuse fee for the protocol using _setFuseFeeFresh.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setInterestRateModel
_setInterestRateModel
Updates the interest rate model (*requires fresh interest accrual)
Parameters:
newInterestRateModel: string
- The new interest rate model to use.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setPendingAdmin
_setPendingAdmin
Begins transfer of admin rights. The newPendingAdmin must call _acceptAdmin
to finalize the transfer.
Parameters:
newPendingAdmin: string
- New pending admin.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_setReserveFactor
_setReserveFactor
Accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh.
Parameters:
newReserveFactorMantissa: number | string | BN
- New reserve factor.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_withdrawAdminFees
_withdrawAdminFees
Accrues interest and reduces admin fees by transferring to admin.
Parameters:
withdrawAmount: number | string | BN
- Amount of fees to withdraw.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
_withdrawFuseFees
_withdrawFuseFees
Accrues interest and reduces Fuse fees by transferring to Fuse.
Parameters:
withdrawAmount: number | string | BN
- Amount of fees to withdraw.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
accrualBlockNumber
accrualBlockNumber
Returns the block number that interest was last accrued at.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
accrualInterest
accrualInterest
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
admin
admin
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
adminFeeMantissa
adminFeeMantissa
Returns the fraction of interest currently set aside for admin fees.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
adminHasRights
adminHasRights
Returns whether or not the admin has admin rights.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
allowance
allowance
Returns the allowance for spender by owner.
Parameters:
owner: string
- Owner of the allowance account.spender: string
- Spender of the allowance.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
approve
approve
Gives allowance to spender
.
Parameters:
spender: string
- Account to give allowance to.amount: number | string | BN
- Amount of allowance.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
balanceOf
balanceOf
Returns the balance of an account.
Parameters:
owner: string
- The account address to get the balance of.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
balanceOfUnderdyling
balanceOfUnderdyling
Returns the balance of the underlying token for a given account.
Parameters:
owner: string
- The account to get the balance of.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
borrow
borrow
Borrows an asset.
Parameters:
borrowAmount: number | string | BN
- Amount to borrow.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
borrowBalanceCurrent
borrowBalanceCurrent
Returns the borrow balance for an account.
Parameters:
account: string
- The account to get the borrow balance of.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
borrowBalanceStored
borrowBalanceStored
Returns the stored borrow balance for an account.
Parameters:
account: string
- The account to get thee balance of.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
borrowIndex
borrowIndex
Returns the borrow Index for the cToken. Borrow index is the accumulator of total earned interest rate since the opening of the market.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
borrowRatePerBlock
borrowRatePerBlock
Returns the borrow rate per block.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
decimals
decimals
EIP-20 token decimals for this token.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
exchangeRateCurrent
exchangeRateCurrent
Returns the current exchange rate for the cToken.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
exchangeRateStored
exchangeRateStored
Returns the stored exchange rate for the cToken.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
fuseAdminHasRights
fuseAdminHasRights
Returns whether or not the Fuse admin has admin rights
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
fuseFeeMantissa
fuseFeeMantissa
Returns the fuse fee.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
getAccountSnapshot
getAccountSnapshot
Returns a snapshot of the account's balances, and the cached exchange rate.
Parameters:
account: string
- Address of the account to snapshot.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<[string, string, string, string]>
getCash
getCash
Returns cash balance of the cToken in the underlying asset
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
interestRateModel
interestRateModel
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
isCEther
isCEther
Returns whether this is a CEther
contract (for inspection).
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
isCToken
isCToken
Returns whether this is a CToken
contract (for inspection).
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<boolean>
liquidateBorrow
liquidateBorrow
Liquidates the borrowers' collateral.
Parameters:
borrower: string
- The borrower of this cToken to be liquidatedrepayAmount: number | string | BN
- The amount of the underlying borrowed asset to repay.cTokenCollateral:
CToken
| string
- The market in which to seize collateral from the borrower.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
mint
mint
Supplies assets into the market, receiving cTokens in exchange
Parameters:
mintAmount: number | string | BN
- The amount of the underlying asset to supply.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
name
name
Returns ERC-20 name of this token.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
pendingAdmin
pendingAdmin
Returns the pending admin for this contract.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
redeem
redeem
Redeems cTokens in exchange for the underlying asset.
Parameters:
redeemTokens: number | string | BN
- The number of cTokens to redeem into underlying.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
redeemUnderlying
redeemUnderlying
Redeems cTokens in exchange for a specified amount of underlying asset.
Parameters:
redeemAmount: number | string | BN
-tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
repayBorrow
repayBorrow
Parameters:
redeemAmount: number | string | BN
- The amount of underlying to redeem.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
repayBorrowBehalf
repayBorrowBehalf
Repays a borrow belonging to borrower.
Parameters:
borrower: string
- The account with the debt being payed off.repayAmount: number | string | BN
- The amount to repay.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
reserveFactorMantissa
reserveFactorMantissa
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
seize
seize
Transfers collateral tokens (this market) to the liquidator.
Parameters:
liquidator: string
- The account receiving seized collateral.borrower: string
- The account having collateral seized.seizeTokens: number | string | BN
- The number of cTokens to seize.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
supplyRatePerBlock
supplyRatePerBlock
Returns the current per-block supply interest rate for this cToken.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
symbol
symbol
Returns the EIP-20 symbol of this token.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalAdminFees
totalAdminFees
Returns the total amount of admin fees of the underlying held in this market.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalBorrows
totalBorrows
Returns the total amount of outstanding borrows of the underlying in this market.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalBorrowsCurrent
totalBorrowsCurrent
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalFuseFees
totalFuseFees
Returns the total amount of Fuse fees of the underlying held in this market.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalReserves
totalReserves
Returns the total amount of reserves of the underlying held in this market.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
totalSupply
totalSupply
Returns the total number of tokens in circulation.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
transfer
transfer
EIP20 transfer function.
Parameters:
dst: string
- Account to transfer to.amount: number | string | BN
- Amount to transfer.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
transferFrom
transferFrom
EIP20 transferFrom function.
Parameters:
src: string
- Account to transfer from.dst: string
- Account to transfer to.amount: number | string | BN
- Amount to transfer.tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<
TransactionReceipt
>
underlying
underlying
Returns the underlying asset for this cToken.
Parameters:
tx?:
NonPayableTx
- The transaction info object for making the transaction with.
Returns: Promise<string>
Last updated