Skip to content

Commit c580b18

Browse files
alexveleagioto64
andauthored
Spot (#92)
* wip * spot api changes * remove unused files * manually fix volume_quota_remaining from sendTx and sendBatchTx * get assets -- HTTP * get assets -- WS * batch TXs example -- cancel orders at the end * get order books example * create orders configurable for spot * README & configurable spot markets for sendBatchTx examples * Update binaries w/ latest release * Public pools * system setup for sub-accounts & pools * fast withdraw example and update binaries * withdraw example * transfer notes and cleanup --------- Co-authored-by: gioto64 <[email protected]>
1 parent 41fde29 commit c580b18

File tree

133 files changed

+6587
-1589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+6587
-1589
lines changed

.openapi-generator/FILES

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
docs/Account.md
22
docs/AccountApi.md
33
docs/AccountApiKeys.md
4+
docs/AccountAsset.md
45
docs/AccountLimits.md
56
docs/AccountMarginStats.md
67
docs/AccountMarketStats.md
@@ -14,9 +15,12 @@ docs/Announcement.md
1415
docs/AnnouncementApi.md
1516
docs/Announcements.md
1617
docs/ApiKey.md
18+
docs/Asset.md
19+
docs/AssetDetails.md
1720
docs/Block.md
1821
docs/BlockApi.md
1922
docs/Blocks.md
23+
docs/Bridge.md
2024
docs/BridgeApi.md
2125
docs/BridgeSupportedNetwork.md
2226
docs/Candlestick.md
@@ -46,28 +50,27 @@ docs/LiqTrade.md
4650
docs/Liquidation.md
4751
docs/LiquidationInfo.md
4852
docs/LiquidationInfos.md
49-
docs/MarketInfo.md
53+
docs/MarketConfig.md
5054
docs/NextNonce.md
5155
docs/NotificationApi.md
5256
docs/Order.md
5357
docs/OrderApi.md
5458
docs/OrderBook.md
5559
docs/OrderBookDepth.md
56-
docs/OrderBookDetail.md
5760
docs/OrderBookDetails.md
5861
docs/OrderBookOrders.md
5962
docs/OrderBookStats.md
6063
docs/OrderBooks.md
6164
docs/Orders.md
65+
docs/PerpsMarketStats.md
66+
docs/PerpsOrderBookDetail.md
6267
docs/PnLEntry.md
6368
docs/PositionFunding.md
6469
docs/PositionFundings.md
6570
docs/PriceLevel.md
66-
docs/PublicPool.md
6771
docs/PublicPoolInfo.md
6872
docs/PublicPoolMetadata.md
6973
docs/PublicPoolShare.md
70-
docs/PublicPools.md
7174
docs/ReferralApi.md
7275
docs/ReferralPointEntry.md
7376
docs/ReferralPoints.md
@@ -81,8 +84,10 @@ docs/ReqGetAccountLimits.md
8184
docs/ReqGetAccountMetadata.md
8285
docs/ReqGetAccountPnL.md
8386
docs/ReqGetAccountTxs.md
87+
docs/ReqGetAssetDetails.md
8488
docs/ReqGetBlock.md
8589
docs/ReqGetBlockTxs.md
90+
docs/ReqGetBridgesByL1Addr.md
8691
docs/ReqGetByAccount.md
8792
docs/ReqGetCandlesticks.md
8893
docs/ReqGetDepositHistory.md
@@ -97,7 +102,6 @@ docs/ReqGetOrderBookDetails.md
97102
docs/ReqGetOrderBookOrders.md
98103
docs/ReqGetOrderBooks.md
99104
docs/ReqGetPositionFunding.md
100-
docs/ReqGetPublicPools.md
101105
docs/ReqGetPublicPoolsMetadata.md
102106
docs/ReqGetRangeWithCursor.md
103107
docs/ReqGetRangeWithIndex.md
@@ -110,17 +114,23 @@ docs/ReqGetTransferHistory.md
110114
docs/ReqGetTx.md
111115
docs/ReqGetWithdrawHistory.md
112116
docs/RespChangeAccountTier.md
117+
docs/RespGetBridgesByL1Addr.md
113118
docs/RespGetFastBridgeInfo.md
119+
docs/RespGetIsNextBridgeFast.md
114120
docs/RespPublicPoolsMetadata.md
115121
docs/RespSendTx.md
116122
docs/RespSendTxBatch.md
123+
docs/RespUpdateKickback.md
124+
docs/RespUpdateReferralCode.md
117125
docs/RespWithdrawalDelay.md
118126
docs/ResultCode.md
119127
docs/RiskInfo.md
120128
docs/RiskParameters.md
121129
docs/RootApi.md
122130
docs/SharePrice.md
123131
docs/SimpleOrder.md
132+
docs/SpotMarketStats.md
133+
docs/SpotOrderBookDetail.md
124134
docs/Status.md
125135
docs/SubAccounts.md
126136
docs/Ticker.md
@@ -160,6 +170,7 @@ lighter/exceptions.py
160170
lighter/models/__init__.py
161171
lighter/models/account.py
162172
lighter/models/account_api_keys.py
173+
lighter/models/account_asset.py
163174
lighter/models/account_limits.py
164175
lighter/models/account_margin_stats.py
165176
lighter/models/account_market_stats.py
@@ -172,8 +183,11 @@ lighter/models/account_trade_stats.py
172183
lighter/models/announcement.py
173184
lighter/models/announcements.py
174185
lighter/models/api_key.py
186+
lighter/models/asset.py
187+
lighter/models/asset_details.py
175188
lighter/models/block.py
176189
lighter/models/blocks.py
190+
lighter/models/bridge.py
177191
lighter/models/bridge_supported_network.py
178192
lighter/models/candlestick.py
179193
lighter/models/candlesticks.py
@@ -199,26 +213,25 @@ lighter/models/liq_trade.py
199213
lighter/models/liquidation.py
200214
lighter/models/liquidation_info.py
201215
lighter/models/liquidation_infos.py
202-
lighter/models/market_info.py
216+
lighter/models/market_config.py
203217
lighter/models/next_nonce.py
204218
lighter/models/order.py
205219
lighter/models/order_book.py
206220
lighter/models/order_book_depth.py
207-
lighter/models/order_book_detail.py
208221
lighter/models/order_book_details.py
209222
lighter/models/order_book_orders.py
210223
lighter/models/order_book_stats.py
211224
lighter/models/order_books.py
212225
lighter/models/orders.py
226+
lighter/models/perps_market_stats.py
227+
lighter/models/perps_order_book_detail.py
213228
lighter/models/pn_l_entry.py
214229
lighter/models/position_funding.py
215230
lighter/models/position_fundings.py
216231
lighter/models/price_level.py
217-
lighter/models/public_pool.py
218232
lighter/models/public_pool_info.py
219233
lighter/models/public_pool_metadata.py
220234
lighter/models/public_pool_share.py
221-
lighter/models/public_pools.py
222235
lighter/models/referral_point_entry.py
223236
lighter/models/referral_points.py
224237
lighter/models/req_export_data.py
@@ -231,8 +244,10 @@ lighter/models/req_get_account_limits.py
231244
lighter/models/req_get_account_metadata.py
232245
lighter/models/req_get_account_pn_l.py
233246
lighter/models/req_get_account_txs.py
247+
lighter/models/req_get_asset_details.py
234248
lighter/models/req_get_block.py
235249
lighter/models/req_get_block_txs.py
250+
lighter/models/req_get_bridges_by_l1_addr.py
236251
lighter/models/req_get_by_account.py
237252
lighter/models/req_get_candlesticks.py
238253
lighter/models/req_get_deposit_history.py
@@ -247,7 +262,6 @@ lighter/models/req_get_order_book_details.py
247262
lighter/models/req_get_order_book_orders.py
248263
lighter/models/req_get_order_books.py
249264
lighter/models/req_get_position_funding.py
250-
lighter/models/req_get_public_pools.py
251265
lighter/models/req_get_public_pools_metadata.py
252266
lighter/models/req_get_range_with_cursor.py
253267
lighter/models/req_get_range_with_index.py
@@ -260,16 +274,22 @@ lighter/models/req_get_transfer_history.py
260274
lighter/models/req_get_tx.py
261275
lighter/models/req_get_withdraw_history.py
262276
lighter/models/resp_change_account_tier.py
277+
lighter/models/resp_get_bridges_by_l1_addr.py
263278
lighter/models/resp_get_fast_bridge_info.py
279+
lighter/models/resp_get_is_next_bridge_fast.py
264280
lighter/models/resp_public_pools_metadata.py
265281
lighter/models/resp_send_tx.py
266282
lighter/models/resp_send_tx_batch.py
283+
lighter/models/resp_update_kickback.py
284+
lighter/models/resp_update_referral_code.py
267285
lighter/models/resp_withdrawal_delay.py
268286
lighter/models/result_code.py
269287
lighter/models/risk_info.py
270288
lighter/models/risk_parameters.py
271289
lighter/models/share_price.py
272290
lighter/models/simple_order.py
291+
lighter/models/spot_market_stats.py
292+
lighter/models/spot_order_book_detail.py
273293
lighter/models/status.py
274294
lighter/models/sub_accounts.py
275295
lighter/models/ticker.py
@@ -291,4 +311,19 @@ lighter/rest.py
291311
setup.cfg
292312
test-requirements.txt
293313
test/__init__.py
314+
test/test_account_asset.py
315+
test/test_asset.py
316+
test/test_asset_details.py
317+
test/test_bridge.py
318+
test/test_market_config.py
319+
test/test_perps_market_stats.py
320+
test/test_perps_order_book_detail.py
321+
test/test_req_get_asset_details.py
322+
test/test_req_get_bridges_by_l1_addr.py
323+
test/test_resp_get_bridges_by_l1_addr.py
324+
test/test_resp_get_is_next_bridge_fast.py
325+
test/test_resp_update_kickback.py
326+
test/test_resp_update_referral_code.py
327+
test/test_spot_market_stats.py
328+
test/test_spot_order_book_detail.py
294329
tox.ini

docs/Account.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Name | Type | Description | Notes
1212
**l1_address** | **str** | |
1313
**cancel_all_time** | **int** | |
1414
**total_order_count** | **int** | |
15-
**total_isolated_order_count** | **int** | |
1615
**pending_order_count** | **int** | |
1716
**available_balance** | **str** | |
1817
**status** | **int** | |

docs/AccountApi.md

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Method | HTTP request | Description
1414
[**liquidations**](AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations
1515
[**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl
1616
[**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding
17-
[**public_pools**](AccountApi.md#public_pools) | **GET** /api/v1/publicPools | publicPools
1817
[**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata
1918

2019

@@ -770,85 +769,6 @@ No authorization required
770769

771770
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
772771

773-
# **public_pools**
774-
> PublicPools public_pools(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
775-
776-
publicPools
777-
778-
Get public pools
779-
780-
### Example
781-
782-
783-
```python
784-
import lighter
785-
from lighter.models.public_pools import PublicPools
786-
from lighter.rest import ApiException
787-
from pprint import pprint
788-
789-
# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai
790-
# See configuration.py for a list of all supported configuration parameters.
791-
configuration = lighter.Configuration(
792-
host = "https://mainnet.zklighter.elliot.ai"
793-
)
794-
795-
796-
# Enter a context with an instance of the API client
797-
async with lighter.ApiClient(configuration) as api_client:
798-
# Create an instance of the API class
799-
api_instance = lighter.AccountApi(api_client)
800-
index = 56 # int |
801-
limit = 56 # int |
802-
authorization = 'authorization_example' # str | (optional)
803-
auth = 'auth_example' # str | (optional)
804-
filter = 'filter_example' # str | (optional)
805-
account_index = 56 # int | (optional)
806-
807-
try:
808-
# publicPools
809-
api_response = await api_instance.public_pools(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
810-
print("The response of AccountApi->public_pools:\n")
811-
pprint(api_response)
812-
except Exception as e:
813-
print("Exception when calling AccountApi->public_pools: %s\n" % e)
814-
```
815-
816-
817-
818-
### Parameters
819-
820-
821-
Name | Type | Description | Notes
822-
------------- | ------------- | ------------- | -------------
823-
**index** | **int**| |
824-
**limit** | **int**| |
825-
**authorization** | **str**| | [optional]
826-
**auth** | **str**| | [optional]
827-
**filter** | **str**| | [optional]
828-
**account_index** | **int**| | [optional]
829-
830-
### Return type
831-
832-
[**PublicPools**](PublicPools.md)
833-
834-
### Authorization
835-
836-
No authorization required
837-
838-
### HTTP request headers
839-
840-
- **Content-Type**: Not defined
841-
- **Accept**: application/json
842-
843-
### HTTP response details
844-
845-
| Status code | Description | Response headers |
846-
|-------------|-------------|------------------|
847-
**200** | A successful response. | - |
848-
**400** | Bad request | - |
849-
850-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
851-
852772
# **public_pools_metadata**
853773
> RespPublicPoolsMetadata public_pools_metadata(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
854774

docs/AccountAsset.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# AccountAsset
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**symbol** | **str** | |
9+
**asset_id** | **int** | |
10+
**balance** | **str** | |
11+
**locked_balance** | **str** | |
12+
13+
## Example
14+
15+
```python
16+
from lighter.models.account_asset import AccountAsset
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of AccountAsset from a JSON string
21+
account_asset_instance = AccountAsset.from_json(json)
22+
# print the JSON string representation of the object
23+
print(AccountAsset.to_json())
24+
25+
# convert the object into a dict
26+
account_asset_dict = account_asset_instance.to_dict()
27+
# create an instance of AccountAsset from a dict
28+
account_asset_from_dict = AccountAsset.from_dict(account_asset_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+

docs/AccountLimits.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Name | Type | Description | Notes
88
**code** | **int** | |
99
**message** | **str** | | [optional]
1010
**max_llp_percentage** | **int** | |
11+
**max_llp_amount** | **str** | |
1112
**user_tier** | **str** | |
13+
**can_create_public_pool** | **bool** | |
1214

1315
## Example
1416

docs/Announcement.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**title** | **str** | |
99
**content** | **str** | |
1010
**created_at** | **int** | |
11+
**expired_at** | **int** | |
1112

1213
## Example
1314

docs/Asset.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Asset
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**asset_id** | **int** | |
9+
**symbol** | **str** | |
10+
**l1_decimals** | **int** | |
11+
**decimals** | **int** | |
12+
**min_transfer_amount** | **str** | |
13+
**min_withdrawal_amount** | **str** | |
14+
**margin_mode** | **str** | |
15+
**index_price** | **str** | |
16+
**l1_address** | **str** | |
17+
18+
## Example
19+
20+
```python
21+
from lighter.models.asset import Asset
22+
23+
# TODO update the JSON string below
24+
json = "{}"
25+
# create an instance of Asset from a JSON string
26+
asset_instance = Asset.from_json(json)
27+
# print the JSON string representation of the object
28+
print(Asset.to_json())
29+
30+
# convert the object into a dict
31+
asset_dict = asset_instance.to_dict()
32+
# create an instance of Asset from a dict
33+
asset_from_dict = Asset.from_dict(asset_dict)
34+
```
35+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
36+
37+

0 commit comments

Comments
 (0)