Giter VIP home page Giter VIP logo

max-websocket-docs's Introduction

Introduction

Official documentation for the new redesign MAX Exchange websocket service

Endpoint: wss://max-stream.maicoin.com/ws

Important note

  • price and volume should be string
  • timestamp and depth should be number

Keep connection

You need to use ping frame to keep connection with server. If server doesn't receive your ping for 1 minute. The connection will be closed by server side. Some libraries will do this for you, so please check your library first.

const WebSocket = require('ws');
const url = "wss://max-stream.maicoin.com/ws"
const ws = new WebSocket(url);

ws.on('open', function open() {
  setInterval(() => {
    ws.ping("test")
  }, 30000);
})
ws.on('pong', function incoming(data) {
  // it will show "server pong test" on the screen
  console.log('server pong', data.toString());
});

Response key alias

We use short keys to reduce response size, please check out mappings below.

abbr meaning comment
e event
E errors
c channel
i id
s subscription
T at // or created_at
ST startTime
ET endTime
k kline
a asks
b bids
M market
m maker
p price
v volume
O open
C close
H high
L low
tk ticker
o orders
t trades
sd side
ot ord_type
sp stop_price
ap avg_price
tc trade_count
B balances
rv remaining_volume
ev executed_volume or filled
qv quote_volume quote volume used in kline
S state
R resolution kline resolution
cu currency
fc fee currency
av available
l locked
f fee
oi order id in trade
ti trade id
tr trend

Error response

If you get any error response, it will be concentrated in an array.

{
  "e": "error",
  "E": ["...."],
  "i": "client1",
  "T": 123456789
}

max-websocket-docs's People

Contributors

c9s avatar dependabot[bot] avatar yhsiang avatar

Watchers

 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.