Socket
Socket
Sign inDemoInstall

bfx-api-node-rest

Package Overview
Dependencies
135
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.6 to 3.0.0

20

docs/rest2.md

@@ -70,2 +70,3 @@ <a name="RESTv2"></a>

* [.cancelFundingOffer(id, cb)](#RESTv2+cancelFundingOffer)
* [.cancelAllFundingOffers(params, cb)](#RESTv2+cancelAllFundingOffers)
* [.closeFunding(params, cb)](#RESTv2+closeFunding)

@@ -882,3 +883,3 @@ * [.submitAutoFunding(params, cb)](#RESTv2+submitAutoFunding)

**Kind**: instance method of [<code>RESTv2</code>](#RESTv2)
**Kind**: instance method of [<code>RESTv2</code>](#RESTv2)

@@ -890,2 +891,17 @@ | Param | Type | Description |

<a name="RESTv2+cancelAllFundingOffers"></a>
### resTv2.cancelAllFundingOffers(params, cb)
Cancel all existing funding offers
**Kind**: instance method of [<code>RESTv2</code>](#RESTv2)
**Returns**: <code>Promise</code> - p
**See**: https://docs.bitfinex.com/reference#rest-auth-cancel-all-funding-offers
| Param | Type | Description |
| --- | --- | --- |
| params | <code>Object</code> | |
| params.currency | <code>string</code> | currency i.e USD |
| cb | <code>Method</code> | |
<a name="RESTv2+closeFunding"></a>

@@ -896,3 +912,3 @@

**Kind**: instance method of [<code>RESTv2</code>](#RESTv2)
**Kind**: instance method of [<code>RESTv2</code>](#RESTv2)

@@ -899,0 +915,0 @@ | Param | Type | Description |

56

lib/rest2.js

@@ -42,2 +42,11 @@ 'use strict'

/**
* Parses response into notification object
* @param {Object} Notification.notify_info
*/
function _takeResNotify (data) {
const notification = new Notification(data)
return notification
}
/**
* Communicates with v2 of the Bitfinex HTTP API

@@ -82,12 +91,2 @@ */

/**
* Parses response into notification object and then
* extracts the info element
* @param {Object} Notification.notify_info
*/
_takeResNotifyInfo (data) {
const notification = new Notification(data)
return notification.notifyInfo
}
/**
* @param {string} path

@@ -1127,3 +1126,4 @@ * @param {Object} payload

// we can only return one. User should use getOrders instead
return this._takeResNotifyInfo(res)[0] || []
const orders = _takeResNotify(res).notifyInfo || []
return orders[0] || []
})

@@ -1140,3 +1140,3 @@ }

return this._makeAuthRequest('/auth/w/order/update', changes, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1152,3 +1152,3 @@

return this._makeAuthRequest('/auth/w/order/cancel', { id }, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1168,3 +1168,3 @@

return this._makeAuthRequest('/auth/w/position/claim', { id }, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1179,3 +1179,3 @@

submitFundingOffer (offer, cb) {
const packet = offer.toNewOrderPacket()
const packet = offer.toNewOfferPacket()

@@ -1191,3 +1191,3 @@ if (this._affCode) {

return this._makeAuthRequest('/auth/w/funding/offer/submit', packet, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1203,6 +1203,18 @@

return this._makeAuthRequest('/auth/w/funding/offer/cancel', { id }, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}
/**
* Cancel all existing funding offers
*
* @param {Object} params
* @param {string} params.currency - currency i.e USD
* @param {Method} cb
*/
cancelAllFundingOffers (params, cb) {
return this._makeAuthRequest('/auth/w/funding/offer/cancel/all', params, cb)
.then(_takeResNotify)
}
/**
* Close funding

@@ -1217,3 +1229,3 @@ *

return this._makeAuthRequest('/auth/w/funding/close', params, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1234,3 +1246,3 @@

return this._makeAuthRequest('/auth/w/funding/auto', params, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1252,3 +1264,3 @@

return this._makeAuthRequest('/auth/w/transfer', params, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1266,3 +1278,3 @@

return this._makeAuthRequest('/auth/w/deposit/address', params, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1280,3 +1292,3 @@

return this._makeAuthRequest('/auth/w/withdraw', params, cb)
.then(this._takeResNotifyInfo)
.then(_takeResNotify)
}

@@ -1283,0 +1295,0 @@ }

{
"name": "bfx-api-node-rest",
"version": "2.0.6",
"version": "3.0.0",
"description": "Official Bitfinex REST v1 & v2 API interfaces",

@@ -5,0 +5,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc