coinbase / coinbase-pro-node

DEPRECATED — The official Node.js library for Coinbase Pro
Apache License 2.0
844 stars 316 forks source link

Websocket is returing full channel all the time #215

Closed Lifestohack closed 6 years ago

Lifestohack commented 6 years ago

Description: I want websocket to return tricker channel. Below is my code:

const websocket = new Gdax.WebsocketClient(
                                                  this.cryptocurrency,
                                                  '',
                                                  {
                                                            key: this.key,
                                                            secret: this.secret,
                                                            passphrase: this.passphrase,
                                                  },
                                                  { 
                                                            channels: ['ticker']
                                                   }
                                          );
websocket.on('message', data => {
console.log(data);
});

I have explicitely provied ticker as channels but I get full all the time.

Actual Result:

{ type: 'match', //done, open, received....
  trade_id: 1971573,
  maker_order_id: '3f3f36fc-8bde-44a9-9b03-9390b4ed9320',
  taker_order_id: '6ff7edef-b489-404a-9bb2-d01d08ac0a5a',
  side: 'buy',
  size: '0.02205614',
  price: '209.41000000',
  product_id: 'LTC-EUR',
  sequence: 415919639,
  time: '2018-01-09T23:40:29.053000Z' }
.
.
.

Expected Result: (As described in GDAX API DOC)

{
    "type": "ticker",
    "trade_id": 20153558,
    "sequence": 3262786978,
    "time": "2017-09-02T17:05:49.250000Z",
    "product_id": "BTC-USD",
    "price": "4388.01000000",
    "side": "buy", 
    "last_size": "0.03000000",
    "best_bid": "4388",
    "best_ask": "4388.01"
}

Version: Gdax v0.4.2

Lifestohack commented 6 years ago

Never mind.. I was looking at the doc of 0.5.1 and working on old gdax before the new version came.