diff options
| author | Tolmachev Igor <me@igorek.dev> | 2025-07-18 15:32:13 +0900 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2025-07-18 15:32:13 +0900 |
| commit | c4518bf870487f73fdee93d65eab7652c4f2486f (patch) | |
| tree | edabf65f7e3b8f2a2ecf11a51837710d558cd976 | |
| parent | c5ec7b7ebce448c6768d0ed728b0a493be41c12e (diff) | |
| download | async_crypto_pay_api-c4518bf870487f73fdee93d65eab7652c4f2486f.tar.gz async_crypto_pay_api-c4518bf870487f73fdee93d65eab7652c4f2486f.zip | |
Add UNKNOWN to asset enums v1.2.0dev
| -rw-r--r-- | src/async_crypto_pay_api/__meta__.py | 2 | ||||
| -rw-r--r-- | src/async_crypto_pay_api/models/assets.py | 20 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/async_crypto_pay_api/__meta__.py b/src/async_crypto_pay_api/__meta__.py index 4b0436d..2b4c76d 100644 --- a/src/async_crypto_pay_api/__meta__.py +++ b/src/async_crypto_pay_api/__meta__.py | |||
| @@ -1,2 +1,2 @@ | |||
| 1 | __version__ = "1.1.0" | 1 | __version__ = "1.2.0" |
| 2 | __api_version__ = "1.5.1" | 2 | __api_version__ = "1.5.1" |
diff --git a/src/async_crypto_pay_api/models/assets.py b/src/async_crypto_pay_api/models/assets.py index ee72b6d..f6c2613 100644 --- a/src/async_crypto_pay_api/models/assets.py +++ b/src/async_crypto_pay_api/models/assets.py | |||
| @@ -1,8 +1,5 @@ | |||
| 1 | from enum import Enum | 1 | from enum import Enum |
| 2 | 2 | from typing import Any | |
| 3 | |||
| 4 | class EnumWithUnknown(Enum): | ||
| 5 | UNKNOWN = "UNKNOWN" | ||
| 6 | 3 | ||
| 7 | 4 | ||
| 8 | class CryptoAsset(Enum): | 5 | class CryptoAsset(Enum): |
| @@ -31,6 +28,11 @@ class CryptoAsset(Enum): | |||
| 31 | USDC = "USDC" | 28 | USDC = "USDC" |
| 32 | JET = "JET" | 29 | JET = "JET" |
| 33 | SEND = "SEND" | 30 | SEND = "SEND" |
| 31 | __UNKNOWN = "UNKNOWN" | ||
| 32 | |||
| 33 | @classmethod | ||
| 34 | def _missing_(cls, value: object) -> Any: | ||
| 35 | return cls.__UNKNOWN | ||
| 34 | 36 | ||
| 35 | 37 | ||
| 36 | class FiatAsset(Enum): | 38 | class FiatAsset(Enum): |
| @@ -56,6 +58,11 @@ class FiatAsset(Enum): | |||
| 56 | ILS = "ILS" | 58 | ILS = "ILS" |
| 57 | KGS = "KGS" | 59 | KGS = "KGS" |
| 58 | TJS = "TJS" | 60 | TJS = "TJS" |
| 61 | __UNKNOWN = "UNKNOWN" | ||
| 62 | |||
| 63 | @classmethod | ||
| 64 | def _missing_(cls, value: object) -> Any: | ||
| 65 | return cls.__UNKNOWN | ||
| 59 | 66 | ||
| 60 | 67 | ||
| 61 | class SwapAsset(Enum): | 68 | class SwapAsset(Enum): |
| @@ -66,6 +73,11 @@ class SwapAsset(Enum): | |||
| 66 | SOL = "SOL" | 73 | SOL = "SOL" |
| 67 | BTC = "BTC" | 74 | BTC = "BTC" |
| 68 | LTC = "LTC" | 75 | LTC = "LTC" |
| 76 | __UNKNOWN = "UNKNOWN" | ||
| 77 | |||
| 78 | @classmethod | ||
| 79 | def _missing_(cls, value: object) -> Any: | ||
| 80 | return cls.__UNKNOWN | ||
| 69 | 81 | ||
| 70 | 82 | ||
| 71 | __all__ = [ | 83 | __all__ = [ |
