A JavaScript object of API request parameters.
Returns the HTTP response body or error.
Makes a request to the GovernanceService API. The Governance Service includes three endpoints to retrieve information about COMP accounts. For more details, see the Venus API documentation.
A JavaScript object of API request parameters.
A string of the name of the corresponding governance
service endpoint. Valid values are proposals, voteReceipts, or
accounts.
Returns the HTTP response body or error.
Makes a request to the MarketHistoryService API. The market history service retrieves information about a market. For more details, see the Venus API documentation.
A JavaScript object of API request parameters.
Returns the HTTP response body or error.
Makes a request to the CTokenService API. The vToken API retrieves information about vToken contract interaction. For more details, see the Venus API documentation.
A JavaScript object of API request parameters.
Returns the HTTP response body or error.
Makes a request to the AccountService API. The Account API retrieves information for various accounts which have interacted with the protocol. For more details, see the Venus API documentation.
(async function() { const account = await Venus.api.account({ "addresses": "0xB61C5971d9c0472befceFfbE662555B78284c307", "network": "testnet" }); let sxpBorrowBalance = 0; if (Object.isExtensible(account) && account.accounts) { account.accounts.forEach((acc) => { acc.tokens.forEach((tok) => { if (tok.symbol === Venus.vSXP) { sxpBorrowBalance = +tok.borrow_balance_underlying.value; } }); }); } console.log('sxpBorrowBalance', sxpBorrowBalance); })().catch(console.error);