"Index 1 out of bounds for length 1" Error when trying to withdraw coins

I’ve been trying to get this to work for hours, I’ve read the API documentation and it’s not helpful at all.

I’ve been able to call other methods in the API without problem, so the timestamp and signature calc functions work.

I set the withdrawal amount to “1000.00”,

What do I to get this thing to work please?

{{{
const timeStamp = Utils.getUnixTimeStampMS()
const baseURL = “https://api.binance.com
const urlPath = “/wapi/v3/withdraw.html”

const params = {
  asset: "DOGE",
  network: "BSC",
  address: address,
  amount: amount,
  timestamp: timeStamp,
}

// @ts-ignore
const paramsURL = new URLSearchParams(params)

const paramsString = paramsURL.toString()

// API signature is a function of the parameters passed to the call (minus the api signature itself)
const apiSignature = BinanceIntegration.generateAPISignature(paramsString, "", apiSecret)

const fullParams = {
  ...params,
  "signature": apiSignature
}

const response: AxiosResponse<any> = await axios.post(baseURL + urlPath, {
  headers: {
    "X-MBX-APIKEY": apiKey,
  },
  params: fullParams
})

}}}

This is not Binance error but programming error, please research online or within the community of the library you’re using.

No, it’s a problem with the server.

I receive a response with a 200 code (it should be an error code, but w/e) and the response body contains a msg string : Index 1 out of bounds for length 1, This means the server is receiving my query, is sending a response, and it is sending back this arcane error message.

Can you try with https://github.com/binance-exchange/binance-api-postman and use the sapi endpoint https://binance-docs.github.io/apidocs/spot/en/#withdraw-sapi, please?

Note: wapi is going to be deprecated soon .

Yes, that was it.

wapi endpoint does not work, sapi endpoint does, however, work.

Thank you for the assistance :slight_smile: