I am currently in the process of expanding an existing wallet client to include the newly introduced localentity endpoints with travel rules. Unfortunately, I’m having problems creating a new withdraw.
All attempts to create a withdraw with the new interface are rejected with 500 Internal Server Error and the error message {“code”:-1000, “msg”: “An unknown error occurred while processing the request.”}. are rejected. The same request with the old API works without any problems.
Here is an example script:
#!/usr/bin/env bash
API_KEY=“xxxxx”
PRIVATE_KEY=“xxxxx”
ADDRESS=“xxxxx”
Set up the request:
API_CALL=“sapi/v1/localentity/withdraw/apply”
TS=$(date +%s000)
PARAMS=“timestamp=$TS”
BODY=“address=$ADDRESS&amount=0.002&coin=ETH&questionnaire={"isAddressOwner": 1}”
SIG=$(echo -n “$PARAMS$BODY” | openssl dgst -sha256 -hmac “$PRIVATE_KEY” | sed ‘s/SHA2-256(stdin)= //g’)
Send the request:
curl -H “X-MBX-APIKEY: $API_KEY” -H “Content-Type: application/x-www-form-urlencoded” -X “POST” -d “$BODY” “https://api.binance.com/$API_CALL?$PARAMS&signature=$SIG”
The questionnaire also appears to be correct, as otherwise the message “Questionnaire format not valid.” or “Questionnaire must not be blank” is displayed.