Add more pre-checkers, docstrings

- add SpwCardNotFound error to `send_transaction()`
- Add balance checker to `send_transactions()`
- Made working docstrings
- Correction errors in Parameters
This commit is contained in:
Teleport
2023-05-09 02:28:12 +03:00
parent fc1161f341
commit c1a172d4be
5 changed files with 205 additions and 51 deletions

View File

@@ -35,6 +35,11 @@ class SpwInsufficientFunds(SpwApiError):
super().__init__("Insufficient funds on the card")
class SpwCardNotFound(SpwApiError):
def __init__(self):
super().__init__("Receiver card not found")
class MojangApiError(_ApiError):
pass
@@ -51,3 +56,23 @@ class MojangAccountNotFound(MojangApiError):
class SurgeplayApiError(_ApiError):
pass
class LengthError(ValueError):
def __init__(self, max_length: int):
super().__init__(f"length must be <= {max_length}.")
class BigAmountError(ValueError):
def __init__(self):
super().__init__(f"amount must be <= 1728.")
class IsNotURLError(ValueError):
def __init__(self):
super().__init__(f"is not url.")
class IsNotCardError(ValueError):
def __init__(self, card: str):
super().__init__(f"Receiver card (`{card}`) number not valid")