Skip to content

Commit

Permalink
Add dapi testnet support for REST endpoints by flamy-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jaggedsoft authored Jul 13, 2020
2 parents 640d644 + 590de85 commit 286712a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions node-binance-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ let api = function Binance( options = {} ) {
let fapi = 'https://fapi.binance.com/fapi/';
let dapi = 'https://dapi.binance.com/dapi/';
let fapiTest = 'https://testnet.binancefuture.com/fapi/';
let dapiTest= 'https://testnet.binancefuture.com/dapi/';
let fstream = 'wss://fstream.binance.com/stream?streams=';
let fstreamSingle = 'wss://fstream.binance.com/ws/';
let fstreamSingleTest = 'wss://stream.binancefuture.com/ws/';
Expand Down Expand Up @@ -470,6 +471,7 @@ let api = function Binance( options = {} ) {
}
let baseURL = typeof flags.base === 'undefined' ? base : flags.base;
if ( Binance.options.test && baseURL === fapi ) baseURL = fapiTest;
if ( Binance.options.test && baseURL === dapi ) baseURL = dapiTest;
let opt = {
headers,
url: baseURL + url,
Expand Down

0 comments on commit 286712a

Please sign in to comment.