GithubHelp home page GithubHelp logo

heritage-ljh / binance-websocket-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from binance/binance-websocket-examples

0.0 2.0 0.0 513 KB

Example code in Nodejs that demonstrate how to subscribe to Binance Websocket server.

License: MIT License

JavaScript 99.49% Dockerfile 0.51%

binance-websocket-examples's Introduction

Binance Websocket Examples

Local orderbook (Spot)

# Cache local orderbook and echo best price
# btcusdt by default
npm run orderbook

# or provide the trading pair
SYMBOL=bnbusdt npm run orderbook

Spot user data stream

# get user data steam
APIKEY=xxxxxx npm run user

# Get margin account update from websocket
APIKEY=xxxxxx APISECRET=xxxxx npm run margin-user

Futures user data stream

# Get user data steam on production
APIKEY=xxxxxx APISECRET=xxxxx npm run futures-user

# On testnet
APIKEY=xxxxxx APISECRET=xxxxx WSS_BASE_URL="wss://stream.binancefuture.com/" HTTP_BASE_URL="https://testnet.binancefuture.com/" npm run futures-user

Delivery Futures user data stream

# Get user data steam - defaults to production
APIKEY=xxxxxx APISECRET=xxxxx npm run delivery-futures-user

Combined streams

# Get multi pairs stream, setting the pairs in src/multi-stream-depth
npm run multi-stream

Spot trade stream delay monitoring

npm run monitor-spot-trade

Spot depth stream delay monitoring

npm run monitor-spot-depth

Futures depth stream delay monitoring

npm run monitor-futures

How to setup

npm install

# run test
npm run test

License

MIT

binance-websocket-examples's People

Contributors

2pd avatar dependabot[bot] avatar iscjt avatar ishuen avatar jorisw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.