Code Monkey home page Code Monkey logo

bitmex-nodejs's Introduction

BitMEX-nodejs - An unofficial BitMEX API connector written with typescript

All types and methods are automatically generated from BitMEX official Swagger Specification

Installation

Live Example

visual studio code - bitmex node

Code Example

import { BitmexAPI } from "bitmex-node";

const bitmex = new BitmexAPI({
    "apiKeyID": "NXTy391NCdhrrSWzsJE_xktb",
    "apiKeySecret": "bPVQ51-xxI7bRcuAAOlvH0wUFpPvusfmC1dF6zyy4s3v8Mgd",
    // "proxy": "https://cors-anywhere.herokuapp.com/"
});

!async function () {

    const chatMessage = await bitmex.Chat.new({ message: 'Pump incoming !!! ' });

}()

Features:

Donate
  • (BTC) 1CUjz7EF1iqgJPi3MPW6Nb556tQwPNryM3

bitmex-nodejs's People

Contributors

dakotalarson avatar ilanfrumer avatar lionel95200x avatar yoann-losbar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bitmex-nodejs's Issues

How can we use BitmexSocket?

Hi bro.

I couldn't find any documentation or any help to use socket.
PLease leave an example to get trades, Create order, ament or etc.

Thank's in advance.

Authentication: Invalid signature

I'm getting the error message:

{
  "message": "Signature not valid.",
  "name": "HTTPError"
}

for the following code:

const r = require('bitmex-node');

const BITMEX_API_KEY = .....
const BITMEX_API_SECRET = .....

const bitmex = new r.BitmexAPI({
    "apiKeyID": BITMEX_API_KEY,
    "apiKeySecret": BITMEX_API_SECRET
});

!async function () {

    const position = await bitmex.Position
        .get({message: 'messageIncoming' })
        .catch(err => {console.log(err);
        });

}();

Not using Auth headers when available

I looked through the code and realized auth headers are only passed to endpoints that require it. Authenticated requests are allowed at a rate of 60 / minute, whereas unauthenticated requests are only allowed at a rate of 30 / minute.

Is this something that can be fixed so that all requests will pass auth headers if they are available?

Creating orders

Can you create and close orders with this? Just want to make sure before I dive deep into this :)
If so, is there any example? I see that you mention that this module is capable of executing functions in the Bitmex API explorer (https://www.bitmex.com/api/explorer/).

Socket is closing

Hey! First of all: Thanks for this client!

I use the BitmexSocket class and sometimes (like every 12-24h) the subscriptions are closing without an error and without being completed. They just stop emitting values...

Do you have any idea why this happens? I think this is a common issue, isn't it?

Order.getOrders()

Hi! I expect only open orders. But I get all the orders

async getOpenedOrders () {
    const orders = await REST.Order.getOrders({ "open": true })
    return orders
}

What am I doing wrong? Thank!

Getting CORS issue for the example code (trade bucket)

Do you have any advice on how to work around this issue?
Access to fetch at 'https://www.bitmex.com/api/v1/trade/bucketed?binSize=5m' from origin 'http://192.168.0.8:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I'm using this with reactjs

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.