Facing issue on the binance withdrawal api

Facing issue on the binance withdrawal api,

I got the API working over ETH, but it will not work over BEP20.
Please can you look at my below code and advise:
$api = new \Binance\API($api_key, $secret_key);
$asset = ‘USDT’;
$network = ‘BSC’; // Set the network to BEP20
try {
$response = $api->withdraw($asset, $destination_address, $amount, false, false,
$network, ‘BEP20’);
//print_r($response);
return $response;
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}

Lastly this is the most recent error we are getting:
Error: signedRequest error: {
“code”: -4019,
“msg”: “Withdrawal is not available for this currency.”
}

Hi,

Without knowing the library and just looking at the snippet you’ve provided, I see that you’re using both BSC and BEP20 which is likely your issue. You’ve set $network = 'BSC' but in the API call you’ve hardcoded BEP20. To give me more context, please let me know which PHP library you’re using.

Using “jaggedsoft/php-binance-api”: “^0.5.28” php sdk

Ok.

I looked at the code and the withdraw function accepts these parameters:
public function withdraw(string $asset, string $address, $amount, $addressTag = null, $addressName = "", bool $transactionFeeFlag = false, $network = null, $orderId = null)

So your code should look like this:
$response = $api->withdraw($asset, $destination_address, $amount, null, "", false, ‘BSC’);

As a side-note, that library is quite out of date and is missing a lot of endpoints, however it should at least work for withdrawing.

Cheers,

@jonte, is there any minimum withdrawal limit?
when we trying to withdraw a small amount 0.115 it shows an error,
Error: signedRequest error: {“code”:-4028,“msg”:“Withdrawal amount must be greater than the transaction fee.”}

So please advise, is there any other php SDK supports the small amount transactions?