While trying to redeem USDT from my binance account using RedeemFlexibleProductAsync
method but I'm getting :
'Error: daily product not exist'
as result.
- I can redeem the amount using the Binance App
- I have checked on typo for string ProductId(which is "USDT")
- The connection with the exchange server is successful
- I can read all flexible balances from that connection, including USDT
- I have enabled Trading and Withdrawal for my API
- I have tried different receiveWindows, now it's set at maximum of 60000
Here is my code:
private async Task<bool> RedeemFromEarn(string coin,decimal redeemAmount)
{
var earn = await client.GeneralApi.Savings.GetFlexibleProductPositionAsync();
var earnBalance = JsonConvert.DeserializeObject(earn.Data.First(x => x.Asset.Equals(coin)).TotalQuantity.ToString());
if(Convert.ToDecimal(earnBalance) > redeemAmount)
{
var redeem = await client.GeneralApi.Savings.RedeemFlexibleProductAsync(coin, redeemAmount,RedeemType.Normal,60000);
if (redeem.Success)
{
Debug.Print($"Redeem successful. Transaction ID: {redeem.Data}");
}
else
{
Debug.Print($"Error: {redeem.Error.Message}");
}
}
else
{
Debug.Print($"Not enough {coin} in Earn, try redeeming max {earnBalance}");
return false;
}
return true;
}