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.9.24 to 0.10.0

12

dist/websocket.js

@@ -345,2 +345,13 @@ "use strict";

var userTransforms = {
// https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md#balance-update
balanceUpdate: function balanceUpdate(m) {
return {
asset: m.a,
balanceDelta: m.d,
clearTime: m.T,
eventTime: m.E,
eventType: 'balanceUpdate'
};
},
// https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md#account-update
outboundAccountInfo: function outboundAccountInfo(m) {

@@ -367,2 +378,3 @@ return {

},
// https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md#order-update
executionReport: function executionReport(m) {

@@ -369,0 +381,0 @@ return {

46

index.d.ts

@@ -210,2 +210,4 @@ // tslint:disable:interface-name

export type UserDataStreamEvent = OutboundAccountInfo | ExecutionReport | BalanceUpdate;
export interface WebSocket {

@@ -219,4 +221,3 @@ depth: (pair: string | string[], callback: (depth: Depth) => void) => ReconnectingWebSocketHandler;

aggTrades: (pairs: string | string[], callback: (trade: Trade) => void) => ReconnectingWebSocketHandler;
user: (callback: (msg: OutboundAccountInfo | ExecutionReport) => void) => Function;
user: (callback: (msg: UserDataStreamEvent) => void) => Function;
marginUser: (callback: (msg: OutboundAccountInfo | ExecutionReport) => void) => Function;

@@ -464,2 +465,16 @@ futuresUser: (callback: (msg: OutboundAccountInfo | ExecutionReport) => void) => Function;

export enum OrderRejectReason {
ACCOUNT_CANNOT_SETTLE = 'ACCOUNT_CANNOT_SETTLE',
ACCOUNT_INACTIVE = 'ACCOUNT_INACTIVE',
DUPLICATE_ORDER = 'DUPLICATE_ORDER',
INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE',
MARKET_CLOSED = 'MARKET_CLOSED',
NONE = 'NONE',
ORDER_WOULD_TRIGGER_IMMEDIATELY = 'ORDER_WOULD_TRIGGER_IMMEDIATELY',
PRICE_QTY_EXCEED_HARD_LIMITS = 'PRICE_QTY_EXCEED_HARD_LIMITS',
UNKNOWN_ACCOUNT = 'UNKNOWN_ACCOUNT',
UNKNOWN_INSTRUMENT = 'UNKNOWN_INSTRUMENT',
UNKNOWN_ORDER = 'UNKNOWN_ORDER'
}
export type ExecutionType =

@@ -473,6 +488,2 @@ | 'NEW'

export type EventType =
| 'executionReport'
| 'account';
export interface Depth {

@@ -563,7 +574,2 @@ eventType: string;

export interface Message {
eventType: EventType;
eventTime: number;
}
export interface Balances {

@@ -576,3 +582,3 @@ [key: string]: {

export interface OutboundAccountInfo extends Message {
export interface OutboundAccountInfo {
balances: Balances;

@@ -587,5 +593,15 @@ makerCommissionRate: number;

lastAccountUpdate: number;
eventType: 'account';
eventTime: number;
}
export interface ExecutionReport extends Message {
export interface BalanceUpdate {
asset: string;
balanceDelta: number;
clearTime: number;
eventTime: number;
eventType: 'balanceUpdate';
}
export interface ExecutionReport {
symbol: string;

@@ -603,3 +619,3 @@ newClientOrderId: string;

orderStatus: OrderStatus;
orderRejectReason: string;
orderRejectReason: OrderRejectReason;
orderId: number;

@@ -616,2 +632,4 @@ orderTime: number;

totalQuoteTradeQuantity: string;
eventType: 'executionReport';
eventTime: number;
}

@@ -618,0 +636,0 @@

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

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

@@ -1102,9 +1102,6 @@ # binance-api-node [![build](https://img.shields.io/travis/Ashlar/binance-api-node/master.svg?style=flat-square)](https://travis-ci.org/Ashlar/binance-api-node) [![cover](https://img.shields.io/coveralls/github/Ashlar/binance-api-node/master?style=flat-square)](https://coveralls.io/github/Ashlar/binance-api-node?branch=master) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node)

```
| Param | Type | Required |
|------------|----------|-----------|
| symbol | String | true |
Name | Type | Mandatory | Description |
-----------|--------|-----------|----------------------------------------
symbol | STRING | YES |
recvWindow | LONG | NO | The value cannot be greater than `60000`
timestamp | LONG | YES |
<details>

@@ -1111,0 +1108,0 @@ <summary>Output</summary>

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