Skip to content

Commit fd5aac3

Browse files
committed
Add logic for not sending symbol on founding offers, credits and loans
1 parent 4d59bbd commit fd5aac3

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

lib/transports/rest2.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,16 +527,19 @@ class RESTv2 {
527527
}
528528

529529
/**
530-
* @param {string} symbol
530+
* @param {string} symbol - optional, omit/leave empty for all
531531
* @param {number} start
532532
* @param {number} end
533533
* @param {number} limit
534534
* @param {Method} cb
535535
* @return {Promise} p
536536
* @see https://docs.bitfinex.com/v2/reference#rest-auth-funding-offers-hist
537537
*/
538-
fundingOfferHistory (symbol = 'tBTCUSD', start = null, end = null, limit = null, cb) {
539-
return this._makeAuthRequest(`/auth/r/funding/offers/${symbol}/hist`, {
538+
fundingOfferHistory (symbol, start = null, end = null, limit = null, cb) {
539+
const url = !_isEmpty(symbol)
540+
? `/auth/r/funding/offers/${symbol}/hist`
541+
: '/auth/r/funding/offers/hist'
542+
return this._makeAuthRequest(url, {
540543
start, end, limit
541544
}, cb, FundingOffer)
542545
}
@@ -552,16 +555,19 @@ class RESTv2 {
552555
}
553556

554557
/**
555-
* @param {string} symbol
558+
* @param {string} symbol - optional, omit/leave empty for all
556559
* @param {number} start
557560
* @param {number} end
558561
* @param {number} limit
559562
* @param {Method} cb
560563
* @return {Promise} p
561564
* @see https://docs.bitfinex.com/v2/reference#rest-auth-funding-loans-hist
562565
*/
563-
fundingLoanHistory (symbol = 'tBTCUSD', start = null, end = null, limit = null, cb) {
564-
return this._makeAuthRequest(`/auth/r/funding/loans/${symbol}/hist`, {
566+
fundingLoanHistory (symbol, start = null, end = null, limit = null, cb) {
567+
const url = !_isEmpty(symbol)
568+
? `/auth/r/funding/loans/${symbol}/hist`
569+
: '/auth/r/funding/loans/hist'
570+
return this._makeAuthRequest(url, {
565571
start, end, limit
566572
}, cb, FundingLoan)
567573
}
@@ -577,16 +583,19 @@ class RESTv2 {
577583
}
578584

579585
/**
580-
* @param {string} symbol
586+
* @param {string} symbol - optional, omit/leave empty for all
581587
* @param {number} start
582588
* @param {number} end
583589
* @param {number} limit
584590
* @param {Method} cb
585591
* @return {Promise} p
586592
* @see https://docs.bitfinex.com/v2/reference#rest-auth-funding-credits-hist
587593
*/
588-
fundingCreditHistory (symbol = 'tBTCUSD', start = null, end = null, limit = null, cb) {
589-
return this._makeAuthRequest(`/auth/r/funding/credits/${symbol}/hist`, {
594+
fundingCreditHistory (symbol, start = null, end = null, limit = null, cb) {
595+
const url = !_isEmpty(symbol)
596+
? `/auth/r/funding/credits/${symbol}/hist`
597+
: '/auth/r/funding/credits/hist'
598+
return this._makeAuthRequest(url, {
590599
start, end, limit
591600
}, cb, FundingCredit)
592601
}

0 commit comments

Comments
 (0)