Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit 16f5150

Browse files
author
Jon Eyrick
authored
v0.8.0
2 parents f6eb762 + 9ae79d4 commit 16f5150

4 files changed

Lines changed: 415 additions & 1791 deletions

File tree

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,27 @@ npm install node-binance-api --save
2020

2121
#### Getting started
2222
```javascript
23-
const Binance = require('node-binance-api');
24-
const binance = new Binance().options({
23+
const binance = require('node-binance-api').options({
2524
APIKEY: '<key>',
2625
APISECRET: '<secret>',
2726
useServerTime: true, // If you get timestamp errors, synchronize to server time at startup
2827
test: true // If you want to use sandbox mode where orders are simulated
2928
});
3029
```
3130

31+
#### Instantiating Multiple Instances
32+
```javascript
33+
const Binance = require('node-binance-api');
34+
35+
const instance1 = new Binance().options({
36+
// ...
37+
});
38+
39+
const instance2 = new Binance().options({
40+
// ...
41+
});
42+
```
43+
3244
#### Getting latest price of a symbol
3345
```js
3446
binance.prices('BNBBTC', (error, ticker) => {

node-binance-api.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
*/
1414
let api = function Binance() {
1515
'use strict';
16-
if (!(this instanceof Binance)) {
17-
return new Binance();
18-
}
1916
const WebSocket = require('ws');
2017
const request = require('request');
2118
const crypto = require('crypto');
@@ -1021,7 +1018,7 @@ let api = function Binance() {
10211018
return this;
10221019
},
10231020

1024-
1021+
10251022
/**
10261023
* Creates an order
10271024
* @param {string} side - BUY or SELL
@@ -1035,7 +1032,7 @@ let api = function Binance() {
10351032
order: function(side, symbol, quantity, price, flags = {}, callback = false) {
10361033
order(side, symbol, quantity, price, flags, callback);
10371034
},
1038-
1035+
10391036
/**
10401037
* Creates a buy order
10411038
* @param {string} symbol - the symbol to buy

0 commit comments

Comments
 (0)