We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfb1940 commit dc12bcfCopy full SHA for dc12bcf
1 file changed
sdk/utils.py
@@ -0,0 +1,30 @@
1
+'''
2
+ * @file utils.py
3
+ * @author Krisna Pranav
4
+ * @brief utils
5
+ * @version 1.0
6
+ * @date 2024-11-25
7
+ *
8
+ * @copyright Copyright (c) 2024 ThunderPayment Developers, Krisna Pranav
9
10
+
11
+import inspect
12
+import json
13
+import traceback
14
15
+from collections.abc import Callable
16
+from decimal import Decimal
17
+from typing import Any
18
19
+from .logger import logger
20
21
+CONVERT_RATE = 100000000
22
23
+def convert_amount_type(amount: str | Decimal) -> Decimal:
24
+ if amount == "None":
25
+ return Decimal("Nan")
26
27
+ return Decimal(amount)
28
29
+def satoshis(amount: str | Decimal) -> int:
30
+ return int(convert_amount_type(amount) * CONVERT_RATE)
0 commit comments