Round amount before sending XMR
This commit is contained in:
parent
1744b9ead8
commit
7bc92dcef9
|
@ -102,6 +102,8 @@ class AgoraDesk:
|
|||
result["message"] = "OK"
|
||||
result["response"] = response
|
||||
else:
|
||||
if "error" in response:
|
||||
result["error"] = response["error"]
|
||||
result["message"] = "API ERROR"
|
||||
|
||||
return result
|
||||
|
@ -1037,8 +1039,9 @@ class AgoraDesk:
|
|||
if otp:
|
||||
params["otp"] = otp
|
||||
|
||||
return await self._api_call(
|
||||
response = await self._api_call(
|
||||
api_method="wallet-send/XMR",
|
||||
http_method="POST",
|
||||
query_values=params,
|
||||
)
|
||||
return response
|
||||
|
|
|
@ -122,9 +122,10 @@ async def withdrawal_job(group=None):
|
|||
|
||||
# for wallet, amount in collapsed.items():
|
||||
print("ITER SEND", wallet, amount)
|
||||
amount_rounded = round(amount, 8)
|
||||
cast = {
|
||||
"address": wallet.address,
|
||||
"amount": amount,
|
||||
"amount": amount_rounded,
|
||||
"password": platform.password,
|
||||
"otp": otp_code,
|
||||
}
|
||||
|
@ -139,7 +140,7 @@ async def withdrawal_job(group=None):
|
|||
payout = Payout.objects.create( # noqa
|
||||
user=group.user,
|
||||
wallet=wallet,
|
||||
amount=amount,
|
||||
amount=amount_rounded,
|
||||
description=reason,
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue