New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bfx-api-node-rest

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bfx-api-node-rest - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

31

doc/rest2.md

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

* [.status(cb)](#RESTv2+status) ⇒ <code>Promise</code>
* [.statusMessages(type, keys, cb)](#RESTv2+statusMessages) ⇒ <code>Promise</code>
* [.ticker(symbol, cb)](#RESTv2+ticker) ⇒ <code>Promise</code>

@@ -47,2 +48,3 @@ * [.tickers(symbols, cb)](#RESTv2+tickers) ⇒ <code>Promise</code>

* [.futures(cb)](#RESTv2+futures) ⇒ <code>Promise</code>
* [.derivsPositionCollateralSet(symbol, collateral, cb)](#RESTv2+derivsPositionCollateralSet) ⇒ <code>Promise</code>
* ~~[.symbolDetails(cb)](#RESTv2+symbolDetails) ⇒ <code>Promise</code>~~

@@ -91,2 +93,16 @@ * ~~[.accountInfo(cb)](#RESTv2+accountInfo) ⇒ <code>Promise</code>~~

<a name="RESTv2+statusMessages"></a>
### resTv2.statusMessages(type, keys, cb) ⇒ <code>Promise</code>
**Kind**: instance method of <code>[RESTv2](#RESTv2)</code>
**Returns**: <code>Promise</code> - p
**See**: https://docs.bitfinex.com/v2/reference#status
| Param | Type | Default |
| --- | --- | --- |
| type | <code>string</code> | <code>&quot;deriv&quot;</code> |
| keys | <code>Array [string]</code> | <code>[&quot;ALL&quot;]</code> |
| cb | <code>Method</code> | |
<a name="RESTv2+ticker"></a>

@@ -568,2 +584,17 @@

<a name="RESTv2+derivsPositionCollateralSet"></a>
### resTv2.derivsPositionCollateralSet(symbol, collateral, cb) ⇒ <code>Promise</code>
Changes the collateral value of an active derivatives position for a certain pair.
**Kind**: instance method of <code>[RESTv2](#RESTv2)</code>
**Returns**: <code>Promise</code> - p
**See**: https://docs.bitfinex.com/v2/reference#rest-auth-deriv-pos-collateral-set
| Param | Type | Description |
| --- | --- | --- |
| symbol | <code>string</code> | <code>&quot;tBTCF0:USDF0&quot;</code> |
| collateral | <code>number</code> | |
| cb | <code>Method</code> | |
<a name="RESTv2+symbolDetails"></a>

@@ -570,0 +601,0 @@

35

lib/rest2.js

@@ -30,3 +30,4 @@ 'use strict'

UserInfo,
Currency
Currency,
StatusMessagesDeriv
} = require('bfx-api-node-models')

@@ -354,2 +355,16 @@

/**
* @param {string?} type
* @param {string[]} keys
* @param {Method?} cb
* @return {Promise} p
* @see https://docs.bitfinex.com/v2/reference#status
*/
statusMessages (type = 'deriv', keys = ['ALL'], cb) {
const url = `/status/${type}?keys=${keys.join(',')}`
const transformer = (type === 'deriv') ? StatusMessagesDeriv : null
return this._makePublicRequest(url, cb, transformer)
}
/**
* @param {string} symbol

@@ -892,2 +907,20 @@ * @param {Method} cb

/**
* Changes the collateral value of an active derivatives position for a certain pair.
*
* @param {string} symbol
* @param {number} collateral
* @param {Method?} cb - legacy callback
* @return {Promise} p
* @see https://docs.bitfinex.com/v2/reference#rest-auth-deriv-pos-collateral-set
*/
derivsPositionCollateralSet (symbol, collateral, cb) {
const url = '/auth/w/deriv/collateral/set'
const isRequestValid = (res) => !!(res && res[0] && res[0][0])
return this._makeAuthRequest(url, {
symbol, collateral
}, cb, isRequestValid)
}
/**
* Get a list of valid symbol names and details

@@ -894,0 +927,0 @@ *

12

package.json
{
"name": "bfx-api-node-rest",
"version": "1.1.1",
"version": "1.1.2",
"description": "Official Bitfinex REST v1 & v2 API interfaces",

@@ -40,3 +40,2 @@ "engines": {

"devDependencies": {
"bfx-api-mock-srv": "git+https://github.com/bitfinexcom/bfx-api-mock-srv.git",
"babel-cli": "^6.26.0",

@@ -46,6 +45,7 @@ "babel-plugin-transform-object-rest-spread": "^6.26.0",

"babel-preset-env": "^1.7.0",
"bfx-api-mock-srv": "git+https://github.com/bitfinexcom/bfx-api-mock-srv.git",
"chai": "^3.4.1",
"mocha": "^3.4.2",
"standard": "^10.0.2",
"jsdoc-to-markdown": "^1.3.1"
"jsdoc-to-markdown": "^5.0.0",
"mocha": "^6.1.4",
"standard": "^10.0.2"
},

@@ -58,3 +58,3 @@ "dependencies": {

"debug": "^2.2.0",
"lodash": "^4.17.4",
"lodash": "^4.17.14",
"request": "^2.67.0",

@@ -61,0 +61,0 @@ "request-promise": "^4.2.0"

@@ -100,2 +100,3 @@ /* eslint-env mocha */

['candles', 'candles.trade:30m:tBTCUSD.hist', [{ timeframe: '30m', symbol: 'tBTCUSD', section: 'hist' }]],
['statusMessages', 'status_messages.deriv.ALL', ['deriv', ['ALL']]],

@@ -123,2 +124,3 @@ // private

['fundingInfo', 'f_info.k', ['k']],
['derivsPositionCollateralSet', 'derivs_pos_col_set.symbol.collateral', ['symbol', 'collateral']],
['performance'],

@@ -125,0 +127,0 @@ ['calcAvailableBalance', 'calc.sym.dir.rate.type', ['sym', 'dir', 'rate', 'type']]

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc