binance-api-node
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -47,3 +47,5 @@ 'use strict'; | ||
if (!res.ok) { | ||
throw new Error(json.msg || res.status + ' ' + res.statusText); | ||
var error = new Error(json.msg || res.status + ' ' + res.statusText); | ||
error.code = json.code; | ||
throw error; | ||
} | ||
@@ -158,3 +160,3 @@ | ||
var candleFields = exports.candleFields = ['openTime', 'open', 'high', 'low', 'close', 'volume', 'closeTime', 'quoteAssetVolume', 'trades', 'baseAssetVolume', 'quoteAssetVolume']; | ||
var candleFields = exports.candleFields = ['openTime', 'open', 'high', 'low', 'close', 'volume', 'closeTime', 'quoteVolume', 'trades', 'baseAssetVolume', 'quoteAssetVolume']; | ||
@@ -161,0 +163,0 @@ /** |
{ | ||
"name": "binance-api-node", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "A node API wrapper for Binance", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
@@ -24,3 +24,5 @@ import crypto from 'crypto' | ||
if (!res.ok) { | ||
throw new Error(json.msg || `${res.status} ${res.statusText}`) | ||
const error = new Error(json.msg || `${res.status} ${res.statusText}`) | ||
error.code = json.code | ||
throw error | ||
} | ||
@@ -142,3 +144,3 @@ | ||
'closeTime', | ||
'quoteAssetVolume', | ||
'quoteVolume', | ||
'trades', | ||
@@ -145,0 +147,0 @@ 'baseAssetVolume', |
@@ -131,2 +131,16 @@ import test from 'ava' | ||
test.serial('[REST] error code', async t => { | ||
try { | ||
await client.orderTest({ | ||
symbol: 'TRXETH', | ||
side: 'SELL', | ||
type: 'LIMIT', | ||
quantity: '-1337.00000000', | ||
price: '1.00000000', | ||
}) | ||
} catch (e) { | ||
t.is(e.code, -1100) | ||
} | ||
}) | ||
test.serial('[WS] user', async t => { | ||
@@ -133,0 +147,0 @@ const clean = await client.ws.user() |
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
237364
1949