lighter-sdk 0.1.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- lighter/__init__.py +140 -0
- lighter/api/__init__.py +11 -0
- lighter/api/account_api.py +2371 -0
- lighter/api/block_api.py +863 -0
- lighter/api/candlestick_api.py +718 -0
- lighter/api/info_api.py +282 -0
- lighter/api/order_api.py +2734 -0
- lighter/api/root_api.py +529 -0
- lighter/api/transaction_api.py +3525 -0
- lighter/api_client.py +784 -0
- lighter/api_response.py +21 -0
- lighter/configuration.py +475 -0
- lighter/exceptions.py +199 -0
- lighter/models/__init__.py +112 -0
- lighter/models/account.py +110 -0
- lighter/models/account_api_keys.py +104 -0
- lighter/models/account_market_stats.py +98 -0
- lighter/models/account_metadata.py +94 -0
- lighter/models/account_pn_l.py +106 -0
- lighter/models/account_position.py +112 -0
- lighter/models/account_stats.py +102 -0
- lighter/models/accounts.py +106 -0
- lighter/models/api_key.py +98 -0
- lighter/models/block.py +124 -0
- lighter/models/blocks.py +106 -0
- lighter/models/bridge_supported_network.py +96 -0
- lighter/models/candlestick.py +106 -0
- lighter/models/candlesticks.py +106 -0
- lighter/models/contract_address.py +94 -0
- lighter/models/current_height.py +96 -0
- lighter/models/cursor.py +92 -0
- lighter/models/deposit_history.py +106 -0
- lighter/models/deposit_history_item.py +105 -0
- lighter/models/detailed_account.py +152 -0
- lighter/models/detailed_accounts.py +106 -0
- lighter/models/detailed_candlestick.py +108 -0
- lighter/models/enriched_tx.py +129 -0
- lighter/models/exchange_stats.py +110 -0
- lighter/models/fee_bucket.py +96 -0
- lighter/models/funding.py +98 -0
- lighter/models/fundings.py +106 -0
- lighter/models/is_whitelisted.py +98 -0
- lighter/models/l1_provider_info.py +98 -0
- lighter/models/layer2_basic_info.py +100 -0
- lighter/models/liquidation.py +100 -0
- lighter/models/market_info.py +116 -0
- lighter/models/next_nonce.py +96 -0
- lighter/models/order.py +159 -0
- lighter/models/order_book.py +119 -0
- lighter/models/order_book_depth.py +115 -0
- lighter/models/order_book_detail.py +151 -0
- lighter/models/order_book_details.py +104 -0
- lighter/models/order_book_orders.py +117 -0
- lighter/models/order_book_stats.py +102 -0
- lighter/models/order_books.py +104 -0
- lighter/models/orders.py +106 -0
- lighter/models/pn_l_entry.py +94 -0
- lighter/models/position_funding.py +111 -0
- lighter/models/price_level.py +94 -0
- lighter/models/public_pool.py +128 -0
- lighter/models/public_pool_info.py +100 -0
- lighter/models/public_pool_share.py +96 -0
- lighter/models/public_pools.py +106 -0
- lighter/models/req_get_account.py +101 -0
- lighter/models/req_get_account_active_orders.py +96 -0
- lighter/models/req_get_account_api_keys.py +94 -0
- lighter/models/req_get_account_by_l1_address.py +92 -0
- lighter/models/req_get_account_inactive_orders.py +103 -0
- lighter/models/req_get_account_orders.py +99 -0
- lighter/models/req_get_account_pending_txs.py +106 -0
- lighter/models/req_get_account_pn_l.py +118 -0
- lighter/models/req_get_account_txs.py +111 -0
- lighter/models/req_get_block.py +101 -0
- lighter/models/req_get_block_txs.py +101 -0
- lighter/models/req_get_by_account.py +101 -0
- lighter/models/req_get_candlesticks.py +109 -0
- lighter/models/req_get_deposit_history.py +106 -0
- lighter/models/req_get_fee_bucket.py +92 -0
- lighter/models/req_get_fundings.py +107 -0
- lighter/models/req_get_l1_tx.py +92 -0
- lighter/models/req_get_latest_deposit.py +92 -0
- lighter/models/req_get_next_nonce.py +94 -0
- lighter/models/req_get_order_book_details.py +92 -0
- lighter/models/req_get_order_book_orders.py +95 -0
- lighter/models/req_get_order_books.py +92 -0
- lighter/models/req_get_public_pools.py +109 -0
- lighter/models/req_get_range_with_cursor.py +95 -0
- lighter/models/req_get_range_with_index.py +95 -0
- lighter/models/req_get_range_with_index_sortable.py +107 -0
- lighter/models/req_get_recent_trades.py +95 -0
- lighter/models/req_get_trades.py +126 -0
- lighter/models/req_get_tx.py +101 -0
- lighter/models/req_get_withdraw_history.py +106 -0
- lighter/models/req_is_whitelisted.py +92 -0
- lighter/models/result_code.py +94 -0
- lighter/models/simple_order.py +102 -0
- lighter/models/status.py +94 -0
- lighter/models/sub_accounts.py +106 -0
- lighter/models/ticker.py +103 -0
- lighter/models/trade.py +125 -0
- lighter/models/trades.py +106 -0
- lighter/models/tx.py +121 -0
- lighter/models/tx_hash.py +96 -0
- lighter/models/tx_hashes.py +96 -0
- lighter/models/txs.py +104 -0
- lighter/models/validator_info.py +94 -0
- lighter/models/withdraw_history.py +110 -0
- lighter/models/withdraw_history_cursor.py +94 -0
- lighter/models/withdraw_history_item.py +114 -0
- lighter/models/zk_lighter_info.py +92 -0
- lighter/py.typed +0 -0
- lighter/rest.py +215 -0
- lighter/signer_client.py +440 -0
- lighter/signers/signer-amd64.so +0 -0
- lighter/signers/signer-arm64.dylib +0 -0
- lighter/transactions/__init__.py +3 -0
- lighter/transactions/cancel_order.py +27 -0
- lighter/transactions/create_order.py +33 -0
- lighter/transactions/withdraw.py +25 -0
- lighter/ws_client.py +160 -0
- lighter_sdk-0.1.0.dist-info/LICENSE +201 -0
- lighter_sdk-0.1.0.dist-info/METADATA +26 -0
- lighter_sdk-0.1.0.dist-info/RECORD +125 -0
- lighter_sdk-0.1.0.dist-info/WHEEL +5 -0
- lighter_sdk-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetByAccount(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetByAccount
|
28
|
+
""" # noqa: E501
|
29
|
+
by: StrictStr
|
30
|
+
value: StrictStr
|
31
|
+
__properties: ClassVar[List[str]] = ["by", "value"]
|
32
|
+
|
33
|
+
@field_validator('by')
|
34
|
+
def by_validate_enum(cls, value):
|
35
|
+
"""Validates the enum"""
|
36
|
+
if value not in set(['account_index']):
|
37
|
+
raise ValueError("must be one of enum values ('account_index')")
|
38
|
+
return value
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
populate_by_name=True,
|
42
|
+
validate_assignment=True,
|
43
|
+
protected_namespaces=(),
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
+
"""Create an instance of ReqGetByAccount from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([
|
72
|
+
])
|
73
|
+
|
74
|
+
_dict = self.model_dump(
|
75
|
+
by_alias=True,
|
76
|
+
exclude=excluded_fields,
|
77
|
+
exclude_none=True,
|
78
|
+
)
|
79
|
+
return _dict
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
83
|
+
"""Create an instance of ReqGetByAccount from a dict"""
|
84
|
+
if obj is None:
|
85
|
+
return None
|
86
|
+
|
87
|
+
if not isinstance(obj, dict):
|
88
|
+
return cls.model_validate(obj)
|
89
|
+
|
90
|
+
# raise errors for additional fields in the input
|
91
|
+
for _key in obj.keys():
|
92
|
+
if _key not in cls.__properties:
|
93
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetByAccount) in the input: " + _key)
|
94
|
+
|
95
|
+
_obj = cls.model_validate({
|
96
|
+
"by": obj.get("by"),
|
97
|
+
"value": obj.get("value")
|
98
|
+
})
|
99
|
+
return _obj
|
100
|
+
|
101
|
+
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictBool, StrictInt, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetCandlesticks(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetCandlesticks
|
28
|
+
""" # noqa: E501
|
29
|
+
market_id: StrictInt
|
30
|
+
resolution: StrictStr
|
31
|
+
start_timestamp: StrictInt
|
32
|
+
end_timestamp: StrictInt
|
33
|
+
count_back: StrictInt
|
34
|
+
set_timestamp_to_end: Optional[StrictBool] = False
|
35
|
+
__properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back", "set_timestamp_to_end"]
|
36
|
+
|
37
|
+
@field_validator('resolution')
|
38
|
+
def resolution_validate_enum(cls, value):
|
39
|
+
"""Validates the enum"""
|
40
|
+
if value not in set(['1m', '5m', '15m', '1h', '4h', '1d']):
|
41
|
+
raise ValueError("must be one of enum values ('1m', '5m', '15m', '1h', '4h', '1d')")
|
42
|
+
return value
|
43
|
+
|
44
|
+
model_config = ConfigDict(
|
45
|
+
populate_by_name=True,
|
46
|
+
validate_assignment=True,
|
47
|
+
protected_namespaces=(),
|
48
|
+
)
|
49
|
+
|
50
|
+
|
51
|
+
def to_str(self) -> str:
|
52
|
+
"""Returns the string representation of the model using alias"""
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
|
+
|
55
|
+
def to_json(self) -> str:
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
|
+
return json.dumps(self.to_dict())
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
|
+
"""Create an instance of ReqGetCandlesticks from a JSON string"""
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
64
|
+
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
74
|
+
"""
|
75
|
+
excluded_fields: Set[str] = set([
|
76
|
+
])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of ReqGetCandlesticks from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
# raise errors for additional fields in the input
|
95
|
+
for _key in obj.keys():
|
96
|
+
if _key not in cls.__properties:
|
97
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetCandlesticks) in the input: " + _key)
|
98
|
+
|
99
|
+
_obj = cls.model_validate({
|
100
|
+
"market_id": obj.get("market_id"),
|
101
|
+
"resolution": obj.get("resolution"),
|
102
|
+
"start_timestamp": obj.get("start_timestamp"),
|
103
|
+
"end_timestamp": obj.get("end_timestamp"),
|
104
|
+
"count_back": obj.get("count_back"),
|
105
|
+
"set_timestamp_to_end": obj.get("set_timestamp_to_end") if obj.get("set_timestamp_to_end") is not None else False
|
106
|
+
})
|
107
|
+
return _obj
|
108
|
+
|
109
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetDepositHistory(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetDepositHistory
|
28
|
+
""" # noqa: E501
|
29
|
+
l1_address: StrictStr
|
30
|
+
cursor: Optional[StrictStr] = None
|
31
|
+
filter: Optional[StrictStr] = None
|
32
|
+
__properties: ClassVar[List[str]] = ["l1_address", "cursor", "filter"]
|
33
|
+
|
34
|
+
@field_validator('filter')
|
35
|
+
def filter_validate_enum(cls, value):
|
36
|
+
"""Validates the enum"""
|
37
|
+
if value is None:
|
38
|
+
return value
|
39
|
+
|
40
|
+
if value not in set(['all', 'pending', 'claimable']):
|
41
|
+
raise ValueError("must be one of enum values ('all', 'pending', 'claimable')")
|
42
|
+
return value
|
43
|
+
|
44
|
+
model_config = ConfigDict(
|
45
|
+
populate_by_name=True,
|
46
|
+
validate_assignment=True,
|
47
|
+
protected_namespaces=(),
|
48
|
+
)
|
49
|
+
|
50
|
+
|
51
|
+
def to_str(self) -> str:
|
52
|
+
"""Returns the string representation of the model using alias"""
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
|
+
|
55
|
+
def to_json(self) -> str:
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
|
+
return json.dumps(self.to_dict())
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
|
+
"""Create an instance of ReqGetDepositHistory from a JSON string"""
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
64
|
+
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
74
|
+
"""
|
75
|
+
excluded_fields: Set[str] = set([
|
76
|
+
])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of ReqGetDepositHistory from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
# raise errors for additional fields in the input
|
95
|
+
for _key in obj.keys():
|
96
|
+
if _key not in cls.__properties:
|
97
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetDepositHistory) in the input: " + _key)
|
98
|
+
|
99
|
+
_obj = cls.model_validate({
|
100
|
+
"l1_address": obj.get("l1_address"),
|
101
|
+
"cursor": obj.get("cursor"),
|
102
|
+
"filter": obj.get("filter")
|
103
|
+
})
|
104
|
+
return _obj
|
105
|
+
|
106
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictInt
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetFeeBucket(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetFeeBucket
|
28
|
+
""" # noqa: E501
|
29
|
+
account_index: StrictInt
|
30
|
+
__properties: ClassVar[List[str]] = ["account_index"]
|
31
|
+
|
32
|
+
model_config = ConfigDict(
|
33
|
+
populate_by_name=True,
|
34
|
+
validate_assignment=True,
|
35
|
+
protected_namespaces=(),
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
def to_str(self) -> str:
|
40
|
+
"""Returns the string representation of the model using alias"""
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
+
|
43
|
+
def to_json(self) -> str:
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
+
return json.dumps(self.to_dict())
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
+
"""Create an instance of ReqGetFeeBucket from a JSON string"""
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
52
|
+
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
55
|
+
|
56
|
+
This has the following differences from calling pydantic's
|
57
|
+
`self.model_dump(by_alias=True)`:
|
58
|
+
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
60
|
+
were set at model initialization. Other fields with value `None`
|
61
|
+
are ignored.
|
62
|
+
"""
|
63
|
+
excluded_fields: Set[str] = set([
|
64
|
+
])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of ReqGetFeeBucket from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
# raise errors for additional fields in the input
|
83
|
+
for _key in obj.keys():
|
84
|
+
if _key not in cls.__properties:
|
85
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetFeeBucket) in the input: " + _key)
|
86
|
+
|
87
|
+
_obj = cls.model_validate({
|
88
|
+
"account_index": obj.get("account_index")
|
89
|
+
})
|
90
|
+
return _obj
|
91
|
+
|
92
|
+
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictInt, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetFundings(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetFundings
|
28
|
+
""" # noqa: E501
|
29
|
+
market_id: StrictInt
|
30
|
+
resolution: StrictStr
|
31
|
+
start_timestamp: StrictInt
|
32
|
+
end_timestamp: StrictInt
|
33
|
+
count_back: StrictInt
|
34
|
+
__properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back"]
|
35
|
+
|
36
|
+
@field_validator('resolution')
|
37
|
+
def resolution_validate_enum(cls, value):
|
38
|
+
"""Validates the enum"""
|
39
|
+
if value not in set(['1h']):
|
40
|
+
raise ValueError("must be one of enum values ('1h')")
|
41
|
+
return value
|
42
|
+
|
43
|
+
model_config = ConfigDict(
|
44
|
+
populate_by_name=True,
|
45
|
+
validate_assignment=True,
|
46
|
+
protected_namespaces=(),
|
47
|
+
)
|
48
|
+
|
49
|
+
|
50
|
+
def to_str(self) -> str:
|
51
|
+
"""Returns the string representation of the model using alias"""
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
53
|
+
|
54
|
+
def to_json(self) -> str:
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
57
|
+
return json.dumps(self.to_dict())
|
58
|
+
|
59
|
+
@classmethod
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
61
|
+
"""Create an instance of ReqGetFundings from a JSON string"""
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
63
|
+
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
66
|
+
|
67
|
+
This has the following differences from calling pydantic's
|
68
|
+
`self.model_dump(by_alias=True)`:
|
69
|
+
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
71
|
+
were set at model initialization. Other fields with value `None`
|
72
|
+
are ignored.
|
73
|
+
"""
|
74
|
+
excluded_fields: Set[str] = set([
|
75
|
+
])
|
76
|
+
|
77
|
+
_dict = self.model_dump(
|
78
|
+
by_alias=True,
|
79
|
+
exclude=excluded_fields,
|
80
|
+
exclude_none=True,
|
81
|
+
)
|
82
|
+
return _dict
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
86
|
+
"""Create an instance of ReqGetFundings from a dict"""
|
87
|
+
if obj is None:
|
88
|
+
return None
|
89
|
+
|
90
|
+
if not isinstance(obj, dict):
|
91
|
+
return cls.model_validate(obj)
|
92
|
+
|
93
|
+
# raise errors for additional fields in the input
|
94
|
+
for _key in obj.keys():
|
95
|
+
if _key not in cls.__properties:
|
96
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetFundings) in the input: " + _key)
|
97
|
+
|
98
|
+
_obj = cls.model_validate({
|
99
|
+
"market_id": obj.get("market_id"),
|
100
|
+
"resolution": obj.get("resolution"),
|
101
|
+
"start_timestamp": obj.get("start_timestamp"),
|
102
|
+
"end_timestamp": obj.get("end_timestamp"),
|
103
|
+
"count_back": obj.get("count_back")
|
104
|
+
})
|
105
|
+
return _obj
|
106
|
+
|
107
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetL1Tx(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetL1Tx
|
28
|
+
""" # noqa: E501
|
29
|
+
hash: StrictStr
|
30
|
+
__properties: ClassVar[List[str]] = ["hash"]
|
31
|
+
|
32
|
+
model_config = ConfigDict(
|
33
|
+
populate_by_name=True,
|
34
|
+
validate_assignment=True,
|
35
|
+
protected_namespaces=(),
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
def to_str(self) -> str:
|
40
|
+
"""Returns the string representation of the model using alias"""
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
+
|
43
|
+
def to_json(self) -> str:
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
+
return json.dumps(self.to_dict())
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
+
"""Create an instance of ReqGetL1Tx from a JSON string"""
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
52
|
+
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
55
|
+
|
56
|
+
This has the following differences from calling pydantic's
|
57
|
+
`self.model_dump(by_alias=True)`:
|
58
|
+
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
60
|
+
were set at model initialization. Other fields with value `None`
|
61
|
+
are ignored.
|
62
|
+
"""
|
63
|
+
excluded_fields: Set[str] = set([
|
64
|
+
])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of ReqGetL1Tx from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
# raise errors for additional fields in the input
|
83
|
+
for _key in obj.keys():
|
84
|
+
if _key not in cls.__properties:
|
85
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetL1Tx) in the input: " + _key)
|
86
|
+
|
87
|
+
_obj = cls.model_validate({
|
88
|
+
"hash": obj.get("hash")
|
89
|
+
})
|
90
|
+
return _obj
|
91
|
+
|
92
|
+
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
|
5
|
+
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
7
|
+
|
8
|
+
The version of the OpenAPI document:
|
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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class ReqGetLatestDeposit(BaseModel):
|
26
|
+
"""
|
27
|
+
ReqGetLatestDeposit
|
28
|
+
""" # noqa: E501
|
29
|
+
l1_address: StrictStr
|
30
|
+
__properties: ClassVar[List[str]] = ["l1_address"]
|
31
|
+
|
32
|
+
model_config = ConfigDict(
|
33
|
+
populate_by_name=True,
|
34
|
+
validate_assignment=True,
|
35
|
+
protected_namespaces=(),
|
36
|
+
)
|
37
|
+
|
38
|
+
|
39
|
+
def to_str(self) -> str:
|
40
|
+
"""Returns the string representation of the model using alias"""
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
42
|
+
|
43
|
+
def to_json(self) -> str:
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
46
|
+
return json.dumps(self.to_dict())
|
47
|
+
|
48
|
+
@classmethod
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
50
|
+
"""Create an instance of ReqGetLatestDeposit from a JSON string"""
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
52
|
+
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
55
|
+
|
56
|
+
This has the following differences from calling pydantic's
|
57
|
+
`self.model_dump(by_alias=True)`:
|
58
|
+
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
60
|
+
were set at model initialization. Other fields with value `None`
|
61
|
+
are ignored.
|
62
|
+
"""
|
63
|
+
excluded_fields: Set[str] = set([
|
64
|
+
])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of ReqGetLatestDeposit from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
# raise errors for additional fields in the input
|
83
|
+
for _key in obj.keys():
|
84
|
+
if _key not in cls.__properties:
|
85
|
+
raise ValueError("Error due to additional fields (not defined in ReqGetLatestDeposit) in the input: " + _key)
|
86
|
+
|
87
|
+
_obj = cls.model_validate({
|
88
|
+
"l1_address": obj.get("l1_address")
|
89
|
+
})
|
90
|
+
return _obj
|
91
|
+
|
92
|
+
|