Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ if __name__ == "__main__":
The [`examples/`](examples) directory contains end-to-end scripts for the
common flows. A few starting points:

- [Read public REST endpoints](examples/get_info.py)
- [Stream order books and account state over websocket](examples/ws.py)
- [Create / modify / cancel an order over HTTP](examples/create_modify_cancel_order_http.py)
- [Create / modify / cancel an order over websocket](examples/create_modify_cancel_order_ws.py)
- [Read public REST endpoints](examples/market-data/get_info.py)
- [Stream order books and account state over websocket](examples/websocket/ws.py)
- [Create / modify / cancel an order over HTTP](examples/orders/create_modify_cancel_order_http.py)
- [Create / modify / cancel an order over websocket](examples/orders/create_modify_cancel_order_ws.py)
- [System setup (API key, signer)](examples/system_setup.py)

See [`examples/README.md`](examples/README.md) for the full annotated list.
Expand Down Expand Up @@ -98,6 +98,9 @@ Class | Method | HTTP request | Description
*CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings
*CandlestickApi* | [**mark_price_candles**](docs/CandlestickApi.md#mark_price_candles) | **GET** /api/v1/markPriceCandles | markPriceCandles
*CandlestickApi* | [**market_price_charts**](docs/CandlestickApi.md#market_price_charts) | **GET** /api/v1/marketPriceCharts | marketPriceCharts
*EventApi* | [**event_create**](docs/EventApi.md#event_create) | **POST** /api/v1/event/create | event_create
*EventApi* | [**event_register_order_book**](docs/EventApi.md#event_register_order_book) | **POST** /api/v1/event/registerOrderBook | event_registerOrderBook
*EventApi* | [**event_update**](docs/EventApi.md#event_update) | **POST** /api/v1/event/update | event_update
*EventApi* | [**events**](docs/EventApi.md#events) | **GET** /api/v1/events | events
*FundingApi* | [**funding_rates**](docs/FundingApi.md#funding_rates) | **GET** /api/v1/funding-rates | funding-rates
*InfoApi* | [**layer1_basic_info**](docs/InfoApi.md#layer1_basic_info) | **GET** /api/v1/layer1BasicInfo | layer1BasicInfo
Expand Down Expand Up @@ -248,6 +251,7 @@ Class | Method | HTTP request | Description
- [ReferralTotals](docs/ReferralTotals.md)
- [ReqSetAccountMetadata](docs/ReqSetAccountMetadata.md)
- [RespChangeAccountTier](docs/RespChangeAccountTier.md)
- [RespCreateEvent](docs/RespCreateEvent.md)
- [RespCreateRFQ](docs/RespCreateRFQ.md)
- [RespGetApiTokens](docs/RespGetApiTokens.md)
- [RespGetBoPnL](docs/RespGetBoPnL.md)
Expand All @@ -265,6 +269,7 @@ Class | Method | HTTP request | Description
- [RespPostApiToken](docs/RespPostApiToken.md)
- [RespPriceOracleInfo](docs/RespPriceOracleInfo.md)
- [RespPublicPoolsMetadata](docs/RespPublicPoolsMetadata.md)
- [RespRegisterEventOrderBook](docs/RespRegisterEventOrderBook.md)
- [RespRespondToRFQ](docs/RespRespondToRFQ.md)
- [RespRevokeApiToken](docs/RespRevokeApiToken.md)
- [RespSendTx](docs/RespSendTx.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/AccountLimits.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Name | Type | Description | Notes
**leased_lit** | **str** | Total actively leased LIT. |
**user_tier_name** | **str** | |
**user_tier_last_update** | **int** | | [optional]
**bo_user_tier_name** | **str** | |
**bo_fee_rate** | **float** | Product of the staking and BO volume multipliers; 0.72 means a 28% discount. |

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/BinaryOptionMarketStats.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Name | Type | Description | Notes
**lifetime_quote_token_volume** | **float** | |
**lifetime_base_token_volume** | **float** | outcome shares traded over the market's life |
**open_interest** | **str** | |
**status** | **str** | inactive once the trading window closes |
**status** | **str** | inactive before the trading window opens, waiting-for-settlement once it closes |
**outcome** | **int** | |

## Example
Expand Down
254 changes: 254 additions & 0 deletions docs/EventApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,263 @@ All URIs are relative to *https://mainnet.zklighter.elliot.ai*

Method | HTTP request | Description
------------- | ------------- | -------------
[**event_create**](EventApi.md#event_create) | **POST** /api/v1/event/create | event_create
[**event_register_order_book**](EventApi.md#event_register_order_book) | **POST** /api/v1/event/registerOrderBook | event_registerOrderBook
[**event_update**](EventApi.md#event_update) | **POST** /api/v1/event/update | event_update
[**events**](EventApi.md#events) | **GET** /api/v1/events | events


# **event_create**
> RespCreateEvent event_create(authorization, account_index, title, start_at, end_at, description=description, tag=tag, event_kind=event_kind, recurrence_period_seconds=recurrence_period_seconds, metadata=metadata)

event_create

Create a binary options event

### Example


```python
import lighter
from lighter.models.resp_create_event import RespCreateEvent
from lighter.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = lighter.Configuration(
host = "https://mainnet.zklighter.elliot.ai"
)


# Enter a context with an instance of the API client
async with lighter.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lighter.EventApi(api_client)
authorization = 'authorization_example' # str |
account_index = 56 # int |
title = 'title_example' # str |
start_at = 56 # int | Unix milliseconds; observation time, not trading time
end_at = 56 # int | Unix milliseconds; must be after start_at
description = 'description_example' # str | (optional)
tag = 'tag_example' # str | series tag; may be shared by different creators (optional)
event_kind = one_off # str | (optional) (default to one_off)
recurrence_period_seconds = 56 # int | 0 for one-off events (optional)
metadata = 'metadata_example' # str | JSON object, max 16 KiB; presentation only (optional)

try:
# event_create
api_response = await api_instance.event_create(authorization, account_index, title, start_at, end_at, description=description, tag=tag, event_kind=event_kind, recurrence_period_seconds=recurrence_period_seconds, metadata=metadata)
print("The response of EventApi->event_create:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->event_create: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization** | **str**| |
**account_index** | **int**| |
**title** | **str**| |
**start_at** | **int**| Unix milliseconds; observation time, not trading time |
**end_at** | **int**| Unix milliseconds; must be after start_at |
**description** | **str**| | [optional]
**tag** | **str**| series tag; may be shared by different creators | [optional]
**event_kind** | **str**| | [optional] [default to one_off]
**recurrence_period_seconds** | **int**| 0 for one-off events | [optional]
**metadata** | **str**| JSON object, max 16 KiB; presentation only | [optional]

### Return type

[**RespCreateEvent**](RespCreateEvent.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**400** | Bad request | - |

[[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)

# **event_register_order_book**
> RespRegisterEventOrderBook event_register_order_book(authorization, account_index, event_id, market_index)

event_registerOrderBook

Register an already deployed order book to an event

### Example


```python
import lighter
from lighter.models.resp_register_event_order_book import RespRegisterEventOrderBook
from lighter.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = lighter.Configuration(
host = "https://mainnet.zklighter.elliot.ai"
)


# Enter a context with an instance of the API client
async with lighter.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lighter.EventApi(api_client)
authorization = 'authorization_example' # str |
account_index = 56 # int |
event_id = 56 # int |
market_index = 56 # int |

try:
# event_registerOrderBook
api_response = await api_instance.event_register_order_book(authorization, account_index, event_id, market_index)
print("The response of EventApi->event_register_order_book:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->event_register_order_book: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization** | **str**| |
**account_index** | **int**| |
**event_id** | **int**| |
**market_index** | **int**| |

### Return type

[**RespRegisterEventOrderBook**](RespRegisterEventOrderBook.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**400** | Bad request | - |

[[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)

# **event_update**
> ResultCode event_update(authorization, account_index, title, start_at, end_at, event_id, description=description, tag=tag, event_kind=event_kind, recurrence_period_seconds=recurrence_period_seconds, metadata=metadata)

event_update

Replace event details as its creator; rejected while any attached unsettled market is within its trading window. Market bindings are unchanged.

### Example


```python
import lighter
from lighter.models.result_code import ResultCode
from lighter.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://mainnet.zklighter.elliot.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = lighter.Configuration(
host = "https://mainnet.zklighter.elliot.ai"
)


# Enter a context with an instance of the API client
async with lighter.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = lighter.EventApi(api_client)
authorization = 'authorization_example' # str |
account_index = 56 # int |
title = 'title_example' # str |
start_at = 56 # int | Unix milliseconds; observation time, not trading time
end_at = 56 # int | Unix milliseconds; must be after start_at
event_id = 56 # int |
description = 'description_example' # str | (optional)
tag = 'tag_example' # str | series tag; may be shared by different creators (optional)
event_kind = one_off # str | (optional) (default to one_off)
recurrence_period_seconds = 56 # int | 0 for one-off events (optional)
metadata = 'metadata_example' # str | JSON object, max 16 KiB; presentation only (optional)

try:
# event_update
api_response = await api_instance.event_update(authorization, account_index, title, start_at, end_at, event_id, description=description, tag=tag, event_kind=event_kind, recurrence_period_seconds=recurrence_period_seconds, metadata=metadata)
print("The response of EventApi->event_update:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->event_update: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**authorization** | **str**| |
**account_index** | **int**| |
**title** | **str**| |
**start_at** | **int**| Unix milliseconds; observation time, not trading time |
**end_at** | **int**| Unix milliseconds; must be after start_at |
**event_id** | **int**| |
**description** | **str**| | [optional]
**tag** | **str**| series tag; may be shared by different creators | [optional]
**event_kind** | **str**| | [optional] [default to one_off]
**recurrence_period_seconds** | **int**| 0 for one-off events | [optional]
**metadata** | **str**| JSON object, max 16 KiB; presentation only | [optional]

### Return type

[**ResultCode**](ResultCode.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**400** | Bad request | - |

[[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)

# **events**
> RespGetEvents events(event_ids=event_ids, market_ids=market_ids, creator_account_index=creator_account_index, cursor=cursor, active=active, limit=limit, tag=tag, event_kind=event_kind, start_from=start_from, start_before=start_before, sort=sort, order=order)

Expand Down
31 changes: 31 additions & 0 deletions docs/RespCreateEvent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# RespCreateEvent


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | |
**message** | **str** | | [optional]
**event_id** | **int** | |

## Example

```python
from lighter.models.resp_create_event import RespCreateEvent

# TODO update the JSON string below
json = "{}"
# create an instance of RespCreateEvent from a JSON string
resp_create_event_instance = RespCreateEvent.from_json(json)
# print the JSON string representation of the object
print(RespCreateEvent.to_json())

# convert the object into a dict
resp_create_event_dict = resp_create_event_instance.to_dict()
# create an instance of RespCreateEvent from a dict
resp_create_event_from_dict = RespCreateEvent.from_dict(resp_create_event_dict)
```
[[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 changes: 31 additions & 0 deletions docs/RespRegisterEventOrderBook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# RespRegisterEventOrderBook


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | |
**message** | **str** | | [optional]
**success** | **bool** | |

## Example

```python
from lighter.models.resp_register_event_order_book import RespRegisterEventOrderBook

# TODO update the JSON string below
json = "{}"
# create an instance of RespRegisterEventOrderBook from a JSON string
resp_register_event_order_book_instance = RespRegisterEventOrderBook.from_json(json)
# print the JSON string representation of the object
print(RespRegisterEventOrderBook.to_json())

# convert the object into a dict
resp_register_event_order_book_dict = resp_register_event_order_book_instance.to_dict()
# create an instance of RespRegisterEventOrderBook from a dict
resp_register_event_order_book_from_dict = RespRegisterEventOrderBook.from_dict(resp_register_event_order_book_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading
Loading