binance-api-node
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -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 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
219702
1510
991