UNPKG

ccxt-look

Version:

A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges

33 lines (19 loc) 829 B
'use strict' // ---------------------------------------------------------------------------- const assert = require ('assert') , testBorrowRate = require ('./test.borrowRate.js') // ---------------------------------------------------------------------------- module.exports = async (exchange, code) => { const method = 'fetchBorrowRate' if (exchange.has[method]) { const borrowRate = await exchange.fetchBorrowRate (code) testBorrowRate (exchange, borrowRate, method, code) console.log (code, method, borrowRate['datetime'], 'rate:', borrowRate['rate'], 'period:', borrowRate['period']) if (code) { assert (borrowRate['currency'] === code) } return borrowRate } else { console.log (code, 'fetchBorrowRate () not supported') } }