cleaning & docs
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
[1]: https://www.npmjs.com/package/bybit-api
|
[1]: https://www.npmjs.com/package/bybit-api
|
||||||
|
|
||||||
A production-ready Node.js connector for the Bybit APIs and WebSockets.
|
A production-ready Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser support.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
`npm install --save bybit-api`
|
`npm install --save bybit-api`
|
||||||
@@ -36,7 +36,7 @@ Build a bundle using webpack:
|
|||||||
- `npm build`
|
- `npm build`
|
||||||
- `npm pack`
|
- `npm pack`
|
||||||
|
|
||||||
The bundle can be found in `lib/`. Altough usage should be largely consistent, smaller differences will exist. Docs TBC.
|
The bundle can be found in `dist/`. Altough usage should be largely consistent, smaller differences will exist. Documentation is still TODO.
|
||||||
|
|
||||||
### Inverse Contracts
|
### Inverse Contracts
|
||||||
#### Rest client
|
#### Rest client
|
||||||
@@ -88,7 +88,7 @@ client.changeUserLeverage({leverage: 4, symbol: 'ETHUSD'})
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
See inverse [rest-client.js](./lib/rest-client.js) for further information.
|
See inverse [rest-client.ts](./src/rest-client.ts) for further information.
|
||||||
|
|
||||||
#### Websocket client
|
#### Websocket client
|
||||||
```javascript
|
```javascript
|
||||||
@@ -150,7 +150,7 @@ ws.on('error', err => {
|
|||||||
console.error('ERR', err);
|
console.error('ERR', err);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
See inverse [websocket-client.js](./lib/websocket-client.js) & [ws api docs](./doc/websocket-client.md) for further information.
|
See inverse [websocket-client.ts](./src/websocket-client.ts) for further information.
|
||||||
|
|
||||||
### Customise Logging
|
### Customise Logging
|
||||||
Pass a custom logger which supports the log methods `silly`, `debug`, `notice`, `info`, `warning` and `error`, or override methods from the default logger as desired:
|
Pass a custom logger which supports the log methods `silly`, `debug`, `notice`, `info`, `warning` and `error`, or override methods from the default logger as desired:
|
||||||
|
|||||||
@@ -105,11 +105,6 @@ export class WebsocketClient extends EventEmitter {
|
|||||||
|
|
||||||
const ws = new WebSocket(url);
|
const ws = new WebSocket(url);
|
||||||
|
|
||||||
// ws.onopen!(this._wsOpenHandler.bind(this));
|
|
||||||
// ws.onmessage!(this._wsMessageHandler.bind(this));
|
|
||||||
// ws.onerror!(this._wsOnErrorHandler.bind(this));
|
|
||||||
// ws.onclose!(this._wsCloseHandler.bind(this));
|
|
||||||
|
|
||||||
ws.onopen = this._wsOpenHandler.bind(this);
|
ws.onopen = this._wsOpenHandler.bind(this);
|
||||||
ws.onmessage = this._wsMessageHandler.bind(this);
|
ws.onmessage = this._wsMessageHandler.bind(this);
|
||||||
ws.onerror = this._wsOnErrorHandler.bind(this);
|
ws.onerror = this._wsOnErrorHandler.bind(this);
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
{
|
{
|
||||||
"compileOnSave": true,
|
"compileOnSave": true,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"declaration": true,
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"moduleResolution": "node",
|
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"outDir": "lib",
|
"moduleResolution": "node",
|
||||||
|
"declaration": true,
|
||||||
|
"sourceMap": true,
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"noEmitOnError": true,
|
"noEmitOnError": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"sourceMap": true,
|
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"lib": ["es2017","dom"],
|
"lib": ["es2017","dom"],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
|
"outDir": "lib",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@src/*": ["src/*"]
|
"@src/*": ["src/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user