Open pdwinkel opened 3 years ago
I think it's possible by using 'test' parametter on options.
const default_options = {
recvWindow: 5000,
useServerTime: false,
reconnect: true,
keepAlive: true,
verbose: false,
test: false,
hedgeMode: false,
localAddress: false,
family: false,
log: function ( ...args ) {
console.log( Array.prototype.slice.call( args ) );
}
};
Like this :
const binance = new Binance().options({
APIKEY: '<key>',
APISECRET: '<secret>',
test: true
});
But it seem make error when a request is maked.
Try setting base: 'https://testnet.binance.vision'
in the options
should do this automatically if test mode is on, this feature was finally released
I'm using the following options, which seem to work for testing spot trading:
{
verbose: true,
urls: {
base: 'https://testnet.binance.vision/api/',
combineStream: 'wss://testnet.binance.vision/stream?streams=',
stream: 'wss://testnet.binance.vision/ws/'
}
}
watch the /
and =
at the end of the strings!
thank you, this is very helpful. it should be easy enough for us to enable this automatically if test mode is true and the other options are set to the defaults.
Hello team,
This is my Options:
const binance = new Binance().options({ APIKEY: testnet_APIKEY, APISECRET: testnet_APISECRET, test: true, base: "https://testnet.binance.vision/api" })
But I get:
code: -2015, msg: 'Invalid API-key, IP, or permissions for action, request ip: 80.235.34.109'
Can Somebody help me to understand what is going on? I checked the API key and secret as well but they are correct. Thanks
Same issue. I have tried tweaking too the principal script, to no avail.
Nevermind, @sinamhbb use @pdwinkel options without test: true,
in your case, as it overwrites the custom URLs configuration.
Is it possible to use/set the Binance test network https://testnet.binance.vision ?