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

binance-api-node

Package Overview
Dependencies
Maintainers
1
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binance-api-node - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

4

dist/http.js

@@ -192,3 +192,5 @@ 'use strict';

return checkParams('order', payload, ['symbol', 'side', 'quantity']) && pCall(url, _extends({ type: 'LIMIT' }, payload), 'POST');
var newPayload = ['LIMIT', 'STOP_LOSS_LIMIT', 'TAKE_PROFIT_LIMIT'].includes(payload.type) || !payload.type ? _extends({ timeInForce: 'GTC' }, payload) : payload;
return checkParams('order', newPayload, ['symbol', 'side', 'quantity']) && pCall(url, _extends({ type: 'LIMIT' }, newPayload), 'POST');
};

@@ -195,0 +197,0 @@

{
"name": "binance-api-node",
"version": "0.5.1",
"version": "0.5.2",
"description": "A node API wrapper for Binance",

@@ -5,0 +5,0 @@ "main": "dist",

@@ -393,2 +393,19 @@ # binance-api-node [![build](https://img.shields.io/travis/HyperCubeProject/binance-api-node.svg?style=flat-square)](https://travis-ci.org/HyperCubeProject/binance-api-node) [![cover](https://img.shields.io/coveralls/HyperCubeProject/binance-api-node.svg?style=flat-square)](https://coveralls.io/github/HyperCubeProject/binance-api-node) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node)

Additional mandatory parameters based on `type`:
Type | Additional mandatory parameters
------------ | ------------
`LIMIT` | `timeInForce`, `quantity`, `price`
`MARKET` | `quantity`
`STOP_LOSS` | `quantity`, `stopPrice`
`STOP_LOSS_LIMIT` | `timeInForce`, `quantity`, `price`, `stopPrice`
`TAKE_PROFIT` | `quantity`, `stopPrice`
`TAKE_PROFIT_LIMIT` | `timeInForce`, `quantity`, `price`, `stopPrice`
`LIMIT_MAKER` | `quantity`, `price`
* `LIMIT_MAKER` are `LIMIT` orders that will be rejected if they would immediately match and trade as a taker.
* `STOP_LOSS` and `TAKE_PROFIT` will execute a `MARKET` order when the `stopPrice` is reached.
* Any `LIMIT` or `LIMIT_MAKER` type order can be made an iceberg order by sending an `icebergQty`.
* Any order with an `icebergQty` MUST have `timeInForce` set to `GTC`.
<details>

@@ -395,0 +412,0 @@ <summary>Output</summary>

@@ -140,5 +140,10 @@ import crypto from 'crypto'

const order = (pCall, payload = {}, url) => {
const newPayload =
['LIMIT', 'STOP_LOSS_LIMIT', 'TAKE_PROFIT_LIMIT'].includes(payload.type) || !payload.type
? { timeInForce: 'GTC', ...payload }
: payload
return (
checkParams('order', payload, ['symbol', 'side', 'quantity']) &&
pCall(url, { type: 'LIMIT', ...payload }, 'POST')
checkParams('order', newPayload, ['symbol', 'side', 'quantity']) &&
pCall(url, { type: 'LIMIT', ...newPayload }, 'POST')
)

@@ -145,0 +150,0 @@ }

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