binance-exchange / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
528 stars 145 forks source link

Is it possible to place an order on test endpoint ? #188

Closed hlalibe closed 4 years ago

hlalibe commented 4 years ago

I see on this page that we can place an order on a test endpoint for trial purpose: https://binance-docs.github.io/apidocs/spot/en/#spot-account-trade The test endpoint is: /api/v3/order/test instead of /api/v3/order

With this library, is it possible to do so ?

thanks

jaggedsoft commented 4 years ago

Hi there!

The latest version is available here https://github.com/jaggedsoft/node-binance-api

You can enable test mode like this:

const Binance = require('node-binance-api');
const binance = new Binance({
  APIKEY: '<key>',
  APISECRET: '<secret>',
  test: true
});

This works for margin and spot trading. Please note that test mode for futures trading isn't automatic yet, and requires manually setting the endpoint url to test. See https://github.com/jaggedsoft/node-binance-api/pull/404

hlalibe commented 4 years ago

Ok thanks for your answer, i've updated my bookmark. I see both repositories install with: npm install node-binance-api --save I'm not entirely familiar with Git. If i ran this command 2 weeks ago, am I running the correct version then ?

jaggedsoft commented 4 years ago

Yeah you should be good to go, just add the test flag to your constructor. You'll know it's working if it returns an empty response. You can view the changelog on the other branch and monitor major changes on the releases page. Cheers!