I started working on my new library a couple of months ago, it’s called ‘binance-lib’ on npm, and I would like to share it here for feedback, it isn’t as versatile as other libraries ‘yet’, but it’s getting there, it will have ALL binance APIs (not just market data and account/trading APIs, but also the withdraw API, wallet API, pay, p2p and basically anything I can get my hands on)
I started working on it after much frustration with the most popular JS library ‘node-binance-api’ which has been dead for a year or two so far, the websocket implementations are terrible and had been causing me problems for ages, so instead I started working on mine.
One of the things my library excels at is the fact that everytime I had a new project, I would have to rewrite code to interpret the responses from the API and convert it into usable data structs, so instead I included those into my library, one of my problems was constantly having to fetch floats/ints from the responses since binance sends them as strings, there’s an option to automatically have it parseFloats when possible. Or having to fetch exchangeInfo responses for a specific coin, instead there is an option to have them ‘mapped’ to an object along with all their properties (and even filters have been changed from an array of the symbol’s filters to object property, so instead of having to run through the exchangeInfo response searching for BTCUSDT, and then running over all of the filter elements from the array, it would be easily accessible via exchangeInfo[].marketLotFilters, or exchangeInfo[].pricePrecision and etc…
It also renames all of the websocket responses from 1 letter properties to their actual name, so any websocket message who contains the property ‘p’ for ‘price’, would actually have the property named ‘price’.
This is a very brief summary of one of the many things the library handles for the developer. There is an extensive documentation over on github, please check it out, send feedback and maybe even give it a star
My hope is one day it will be featured on the binance API docs, the library is built from a HEAVY API user, so I hope this will suit most of the devs’ needs.
P.S: This is still a very early version of the library, for now it includes ALL of the futures API (apart from batchOrders), all spot market data/account data API, most of the spot trading API (except for OCO), and a FULL websocket support for all futures and spot-margin. Also the new Websocket API coming soon!