crypticorn 1.0.2rc3__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crypticorn/__init__.py +3 -3
- crypticorn/auth/__init__.py +2 -0
- crypticorn/auth/client/__init__.py +112 -0
- crypticorn/auth/client/api/__init__.py +8 -0
- crypticorn/auth/client/api/admin_api.py +522 -0
- crypticorn/auth/client/api/auth_api.py +2089 -0
- crypticorn/auth/client/api/service_api.py +309 -0
- crypticorn/auth/client/api/user_api.py +2540 -0
- crypticorn/auth/client/api/wallet_api.py +1698 -0
- crypticorn/auth/client/api_client.py +758 -0
- crypticorn/auth/client/api_response.py +20 -0
- crypticorn/auth/client/configuration.py +584 -0
- crypticorn/auth/client/exceptions.py +220 -0
- crypticorn/auth/client/models/__init__.py +91 -0
- crypticorn/auth/client/models/add_wallet200_response.py +86 -0
- crypticorn/auth/client/models/add_wallet_request.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response.py +107 -0
- crypticorn/auth/client/models/authorize_user200_response_auth.py +101 -0
- crypticorn/auth/client/models/authorize_user_request.py +96 -0
- crypticorn/auth/client/models/create_user_request.py +114 -0
- crypticorn/auth/client/models/list_wallets200_response.py +137 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_sale_round.py +115 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet.py +168 -0
- crypticorn/auth/client/models/list_wallets200_response_balances_inner_wallet_vesting_wallets_inner.py +191 -0
- crypticorn/auth/client/models/list_wallets200_response_data_inner.py +102 -0
- crypticorn/auth/client/models/list_wallets200_response_user_value.py +118 -0
- crypticorn/auth/client/models/logout_default_response.py +108 -0
- crypticorn/auth/client/models/logout_default_response_issues_inner.py +83 -0
- crypticorn/auth/client/models/refresh_token_info200_response.py +97 -0
- crypticorn/auth/client/models/refresh_token_info200_response_user_session.py +105 -0
- crypticorn/auth/client/models/resend_verification_email_request.py +84 -0
- crypticorn/auth/client/models/revoke_user_tokens_request.py +83 -0
- crypticorn/auth/client/models/rotate_tokens200_response.py +110 -0
- crypticorn/auth/client/models/token_info200_response.py +97 -0
- crypticorn/auth/client/models/unlink_wallet_request.py +83 -0
- crypticorn/auth/client/models/update_user_request.py +93 -0
- crypticorn/auth/client/models/user_reset_password_request.py +87 -0
- crypticorn/auth/client/models/user_set_password_request.py +89 -0
- crypticorn/auth/client/models/verify200_response.py +110 -0
- crypticorn/auth/client/models/verify_email200_response.py +107 -0
- crypticorn/auth/client/models/verify_email200_response_auth.py +101 -0
- crypticorn/auth/client/models/verify_email200_response_auth_auth.py +110 -0
- crypticorn/auth/client/models/verify_email_request.py +83 -0
- crypticorn/auth/client/models/verify_wallet_request.py +91 -0
- crypticorn/auth/client/models/wallet_verified200_response.py +83 -0
- crypticorn/auth/client/models/whoami200_response.py +104 -0
- crypticorn/auth/client/rest.py +195 -0
- crypticorn/auth/main.py +45 -0
- crypticorn/client.py +46 -8
- crypticorn/common/__init__.py +5 -0
- crypticorn/common/auth.py +43 -0
- crypticorn/common/auth_client.py +163 -0
- crypticorn/common/errors.py +432 -0
- crypticorn/common/scopes.py +29 -0
- crypticorn/common/urls.py +25 -0
- crypticorn/hive/__init__.py +2 -1
- crypticorn/hive/client/__init__.py +57 -0
- crypticorn/hive/client/api/__init__.py +6 -0
- crypticorn/hive/client/api/data_api.py +594 -0
- crypticorn/hive/client/api/models_api.py +1680 -0
- crypticorn/hive/client/api/status_api.py +263 -0
- crypticorn/hive/client/api_client.py +758 -0
- crypticorn/hive/client/api_response.py +20 -0
- crypticorn/hive/client/configuration.py +612 -0
- crypticorn/hive/client/exceptions.py +220 -0
- crypticorn/hive/client/models/__init__.py +38 -0
- crypticorn/hive/client/models/coins.py +44 -0
- crypticorn/hive/client/models/data_download_response.py +113 -0
- crypticorn/hive/client/models/data_info.py +115 -0
- crypticorn/hive/client/models/data_value_value_value_inner.py +154 -0
- crypticorn/hive/client/models/data_version.py +35 -0
- crypticorn/hive/client/models/download_links.py +91 -0
- crypticorn/hive/client/models/evaluation.py +86 -0
- crypticorn/hive/client/models/evaluation_response.py +85 -0
- crypticorn/hive/client/models/feature_size.py +36 -0
- crypticorn/hive/client/models/http_validation_error.py +99 -0
- crypticorn/hive/client/models/model.py +133 -0
- crypticorn/hive/client/models/model_create.py +93 -0
- crypticorn/hive/client/models/model_status.py +35 -0
- crypticorn/hive/client/models/model_update.py +83 -0
- crypticorn/hive/client/models/target.py +36 -0
- crypticorn/hive/client/models/target_type.py +35 -0
- crypticorn/hive/client/models/validation_error.py +105 -0
- crypticorn/hive/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/hive/client/py.typed +0 -0
- crypticorn/hive/client/rest.py +195 -0
- crypticorn/hive/main.py +27 -100
- crypticorn/klines/client/__init__.py +21 -7
- crypticorn/klines/client/api/__init__.py +0 -1
- crypticorn/klines/client/api/funding_rates_api.py +90 -79
- crypticorn/klines/client/api/health_check_api.py +29 -45
- crypticorn/klines/client/api/ohlcv_data_api.py +104 -87
- crypticorn/klines/client/api/symbols_api.py +36 -54
- crypticorn/klines/client/api/udf_api.py +228 -352
- crypticorn/klines/client/api_client.py +106 -148
- crypticorn/klines/client/api_response.py +2 -3
- crypticorn/klines/client/configuration.py +64 -50
- crypticorn/klines/client/exceptions.py +20 -16
- crypticorn/klines/client/models/__init__.py +21 -7
- crypticorn/klines/client/models/base_response_health_check_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_funding_rate_response.py +21 -15
- crypticorn/klines/client/models/base_response_list_str.py +16 -14
- crypticorn/klines/client/models/base_response_ohlcv_response.py +21 -15
- crypticorn/klines/client/models/error_response.py +23 -15
- crypticorn/klines/client/models/exchange.py +11 -11
- crypticorn/klines/client/models/funding_rate_response.py +11 -11
- crypticorn/klines/client/models/health_check_response.py +14 -12
- crypticorn/klines/client/models/history_error_response.py +11 -11
- crypticorn/klines/client/models/history_no_data_response.py +16 -16
- crypticorn/klines/client/models/history_success_response.py +16 -16
- crypticorn/klines/client/models/http_validation_error.py +14 -10
- crypticorn/klines/client/models/market.py +2 -4
- crypticorn/klines/client/models/ohlcv_response.py +22 -15
- crypticorn/klines/client/models/resolution.py +5 -7
- crypticorn/klines/client/models/response_get_history_udf_history_get.py +71 -22
- crypticorn/klines/client/models/search_symbol_response.py +22 -15
- crypticorn/klines/client/models/sort_direction.py +2 -4
- crypticorn/klines/client/models/symbol_group_response.py +5 -9
- crypticorn/klines/client/models/symbol_info_response.py +40 -24
- crypticorn/klines/client/models/symbol_type.py +5 -10
- crypticorn/klines/client/models/timeframe.py +5 -7
- crypticorn/klines/client/models/udf_config_response.py +60 -21
- crypticorn/klines/client/models/validation_error.py +19 -13
- crypticorn/klines/client/models/validation_error_loc_inner.py +32 -11
- crypticorn/klines/client/rest.py +30 -41
- crypticorn/klines/main.py +52 -15
- crypticorn/pay/__init__.py +2 -0
- crypticorn/pay/client/__init__.py +52 -0
- crypticorn/pay/client/api/__init__.py +7 -0
- crypticorn/pay/client/api/now_payments_api.py +813 -0
- crypticorn/pay/client/api/payments_api.py +799 -0
- crypticorn/pay/client/api/products_api.py +891 -0
- crypticorn/pay/client/api/status_api.py +260 -0
- crypticorn/pay/client/api_client.py +758 -0
- crypticorn/pay/client/api_response.py +20 -0
- crypticorn/pay/client/configuration.py +612 -0
- crypticorn/pay/client/exceptions.py +220 -0
- crypticorn/pay/client/models/__init__.py +32 -0
- crypticorn/pay/client/models/api_status_res.py +83 -0
- crypticorn/pay/client/models/combined_payment_history.py +101 -0
- crypticorn/pay/client/models/create_invoice_req.py +188 -0
- crypticorn/pay/client/models/create_invoice_res.py +188 -0
- crypticorn/pay/client/models/currency.py +165 -0
- crypticorn/pay/client/models/estimate_price_req.py +91 -0
- crypticorn/pay/client/models/estimate_price_res.py +102 -0
- crypticorn/pay/client/models/get_currencies_res.py +99 -0
- crypticorn/pay/client/models/get_payment_status_res.py +222 -0
- crypticorn/pay/client/models/get_payments_list_res.py +109 -0
- crypticorn/pay/client/models/http_validation_error.py +99 -0
- crypticorn/pay/client/models/min_amount_req.py +124 -0
- crypticorn/pay/client/models/min_amount_res.py +105 -0
- crypticorn/pay/client/models/now_api_status_res.py +83 -0
- crypticorn/pay/client/models/now_create_invoice_req.py +188 -0
- crypticorn/pay/client/models/now_create_invoice_res.py +188 -0
- crypticorn/pay/client/models/now_fee_structure.py +104 -0
- crypticorn/pay/client/models/now_payment_model.py +124 -0
- crypticorn/pay/client/models/now_payment_status.py +42 -0
- crypticorn/pay/client/models/now_webhook_payload.py +181 -0
- crypticorn/pay/client/models/payment.py +231 -0
- crypticorn/pay/client/models/payment_status.py +40 -0
- crypticorn/pay/client/models/product.py +87 -0
- crypticorn/pay/client/models/product_model.py +119 -0
- crypticorn/pay/client/models/product_subs_model.py +108 -0
- crypticorn/pay/client/models/services.py +34 -0
- crypticorn/pay/client/models/unified_payment_model.py +112 -0
- crypticorn/pay/client/models/validation_error.py +105 -0
- crypticorn/pay/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/pay/client/py.typed +0 -0
- crypticorn/pay/client/rest.py +195 -0
- crypticorn/pay/main.py +35 -0
- crypticorn/trade/client/__init__.py +9 -4
- crypticorn/trade/client/api/__init__.py +0 -1
- crypticorn/trade/client/api/api_keys_api.py +203 -304
- crypticorn/trade/client/api/bots_api.py +177 -250
- crypticorn/trade/client/api/exchanges_api.py +38 -57
- crypticorn/trade/client/api/futures_trading_panel_api.py +223 -321
- crypticorn/trade/client/api/notifications_api.py +247 -364
- crypticorn/trade/client/api/orders_api.py +44 -63
- crypticorn/trade/client/api/status_api.py +35 -53
- crypticorn/trade/client/api/strategies_api.py +852 -64
- crypticorn/trade/client/api/trading_actions_api.py +126 -203
- crypticorn/trade/client/api_client.py +115 -154
- crypticorn/trade/client/api_response.py +2 -3
- crypticorn/trade/client/configuration.py +128 -90
- crypticorn/trade/client/exceptions.py +21 -17
- crypticorn/trade/client/models/__init__.py +9 -4
- crypticorn/trade/client/models/action_model.py +114 -50
- crypticorn/trade/client/models/api_error_identifier.py +60 -51
- crypticorn/trade/client/models/api_error_level.py +37 -0
- crypticorn/trade/client/models/api_error_type.py +37 -0
- crypticorn/trade/client/models/api_key_model.py +49 -28
- crypticorn/trade/client/models/bot_model.py +76 -31
- crypticorn/trade/client/models/bot_status.py +37 -0
- crypticorn/trade/client/models/exchange.py +3 -5
- crypticorn/trade/client/models/execution_ids.py +14 -14
- crypticorn/trade/client/models/futures_balance.py +39 -23
- crypticorn/trade/client/models/futures_trading_action.py +98 -46
- crypticorn/trade/client/models/http_validation_error.py +15 -11
- crypticorn/trade/client/models/margin_mode.py +3 -5
- crypticorn/trade/client/models/market_type.py +3 -5
- crypticorn/trade/client/models/notification_model.py +60 -27
- crypticorn/trade/client/models/notification_type.py +4 -6
- crypticorn/trade/client/models/order_model.py +125 -65
- crypticorn/trade/client/models/order_status.py +6 -8
- crypticorn/trade/client/models/post_futures_action.py +16 -12
- crypticorn/trade/client/models/strategy_exchange_info.py +11 -12
- crypticorn/trade/client/models/strategy_model.py +66 -27
- crypticorn/trade/client/models/strategy_model_input.py +160 -0
- crypticorn/trade/client/models/strategy_model_output.py +160 -0
- crypticorn/trade/client/models/tpsl.py +35 -21
- crypticorn/trade/client/models/trading_action_type.py +5 -7
- crypticorn/trade/client/models/update_notification.py +17 -13
- crypticorn/trade/client/models/validation_error.py +20 -14
- crypticorn/trade/client/models/validation_error_loc_inner.py +33 -12
- crypticorn/trade/client/rest.py +108 -170
- crypticorn/trade/main.py +26 -19
- crypticorn-2.0.0.dist-info/METADATA +74 -0
- crypticorn-2.0.0.dist-info/RECORD +226 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/WHEEL +1 -1
- crypticorn/hive/requirements.txt +0 -4
- crypticorn/hive/utils.py +0 -109
- crypticorn/klines/requirements.txt +0 -4
- crypticorn/klines/test/test_base_response_health_check_response.py +0 -56
- crypticorn/klines/test/test_base_response_list_funding_rate_response.py +0 -59
- crypticorn/klines/test/test_base_response_list_str.py +0 -56
- crypticorn/klines/test/test_base_response_ohlcv_response.py +0 -72
- crypticorn/klines/test/test_error_response.py +0 -57
- crypticorn/klines/test/test_exchange.py +0 -56
- crypticorn/klines/test/test_funding_rate_response.py +0 -56
- crypticorn/klines/test/test_funding_rates_api.py +0 -38
- crypticorn/klines/test/test_health_check_api.py +0 -38
- crypticorn/klines/test/test_health_check_response.py +0 -52
- crypticorn/klines/test/test_history_error_response.py +0 -53
- crypticorn/klines/test/test_history_no_data_response.py +0 -69
- crypticorn/klines/test/test_history_success_response.py +0 -87
- crypticorn/klines/test/test_http_validation_error.py +0 -58
- crypticorn/klines/test/test_market.py +0 -33
- crypticorn/klines/test/test_ohlcv_data_api.py +0 -38
- crypticorn/klines/test/test_ohlcv_response.py +0 -86
- crypticorn/klines/test/test_resolution.py +0 -33
- crypticorn/klines/test/test_response_get_history_udf_history_get.py +0 -89
- crypticorn/klines/test/test_search_symbol_response.py +0 -62
- crypticorn/klines/test/test_sort_direction.py +0 -33
- crypticorn/klines/test/test_symbol_group_response.py +0 -53
- crypticorn/klines/test/test_symbol_info_response.py +0 -84
- crypticorn/klines/test/test_symbol_type.py +0 -54
- crypticorn/klines/test/test_symbols_api.py +0 -38
- crypticorn/klines/test/test_timeframe.py +0 -33
- crypticorn/klines/test/test_udf_api.py +0 -80
- crypticorn/klines/test/test_udf_config_response.py +0 -95
- crypticorn/klines/test/test_validation_error.py +0 -60
- crypticorn/klines/test/test_validation_error_loc_inner.py +0 -50
- crypticorn/trade/requirements.txt +0 -4
- crypticorn-1.0.2rc3.dist-info/LICENSE.md +0 -19
- crypticorn-1.0.2rc3.dist-info/METADATA +0 -47
- crypticorn-1.0.2rc3.dist-info/RECORD +0 -128
- /crypticorn/{klines/test/__init__.py → auth/client/py.typed} +0 -0
- {crypticorn-1.0.2rc3.dist-info → crypticorn-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class NowPaymentStatus(str, Enum):
|
22
|
+
"""
|
23
|
+
Payment status for the payment
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
WAITING = "waiting"
|
30
|
+
CONFIRMING = "confirming"
|
31
|
+
CONFIRMED = "confirmed"
|
32
|
+
SENDING = "sending"
|
33
|
+
PARTIALLY_PAID = "partially_paid"
|
34
|
+
FINISHED = "finished"
|
35
|
+
FAILED = "failed"
|
36
|
+
REFUNDED = "refunded"
|
37
|
+
EXPIRED = "expired"
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_json(cls, json_str: str) -> Self:
|
41
|
+
"""Create an instance of NowPaymentStatus from a JSON string"""
|
42
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,181 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from crypticorn.pay.client.models.now_fee_structure import NowFeeStructure
|
23
|
+
from crypticorn.pay.client.models.now_payment_status import NowPaymentStatus
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
|
28
|
+
class NowWebhookPayload(BaseModel):
|
29
|
+
"""
|
30
|
+
Model for NOWPayments webhook (IPN) payload.
|
31
|
+
""" # noqa: E501
|
32
|
+
|
33
|
+
actually_paid: Union[StrictFloat, StrictInt] = Field(
|
34
|
+
description="Actually paid amount"
|
35
|
+
)
|
36
|
+
actually_paid_at_fiat: Union[StrictFloat, StrictInt] = Field(
|
37
|
+
description="Actually paid amount in fiat currency"
|
38
|
+
)
|
39
|
+
fee: NowFeeStructure = Field(description="Fee structure for the payment")
|
40
|
+
invoice_id: StrictInt = Field(description="Associated invoice ID")
|
41
|
+
order_description: StrictStr = Field(description="Order description")
|
42
|
+
order_id: StrictStr = Field(description="Internal order ID")
|
43
|
+
outcome_amount: Union[StrictFloat, StrictInt] = Field(description="Outcome amount")
|
44
|
+
outcome_currency: StrictStr = Field(description="Outcome currency")
|
45
|
+
parent_payment_id: Optional[StrictInt] = None
|
46
|
+
pay_address: StrictStr = Field(description="Payment destination address")
|
47
|
+
pay_amount: Union[StrictFloat, StrictInt] = Field(description="Amount to pay")
|
48
|
+
pay_currency: StrictStr = Field(description="Payment currency")
|
49
|
+
payment_id: StrictInt = Field(description="Unique payment identifier")
|
50
|
+
payment_status: NowPaymentStatus = Field(description="Current payment status")
|
51
|
+
price_amount: Union[StrictFloat, StrictInt] = Field(
|
52
|
+
description="Original price amount"
|
53
|
+
)
|
54
|
+
price_currency: StrictStr = Field(description="Original price currency")
|
55
|
+
purchase_id: StrictStr = Field(description="Purchase ID")
|
56
|
+
updated_at: StrictInt = Field(
|
57
|
+
description="Payment last update timestamp in milliseconds"
|
58
|
+
)
|
59
|
+
additional_properties: Dict[str, Any] = {}
|
60
|
+
__properties: ClassVar[List[str]] = [
|
61
|
+
"actually_paid",
|
62
|
+
"actually_paid_at_fiat",
|
63
|
+
"fee",
|
64
|
+
"invoice_id",
|
65
|
+
"order_description",
|
66
|
+
"order_id",
|
67
|
+
"outcome_amount",
|
68
|
+
"outcome_currency",
|
69
|
+
"parent_payment_id",
|
70
|
+
"pay_address",
|
71
|
+
"pay_amount",
|
72
|
+
"pay_currency",
|
73
|
+
"payment_id",
|
74
|
+
"payment_status",
|
75
|
+
"price_amount",
|
76
|
+
"price_currency",
|
77
|
+
"purchase_id",
|
78
|
+
"updated_at",
|
79
|
+
]
|
80
|
+
|
81
|
+
model_config = ConfigDict(
|
82
|
+
populate_by_name=True,
|
83
|
+
validate_assignment=True,
|
84
|
+
protected_namespaces=(),
|
85
|
+
)
|
86
|
+
|
87
|
+
def to_str(self) -> str:
|
88
|
+
"""Returns the string representation of the model using alias"""
|
89
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
90
|
+
|
91
|
+
def to_json(self) -> str:
|
92
|
+
"""Returns the JSON representation of the model using alias"""
|
93
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
94
|
+
return json.dumps(self.to_dict())
|
95
|
+
|
96
|
+
@classmethod
|
97
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
98
|
+
"""Create an instance of NowWebhookPayload from a JSON string"""
|
99
|
+
return cls.from_dict(json.loads(json_str))
|
100
|
+
|
101
|
+
def to_dict(self) -> Dict[str, Any]:
|
102
|
+
"""Return the dictionary representation of the model using alias.
|
103
|
+
|
104
|
+
This has the following differences from calling pydantic's
|
105
|
+
`self.model_dump(by_alias=True)`:
|
106
|
+
|
107
|
+
* `None` is only added to the output dict for nullable fields that
|
108
|
+
were set at model initialization. Other fields with value `None`
|
109
|
+
are ignored.
|
110
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
111
|
+
"""
|
112
|
+
excluded_fields: Set[str] = set(
|
113
|
+
[
|
114
|
+
"additional_properties",
|
115
|
+
]
|
116
|
+
)
|
117
|
+
|
118
|
+
_dict = self.model_dump(
|
119
|
+
by_alias=True,
|
120
|
+
exclude=excluded_fields,
|
121
|
+
exclude_none=True,
|
122
|
+
)
|
123
|
+
# override the default output from pydantic by calling `to_dict()` of fee
|
124
|
+
if self.fee:
|
125
|
+
_dict["fee"] = self.fee.to_dict()
|
126
|
+
# puts key-value pairs in additional_properties in the top level
|
127
|
+
if self.additional_properties is not None:
|
128
|
+
for _key, _value in self.additional_properties.items():
|
129
|
+
_dict[_key] = _value
|
130
|
+
|
131
|
+
# set to None if parent_payment_id (nullable) is None
|
132
|
+
# and model_fields_set contains the field
|
133
|
+
if (
|
134
|
+
self.parent_payment_id is None
|
135
|
+
and "parent_payment_id" in self.model_fields_set
|
136
|
+
):
|
137
|
+
_dict["parent_payment_id"] = None
|
138
|
+
|
139
|
+
return _dict
|
140
|
+
|
141
|
+
@classmethod
|
142
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
143
|
+
"""Create an instance of NowWebhookPayload from a dict"""
|
144
|
+
if obj is None:
|
145
|
+
return None
|
146
|
+
|
147
|
+
if not isinstance(obj, dict):
|
148
|
+
return cls.model_validate(obj)
|
149
|
+
|
150
|
+
_obj = cls.model_validate(
|
151
|
+
{
|
152
|
+
"actually_paid": obj.get("actually_paid"),
|
153
|
+
"actually_paid_at_fiat": obj.get("actually_paid_at_fiat"),
|
154
|
+
"fee": (
|
155
|
+
NowFeeStructure.from_dict(obj["fee"])
|
156
|
+
if obj.get("fee") is not None
|
157
|
+
else None
|
158
|
+
),
|
159
|
+
"invoice_id": obj.get("invoice_id"),
|
160
|
+
"order_description": obj.get("order_description"),
|
161
|
+
"order_id": obj.get("order_id"),
|
162
|
+
"outcome_amount": obj.get("outcome_amount"),
|
163
|
+
"outcome_currency": obj.get("outcome_currency"),
|
164
|
+
"parent_payment_id": obj.get("parent_payment_id"),
|
165
|
+
"pay_address": obj.get("pay_address"),
|
166
|
+
"pay_amount": obj.get("pay_amount"),
|
167
|
+
"pay_currency": obj.get("pay_currency"),
|
168
|
+
"payment_id": obj.get("payment_id"),
|
169
|
+
"payment_status": obj.get("payment_status"),
|
170
|
+
"price_amount": obj.get("price_amount"),
|
171
|
+
"price_currency": obj.get("price_currency"),
|
172
|
+
"purchase_id": obj.get("purchase_id"),
|
173
|
+
"updated_at": obj.get("updated_at"),
|
174
|
+
}
|
175
|
+
)
|
176
|
+
# store additional fields in additional_properties
|
177
|
+
for _key in obj.keys():
|
178
|
+
if _key not in cls.__properties:
|
179
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
180
|
+
|
181
|
+
return _obj
|
@@ -0,0 +1,231 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
|
26
|
+
class Payment(BaseModel):
|
27
|
+
"""
|
28
|
+
Model representing a single payment.
|
29
|
+
""" # noqa: E501
|
30
|
+
|
31
|
+
payment_id: StrictInt = Field(description="Unique payment identifier")
|
32
|
+
invoice_id: Optional[StrictInt] = None
|
33
|
+
payment_status: StrictStr = Field(description="Current payment status")
|
34
|
+
pay_address: StrictStr = Field(description="Payment destination address")
|
35
|
+
payin_extra_id: Optional[StrictStr] = None
|
36
|
+
price_amount: Union[StrictFloat, StrictInt] = Field(
|
37
|
+
description="Original price amount"
|
38
|
+
)
|
39
|
+
price_currency: StrictStr = Field(description="Original price currency")
|
40
|
+
pay_amount: Union[StrictFloat, StrictInt] = Field(description="Amount to pay")
|
41
|
+
actually_paid: Union[StrictFloat, StrictInt] = Field(
|
42
|
+
description="Actually paid amount"
|
43
|
+
)
|
44
|
+
pay_currency: StrictStr = Field(description="Payment currency")
|
45
|
+
order_id: Optional[StrictStr] = None
|
46
|
+
order_description: Optional[StrictStr] = None
|
47
|
+
purchase_id: Optional[StrictInt] = None
|
48
|
+
outcome_amount: Optional[Union[StrictFloat, StrictInt]] = None
|
49
|
+
outcome_currency: Optional[StrictStr] = None
|
50
|
+
payout_hash: Optional[StrictStr] = None
|
51
|
+
payin_hash: Optional[StrictStr] = None
|
52
|
+
created_at: StrictStr = Field(description="Payment creation timestamp")
|
53
|
+
updated_at: StrictStr = Field(description="Payment last update timestamp")
|
54
|
+
type: StrictStr = Field(description="Type of payment (e.g., crypto2crypto)")
|
55
|
+
payment_extra_ids: Optional[List[StrictInt]] = None
|
56
|
+
parent_payment_id: Optional[StrictInt] = None
|
57
|
+
origin_type: Optional[StrictStr] = None
|
58
|
+
__properties: ClassVar[List[str]] = [
|
59
|
+
"payment_id",
|
60
|
+
"invoice_id",
|
61
|
+
"payment_status",
|
62
|
+
"pay_address",
|
63
|
+
"payin_extra_id",
|
64
|
+
"price_amount",
|
65
|
+
"price_currency",
|
66
|
+
"pay_amount",
|
67
|
+
"actually_paid",
|
68
|
+
"pay_currency",
|
69
|
+
"order_id",
|
70
|
+
"order_description",
|
71
|
+
"purchase_id",
|
72
|
+
"outcome_amount",
|
73
|
+
"outcome_currency",
|
74
|
+
"payout_hash",
|
75
|
+
"payin_hash",
|
76
|
+
"created_at",
|
77
|
+
"updated_at",
|
78
|
+
"type",
|
79
|
+
"payment_extra_ids",
|
80
|
+
"parent_payment_id",
|
81
|
+
"origin_type",
|
82
|
+
]
|
83
|
+
|
84
|
+
model_config = ConfigDict(
|
85
|
+
populate_by_name=True,
|
86
|
+
validate_assignment=True,
|
87
|
+
protected_namespaces=(),
|
88
|
+
)
|
89
|
+
|
90
|
+
def to_str(self) -> str:
|
91
|
+
"""Returns the string representation of the model using alias"""
|
92
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
93
|
+
|
94
|
+
def to_json(self) -> str:
|
95
|
+
"""Returns the JSON representation of the model using alias"""
|
96
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
97
|
+
return json.dumps(self.to_dict())
|
98
|
+
|
99
|
+
@classmethod
|
100
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
101
|
+
"""Create an instance of Payment from a JSON string"""
|
102
|
+
return cls.from_dict(json.loads(json_str))
|
103
|
+
|
104
|
+
def to_dict(self) -> Dict[str, Any]:
|
105
|
+
"""Return the dictionary representation of the model using alias.
|
106
|
+
|
107
|
+
This has the following differences from calling pydantic's
|
108
|
+
`self.model_dump(by_alias=True)`:
|
109
|
+
|
110
|
+
* `None` is only added to the output dict for nullable fields that
|
111
|
+
were set at model initialization. Other fields with value `None`
|
112
|
+
are ignored.
|
113
|
+
"""
|
114
|
+
excluded_fields: Set[str] = set([])
|
115
|
+
|
116
|
+
_dict = self.model_dump(
|
117
|
+
by_alias=True,
|
118
|
+
exclude=excluded_fields,
|
119
|
+
exclude_none=True,
|
120
|
+
)
|
121
|
+
# set to None if invoice_id (nullable) is None
|
122
|
+
# and model_fields_set contains the field
|
123
|
+
if self.invoice_id is None and "invoice_id" in self.model_fields_set:
|
124
|
+
_dict["invoice_id"] = None
|
125
|
+
|
126
|
+
# set to None if payin_extra_id (nullable) is None
|
127
|
+
# and model_fields_set contains the field
|
128
|
+
if self.payin_extra_id is None and "payin_extra_id" in self.model_fields_set:
|
129
|
+
_dict["payin_extra_id"] = None
|
130
|
+
|
131
|
+
# set to None if order_id (nullable) is None
|
132
|
+
# and model_fields_set contains the field
|
133
|
+
if self.order_id is None and "order_id" in self.model_fields_set:
|
134
|
+
_dict["order_id"] = None
|
135
|
+
|
136
|
+
# set to None if order_description (nullable) is None
|
137
|
+
# and model_fields_set contains the field
|
138
|
+
if (
|
139
|
+
self.order_description is None
|
140
|
+
and "order_description" in self.model_fields_set
|
141
|
+
):
|
142
|
+
_dict["order_description"] = None
|
143
|
+
|
144
|
+
# set to None if purchase_id (nullable) is None
|
145
|
+
# and model_fields_set contains the field
|
146
|
+
if self.purchase_id is None and "purchase_id" in self.model_fields_set:
|
147
|
+
_dict["purchase_id"] = None
|
148
|
+
|
149
|
+
# set to None if outcome_amount (nullable) is None
|
150
|
+
# and model_fields_set contains the field
|
151
|
+
if self.outcome_amount is None and "outcome_amount" in self.model_fields_set:
|
152
|
+
_dict["outcome_amount"] = None
|
153
|
+
|
154
|
+
# set to None if outcome_currency (nullable) is None
|
155
|
+
# and model_fields_set contains the field
|
156
|
+
if (
|
157
|
+
self.outcome_currency is None
|
158
|
+
and "outcome_currency" in self.model_fields_set
|
159
|
+
):
|
160
|
+
_dict["outcome_currency"] = None
|
161
|
+
|
162
|
+
# set to None if payout_hash (nullable) is None
|
163
|
+
# and model_fields_set contains the field
|
164
|
+
if self.payout_hash is None and "payout_hash" in self.model_fields_set:
|
165
|
+
_dict["payout_hash"] = None
|
166
|
+
|
167
|
+
# set to None if payin_hash (nullable) is None
|
168
|
+
# and model_fields_set contains the field
|
169
|
+
if self.payin_hash is None and "payin_hash" in self.model_fields_set:
|
170
|
+
_dict["payin_hash"] = None
|
171
|
+
|
172
|
+
# set to None if payment_extra_ids (nullable) is None
|
173
|
+
# and model_fields_set contains the field
|
174
|
+
if (
|
175
|
+
self.payment_extra_ids is None
|
176
|
+
and "payment_extra_ids" in self.model_fields_set
|
177
|
+
):
|
178
|
+
_dict["payment_extra_ids"] = None
|
179
|
+
|
180
|
+
# set to None if parent_payment_id (nullable) is None
|
181
|
+
# and model_fields_set contains the field
|
182
|
+
if (
|
183
|
+
self.parent_payment_id is None
|
184
|
+
and "parent_payment_id" in self.model_fields_set
|
185
|
+
):
|
186
|
+
_dict["parent_payment_id"] = None
|
187
|
+
|
188
|
+
# set to None if origin_type (nullable) is None
|
189
|
+
# and model_fields_set contains the field
|
190
|
+
if self.origin_type is None and "origin_type" in self.model_fields_set:
|
191
|
+
_dict["origin_type"] = None
|
192
|
+
|
193
|
+
return _dict
|
194
|
+
|
195
|
+
@classmethod
|
196
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
197
|
+
"""Create an instance of Payment from a dict"""
|
198
|
+
if obj is None:
|
199
|
+
return None
|
200
|
+
|
201
|
+
if not isinstance(obj, dict):
|
202
|
+
return cls.model_validate(obj)
|
203
|
+
|
204
|
+
_obj = cls.model_validate(
|
205
|
+
{
|
206
|
+
"payment_id": obj.get("payment_id"),
|
207
|
+
"invoice_id": obj.get("invoice_id"),
|
208
|
+
"payment_status": obj.get("payment_status"),
|
209
|
+
"pay_address": obj.get("pay_address"),
|
210
|
+
"payin_extra_id": obj.get("payin_extra_id"),
|
211
|
+
"price_amount": obj.get("price_amount"),
|
212
|
+
"price_currency": obj.get("price_currency"),
|
213
|
+
"pay_amount": obj.get("pay_amount"),
|
214
|
+
"actually_paid": obj.get("actually_paid"),
|
215
|
+
"pay_currency": obj.get("pay_currency"),
|
216
|
+
"order_id": obj.get("order_id"),
|
217
|
+
"order_description": obj.get("order_description"),
|
218
|
+
"purchase_id": obj.get("purchase_id"),
|
219
|
+
"outcome_amount": obj.get("outcome_amount"),
|
220
|
+
"outcome_currency": obj.get("outcome_currency"),
|
221
|
+
"payout_hash": obj.get("payout_hash"),
|
222
|
+
"payin_hash": obj.get("payin_hash"),
|
223
|
+
"created_at": obj.get("created_at"),
|
224
|
+
"updated_at": obj.get("updated_at"),
|
225
|
+
"type": obj.get("type"),
|
226
|
+
"payment_extra_ids": obj.get("payment_extra_ids"),
|
227
|
+
"parent_payment_id": obj.get("parent_payment_id"),
|
228
|
+
"origin_type": obj.get("origin_type"),
|
229
|
+
}
|
230
|
+
)
|
231
|
+
return _obj
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class PaymentStatus(str, Enum):
|
22
|
+
"""
|
23
|
+
Payment status
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
WAITING = "waiting"
|
30
|
+
PROCESSING = "processing"
|
31
|
+
PAID = "paid"
|
32
|
+
PARTIALLY_PAID = "partially_paid"
|
33
|
+
REFUNDED = "refunded"
|
34
|
+
FAILED = "failed"
|
35
|
+
CANCELLED = "cancelled"
|
36
|
+
|
37
|
+
@classmethod
|
38
|
+
def from_json(cls, json_str: str) -> Self:
|
39
|
+
"""Create an instance of PaymentStatus from a JSON string"""
|
40
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Payment API
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 0.1.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
|
26
|
+
class Product(BaseModel):
|
27
|
+
"""
|
28
|
+
Product
|
29
|
+
""" # noqa: E501
|
30
|
+
|
31
|
+
id: StrictStr
|
32
|
+
name: StrictStr
|
33
|
+
price: Union[StrictFloat, StrictInt]
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "price"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
def to_str(self) -> str:
|
43
|
+
"""Returns the string representation of the model using alias"""
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
45
|
+
|
46
|
+
def to_json(self) -> str:
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
49
|
+
return json.dumps(self.to_dict())
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
+
"""Create an instance of Product from a JSON string"""
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
55
|
+
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
58
|
+
|
59
|
+
This has the following differences from calling pydantic's
|
60
|
+
`self.model_dump(by_alias=True)`:
|
61
|
+
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
63
|
+
were set at model initialization. Other fields with value `None`
|
64
|
+
are ignored.
|
65
|
+
"""
|
66
|
+
excluded_fields: Set[str] = set([])
|
67
|
+
|
68
|
+
_dict = self.model_dump(
|
69
|
+
by_alias=True,
|
70
|
+
exclude=excluded_fields,
|
71
|
+
exclude_none=True,
|
72
|
+
)
|
73
|
+
return _dict
|
74
|
+
|
75
|
+
@classmethod
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
+
"""Create an instance of Product from a dict"""
|
78
|
+
if obj is None:
|
79
|
+
return None
|
80
|
+
|
81
|
+
if not isinstance(obj, dict):
|
82
|
+
return cls.model_validate(obj)
|
83
|
+
|
84
|
+
_obj = cls.model_validate(
|
85
|
+
{"id": obj.get("id"), "name": obj.get("name"), "price": obj.get("price")}
|
86
|
+
)
|
87
|
+
return _obj
|