Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bfx-api-node-models

Package Overview
Dependencies
Maintainers
3
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 1.6.1 to 1.6.2

33

lib/order.js

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

const _includes = require('lodash/includes')
const _isBoolean = require('lodash/isBoolean')
const _isUndefined = require('lodash/isUndefined')

@@ -105,2 +106,3 @@ const { prepareAmount, preparePrice } = require('bfx-api-node-util')

if (!_isUndefined(data.hidden)) this.setHidden(data.hidden)
if (!_isUndefined(data.visibleOnHit)) this.setVisibleOnHit(data.visibleOnHit)
if (!_isUndefined(data.postonly)) this.setPostOnly(data.postonly)

@@ -164,2 +166,3 @@ if (!_isUndefined(data.reduceonly)) this.setReduceOnly(data.reduceonly)

this.isHidden() && 'hidden',
this.isVisibleOnHit() && 'visible-on-hit',
this.isPostOnly() && 'post-only',

@@ -189,2 +192,9 @@ this.isReduceOnly() && 'reduce-only',

/**
* @returns {boolean} visibleOnHit
*/
isVisibleOnHit () {
return !!(this.isHidden() && this.meta && this.meta.make_visible)
}
/**
* @returns {boolean} postonly

@@ -243,2 +253,5 @@ */

setHidden (v) {
if (!v && this.meta) {
delete this.meta.make_visible
}
return this.modifyFlag(Order.flags.HIDDEN, v)

@@ -248,2 +261,22 @@ }

/**
* Update the meta object. The rest part of the hidden order will be visible
* after first hit(partial execution).
*
* @param {boolean} v - visibleOnHit value
* @returns {number} meta
*/
setVisibleOnHit (v) {
if (!this.isHidden() || !_isBoolean(v)) {
return
}
this.meta = {
...(this.meta || {}),
make_visible: +v
}
return this.meta
}
/**
* Update the post-only flag value. If post-only and the order would

@@ -250,0 +283,0 @@ * immediately fill, the order is automatically cancelled.

2

package.json
{
"name": "bfx-api-node-models",
"version": "1.6.1",
"version": "1.6.2",
"description": "Object models for usage with the Bitfinex node API",

@@ -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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc