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