Skip to content

Commit 3b5d4a0

Browse files
committed
update Readme
1 parent de31bd9 commit 3b5d4a0

2 files changed

Lines changed: 26 additions & 57 deletions

File tree

README.md

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,20 @@
11
# lighter
2-
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
32

4-
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5-
6-
- API version:
7-
- Package version: 1.0.0
8-
- Generator version: 7.7.0
9-
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
3+
Python SDK for Lighter
104

115
## Requirements.
126

13-
Python 3.7+
7+
Python 3.8+
148

159
## Installation & Usage
1610
### pip install
1711

1812
If the python package is hosted on a repository, you can install directly using:
1913

2014
```sh
21-
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
22-
```
23-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
24-
25-
Then import the package:
26-
```python
27-
import lighter
15+
pip install git+https://github.com/elliottech/lighter-python.git
2816
```
2917

30-
### Setuptools
31-
32-
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
33-
34-
```sh
35-
python setup.py install --user
36-
```
37-
(or `sudo python setup.py install` to install the package for all users)
3818

3919
Then import the package:
4020
```python
@@ -52,32 +32,33 @@ Please follow the [installation procedure](#installation--usage) and then run th
5232
```python
5333

5434
import lighter
55-
from lighter.rest import ApiException
56-
from pprint import pprint
35+
import asyncio
5736

58-
# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai
59-
# See configuration.py for a list of all supported configuration parameters.
60-
configuration = lighter.Configuration(
61-
host = "https://mainnet.zklighter.elliot.ai"
62-
)
37+
async def main():
38+
client = lighter.ApiClient()
39+
account_api = lighter.AccountApi(client)
40+
account = await account_api.get_account(by="index", value="1")
41+
print(account)
6342

43+
if __name__ == "__main__":
44+
asyncio.run(main())
6445

46+
```
6547

66-
# Enter a context with an instance of the API client
67-
async with lighter.ApiClient(configuration) as api_client:
68-
# Create an instance of the API class
69-
api_instance = lighter.AccountApi(api_client)
70-
by = 'by_example' # str |
71-
value = 'value_example' # str |
48+
# Examples
49+
## [Read API Functions](examples/get_info.py)
50+
```sh
51+
python examples/get_info.py
52+
```
7253

73-
try:
74-
# account
75-
api_response = await api_instance.account(by, value)
76-
print("The response of AccountApi->account:\n")
77-
pprint(api_response)
78-
except ApiException as e:
79-
print("Exception when calling AccountApi->account: %s\n" % e)
54+
## [Websocket Sync Order Books & Accounts](examples/ws.py)
55+
```sh
56+
python examples/ws.py
57+
```
8058

59+
## [Create, Cancel & Withdraw Orders](examples/create_cancel_withdraw_order.py)
60+
```sh
61+
python examples/create_cancel_withdraw_order.py
8162
```
8263

8364
## Documentation for API Endpoints
@@ -228,18 +209,6 @@ Class | Method | HTTP request | Description
228209
<a id="documentation-for-authorization"></a>
229210
## Documentation For Authorization
230211

231-
232-
Authentication schemes defined for the API:
233-
<a id="apiKey"></a>
234-
### apiKey
235-
236-
- **Type**: API key
237-
- **API key parameter name**: Authorization
238-
- **Location**: HTTP header
239-
240-
241-
## Author
242-
243-
212+
Endpoints do not require authorization.
244213

245214

examples/create_cancel_withdraw_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
logging.basicConfig(level=logging.DEBUG)
77

88

9-
BASE_URL = "https://mainnet.lighter.elliot.ai"
9+
BASE_URL = "https://mainnet.zklighter.elliot.ai"
1010
PRIVATE_KEY = "WALLET_PRIVATE_KEY"
1111

1212

0 commit comments

Comments
 (0)