binance-us / binance-us-api-docs

Official Documentation for the Binance US APIs and Streams
407 stars 170 forks source link

code: -1135, msg: 'Invalid account status.' #106

Open mishuan opened 1 year ago

mishuan commented 1 year ago

I recently created an API key for futures trading but hit this error code when trying to buy using the API key. I've verified I can successfully buy futures through the web app and I've also verified the code I wrote works for other people's API keys.

Could we get some clarity as to exactly what this status code entails and how to debug it?

Sample code:

async function smallBuy() {
    const Binance = require("node-binance-api");
    const signedBinance = new Binance().options({
        APIKEY: "",
        APISECRET: "",
        useServerTime: true
    });

    const test1 = await signedBinance.futuresBuy("BNBUSDT", 0.1)
    console.log(test1);

    const balance = await signedBinance.balance();
    const test2 = Object.keys(balance).map(_ => { return { [_]: Number(balance[_].available) } }).filter(_ => Object.values(_)[0] > 0);
    console.log(test2);
}
PengRusty commented 1 year ago

Hi there, Binance.us doesn't support futures trading yet. I guess you are trading in Binance.com.