mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
docs: 更新 lighter-python-main 文档,添加示例代码和 API 说明,重构部分内容以提高可读性
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
Welcome to the Lighter SDK and API Introduction. Here, we will go through everything from the system setup, to creating and cancelling all types of orders, to fetching exchange data.
|
||||
|
||||
Setting up an API KEY
|
||||
In order to get started using the Lighter API, you must first set up an API_KEY_PRIVATE_KEY, as you will need it to sign any transaction you want to make. You can find how to do it in the following example. The BASE_URL will reflect if your key is generated on testnet or mainnet (for mainnet, just change the BASE_URL in the example to https://mainnet.zklighter.elliot.ai). Note that you also need to provide your ETH_PRIVATE_KEY.
|
||||
|
||||
You can setup up to 253 API keys (2 <= API_KEY_INDEX <= 254). The 0 index is the one reserved for the desktop, while 1 is the one reserved for the mobile. Finally, the 255 index can be used as a value for the api_key_index parameter of the apikeys method of the AccountApi for getting the data about all the API keys.
|
||||
|
||||
In case you do not know your ACCOUNT_INDEX, you can find it by querying the AccountApi for the data about your account, as shown in this example.
|
||||
|
||||
Account types
|
||||
Lighter API users can operate under a Standard or Premium account. The Standard account is suitable for latency insensitive traders, providing 0 fees, while the premium one provides a latency suitable for HFTs at 0.2 bps maker and 2 bps taker fees. You can find more information about it in the Account Types section.
|
||||
|
||||
The Signer
|
||||
In order to create a transaction (create/cancel/modify order), you need to use the SignerClient. For initializing it, use the following lines of code:
|
||||
|
||||
Initialize SignerClient
|
||||
|
||||
client = lighter.SignerClient(
|
||||
url=BASE_URL,
|
||||
private_key=API_KEY_PRIVATE_KEY,
|
||||
account_index=ACCOUNT_INDEX,
|
||||
api_key_index=API_KEY_INDEX
|
||||
)
|
||||
The code for the signer can be found in the same repo, in the signer_client.py file. You may notice that it uses a binary for the signer: the code for it can be found in the lighter-go public repo, and you can compile it yourself using the justfile.
|
||||
|
||||
Nonces
|
||||
When signing a transaction, you may need to provide a nonce (number used once). A nonce needs to be incremented each time you sign something. You can get the next nonce that you need to use using the TransactionApi’s next_nonce method or take care of incrementing it yourself. Note that each nonce is handled per API_KEY.
|
||||
|
||||
Signing a transaction
|
||||
One can sign a transaction using the SignerClient’s sign_create_order, sign_modify_order, sign_cancel_order and its other similar methods. For actually pushing the transaction, you need to call send_tx or send_tx_batch using the TransactionApi. Here’s an example that includes such an operation.
|
||||
|
||||
Note that base_amount, price are to be passed as integers, and client_order_index is an unique (across all markets) identifier you provide for you to be able to reference this order later (e.g. if you want to cancel it).
|
||||
|
||||
The following values can be provided for the order_type parameter:
|
||||
|
||||
ORDER_TYPE_LIMIT
|
||||
ORDER_TYPE_MARKET
|
||||
ORDER_TYPE_STOP_LOSS
|
||||
ORDER_TYPE_STOP_LOSS_LIMIT
|
||||
ORDER_TYPE_TAKE_PROFIT
|
||||
ORDER_TYPE_TAKE_PROFIT_LIMIT
|
||||
ORDER_TYPE_TWAP
|
||||
The following values can be provided for the time_in_force parameter:
|
||||
|
||||
ORDER_TIME_IN_FORCE_IMMEDIATE_OR_CANCEL
|
||||
ORDER_TIME_IN_FORCE_GOOD_TILL_TIME
|
||||
ORDER_TIME_IN_FORCE_POST_ONLY
|
||||
Signer Client Useful Wrapper Functions
|
||||
The SignerClient provides several functions that sign and push a type of transaction. Here’s a list of some of them:
|
||||
|
||||
create_order - signs and pushes a create order transaction;
|
||||
create_market_order - signs and pushes a create order transaction for a market order;
|
||||
create_cancel_order - signs and pushes a cancel transaction for a certain order. Note that the order_index needs to equal the client_order_index of the order to cancel;
|
||||
cancel_all_orders - signs and pushes a cancel all transactions. Note that, depending on the time_in_force provided, the transaction has different consequences:
|
||||
ORDER_TIME_IN_FORCE_IMMEDIATE_OR_CANCEL - ImmediateCancelAll;
|
||||
ORDER_TIME_IN_FORCE_GOOD_TILL_TIME - ScheduledCancelAll;
|
||||
ORDER_TIME_IN_FORCE_POST_ONLY - AbortScheduledCancelAll.
|
||||
create_auth_token_with_expiry - creates an auth token (useful for getting data using the Api and Ws methods)
|
||||
API
|
||||
The SDK provides API classes that make calling the Lighter API easier. Here are some of them and the most important of their methods:
|
||||
|
||||
AccountApi - provides account data
|
||||
account - get account data either by l1_address or index
|
||||
accounts_by_l1_address - get data about all the accounts (master account and subaccounts)
|
||||
apikeys - get data about the api keys of an account (use api_key_index = 255 for getting data about all the api keys)
|
||||
TransactionApi - provides transaction related data
|
||||
next_nonce - get next nonce to be used for signing a transaction using a certain api key
|
||||
send_tx - push a transaction
|
||||
send_tx_batch - push several transactions at once
|
||||
OrderApi - provides data about orders, trades and the orderbook
|
||||
order_book_details - get data about a specific market’s orderbook
|
||||
order_books - get data about all markets’ orderbooks
|
||||
You can find the rest here. We also provide an example showing how to use some of these. For the methods that require an auth token, you can generate one using the create_auth_token_with_expiry method of the SignerClient (the same applies to the websockets auth).
|
||||
|
||||
WebSockets
|
||||
Lighter also provides access to essential info using websockets. A simple version of an WsClient for subscribing to account and orderbook updates is implemented here. You can also take it as an example implementation of such a client.
|
||||
|
||||
To get access to more data, you will need to connect to the websockets without the provided WsClient. You can find the streams you can connect to, how to connect, and the data they provide in the websockets section.
|
||||
@@ -0,0 +1,38 @@
|
||||
# NOTE: This file is auto generated by OpenAPI Generator.
|
||||
# URL: https://openapi-generator.tech
|
||||
#
|
||||
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: lighter Python package
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest --ignore-glob="*api.py"
|
||||
@@ -0,0 +1,71 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
dev/
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
.hypothesis/
|
||||
venv/
|
||||
.venv/
|
||||
.python-version
|
||||
.pytest_cache
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
#Ipython Notebook
|
||||
.ipynb_checkpoints
|
||||
openapi-generator-cli.jar
|
||||
|
||||
|
||||
.idea
|
||||
|
||||
examples/secrets.py
|
||||
@@ -0,0 +1,28 @@
|
||||
# NOTE: This file is auto generated by OpenAPI Generator.
|
||||
# URL: https://openapi-generator.tech
|
||||
#
|
||||
# ref: https://docs.gitlab.com/ee/ci/README.html
|
||||
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
|
||||
|
||||
stages:
|
||||
- test
|
||||
|
||||
.pytest:
|
||||
stage: test
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r test-requirements.txt
|
||||
- pytest --cov=lighter --ignore-glob *api.py
|
||||
|
||||
pytest-3.8:
|
||||
extends: .pytest
|
||||
image: python:3.8-alpine
|
||||
pytest-3.9:
|
||||
extends: .pytest
|
||||
image: python:3.9-alpine
|
||||
pytest-3.10:
|
||||
extends: .pytest
|
||||
image: python:3.10-alpine
|
||||
pytest-3.11:
|
||||
extends: .pytest
|
||||
image: python:3.11-alpine
|
||||
@@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
@@ -0,0 +1,294 @@
|
||||
docs/Account.md
|
||||
docs/AccountApi.md
|
||||
docs/AccountApiKeys.md
|
||||
docs/AccountLimits.md
|
||||
docs/AccountMarginStats.md
|
||||
docs/AccountMarketStats.md
|
||||
docs/AccountMetadata.md
|
||||
docs/AccountMetadatas.md
|
||||
docs/AccountPnL.md
|
||||
docs/AccountPosition.md
|
||||
docs/AccountStats.md
|
||||
docs/AccountTradeStats.md
|
||||
docs/Announcement.md
|
||||
docs/AnnouncementApi.md
|
||||
docs/Announcements.md
|
||||
docs/ApiKey.md
|
||||
docs/Block.md
|
||||
docs/BlockApi.md
|
||||
docs/Blocks.md
|
||||
docs/BridgeApi.md
|
||||
docs/BridgeSupportedNetwork.md
|
||||
docs/Candlestick.md
|
||||
docs/CandlestickApi.md
|
||||
docs/Candlesticks.md
|
||||
docs/ContractAddress.md
|
||||
docs/CurrentHeight.md
|
||||
docs/Cursor.md
|
||||
docs/DailyReturn.md
|
||||
docs/DepositHistory.md
|
||||
docs/DepositHistoryItem.md
|
||||
docs/DetailedAccount.md
|
||||
docs/DetailedAccounts.md
|
||||
docs/DetailedCandlestick.md
|
||||
docs/EnrichedTx.md
|
||||
docs/ExchangeStats.md
|
||||
docs/ExportData.md
|
||||
docs/Funding.md
|
||||
docs/FundingApi.md
|
||||
docs/FundingRate.md
|
||||
docs/FundingRates.md
|
||||
docs/Fundings.md
|
||||
docs/InfoApi.md
|
||||
docs/L1Metadata.md
|
||||
docs/L1ProviderInfo.md
|
||||
docs/LiqTrade.md
|
||||
docs/Liquidation.md
|
||||
docs/LiquidationInfo.md
|
||||
docs/LiquidationInfos.md
|
||||
docs/MarketInfo.md
|
||||
docs/NextNonce.md
|
||||
docs/NotificationApi.md
|
||||
docs/Order.md
|
||||
docs/OrderApi.md
|
||||
docs/OrderBook.md
|
||||
docs/OrderBookDepth.md
|
||||
docs/OrderBookDetail.md
|
||||
docs/OrderBookDetails.md
|
||||
docs/OrderBookOrders.md
|
||||
docs/OrderBookStats.md
|
||||
docs/OrderBooks.md
|
||||
docs/Orders.md
|
||||
docs/PnLEntry.md
|
||||
docs/PositionFunding.md
|
||||
docs/PositionFundings.md
|
||||
docs/PriceLevel.md
|
||||
docs/PublicPool.md
|
||||
docs/PublicPoolInfo.md
|
||||
docs/PublicPoolMetadata.md
|
||||
docs/PublicPoolShare.md
|
||||
docs/PublicPools.md
|
||||
docs/ReferralApi.md
|
||||
docs/ReferralPointEntry.md
|
||||
docs/ReferralPoints.md
|
||||
docs/ReqExportData.md
|
||||
docs/ReqGetAccount.md
|
||||
docs/ReqGetAccountActiveOrders.md
|
||||
docs/ReqGetAccountApiKeys.md
|
||||
docs/ReqGetAccountByL1Address.md
|
||||
docs/ReqGetAccountInactiveOrders.md
|
||||
docs/ReqGetAccountLimits.md
|
||||
docs/ReqGetAccountMetadata.md
|
||||
docs/ReqGetAccountPnL.md
|
||||
docs/ReqGetAccountTxs.md
|
||||
docs/ReqGetBlock.md
|
||||
docs/ReqGetBlockTxs.md
|
||||
docs/ReqGetByAccount.md
|
||||
docs/ReqGetCandlesticks.md
|
||||
docs/ReqGetDepositHistory.md
|
||||
docs/ReqGetFastWithdrawInfo.md
|
||||
docs/ReqGetFundings.md
|
||||
docs/ReqGetL1Metadata.md
|
||||
docs/ReqGetL1Tx.md
|
||||
docs/ReqGetLatestDeposit.md
|
||||
docs/ReqGetLiquidationInfos.md
|
||||
docs/ReqGetNextNonce.md
|
||||
docs/ReqGetOrderBookDetails.md
|
||||
docs/ReqGetOrderBookOrders.md
|
||||
docs/ReqGetOrderBooks.md
|
||||
docs/ReqGetPositionFunding.md
|
||||
docs/ReqGetPublicPools.md
|
||||
docs/ReqGetPublicPoolsMetadata.md
|
||||
docs/ReqGetRangeWithCursor.md
|
||||
docs/ReqGetRangeWithIndex.md
|
||||
docs/ReqGetRangeWithIndexSortable.md
|
||||
docs/ReqGetRecentTrades.md
|
||||
docs/ReqGetReferralPoints.md
|
||||
docs/ReqGetTrades.md
|
||||
docs/ReqGetTransferFeeInfo.md
|
||||
docs/ReqGetTransferHistory.md
|
||||
docs/ReqGetTx.md
|
||||
docs/ReqGetWithdrawHistory.md
|
||||
docs/RespChangeAccountTier.md
|
||||
docs/RespGetFastBridgeInfo.md
|
||||
docs/RespPublicPoolsMetadata.md
|
||||
docs/RespSendTx.md
|
||||
docs/RespSendTxBatch.md
|
||||
docs/RespWithdrawalDelay.md
|
||||
docs/ResultCode.md
|
||||
docs/RiskInfo.md
|
||||
docs/RiskParameters.md
|
||||
docs/RootApi.md
|
||||
docs/SharePrice.md
|
||||
docs/SimpleOrder.md
|
||||
docs/Status.md
|
||||
docs/SubAccounts.md
|
||||
docs/Ticker.md
|
||||
docs/Trade.md
|
||||
docs/Trades.md
|
||||
docs/TransactionApi.md
|
||||
docs/TransferFeeInfo.md
|
||||
docs/TransferHistory.md
|
||||
docs/TransferHistoryItem.md
|
||||
docs/Tx.md
|
||||
docs/TxHash.md
|
||||
docs/TxHashes.md
|
||||
docs/Txs.md
|
||||
docs/ValidatorInfo.md
|
||||
docs/WithdrawHistory.md
|
||||
docs/WithdrawHistoryItem.md
|
||||
docs/ZkLighterInfo.md
|
||||
git_push.sh
|
||||
lighter/__init__.py
|
||||
lighter/api/__init__.py
|
||||
lighter/api/account_api.py
|
||||
lighter/api/announcement_api.py
|
||||
lighter/api/block_api.py
|
||||
lighter/api/bridge_api.py
|
||||
lighter/api/candlestick_api.py
|
||||
lighter/api/funding_api.py
|
||||
lighter/api/info_api.py
|
||||
lighter/api/notification_api.py
|
||||
lighter/api/order_api.py
|
||||
lighter/api/referral_api.py
|
||||
lighter/api/root_api.py
|
||||
lighter/api/transaction_api.py
|
||||
lighter/api_client.py
|
||||
lighter/api_response.py
|
||||
lighter/configuration.py
|
||||
lighter/exceptions.py
|
||||
lighter/models/__init__.py
|
||||
lighter/models/account.py
|
||||
lighter/models/account_api_keys.py
|
||||
lighter/models/account_limits.py
|
||||
lighter/models/account_margin_stats.py
|
||||
lighter/models/account_market_stats.py
|
||||
lighter/models/account_metadata.py
|
||||
lighter/models/account_metadatas.py
|
||||
lighter/models/account_pn_l.py
|
||||
lighter/models/account_position.py
|
||||
lighter/models/account_stats.py
|
||||
lighter/models/account_trade_stats.py
|
||||
lighter/models/announcement.py
|
||||
lighter/models/announcements.py
|
||||
lighter/models/api_key.py
|
||||
lighter/models/block.py
|
||||
lighter/models/blocks.py
|
||||
lighter/models/bridge_supported_network.py
|
||||
lighter/models/candlestick.py
|
||||
lighter/models/candlesticks.py
|
||||
lighter/models/contract_address.py
|
||||
lighter/models/current_height.py
|
||||
lighter/models/cursor.py
|
||||
lighter/models/daily_return.py
|
||||
lighter/models/deposit_history.py
|
||||
lighter/models/deposit_history_item.py
|
||||
lighter/models/detailed_account.py
|
||||
lighter/models/detailed_accounts.py
|
||||
lighter/models/detailed_candlestick.py
|
||||
lighter/models/enriched_tx.py
|
||||
lighter/models/exchange_stats.py
|
||||
lighter/models/export_data.py
|
||||
lighter/models/funding.py
|
||||
lighter/models/funding_rate.py
|
||||
lighter/models/funding_rates.py
|
||||
lighter/models/fundings.py
|
||||
lighter/models/l1_metadata.py
|
||||
lighter/models/l1_provider_info.py
|
||||
lighter/models/liq_trade.py
|
||||
lighter/models/liquidation.py
|
||||
lighter/models/liquidation_info.py
|
||||
lighter/models/liquidation_infos.py
|
||||
lighter/models/market_info.py
|
||||
lighter/models/next_nonce.py
|
||||
lighter/models/order.py
|
||||
lighter/models/order_book.py
|
||||
lighter/models/order_book_depth.py
|
||||
lighter/models/order_book_detail.py
|
||||
lighter/models/order_book_details.py
|
||||
lighter/models/order_book_orders.py
|
||||
lighter/models/order_book_stats.py
|
||||
lighter/models/order_books.py
|
||||
lighter/models/orders.py
|
||||
lighter/models/pn_l_entry.py
|
||||
lighter/models/position_funding.py
|
||||
lighter/models/position_fundings.py
|
||||
lighter/models/price_level.py
|
||||
lighter/models/public_pool.py
|
||||
lighter/models/public_pool_info.py
|
||||
lighter/models/public_pool_metadata.py
|
||||
lighter/models/public_pool_share.py
|
||||
lighter/models/public_pools.py
|
||||
lighter/models/referral_point_entry.py
|
||||
lighter/models/referral_points.py
|
||||
lighter/models/req_export_data.py
|
||||
lighter/models/req_get_account.py
|
||||
lighter/models/req_get_account_active_orders.py
|
||||
lighter/models/req_get_account_api_keys.py
|
||||
lighter/models/req_get_account_by_l1_address.py
|
||||
lighter/models/req_get_account_inactive_orders.py
|
||||
lighter/models/req_get_account_limits.py
|
||||
lighter/models/req_get_account_metadata.py
|
||||
lighter/models/req_get_account_pn_l.py
|
||||
lighter/models/req_get_account_txs.py
|
||||
lighter/models/req_get_block.py
|
||||
lighter/models/req_get_block_txs.py
|
||||
lighter/models/req_get_by_account.py
|
||||
lighter/models/req_get_candlesticks.py
|
||||
lighter/models/req_get_deposit_history.py
|
||||
lighter/models/req_get_fast_withdraw_info.py
|
||||
lighter/models/req_get_fundings.py
|
||||
lighter/models/req_get_l1_metadata.py
|
||||
lighter/models/req_get_l1_tx.py
|
||||
lighter/models/req_get_latest_deposit.py
|
||||
lighter/models/req_get_liquidation_infos.py
|
||||
lighter/models/req_get_next_nonce.py
|
||||
lighter/models/req_get_order_book_details.py
|
||||
lighter/models/req_get_order_book_orders.py
|
||||
lighter/models/req_get_order_books.py
|
||||
lighter/models/req_get_position_funding.py
|
||||
lighter/models/req_get_public_pools.py
|
||||
lighter/models/req_get_public_pools_metadata.py
|
||||
lighter/models/req_get_range_with_cursor.py
|
||||
lighter/models/req_get_range_with_index.py
|
||||
lighter/models/req_get_range_with_index_sortable.py
|
||||
lighter/models/req_get_recent_trades.py
|
||||
lighter/models/req_get_referral_points.py
|
||||
lighter/models/req_get_trades.py
|
||||
lighter/models/req_get_transfer_fee_info.py
|
||||
lighter/models/req_get_transfer_history.py
|
||||
lighter/models/req_get_tx.py
|
||||
lighter/models/req_get_withdraw_history.py
|
||||
lighter/models/resp_change_account_tier.py
|
||||
lighter/models/resp_get_fast_bridge_info.py
|
||||
lighter/models/resp_public_pools_metadata.py
|
||||
lighter/models/resp_send_tx.py
|
||||
lighter/models/resp_send_tx_batch.py
|
||||
lighter/models/resp_withdrawal_delay.py
|
||||
lighter/models/result_code.py
|
||||
lighter/models/risk_info.py
|
||||
lighter/models/risk_parameters.py
|
||||
lighter/models/share_price.py
|
||||
lighter/models/simple_order.py
|
||||
lighter/models/status.py
|
||||
lighter/models/sub_accounts.py
|
||||
lighter/models/ticker.py
|
||||
lighter/models/trade.py
|
||||
lighter/models/trades.py
|
||||
lighter/models/transfer_fee_info.py
|
||||
lighter/models/transfer_history.py
|
||||
lighter/models/transfer_history_item.py
|
||||
lighter/models/tx.py
|
||||
lighter/models/tx_hash.py
|
||||
lighter/models/tx_hashes.py
|
||||
lighter/models/txs.py
|
||||
lighter/models/validator_info.py
|
||||
lighter/models/withdraw_history.py
|
||||
lighter/models/withdraw_history_item.py
|
||||
lighter/models/zk_lighter_info.py
|
||||
lighter/py.typed
|
||||
lighter/rest.py
|
||||
setup.cfg
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
tox.ini
|
||||
@@ -0,0 +1 @@
|
||||
7.7.0
|
||||
@@ -0,0 +1,16 @@
|
||||
# ref: https://docs.travis-ci.com/user/languages/python
|
||||
language: python
|
||||
python:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
# uncomment the following if needed
|
||||
#- "3.11-dev" # 3.11 development branch
|
||||
#- "nightly" # nightly build
|
||||
# command to install dependencies
|
||||
install:
|
||||
- "pip install -r requirements.txt"
|
||||
- "pip install -r test-requirements.txt"
|
||||
# command to run tests
|
||||
script: pytest --cov=lighter
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,198 @@
|
||||
# Lighter Python
|
||||
|
||||
Python SDK for Lighter
|
||||
|
||||
## Requirements.
|
||||
|
||||
Python 3.8+
|
||||
|
||||
## Installation & Usage
|
||||
### pip install
|
||||
|
||||
If the python package is hosted on a repository, you can install directly using:
|
||||
|
||||
```sh
|
||||
pip install git+https://github.com/elliottech/lighter-python.git
|
||||
```
|
||||
|
||||
|
||||
Then import the package:
|
||||
```python
|
||||
import lighter
|
||||
```
|
||||
|
||||
### Tests
|
||||
|
||||
Execute `pytest` to run the tests.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```python
|
||||
|
||||
import lighter
|
||||
import asyncio
|
||||
|
||||
async def main():
|
||||
client = lighter.ApiClient()
|
||||
account_api = lighter.AccountApi(client)
|
||||
account = await account_api.get_account(by="index", value="1")
|
||||
print(account)
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
|
||||
```
|
||||
|
||||
# Examples
|
||||
## [Read API Functions](examples/get_info.py)
|
||||
```sh
|
||||
python examples/get_info.py
|
||||
```
|
||||
|
||||
## [Websocket Sync Order Books & Accounts](examples/ws.py)
|
||||
```sh
|
||||
python examples/ws.py
|
||||
```
|
||||
|
||||
## [Create & Cancel Orders](examples/create_cancel_order.py)
|
||||
```sh
|
||||
python examples/create_cancel_order.py
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AccountApi* | [**account**](docs/AccountApi.md#account) | **GET** /api/v1/account | account
|
||||
*AccountApi* | [**accounts_by_l1_address**](docs/AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address
|
||||
*AccountApi* | [**apikeys**](docs/AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys
|
||||
*AccountApi* | [**pnl**](docs/AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl
|
||||
*AccountApi* | [**public_pools**](docs/AccountApi.md#public_pools) | **GET** /api/v1/publicPools | publicPools
|
||||
*BlockApi* | [**block**](docs/BlockApi.md#block) | **GET** /api/v1/block | block
|
||||
*BlockApi* | [**blocks**](docs/BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks
|
||||
*BlockApi* | [**current_height**](docs/BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight
|
||||
*CandlestickApi* | [**candlesticks**](docs/CandlestickApi.md#candlesticks) | **GET** /api/v1/candlesticks | candlesticks
|
||||
*CandlestickApi* | [**fundings**](docs/CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings
|
||||
*OrderApi* | [**account_inactive_orders**](docs/OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders
|
||||
*OrderApi* | [**exchange_stats**](docs/OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats
|
||||
*OrderApi* | [**order_book_details**](docs/OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails
|
||||
*OrderApi* | [**order_book_orders**](docs/OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders
|
||||
*OrderApi* | [**order_books**](docs/OrderApi.md#order_books) | **GET** /api/v1/orderBooks | orderBooks
|
||||
*OrderApi* | [**recent_trades**](docs/OrderApi.md#recent_trades) | **GET** /api/v1/recentTrades | recentTrades
|
||||
*OrderApi* | [**trades**](docs/OrderApi.md#trades) | **GET** /api/v1/trades | trades
|
||||
*RootApi* | [**info**](docs/RootApi.md#info) | **GET** /info | info
|
||||
*RootApi* | [**status**](docs/RootApi.md#status) | **GET** / | status
|
||||
*TransactionApi* | [**account_txs**](docs/TransactionApi.md#account_txs) | **GET** /api/v1/accountTxs | accountTxs
|
||||
*TransactionApi* | [**block_txs**](docs/TransactionApi.md#block_txs) | **GET** /api/v1/blockTxs | blockTxs
|
||||
*TransactionApi* | [**deposit_history**](docs/TransactionApi.md#deposit_history) | **GET** /api/v1/deposit/history | deposit_history
|
||||
*TransactionApi* | [**next_nonce**](docs/TransactionApi.md#next_nonce) | **GET** /api/v1/nextNonce | nextNonce
|
||||
*TransactionApi* | [**send_tx**](docs/TransactionApi.md#send_tx) | **POST** /api/v1/sendTx | sendTx
|
||||
*TransactionApi* | [**send_tx_batch**](docs/TransactionApi.md#send_tx_batch) | **POST** /api/v1/sendTxBatch | sendTxBatch
|
||||
*TransactionApi* | [**tx**](docs/TransactionApi.md#tx) | **GET** /api/v1/tx | tx
|
||||
*TransactionApi* | [**tx_from_l1_tx_hash**](docs/TransactionApi.md#tx_from_l1_tx_hash) | **GET** /api/v1/txFromL1TxHash | txFromL1TxHash
|
||||
*TransactionApi* | [**txs**](docs/TransactionApi.md#txs) | **GET** /api/v1/txs | txs
|
||||
*TransactionApi* | [**withdraw_history**](docs/TransactionApi.md#withdraw_history) | **GET** /api/v1/withdraw/history | withdraw_history
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [Account](docs/Account.md)
|
||||
- [AccountApiKeys](docs/AccountApiKeys.md)
|
||||
- [AccountMarketStats](docs/AccountMarketStats.md)
|
||||
- [AccountMetadata](docs/AccountMetadata.md)
|
||||
- [AccountPnL](docs/AccountPnL.md)
|
||||
- [AccountPosition](docs/AccountPosition.md)
|
||||
- [AccountStats](docs/AccountStats.md)
|
||||
- [ApiKey](docs/ApiKey.md)
|
||||
- [Block](docs/Block.md)
|
||||
- [Blocks](docs/Blocks.md)
|
||||
- [BridgeSupportedNetwork](docs/BridgeSupportedNetwork.md)
|
||||
- [Candlestick](docs/Candlestick.md)
|
||||
- [Candlesticks](docs/Candlesticks.md)
|
||||
- [ContractAddress](docs/ContractAddress.md)
|
||||
- [CurrentHeight](docs/CurrentHeight.md)
|
||||
- [Cursor](docs/Cursor.md)
|
||||
- [DepositHistory](docs/DepositHistory.md)
|
||||
- [DepositHistoryItem](docs/DepositHistoryItem.md)
|
||||
- [DetailedAccount](docs/DetailedAccount.md)
|
||||
- [DetailedAccounts](docs/DetailedAccounts.md)
|
||||
- [DetailedCandlestick](docs/DetailedCandlestick.md)
|
||||
- [EnrichedTx](docs/EnrichedTx.md)
|
||||
- [ExchangeStats](docs/ExchangeStats.md)
|
||||
- [Funding](docs/Funding.md)
|
||||
- [Fundings](docs/Fundings.md)
|
||||
- [L1ProviderInfo](docs/L1ProviderInfo.md)
|
||||
- [Liquidation](docs/Liquidation.md)
|
||||
- [MarketInfo](docs/MarketInfo.md)
|
||||
- [NextNonce](docs/NextNonce.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [OrderBook](docs/OrderBook.md)
|
||||
- [OrderBookDepth](docs/OrderBookDepth.md)
|
||||
- [OrderBookDetail](docs/OrderBookDetail.md)
|
||||
- [OrderBookDetails](docs/OrderBookDetails.md)
|
||||
- [OrderBookOrders](docs/OrderBookOrders.md)
|
||||
- [OrderBookStats](docs/OrderBookStats.md)
|
||||
- [OrderBooks](docs/OrderBooks.md)
|
||||
- [Orders](docs/Orders.md)
|
||||
- [PnLEntry](docs/PnLEntry.md)
|
||||
- [PositionFunding](docs/PositionFunding.md)
|
||||
- [PriceLevel](docs/PriceLevel.md)
|
||||
- [PublicPool](docs/PublicPool.md)
|
||||
- [PublicPoolInfo](docs/PublicPoolInfo.md)
|
||||
- [PublicPoolShare](docs/PublicPoolShare.md)
|
||||
- [PublicPools](docs/PublicPools.md)
|
||||
- [ReqGetAccount](docs/ReqGetAccount.md)
|
||||
- [ReqGetAccountApiKeys](docs/ReqGetAccountApiKeys.md)
|
||||
- [ReqGetAccountByL1Address](docs/ReqGetAccountByL1Address.md)
|
||||
- [ReqGetAccountInactiveOrders](docs/ReqGetAccountInactiveOrders.md)
|
||||
- [ReqGetAccountPnL](docs/ReqGetAccountPnL.md)
|
||||
- [ReqGetAccountTxs](docs/ReqGetAccountTxs.md)
|
||||
- [ReqGetBlock](docs/ReqGetBlock.md)
|
||||
- [ReqGetBlockTxs](docs/ReqGetBlockTxs.md)
|
||||
- [ReqGetByAccount](docs/ReqGetByAccount.md)
|
||||
- [ReqGetCandlesticks](docs/ReqGetCandlesticks.md)
|
||||
- [ReqGetDepositHistory](docs/ReqGetDepositHistory.md)
|
||||
- [ReqGetFundings](docs/ReqGetFundings.md)
|
||||
- [ReqGetL1Tx](docs/ReqGetL1Tx.md)
|
||||
- [ReqGetLatestDeposit](docs/ReqGetLatestDeposit.md)
|
||||
- [ReqGetNextNonce](docs/ReqGetNextNonce.md)
|
||||
- [ReqGetOrderBookDetails](docs/ReqGetOrderBookDetails.md)
|
||||
- [ReqGetOrderBookOrders](docs/ReqGetOrderBookOrders.md)
|
||||
- [ReqGetOrderBooks](docs/ReqGetOrderBooks.md)
|
||||
- [ReqGetPublicPools](docs/ReqGetPublicPools.md)
|
||||
- [ReqGetRangeWithCursor](docs/ReqGetRangeWithCursor.md)
|
||||
- [ReqGetRangeWithIndex](docs/ReqGetRangeWithIndex.md)
|
||||
- [ReqGetRangeWithIndexSortable](docs/ReqGetRangeWithIndexSortable.md)
|
||||
- [ReqGetRecentTrades](docs/ReqGetRecentTrades.md)
|
||||
- [ReqGetTrades](docs/ReqGetTrades.md)
|
||||
- [ReqGetTx](docs/ReqGetTx.md)
|
||||
- [ReqGetWithdrawHistory](docs/ReqGetWithdrawHistory.md)
|
||||
- [ResultCode](docs/ResultCode.md)
|
||||
- [SimpleOrder](docs/SimpleOrder.md)
|
||||
- [Status](docs/Status.md)
|
||||
- [SubAccounts](docs/SubAccounts.md)
|
||||
- [Ticker](docs/Ticker.md)
|
||||
- [Trade](docs/Trade.md)
|
||||
- [Trades](docs/Trades.md)
|
||||
- [Tx](docs/Tx.md)
|
||||
- [TxHash](docs/TxHash.md)
|
||||
- [TxHashes](docs/TxHashes.md)
|
||||
- [Txs](docs/Txs.md)
|
||||
- [ValidatorInfo](docs/ValidatorInfo.md)
|
||||
- [WithdrawHistory](docs/WithdrawHistory.md)
|
||||
- [WithdrawHistoryItem](docs/WithdrawHistoryItem.md)
|
||||
- [ZkLighterInfo](docs/ZkLighterInfo.md)
|
||||
|
||||
|
||||
[//]: # (<a id="documentation-for-authorization"></a>)
|
||||
|
||||
[//]: # (## Documentation For Authorization)
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (Endpoints do not require authorization.)
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
disallowAdditionalPropertiesIfNotPresent: false
|
||||
library: asyncio
|
||||
packageName: lighter-sdk
|
||||
projectName: lighter-sdk
|
||||
@@ -0,0 +1,40 @@
|
||||
# Account
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**account_type** | **int** | |
|
||||
**index** | **int** | |
|
||||
**l1_address** | **str** | |
|
||||
**cancel_all_time** | **int** | |
|
||||
**total_order_count** | **int** | |
|
||||
**total_isolated_order_count** | **int** | |
|
||||
**pending_order_count** | **int** | |
|
||||
**available_balance** | **str** | |
|
||||
**status** | **int** | |
|
||||
**collateral** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account import Account
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Account from a JSON string
|
||||
account_instance = Account.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Account.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_dict = account_instance.to_dict()
|
||||
# create an instance of Account from a dict
|
||||
account_from_dict = Account.from_dict(account_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,930 @@
|
||||
# lighter.AccountApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**account**](AccountApi.md#account) | **GET** /api/v1/account | account
|
||||
[**account_limits**](AccountApi.md#account_limits) | **GET** /api/v1/accountLimits | accountLimits
|
||||
[**account_metadata**](AccountApi.md#account_metadata) | **GET** /api/v1/accountMetadata | accountMetadata
|
||||
[**accounts_by_l1_address**](AccountApi.md#accounts_by_l1_address) | **GET** /api/v1/accountsByL1Address | accountsByL1Address
|
||||
[**apikeys**](AccountApi.md#apikeys) | **GET** /api/v1/apikeys | apikeys
|
||||
[**change_account_tier**](AccountApi.md#change_account_tier) | **POST** /api/v1/changeAccountTier | changeAccountTier
|
||||
[**l1_metadata**](AccountApi.md#l1_metadata) | **GET** /api/v1/l1Metadata | l1Metadata
|
||||
[**liquidations**](AccountApi.md#liquidations) | **GET** /api/v1/liquidations | liquidations
|
||||
[**pnl**](AccountApi.md#pnl) | **GET** /api/v1/pnl | pnl
|
||||
[**position_funding**](AccountApi.md#position_funding) | **GET** /api/v1/positionFunding | positionFunding
|
||||
[**public_pools**](AccountApi.md#public_pools) | **GET** /api/v1/publicPools | publicPools
|
||||
[**public_pools_metadata**](AccountApi.md#public_pools_metadata) | **GET** /api/v1/publicPoolsMetadata | publicPoolsMetadata
|
||||
|
||||
|
||||
# **account**
|
||||
> DetailedAccounts account(by, value)
|
||||
|
||||
account
|
||||
|
||||
Get account by account's index. <br>More details about account index: [Account Index](https://apidocs.lighter.xyz/docs/account-index)<hr>**Response Description:**<br><br>1) **Status:** 1 is active 0 is inactive.<br>2) **Collateral:** The amount of collateral in the account.<hr>**Position Details Description:**<br>1) **OOC:** Open order count in that market.<br>2) **Sign:** 1 for Long, -1 for Short.<br>3) **Position:** The amount of position in that market.<br>4) **Avg Entry Price:** The average entry price of the position.<br>5) **Position Value:** The value of the position.<br>6) **Unrealized PnL:** The unrealized profit and loss of the position.<br>7) **Realized PnL:** The realized profit and loss of the position.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.detailed_accounts import DetailedAccounts
|
||||
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.AccountApi(api_client)
|
||||
by = 'by_example' # str |
|
||||
value = 'value_example' # str |
|
||||
|
||||
try:
|
||||
# account
|
||||
api_response = await api_instance.account(by, value)
|
||||
print("The response of AccountApi->account:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->account: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**by** | **str**| |
|
||||
**value** | **str**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**DetailedAccounts**](DetailedAccounts.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **account_limits**
|
||||
> AccountLimits account_limits(account_index, authorization=authorization, auth=auth)
|
||||
|
||||
accountLimits
|
||||
|
||||
Get account limits
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.account_limits import AccountLimits
|
||||
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.AccountApi(api_client)
|
||||
account_index = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# accountLimits
|
||||
api_response = await api_instance.account_limits(account_index, authorization=authorization, auth=auth)
|
||||
print("The response of AccountApi->account_limits:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->account_limits: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**AccountLimits**](AccountLimits.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **account_metadata**
|
||||
> AccountMetadatas account_metadata(by, value, authorization=authorization, auth=auth)
|
||||
|
||||
accountMetadata
|
||||
|
||||
Get account metadatas
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.account_metadatas import AccountMetadatas
|
||||
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.AccountApi(api_client)
|
||||
by = 'by_example' # str |
|
||||
value = 'value_example' # str |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
|
||||
try:
|
||||
# accountMetadata
|
||||
api_response = await api_instance.account_metadata(by, value, authorization=authorization, auth=auth)
|
||||
print("The response of AccountApi->account_metadata:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->account_metadata: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**by** | **str**| |
|
||||
**value** | **str**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**AccountMetadatas**](AccountMetadatas.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **accounts_by_l1_address**
|
||||
> SubAccounts accounts_by_l1_address(l1_address)
|
||||
|
||||
accountsByL1Address
|
||||
|
||||
Get accounts by l1_address returns all accounts associated with the given L1 address
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.sub_accounts import SubAccounts
|
||||
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.AccountApi(api_client)
|
||||
l1_address = 'l1_address_example' # str |
|
||||
|
||||
try:
|
||||
# accountsByL1Address
|
||||
api_response = await api_instance.accounts_by_l1_address(l1_address)
|
||||
print("The response of AccountApi->accounts_by_l1_address:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->accounts_by_l1_address: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**l1_address** | **str**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**SubAccounts**](SubAccounts.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **apikeys**
|
||||
> AccountApiKeys apikeys(account_index, api_key_index=api_key_index)
|
||||
|
||||
apikeys
|
||||
|
||||
Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.account_api_keys import AccountApiKeys
|
||||
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.AccountApi(api_client)
|
||||
account_index = 56 # int |
|
||||
api_key_index = 255 # int | (optional) (default to 255)
|
||||
|
||||
try:
|
||||
# apikeys
|
||||
api_response = await api_instance.apikeys(account_index, api_key_index=api_key_index)
|
||||
print("The response of AccountApi->apikeys:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->apikeys: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**api_key_index** | **int**| | [optional] [default to 255]
|
||||
|
||||
### Return type
|
||||
|
||||
[**AccountApiKeys**](AccountApiKeys.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **change_account_tier**
|
||||
> RespChangeAccountTier change_account_tier(account_index, new_tier, authorization=authorization, auth=auth)
|
||||
|
||||
changeAccountTier
|
||||
|
||||
Change account tier
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.resp_change_account_tier import RespChangeAccountTier
|
||||
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.AccountApi(api_client)
|
||||
account_index = 56 # int |
|
||||
new_tier = 'new_tier_example' # str |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# changeAccountTier
|
||||
api_response = await api_instance.change_account_tier(account_index, new_tier, authorization=authorization, auth=auth)
|
||||
print("The response of AccountApi->change_account_tier:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->change_account_tier: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**new_tier** | **str**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**RespChangeAccountTier**](RespChangeAccountTier.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **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)
|
||||
|
||||
# **l1_metadata**
|
||||
> L1Metadata l1_metadata(l1_address, authorization=authorization, auth=auth)
|
||||
|
||||
l1Metadata
|
||||
|
||||
Get L1 metadata
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.l1_metadata import L1Metadata
|
||||
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.AccountApi(api_client)
|
||||
l1_address = 'l1_address_example' # str |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# l1Metadata
|
||||
api_response = await api_instance.l1_metadata(l1_address, authorization=authorization, auth=auth)
|
||||
print("The response of AccountApi->l1_metadata:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->l1_metadata: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**l1_address** | **str**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**L1Metadata**](L1Metadata.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **liquidations**
|
||||
> LiquidationInfos liquidations(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor)
|
||||
|
||||
liquidations
|
||||
|
||||
Get liquidation infos
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.liquidation_infos import LiquidationInfos
|
||||
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.AccountApi(api_client)
|
||||
account_index = 56 # int |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
cursor = 'cursor_example' # str | (optional)
|
||||
|
||||
try:
|
||||
# liquidations
|
||||
api_response = await api_instance.liquidations(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor)
|
||||
print("The response of AccountApi->liquidations:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->liquidations: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
**cursor** | **str**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**LiquidationInfos**](LiquidationInfos.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **pnl**
|
||||
> AccountPnL pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, auth=auth, ignore_transfers=ignore_transfers)
|
||||
|
||||
pnl
|
||||
|
||||
Get account PnL chart
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.account_pn_l import AccountPnL
|
||||
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.AccountApi(api_client)
|
||||
by = 'by_example' # str |
|
||||
value = 'value_example' # str |
|
||||
resolution = 'resolution_example' # str |
|
||||
start_timestamp = 56 # int |
|
||||
end_timestamp = 56 # int |
|
||||
count_back = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
ignore_transfers = False # bool | (optional) (default to False)
|
||||
|
||||
try:
|
||||
# pnl
|
||||
api_response = await api_instance.pnl(by, value, resolution, start_timestamp, end_timestamp, count_back, authorization=authorization, auth=auth, ignore_transfers=ignore_transfers)
|
||||
print("The response of AccountApi->pnl:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->pnl: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**by** | **str**| |
|
||||
**value** | **str**| |
|
||||
**resolution** | **str**| |
|
||||
**start_timestamp** | **int**| |
|
||||
**end_timestamp** | **int**| |
|
||||
**count_back** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**ignore_transfers** | **bool**| | [optional] [default to False]
|
||||
|
||||
### Return type
|
||||
|
||||
[**AccountPnL**](AccountPnL.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **position_funding**
|
||||
> PositionFundings position_funding(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor, side=side)
|
||||
|
||||
positionFunding
|
||||
|
||||
Get accounts position fundings
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.position_fundings import PositionFundings
|
||||
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.AccountApi(api_client)
|
||||
account_index = 56 # int |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
cursor = 'cursor_example' # str | (optional)
|
||||
side = all # str | (optional) (default to all)
|
||||
|
||||
try:
|
||||
# positionFunding
|
||||
api_response = await api_instance.position_funding(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, cursor=cursor, side=side)
|
||||
print("The response of AccountApi->position_funding:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->position_funding: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
**cursor** | **str**| | [optional]
|
||||
**side** | **str**| | [optional] [default to all]
|
||||
|
||||
### Return type
|
||||
|
||||
[**PositionFundings**](PositionFundings.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **public_pools**
|
||||
> PublicPools public_pools(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
|
||||
|
||||
publicPools
|
||||
|
||||
Get public pools
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.public_pools import PublicPools
|
||||
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.AccountApi(api_client)
|
||||
index = 56 # int |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
filter = 'filter_example' # str | (optional)
|
||||
account_index = 56 # int | (optional)
|
||||
|
||||
try:
|
||||
# publicPools
|
||||
api_response = await api_instance.public_pools(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
|
||||
print("The response of AccountApi->public_pools:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->public_pools: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**index** | **int**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**filter** | **str**| | [optional]
|
||||
**account_index** | **int**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**PublicPools**](PublicPools.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **public_pools_metadata**
|
||||
> RespPublicPoolsMetadata public_pools_metadata(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
|
||||
|
||||
publicPoolsMetadata
|
||||
|
||||
Get public pools metadata
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.resp_public_pools_metadata import RespPublicPoolsMetadata
|
||||
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.AccountApi(api_client)
|
||||
index = 56 # int |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
filter = 'filter_example' # str | (optional)
|
||||
account_index = 56 # int | (optional)
|
||||
|
||||
try:
|
||||
# publicPoolsMetadata
|
||||
api_response = await api_instance.public_pools_metadata(index, limit, authorization=authorization, auth=auth, filter=filter, account_index=account_index)
|
||||
print("The response of AccountApi->public_pools_metadata:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AccountApi->public_pools_metadata: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**index** | **int**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**filter** | **str**| | [optional]
|
||||
**account_index** | **int**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**RespPublicPoolsMetadata**](RespPublicPoolsMetadata.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# AccountApiKeys
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**api_keys** | [**List[ApiKey]**](ApiKey.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_api_keys import AccountApiKeys
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountApiKeys from a JSON string
|
||||
account_api_keys_instance = AccountApiKeys.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountApiKeys.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_api_keys_dict = account_api_keys_instance.to_dict()
|
||||
# create an instance of AccountApiKeys from a dict
|
||||
account_api_keys_from_dict = AccountApiKeys.from_dict(account_api_keys_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# AccountLimits
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**max_llp_percentage** | **int** | |
|
||||
**user_tier** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_limits import AccountLimits
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountLimits from a JSON string
|
||||
account_limits_instance = AccountLimits.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountLimits.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_limits_dict = account_limits_instance.to_dict()
|
||||
# create an instance of AccountLimits from a dict
|
||||
account_limits_from_dict = AccountLimits.from_dict(account_limits_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# AccountMarginStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**collateral** | **str** | |
|
||||
**portfolio_value** | **str** | |
|
||||
**leverage** | **str** | |
|
||||
**available_balance** | **str** | |
|
||||
**margin_usage** | **str** | |
|
||||
**buying_power** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_margin_stats import AccountMarginStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountMarginStats from a JSON string
|
||||
account_margin_stats_instance = AccountMarginStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountMarginStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_margin_stats_dict = account_margin_stats_instance.to_dict()
|
||||
# create an instance of AccountMarginStats from a dict
|
||||
account_margin_stats_from_dict = AccountMarginStats.from_dict(account_margin_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# AccountMarketStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**market_id** | **int** | |
|
||||
**daily_trades_count** | **int** | |
|
||||
**daily_base_token_volume** | **float** | |
|
||||
**daily_quote_token_volume** | **float** | |
|
||||
**weekly_trades_count** | **int** | |
|
||||
**weekly_base_token_volume** | **float** | |
|
||||
**weekly_quote_token_volume** | **float** | |
|
||||
**monthly_trades_count** | **int** | |
|
||||
**monthly_base_token_volume** | **float** | |
|
||||
**monthly_quote_token_volume** | **float** | |
|
||||
**total_trades_count** | **int** | |
|
||||
**total_base_token_volume** | **float** | |
|
||||
**total_quote_token_volume** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_market_stats import AccountMarketStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountMarketStats from a JSON string
|
||||
account_market_stats_instance = AccountMarketStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountMarketStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_market_stats_dict = account_market_stats_instance.to_dict()
|
||||
# create an instance of AccountMarketStats from a dict
|
||||
account_market_stats_from_dict = AccountMarketStats.from_dict(account_market_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# AccountMetadata
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**name** | **str** | |
|
||||
**description** | **str** | |
|
||||
**can_invite** | **bool** | Remove After FE uses L1 meta endpoint |
|
||||
**referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_metadata import AccountMetadata
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountMetadata from a JSON string
|
||||
account_metadata_instance = AccountMetadata.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountMetadata.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_metadata_dict = account_metadata_instance.to_dict()
|
||||
# create an instance of AccountMetadata from a dict
|
||||
account_metadata_from_dict = AccountMetadata.from_dict(account_metadata_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# AccountMetadatas
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**account_metadatas** | [**List[AccountMetadata]**](AccountMetadata.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_metadatas import AccountMetadatas
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountMetadatas from a JSON string
|
||||
account_metadatas_instance = AccountMetadatas.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountMetadatas.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_metadatas_dict = account_metadatas_instance.to_dict()
|
||||
# create an instance of AccountMetadatas from a dict
|
||||
account_metadatas_from_dict = AccountMetadatas.from_dict(account_metadatas_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# AccountPnL
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**resolution** | **str** | |
|
||||
**pnl** | [**List[PnLEntry]**](PnLEntry.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_pn_l import AccountPnL
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountPnL from a JSON string
|
||||
account_pn_l_instance = AccountPnL.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountPnL.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_pn_l_dict = account_pn_l_instance.to_dict()
|
||||
# create an instance of AccountPnL from a dict
|
||||
account_pn_l_from_dict = AccountPnL.from_dict(account_pn_l_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
# AccountPosition
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**market_id** | **int** | |
|
||||
**symbol** | **str** | |
|
||||
**initial_margin_fraction** | **str** | |
|
||||
**open_order_count** | **int** | |
|
||||
**pending_order_count** | **int** | |
|
||||
**position_tied_order_count** | **int** | |
|
||||
**sign** | **int** | |
|
||||
**position** | **str** | |
|
||||
**avg_entry_price** | **str** | |
|
||||
**position_value** | **str** | |
|
||||
**unrealized_pnl** | **str** | |
|
||||
**realized_pnl** | **str** | |
|
||||
**liquidation_price** | **str** | |
|
||||
**total_funding_paid_out** | **str** | | [optional]
|
||||
**margin_mode** | **int** | |
|
||||
**allocated_margin** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_position import AccountPosition
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountPosition from a JSON string
|
||||
account_position_instance = AccountPosition.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountPosition.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_position_dict = account_position_instance.to_dict()
|
||||
# create an instance of AccountPosition from a dict
|
||||
account_position_from_dict = AccountPosition.from_dict(account_position_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# AccountStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**collateral** | **str** | |
|
||||
**portfolio_value** | **str** | |
|
||||
**leverage** | **str** | |
|
||||
**available_balance** | **str** | |
|
||||
**margin_usage** | **str** | |
|
||||
**buying_power** | **str** | |
|
||||
**cross_stats** | [**AccountMarginStats**](AccountMarginStats.md) | |
|
||||
**total_stats** | [**AccountMarginStats**](AccountMarginStats.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_stats import AccountStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountStats from a JSON string
|
||||
account_stats_instance = AccountStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_stats_dict = account_stats_instance.to_dict()
|
||||
# create an instance of AccountStats from a dict
|
||||
account_stats_from_dict = AccountStats.from_dict(account_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# AccountTradeStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**daily_trades_count** | **int** | |
|
||||
**daily_volume** | **float** | |
|
||||
**weekly_trades_count** | **int** | |
|
||||
**weekly_volume** | **float** | |
|
||||
**monthly_trades_count** | **int** | |
|
||||
**monthly_volume** | **float** | |
|
||||
**total_trades_count** | **int** | |
|
||||
**total_volume** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.account_trade_stats import AccountTradeStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AccountTradeStats from a JSON string
|
||||
account_trade_stats_instance = AccountTradeStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AccountTradeStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
account_trade_stats_dict = account_trade_stats_instance.to_dict()
|
||||
# create an instance of AccountTradeStats from a dict
|
||||
account_trade_stats_from_dict = AccountTradeStats.from_dict(account_trade_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Announcement
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**title** | **str** | |
|
||||
**content** | **str** | |
|
||||
**created_at** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.announcement import Announcement
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Announcement from a JSON string
|
||||
announcement_instance = Announcement.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Announcement.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
announcement_dict = announcement_instance.to_dict()
|
||||
# create an instance of Announcement from a dict
|
||||
announcement_from_dict = Announcement.from_dict(announcement_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# lighter.AnnouncementApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**announcement**](AnnouncementApi.md#announcement) | **GET** /api/v1/announcement | announcement
|
||||
|
||||
|
||||
# **announcement**
|
||||
> Announcements announcement()
|
||||
|
||||
announcement
|
||||
|
||||
Get announcement
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.announcements import Announcements
|
||||
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.AnnouncementApi(api_client)
|
||||
|
||||
try:
|
||||
# announcement
|
||||
api_response = await api_instance.announcement()
|
||||
print("The response of AnnouncementApi->announcement:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AnnouncementApi->announcement: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Announcements**](Announcements.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Announcements
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**announcements** | [**List[Announcement]**](Announcement.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.announcements import Announcements
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Announcements from a JSON string
|
||||
announcements_instance = Announcements.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Announcements.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
announcements_dict = announcements_instance.to_dict()
|
||||
# create an instance of Announcements from a dict
|
||||
announcements_from_dict = Announcements.from_dict(announcements_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# ApiKey
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**api_key_index** | **int** | |
|
||||
**nonce** | **int** | |
|
||||
**public_key** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.api_key import ApiKey
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ApiKey from a JSON string
|
||||
api_key_instance = ApiKey.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ApiKey.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
api_key_dict = api_key_instance.to_dict()
|
||||
# create an instance of ApiKey from a dict
|
||||
api_key_from_dict = ApiKey.from_dict(api_key_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Block
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**commitment** | **str** | |
|
||||
**height** | **int** | |
|
||||
**state_root** | **str** | |
|
||||
**priority_operations** | **int** | |
|
||||
**on_chain_l2_operations** | **int** | |
|
||||
**pending_on_chain_operations_pub_data** | **str** | |
|
||||
**committed_tx_hash** | **str** | |
|
||||
**committed_at** | **int** | |
|
||||
**verified_tx_hash** | **str** | |
|
||||
**verified_at** | **int** | |
|
||||
**txs** | [**List[Tx]**](Tx.md) | |
|
||||
**status** | **int** | |
|
||||
**size** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.block import Block
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Block from a JSON string
|
||||
block_instance = Block.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Block.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
block_dict = block_instance.to_dict()
|
||||
# create an instance of Block from a dict
|
||||
block_from_dict = Block.from_dict(block_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
# lighter.BlockApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**block**](BlockApi.md#block) | **GET** /api/v1/block | block
|
||||
[**blocks**](BlockApi.md#blocks) | **GET** /api/v1/blocks | blocks
|
||||
[**current_height**](BlockApi.md#current_height) | **GET** /api/v1/currentHeight | currentHeight
|
||||
|
||||
|
||||
# **block**
|
||||
> Blocks block(by, value)
|
||||
|
||||
block
|
||||
|
||||
Get block by its height or commitment
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.blocks import Blocks
|
||||
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.BlockApi(api_client)
|
||||
by = 'by_example' # str |
|
||||
value = 'value_example' # str |
|
||||
|
||||
try:
|
||||
# block
|
||||
api_response = await api_instance.block(by, value)
|
||||
print("The response of BlockApi->block:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling BlockApi->block: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**by** | **str**| |
|
||||
**value** | **str**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Blocks**](Blocks.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **blocks**
|
||||
> Blocks blocks(limit, index=index, sort=sort)
|
||||
|
||||
blocks
|
||||
|
||||
Get blocks
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.blocks import Blocks
|
||||
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.BlockApi(api_client)
|
||||
limit = 56 # int |
|
||||
index = 56 # int | (optional)
|
||||
sort = asc # str | (optional) (default to asc)
|
||||
|
||||
try:
|
||||
# blocks
|
||||
api_response = await api_instance.blocks(limit, index=index, sort=sort)
|
||||
print("The response of BlockApi->blocks:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling BlockApi->blocks: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**limit** | **int**| |
|
||||
**index** | **int**| | [optional]
|
||||
**sort** | **str**| | [optional] [default to asc]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Blocks**](Blocks.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **current_height**
|
||||
> CurrentHeight current_height()
|
||||
|
||||
currentHeight
|
||||
|
||||
Get current height
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.current_height import CurrentHeight
|
||||
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.BlockApi(api_client)
|
||||
|
||||
try:
|
||||
# currentHeight
|
||||
api_response = await api_instance.current_height()
|
||||
print("The response of BlockApi->current_height:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling BlockApi->current_height: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**CurrentHeight**](CurrentHeight.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Blocks
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**total** | **int** | |
|
||||
**blocks** | [**List[Block]**](Block.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.blocks import Blocks
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Blocks from a JSON string
|
||||
blocks_instance = Blocks.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Blocks.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
blocks_dict = blocks_instance.to_dict()
|
||||
# create an instance of Blocks from a dict
|
||||
blocks_from_dict = Blocks.from_dict(blocks_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# lighter.BridgeApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**fastbridge_info**](BridgeApi.md#fastbridge_info) | **GET** /api/v1/fastbridge/info | fastbridge_info
|
||||
|
||||
|
||||
# **fastbridge_info**
|
||||
> RespGetFastBridgeInfo fastbridge_info()
|
||||
|
||||
fastbridge_info
|
||||
|
||||
Get fast bridge info
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.resp_get_fast_bridge_info import RespGetFastBridgeInfo
|
||||
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.BridgeApi(api_client)
|
||||
|
||||
try:
|
||||
# fastbridge_info
|
||||
api_response = await api_instance.fastbridge_info()
|
||||
print("The response of BridgeApi->fastbridge_info:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling BridgeApi->fastbridge_info: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**RespGetFastBridgeInfo**](RespGetFastBridgeInfo.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# BridgeSupportedNetwork
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | |
|
||||
**chain_id** | **str** | |
|
||||
**explorer** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.bridge_supported_network import BridgeSupportedNetwork
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of BridgeSupportedNetwork from a JSON string
|
||||
bridge_supported_network_instance = BridgeSupportedNetwork.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(BridgeSupportedNetwork.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
bridge_supported_network_dict = bridge_supported_network_instance.to_dict()
|
||||
# create an instance of BridgeSupportedNetwork from a dict
|
||||
bridge_supported_network_from_dict = BridgeSupportedNetwork.from_dict(bridge_supported_network_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Candlestick
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**open** | **float** | |
|
||||
**high** | **float** | |
|
||||
**low** | **float** | |
|
||||
**close** | **float** | |
|
||||
**volume0** | **float** | |
|
||||
**volume1** | **float** | |
|
||||
**last_trade_id** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.candlestick import Candlestick
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Candlestick from a JSON string
|
||||
candlestick_instance = Candlestick.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Candlestick.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
candlestick_dict = candlestick_instance.to_dict()
|
||||
# create an instance of Candlestick from a dict
|
||||
candlestick_from_dict = Candlestick.from_dict(candlestick_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
# lighter.CandlestickApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**candlesticks**](CandlestickApi.md#candlesticks) | **GET** /api/v1/candlesticks | candlesticks
|
||||
[**fundings**](CandlestickApi.md#fundings) | **GET** /api/v1/fundings | fundings
|
||||
|
||||
|
||||
# **candlesticks**
|
||||
> Candlesticks candlesticks(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end)
|
||||
|
||||
candlesticks
|
||||
|
||||
Get candlesticks
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.candlesticks import Candlesticks
|
||||
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.CandlestickApi(api_client)
|
||||
market_id = 56 # int |
|
||||
resolution = 'resolution_example' # str |
|
||||
start_timestamp = 56 # int |
|
||||
end_timestamp = 56 # int |
|
||||
count_back = 56 # int |
|
||||
set_timestamp_to_end = False # bool | (optional) (default to False)
|
||||
|
||||
try:
|
||||
# candlesticks
|
||||
api_response = await api_instance.candlesticks(market_id, resolution, start_timestamp, end_timestamp, count_back, set_timestamp_to_end=set_timestamp_to_end)
|
||||
print("The response of CandlestickApi->candlesticks:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling CandlestickApi->candlesticks: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| |
|
||||
**resolution** | **str**| |
|
||||
**start_timestamp** | **int**| |
|
||||
**end_timestamp** | **int**| |
|
||||
**count_back** | **int**| |
|
||||
**set_timestamp_to_end** | **bool**| | [optional] [default to False]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Candlesticks**](Candlesticks.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **fundings**
|
||||
> Fundings fundings(market_id, resolution, start_timestamp, end_timestamp, count_back)
|
||||
|
||||
fundings
|
||||
|
||||
Get fundings
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.fundings import Fundings
|
||||
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.CandlestickApi(api_client)
|
||||
market_id = 56 # int |
|
||||
resolution = 'resolution_example' # str |
|
||||
start_timestamp = 56 # int |
|
||||
end_timestamp = 56 # int |
|
||||
count_back = 56 # int |
|
||||
|
||||
try:
|
||||
# fundings
|
||||
api_response = await api_instance.fundings(market_id, resolution, start_timestamp, end_timestamp, count_back)
|
||||
print("The response of CandlestickApi->fundings:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling CandlestickApi->fundings: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| |
|
||||
**resolution** | **str**| |
|
||||
**start_timestamp** | **int**| |
|
||||
**end_timestamp** | **int**| |
|
||||
**count_back** | **int**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Fundings**](Fundings.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Candlesticks
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**resolution** | **str** | |
|
||||
**candlesticks** | [**List[Candlestick]**](Candlestick.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.candlesticks import Candlesticks
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Candlesticks from a JSON string
|
||||
candlesticks_instance = Candlesticks.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Candlesticks.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
candlesticks_dict = candlesticks_instance.to_dict()
|
||||
# create an instance of Candlesticks from a dict
|
||||
candlesticks_from_dict = Candlesticks.from_dict(candlesticks_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ContractAddress
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | |
|
||||
**address** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.contract_address import ContractAddress
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ContractAddress from a JSON string
|
||||
contract_address_instance = ContractAddress.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ContractAddress.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
contract_address_dict = contract_address_instance.to_dict()
|
||||
# create an instance of ContractAddress from a dict
|
||||
contract_address_from_dict = ContractAddress.from_dict(contract_address_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# CurrentHeight
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**height** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.current_height import CurrentHeight
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of CurrentHeight from a JSON string
|
||||
current_height_instance = CurrentHeight.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(CurrentHeight.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
current_height_dict = current_height_instance.to_dict()
|
||||
# create an instance of CurrentHeight from a dict
|
||||
current_height_from_dict = CurrentHeight.from_dict(current_height_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# Cursor
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**next_cursor** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.cursor import Cursor
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Cursor from a JSON string
|
||||
cursor_instance = Cursor.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Cursor.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
cursor_dict = cursor_instance.to_dict()
|
||||
# create an instance of Cursor from a dict
|
||||
cursor_from_dict = Cursor.from_dict(cursor_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# DailyReturn
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**daily_return** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.daily_return import DailyReturn
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DailyReturn from a JSON string
|
||||
daily_return_instance = DailyReturn.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DailyReturn.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
daily_return_dict = daily_return_instance.to_dict()
|
||||
# create an instance of DailyReturn from a dict
|
||||
daily_return_from_dict = DailyReturn.from_dict(daily_return_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# DepositHistory
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**deposits** | [**List[DepositHistoryItem]**](DepositHistoryItem.md) | |
|
||||
**cursor** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.deposit_history import DepositHistory
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DepositHistory from a JSON string
|
||||
deposit_history_instance = DepositHistory.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DepositHistory.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
deposit_history_dict = deposit_history_instance.to_dict()
|
||||
# create an instance of DepositHistory from a dict
|
||||
deposit_history_from_dict = DepositHistory.from_dict(deposit_history_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# DepositHistoryItem
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **str** | |
|
||||
**amount** | **str** | |
|
||||
**timestamp** | **int** | |
|
||||
**status** | **str** | |
|
||||
**l1_tx_hash** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.deposit_history_item import DepositHistoryItem
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DepositHistoryItem from a JSON string
|
||||
deposit_history_item_instance = DepositHistoryItem.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DepositHistoryItem.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
deposit_history_item_dict = deposit_history_item_instance.to_dict()
|
||||
# create an instance of DepositHistoryItem from a dict
|
||||
deposit_history_item_from_dict = DepositHistoryItem.from_dict(deposit_history_item_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# DetailedAccount
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**account_type** | **int** | |
|
||||
**index** | **int** | |
|
||||
**l1_address** | **str** | |
|
||||
**cancel_all_time** | **int** | |
|
||||
**total_order_count** | **int** | |
|
||||
**total_isolated_order_count** | **int** | |
|
||||
**pending_order_count** | **int** | |
|
||||
**available_balance** | **str** | |
|
||||
**status** | **int** | |
|
||||
**collateral** | **str** | |
|
||||
**account_index** | **int** | |
|
||||
**name** | **str** | |
|
||||
**description** | **str** | |
|
||||
**can_invite** | **bool** | Remove After FE uses L1 meta endpoint |
|
||||
**referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint |
|
||||
**positions** | [**List[AccountPosition]**](AccountPosition.md) | |
|
||||
**total_asset_value** | **str** | |
|
||||
**cross_asset_value** | **str** | |
|
||||
**pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | |
|
||||
**shares** | [**List[PublicPoolShare]**](PublicPoolShare.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.detailed_account import DetailedAccount
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DetailedAccount from a JSON string
|
||||
detailed_account_instance = DetailedAccount.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DetailedAccount.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
detailed_account_dict = detailed_account_instance.to_dict()
|
||||
# create an instance of DetailedAccount from a dict
|
||||
detailed_account_from_dict = DetailedAccount.from_dict(detailed_account_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# DetailedAccounts
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**total** | **int** | |
|
||||
**accounts** | [**List[DetailedAccount]**](DetailedAccount.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.detailed_accounts import DetailedAccounts
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DetailedAccounts from a JSON string
|
||||
detailed_accounts_instance = DetailedAccounts.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DetailedAccounts.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
detailed_accounts_dict = detailed_accounts_instance.to_dict()
|
||||
# create an instance of DetailedAccounts from a dict
|
||||
detailed_accounts_from_dict = DetailedAccounts.from_dict(detailed_accounts_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# DetailedCandlestick
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**open** | **float** | |
|
||||
**high** | **float** | |
|
||||
**low** | **float** | |
|
||||
**close** | **float** | |
|
||||
**volume0** | **float** | |
|
||||
**volume1** | **float** | |
|
||||
**last_trade_id** | **int** | |
|
||||
**trade_count** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.detailed_candlestick import DetailedCandlestick
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of DetailedCandlestick from a JSON string
|
||||
detailed_candlestick_instance = DetailedCandlestick.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(DetailedCandlestick.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
detailed_candlestick_dict = detailed_candlestick_instance.to_dict()
|
||||
# create an instance of DetailedCandlestick from a dict
|
||||
detailed_candlestick_from_dict = DetailedCandlestick.from_dict(detailed_candlestick_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# EnrichedTx
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**hash** | **str** | |
|
||||
**type** | **int** | |
|
||||
**info** | **str** | |
|
||||
**event_info** | **str** | |
|
||||
**status** | **int** | |
|
||||
**transaction_index** | **int** | |
|
||||
**l1_address** | **str** | |
|
||||
**account_index** | **int** | |
|
||||
**nonce** | **int** | |
|
||||
**expire_at** | **int** | |
|
||||
**block_height** | **int** | |
|
||||
**queued_at** | **int** | |
|
||||
**executed_at** | **int** | |
|
||||
**sequence_index** | **int** | |
|
||||
**parent_hash** | **str** | |
|
||||
**committed_at** | **int** | |
|
||||
**verified_at** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.enriched_tx import EnrichedTx
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of EnrichedTx from a JSON string
|
||||
enriched_tx_instance = EnrichedTx.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(EnrichedTx.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
enriched_tx_dict = enriched_tx_instance.to_dict()
|
||||
# create an instance of EnrichedTx from a dict
|
||||
enriched_tx_from_dict = EnrichedTx.from_dict(enriched_tx_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# ExchangeStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**total** | **int** | |
|
||||
**order_book_stats** | [**List[OrderBookStats]**](OrderBookStats.md) | |
|
||||
**daily_usd_volume** | **float** | |
|
||||
**daily_trades_count** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.exchange_stats import ExchangeStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ExchangeStats from a JSON string
|
||||
exchange_stats_instance = ExchangeStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ExchangeStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
exchange_stats_dict = exchange_stats_instance.to_dict()
|
||||
# create an instance of ExchangeStats from a dict
|
||||
exchange_stats_from_dict = ExchangeStats.from_dict(exchange_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# ExportData
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**data_url** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.export_data import ExportData
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ExportData from a JSON string
|
||||
export_data_instance = ExportData.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ExportData.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
export_data_dict = export_data_instance.to_dict()
|
||||
# create an instance of ExportData from a dict
|
||||
export_data_from_dict = ExportData.from_dict(export_data_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Funding
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**value** | **str** | |
|
||||
**rate** | **str** | |
|
||||
**direction** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.funding import Funding
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Funding from a JSON string
|
||||
funding_instance = Funding.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Funding.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
funding_dict = funding_instance.to_dict()
|
||||
# create an instance of Funding from a dict
|
||||
funding_from_dict = Funding.from_dict(funding_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# lighter.FundingApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**funding_rates**](FundingApi.md#funding_rates) | **GET** /api/v1/funding-rates | funding-rates
|
||||
|
||||
|
||||
# **funding_rates**
|
||||
> FundingRates funding_rates()
|
||||
|
||||
funding-rates
|
||||
|
||||
Get funding rates
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.funding_rates import FundingRates
|
||||
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.FundingApi(api_client)
|
||||
|
||||
try:
|
||||
# funding-rates
|
||||
api_response = await api_instance.funding_rates()
|
||||
print("The response of FundingApi->funding_rates:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling FundingApi->funding_rates: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**FundingRates**](FundingRates.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# FundingRate
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**market_id** | **int** | |
|
||||
**exchange** | **str** | |
|
||||
**symbol** | **str** | |
|
||||
**rate** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.funding_rate import FundingRate
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of FundingRate from a JSON string
|
||||
funding_rate_instance = FundingRate.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(FundingRate.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
funding_rate_dict = funding_rate_instance.to_dict()
|
||||
# create an instance of FundingRate from a dict
|
||||
funding_rate_from_dict = FundingRate.from_dict(funding_rate_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# FundingRates
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**funding_rates** | [**List[FundingRate]**](FundingRate.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.funding_rates import FundingRates
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of FundingRates from a JSON string
|
||||
funding_rates_instance = FundingRates.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(FundingRates.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
funding_rates_dict = funding_rates_instance.to_dict()
|
||||
# create an instance of FundingRates from a dict
|
||||
funding_rates_from_dict = FundingRates.from_dict(funding_rates_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Fundings
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**resolution** | **str** | |
|
||||
**fundings** | [**List[Funding]**](Funding.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.fundings import Fundings
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Fundings from a JSON string
|
||||
fundings_instance = Fundings.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Fundings.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
fundings_dict = fundings_instance.to_dict()
|
||||
# create an instance of Fundings from a dict
|
||||
fundings_from_dict = Fundings.from_dict(fundings_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
# lighter.InfoApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**transfer_fee_info**](InfoApi.md#transfer_fee_info) | **GET** /api/v1/transferFeeInfo | transferFeeInfo
|
||||
[**withdrawal_delay**](InfoApi.md#withdrawal_delay) | **GET** /api/v1/withdrawalDelay | withdrawalDelay
|
||||
|
||||
|
||||
# **transfer_fee_info**
|
||||
> TransferFeeInfo transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index)
|
||||
|
||||
transferFeeInfo
|
||||
|
||||
Transfer fee info
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.transfer_fee_info import TransferFeeInfo
|
||||
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.InfoApi(api_client)
|
||||
account_index = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
to_account_index = -1 # int | (optional) (default to -1)
|
||||
|
||||
try:
|
||||
# transferFeeInfo
|
||||
api_response = await api_instance.transfer_fee_info(account_index, authorization=authorization, auth=auth, to_account_index=to_account_index)
|
||||
print("The response of InfoApi->transfer_fee_info:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling InfoApi->transfer_fee_info: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**to_account_index** | **int**| | [optional] [default to -1]
|
||||
|
||||
### Return type
|
||||
|
||||
[**TransferFeeInfo**](TransferFeeInfo.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **withdrawal_delay**
|
||||
> RespWithdrawalDelay withdrawal_delay()
|
||||
|
||||
withdrawalDelay
|
||||
|
||||
Withdrawal delay in seconds
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.resp_withdrawal_delay import RespWithdrawalDelay
|
||||
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.InfoApi(api_client)
|
||||
|
||||
try:
|
||||
# withdrawalDelay
|
||||
api_response = await api_instance.withdrawal_delay()
|
||||
print("The response of InfoApi->withdrawal_delay:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling InfoApi->withdrawal_delay: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**RespWithdrawalDelay**](RespWithdrawalDelay.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# L1Metadata
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**l1_address** | **str** | |
|
||||
**can_invite** | **bool** | |
|
||||
**referral_points_percentage** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.l1_metadata import L1Metadata
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of L1Metadata from a JSON string
|
||||
l1_metadata_instance = L1Metadata.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(L1Metadata.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
l1_metadata_dict = l1_metadata_instance.to_dict()
|
||||
# create an instance of L1Metadata from a dict
|
||||
l1_metadata_from_dict = L1Metadata.from_dict(l1_metadata_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# L1ProviderInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**chain_id** | **int** | |
|
||||
**network_id** | **int** | |
|
||||
**latest_block_number** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.l1_provider_info import L1ProviderInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of L1ProviderInfo from a JSON string
|
||||
l1_provider_info_instance = L1ProviderInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(L1ProviderInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
l1_provider_info_dict = l1_provider_info_instance.to_dict()
|
||||
# create an instance of L1ProviderInfo from a dict
|
||||
l1_provider_info_from_dict = L1ProviderInfo.from_dict(l1_provider_info_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# LiqTrade
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**price** | **str** | |
|
||||
**size** | **str** | |
|
||||
**taker_fee** | **str** | |
|
||||
**maker_fee** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.liq_trade import LiqTrade
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of LiqTrade from a JSON string
|
||||
liq_trade_instance = LiqTrade.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(LiqTrade.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
liq_trade_dict = liq_trade_instance.to_dict()
|
||||
# create an instance of LiqTrade from a dict
|
||||
liq_trade_from_dict = LiqTrade.from_dict(liq_trade_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Liquidation
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | |
|
||||
**market_id** | **int** | |
|
||||
**type** | **str** | |
|
||||
**trade** | [**LiqTrade**](LiqTrade.md) | |
|
||||
**info** | [**LiquidationInfo**](LiquidationInfo.md) | |
|
||||
**executed_at** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.liquidation import Liquidation
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Liquidation from a JSON string
|
||||
liquidation_instance = Liquidation.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Liquidation.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
liquidation_dict = liquidation_instance.to_dict()
|
||||
# create an instance of Liquidation from a dict
|
||||
liquidation_from_dict = Liquidation.from_dict(liquidation_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# LiquidationInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**positions** | [**List[AccountPosition]**](AccountPosition.md) | |
|
||||
**risk_info_before** | [**RiskInfo**](RiskInfo.md) | |
|
||||
**risk_info_after** | [**RiskInfo**](RiskInfo.md) | |
|
||||
**mark_prices** | **Dict[str, float]** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.liquidation_info import LiquidationInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of LiquidationInfo from a JSON string
|
||||
liquidation_info_instance = LiquidationInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(LiquidationInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
liquidation_info_dict = liquidation_info_instance.to_dict()
|
||||
# create an instance of LiquidationInfo from a dict
|
||||
liquidation_info_from_dict = LiquidationInfo.from_dict(liquidation_info_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# LiquidationInfos
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**liquidations** | [**List[Liquidation]**](Liquidation.md) | |
|
||||
**next_cursor** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.liquidation_infos import LiquidationInfos
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of LiquidationInfos from a JSON string
|
||||
liquidation_infos_instance = LiquidationInfos.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(LiquidationInfos.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
liquidation_infos_dict = liquidation_infos_instance.to_dict()
|
||||
# create an instance of LiquidationInfos from a dict
|
||||
liquidation_infos_from_dict = LiquidationInfos.from_dict(liquidation_infos_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# MarketInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**market_id** | **int** | |
|
||||
**index_price** | **str** | |
|
||||
**mark_price** | **str** | |
|
||||
**open_interest** | **str** | |
|
||||
**last_trade_price** | **str** | |
|
||||
**current_funding_rate** | **str** | |
|
||||
**funding_rate** | **str** | |
|
||||
**funding_timestamp** | **int** | |
|
||||
**daily_base_token_volume** | **float** | |
|
||||
**daily_quote_token_volume** | **float** | |
|
||||
**daily_price_low** | **float** | |
|
||||
**daily_price_high** | **float** | |
|
||||
**daily_price_change** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.market_info import MarketInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of MarketInfo from a JSON string
|
||||
market_info_instance = MarketInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(MarketInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
market_info_dict = market_info_instance.to_dict()
|
||||
# create an instance of MarketInfo from a dict
|
||||
market_info_from_dict = MarketInfo.from_dict(market_info_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# NextNonce
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**nonce** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.next_nonce import NextNonce
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of NextNonce from a JSON string
|
||||
next_nonce_instance = NextNonce.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(NextNonce.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
next_nonce_dict = next_nonce_instance.to_dict()
|
||||
# create an instance of NextNonce from a dict
|
||||
next_nonce_from_dict = NextNonce.from_dict(next_nonce_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
# lighter.NotificationApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**notification_ack**](NotificationApi.md#notification_ack) | **POST** /api/v1/notification/ack | notification_ack
|
||||
|
||||
|
||||
# **notification_ack**
|
||||
> ResultCode notification_ack(notif_id, account_index, authorization=authorization, auth=auth)
|
||||
|
||||
notification_ack
|
||||
|
||||
Ack notification
|
||||
|
||||
### 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.NotificationApi(api_client)
|
||||
notif_id = 'notif_id_example' # str |
|
||||
account_index = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# notification_ack
|
||||
api_response = await api_instance.notification_ack(notif_id, account_index, authorization=authorization, auth=auth)
|
||||
print("The response of NotificationApi->notification_ack:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling NotificationApi->notification_ack: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**notif_id** | **str**| |
|
||||
**account_index** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ResultCode**](ResultCode.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# Order
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**order_index** | **int** | |
|
||||
**client_order_index** | **int** | |
|
||||
**order_id** | **str** | |
|
||||
**client_order_id** | **str** | |
|
||||
**market_index** | **int** | |
|
||||
**owner_account_index** | **int** | |
|
||||
**initial_base_amount** | **str** | |
|
||||
**price** | **str** | |
|
||||
**nonce** | **int** | |
|
||||
**remaining_base_amount** | **str** | |
|
||||
**is_ask** | **bool** | |
|
||||
**base_size** | **int** | |
|
||||
**base_price** | **int** | |
|
||||
**filled_base_amount** | **str** | |
|
||||
**filled_quote_amount** | **str** | |
|
||||
**side** | **str** | TODO: remove this | [default to 'buy']
|
||||
**type** | **str** | |
|
||||
**time_in_force** | **str** | | [default to 'good-till-time']
|
||||
**reduce_only** | **bool** | |
|
||||
**trigger_price** | **str** | |
|
||||
**order_expiry** | **int** | |
|
||||
**status** | **str** | |
|
||||
**trigger_status** | **str** | |
|
||||
**trigger_time** | **int** | |
|
||||
**parent_order_index** | **int** | |
|
||||
**parent_order_id** | **str** | |
|
||||
**to_trigger_order_id_0** | **str** | |
|
||||
**to_trigger_order_id_1** | **str** | |
|
||||
**to_cancel_order_id_0** | **str** | |
|
||||
**block_height** | **int** | |
|
||||
**timestamp** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order import Order
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Order from a JSON string
|
||||
order_instance = Order.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Order.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_dict = order_instance.to_dict()
|
||||
# create an instance of Order from a dict
|
||||
order_from_dict = Order.from_dict(order_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,686 @@
|
||||
# lighter.OrderApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**account_active_orders**](OrderApi.md#account_active_orders) | **GET** /api/v1/accountActiveOrders | accountActiveOrders
|
||||
[**account_inactive_orders**](OrderApi.md#account_inactive_orders) | **GET** /api/v1/accountInactiveOrders | accountInactiveOrders
|
||||
[**exchange_stats**](OrderApi.md#exchange_stats) | **GET** /api/v1/exchangeStats | exchangeStats
|
||||
[**export**](OrderApi.md#export) | **GET** /api/v1/export | export
|
||||
[**order_book_details**](OrderApi.md#order_book_details) | **GET** /api/v1/orderBookDetails | orderBookDetails
|
||||
[**order_book_orders**](OrderApi.md#order_book_orders) | **GET** /api/v1/orderBookOrders | orderBookOrders
|
||||
[**order_books**](OrderApi.md#order_books) | **GET** /api/v1/orderBooks | orderBooks
|
||||
[**recent_trades**](OrderApi.md#recent_trades) | **GET** /api/v1/recentTrades | recentTrades
|
||||
[**trades**](OrderApi.md#trades) | **GET** /api/v1/trades | trades
|
||||
|
||||
|
||||
# **account_active_orders**
|
||||
> Orders account_active_orders(account_index, market_id, authorization=authorization, auth=auth)
|
||||
|
||||
accountActiveOrders
|
||||
|
||||
Get account active orders. `auth` can be generated using the SDK.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.orders import Orders
|
||||
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.OrderApi(api_client)
|
||||
account_index = 56 # int |
|
||||
market_id = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# accountActiveOrders
|
||||
api_response = await api_instance.account_active_orders(account_index, market_id, authorization=authorization, auth=auth)
|
||||
print("The response of OrderApi->account_active_orders:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->account_active_orders: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**market_id** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Orders**](Orders.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **account_inactive_orders**
|
||||
> Orders account_inactive_orders(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor)
|
||||
|
||||
accountInactiveOrders
|
||||
|
||||
Get account inactive orders
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.orders import Orders
|
||||
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.OrderApi(api_client)
|
||||
account_index = 56 # int |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
ask_filter = -1 # int | (optional) (default to -1)
|
||||
between_timestamps = 'between_timestamps_example' # str | (optional)
|
||||
cursor = 'cursor_example' # str | (optional)
|
||||
|
||||
try:
|
||||
# accountInactiveOrders
|
||||
api_response = await api_instance.account_inactive_orders(account_index, limit, authorization=authorization, auth=auth, market_id=market_id, ask_filter=ask_filter, between_timestamps=between_timestamps, cursor=cursor)
|
||||
print("The response of OrderApi->account_inactive_orders:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->account_inactive_orders: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
**ask_filter** | **int**| | [optional] [default to -1]
|
||||
**between_timestamps** | **str**| | [optional]
|
||||
**cursor** | **str**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Orders**](Orders.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **exchange_stats**
|
||||
> ExchangeStats exchange_stats()
|
||||
|
||||
exchangeStats
|
||||
|
||||
Get exchange stats
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.exchange_stats import ExchangeStats
|
||||
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.OrderApi(api_client)
|
||||
|
||||
try:
|
||||
# exchangeStats
|
||||
api_response = await api_instance.exchange_stats()
|
||||
print("The response of OrderApi->exchange_stats:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->exchange_stats: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**ExchangeStats**](ExchangeStats.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **export**
|
||||
> ExportData export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id)
|
||||
|
||||
export
|
||||
|
||||
Export data
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.export_data import ExportData
|
||||
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.OrderApi(api_client)
|
||||
type = 'type_example' # str |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
account_index = -1 # int | (optional) (default to -1)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
|
||||
try:
|
||||
# export
|
||||
api_response = await api_instance.export(type, authorization=authorization, auth=auth, account_index=account_index, market_id=market_id)
|
||||
print("The response of OrderApi->export:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->export: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**type** | **str**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**account_index** | **int**| | [optional] [default to -1]
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ExportData**](ExportData.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **order_book_details**
|
||||
> OrderBookDetails order_book_details(market_id=market_id)
|
||||
|
||||
orderBookDetails
|
||||
|
||||
Get order books metadata
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.order_book_details import OrderBookDetails
|
||||
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.OrderApi(api_client)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
|
||||
try:
|
||||
# orderBookDetails
|
||||
api_response = await api_instance.order_book_details(market_id=market_id)
|
||||
print("The response of OrderApi->order_book_details:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->order_book_details: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OrderBookDetails**](OrderBookDetails.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **order_book_orders**
|
||||
> OrderBookOrders order_book_orders(market_id, limit)
|
||||
|
||||
orderBookOrders
|
||||
|
||||
Get order book orders
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.order_book_orders import OrderBookOrders
|
||||
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.OrderApi(api_client)
|
||||
market_id = 56 # int |
|
||||
limit = 56 # int |
|
||||
|
||||
try:
|
||||
# orderBookOrders
|
||||
api_response = await api_instance.order_book_orders(market_id, limit)
|
||||
print("The response of OrderApi->order_book_orders:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->order_book_orders: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| |
|
||||
**limit** | **int**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OrderBookOrders**](OrderBookOrders.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **order_books**
|
||||
> OrderBooks order_books(market_id=market_id)
|
||||
|
||||
orderBooks
|
||||
|
||||
Get order books metadata.<hr>**Response Description:**<br><br>1) **Taker and maker fees** are in percentage.<br>2) **Min base amount:** The amount of base token that can be traded in a single order.<br>3) **Min quote amount:** The amount of quote token that can be traded in a single order.<br>4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.<br>5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.<br>6) **Supported quote decimals:** Size Decimals + Quote Decimals.
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.order_books import OrderBooks
|
||||
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.OrderApi(api_client)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
|
||||
try:
|
||||
# orderBooks
|
||||
api_response = await api_instance.order_books(market_id=market_id)
|
||||
print("The response of OrderApi->order_books:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->order_books: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OrderBooks**](OrderBooks.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **recent_trades**
|
||||
> Trades recent_trades(market_id, limit)
|
||||
|
||||
recentTrades
|
||||
|
||||
Get recent trades
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.trades import Trades
|
||||
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.OrderApi(api_client)
|
||||
market_id = 56 # int |
|
||||
limit = 56 # int |
|
||||
|
||||
try:
|
||||
# recentTrades
|
||||
api_response = await api_instance.recent_trades(market_id, limit)
|
||||
print("The response of OrderApi->recent_trades:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->recent_trades: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**market_id** | **int**| |
|
||||
**limit** | **int**| |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Trades**](Trades.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
# **trades**
|
||||
> Trades trades(sort_by, limit, authorization=authorization, auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter)
|
||||
|
||||
trades
|
||||
|
||||
Get trades
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.trades import Trades
|
||||
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.OrderApi(api_client)
|
||||
sort_by = 'sort_by_example' # str |
|
||||
limit = 56 # int |
|
||||
authorization = 'authorization_example' # str | (optional)
|
||||
auth = 'auth_example' # str | (optional)
|
||||
market_id = 255 # int | (optional) (default to 255)
|
||||
account_index = -1 # int | (optional) (default to -1)
|
||||
order_index = 56 # int | (optional)
|
||||
sort_dir = desc # str | (optional) (default to desc)
|
||||
cursor = 'cursor_example' # str | (optional)
|
||||
var_from = -1 # int | (optional) (default to -1)
|
||||
ask_filter = -1 # int | (optional) (default to -1)
|
||||
|
||||
try:
|
||||
# trades
|
||||
api_response = await api_instance.trades(sort_by, limit, authorization=authorization, auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, sort_dir=sort_dir, cursor=cursor, var_from=var_from, ask_filter=ask_filter)
|
||||
print("The response of OrderApi->trades:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling OrderApi->trades: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**sort_by** | **str**| |
|
||||
**limit** | **int**| |
|
||||
**authorization** | **str**| | [optional]
|
||||
**auth** | **str**| | [optional]
|
||||
**market_id** | **int**| | [optional] [default to 255]
|
||||
**account_index** | **int**| | [optional] [default to -1]
|
||||
**order_index** | **int**| | [optional]
|
||||
**sort_dir** | **str**| | [optional] [default to desc]
|
||||
**cursor** | **str**| | [optional]
|
||||
**var_from** | **int**| | [optional] [default to -1]
|
||||
**ask_filter** | **int**| | [optional] [default to -1]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Trades**](Trades.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# OrderBook
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**symbol** | **str** | |
|
||||
**market_id** | **int** | |
|
||||
**status** | **str** | |
|
||||
**taker_fee** | **str** | |
|
||||
**maker_fee** | **str** | |
|
||||
**liquidation_fee** | **str** | |
|
||||
**min_base_amount** | **str** | |
|
||||
**min_quote_amount** | **str** | |
|
||||
**supported_size_decimals** | **int** | |
|
||||
**supported_price_decimals** | **int** | |
|
||||
**supported_quote_decimals** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book import OrderBook
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBook from a JSON string
|
||||
order_book_instance = OrderBook.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBook.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_dict = order_book_instance.to_dict()
|
||||
# create an instance of OrderBook from a dict
|
||||
order_book_from_dict = OrderBook.from_dict(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)
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# OrderBookDepth
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**asks** | [**List[PriceLevel]**](PriceLevel.md) | |
|
||||
**bids** | [**List[PriceLevel]**](PriceLevel.md) | |
|
||||
**offset** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book_depth import OrderBookDepth
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBookDepth from a JSON string
|
||||
order_book_depth_instance = OrderBookDepth.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBookDepth.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_depth_dict = order_book_depth_instance.to_dict()
|
||||
# create an instance of OrderBookDepth from a dict
|
||||
order_book_depth_from_dict = OrderBookDepth.from_dict(order_book_depth_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# OrderBookDetail
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**symbol** | **str** | |
|
||||
**market_id** | **int** | |
|
||||
**status** | **str** | |
|
||||
**taker_fee** | **str** | |
|
||||
**maker_fee** | **str** | |
|
||||
**liquidation_fee** | **str** | |
|
||||
**min_base_amount** | **str** | |
|
||||
**min_quote_amount** | **str** | |
|
||||
**supported_size_decimals** | **int** | |
|
||||
**supported_price_decimals** | **int** | |
|
||||
**supported_quote_decimals** | **int** | |
|
||||
**size_decimals** | **int** | |
|
||||
**price_decimals** | **int** | |
|
||||
**quote_multiplier** | **int** | |
|
||||
**default_initial_margin_fraction** | **int** | |
|
||||
**min_initial_margin_fraction** | **int** | |
|
||||
**maintenance_margin_fraction** | **int** | |
|
||||
**closeout_margin_fraction** | **int** | |
|
||||
**last_trade_price** | **float** | |
|
||||
**daily_trades_count** | **int** | |
|
||||
**daily_base_token_volume** | **float** | |
|
||||
**daily_quote_token_volume** | **float** | |
|
||||
**daily_price_low** | **float** | |
|
||||
**daily_price_high** | **float** | |
|
||||
**daily_price_change** | **float** | |
|
||||
**open_interest** | **float** | |
|
||||
**daily_chart** | **Dict[str, float]** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book_detail import OrderBookDetail
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBookDetail from a JSON string
|
||||
order_book_detail_instance = OrderBookDetail.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBookDetail.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_detail_dict = order_book_detail_instance.to_dict()
|
||||
# create an instance of OrderBookDetail from a dict
|
||||
order_book_detail_from_dict = OrderBookDetail.from_dict(order_book_detail_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# OrderBookDetails
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**order_book_details** | [**List[OrderBookDetail]**](OrderBookDetail.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book_details import OrderBookDetails
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBookDetails from a JSON string
|
||||
order_book_details_instance = OrderBookDetails.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBookDetails.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_details_dict = order_book_details_instance.to_dict()
|
||||
# create an instance of OrderBookDetails from a dict
|
||||
order_book_details_from_dict = OrderBookDetails.from_dict(order_book_details_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# OrderBookOrders
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**total_asks** | **int** | |
|
||||
**asks** | [**List[SimpleOrder]**](SimpleOrder.md) | |
|
||||
**total_bids** | **int** | |
|
||||
**bids** | [**List[SimpleOrder]**](SimpleOrder.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book_orders import OrderBookOrders
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBookOrders from a JSON string
|
||||
order_book_orders_instance = OrderBookOrders.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBookOrders.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_orders_dict = order_book_orders_instance.to_dict()
|
||||
# create an instance of OrderBookOrders from a dict
|
||||
order_book_orders_from_dict = OrderBookOrders.from_dict(order_book_orders_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# OrderBookStats
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**symbol** | **str** | |
|
||||
**last_trade_price** | **float** | |
|
||||
**daily_trades_count** | **int** | |
|
||||
**daily_base_token_volume** | **float** | |
|
||||
**daily_quote_token_volume** | **float** | |
|
||||
**daily_price_change** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_book_stats import OrderBookStats
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBookStats from a JSON string
|
||||
order_book_stats_instance = OrderBookStats.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBookStats.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_book_stats_dict = order_book_stats_instance.to_dict()
|
||||
# create an instance of OrderBookStats from a dict
|
||||
order_book_stats_from_dict = OrderBookStats.from_dict(order_book_stats_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# OrderBooks
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**order_books** | [**List[OrderBook]**](OrderBook.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.order_books import OrderBooks
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of OrderBooks from a JSON string
|
||||
order_books_instance = OrderBooks.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(OrderBooks.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
order_books_dict = order_books_instance.to_dict()
|
||||
# create an instance of OrderBooks from a dict
|
||||
order_books_from_dict = OrderBooks.from_dict(order_books_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# Orders
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**next_cursor** | **str** | | [optional]
|
||||
**orders** | [**List[Order]**](Order.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.orders import Orders
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Orders from a JSON string
|
||||
orders_instance = Orders.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Orders.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
orders_dict = orders_instance.to_dict()
|
||||
# create an instance of Orders from a dict
|
||||
orders_from_dict = Orders.from_dict(orders_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# PnLEntry
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**trade_pnl** | **float** | |
|
||||
**inflow** | **float** | |
|
||||
**outflow** | **float** | |
|
||||
**pool_pnl** | **float** | |
|
||||
**pool_inflow** | **float** | |
|
||||
**pool_outflow** | **float** | |
|
||||
**pool_total_shares** | **float** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.pn_l_entry import PnLEntry
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PnLEntry from a JSON string
|
||||
pn_l_entry_instance = PnLEntry.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PnLEntry.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
pn_l_entry_dict = pn_l_entry_instance.to_dict()
|
||||
# create an instance of PnLEntry from a dict
|
||||
pn_l_entry_from_dict = PnLEntry.from_dict(pn_l_entry_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# PositionFunding
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**timestamp** | **int** | |
|
||||
**market_id** | **int** | |
|
||||
**funding_id** | **int** | |
|
||||
**change** | **str** | |
|
||||
**rate** | **str** | |
|
||||
**position_size** | **str** | |
|
||||
**position_side** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.position_funding import PositionFunding
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PositionFunding from a JSON string
|
||||
position_funding_instance = PositionFunding.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PositionFunding.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
position_funding_dict = position_funding_instance.to_dict()
|
||||
# create an instance of PositionFunding from a dict
|
||||
position_funding_from_dict = PositionFunding.from_dict(position_funding_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# PositionFundings
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**position_fundings** | [**List[PositionFunding]**](PositionFunding.md) | |
|
||||
**next_cursor** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.position_fundings import PositionFundings
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PositionFundings from a JSON string
|
||||
position_fundings_instance = PositionFundings.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PositionFundings.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
position_fundings_dict = position_fundings_instance.to_dict()
|
||||
# create an instance of PositionFundings from a dict
|
||||
position_fundings_from_dict = PositionFundings.from_dict(position_fundings_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# PriceLevel
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**price** | **str** | |
|
||||
**size** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.price_level import PriceLevel
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PriceLevel from a JSON string
|
||||
price_level_instance = PriceLevel.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PriceLevel.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
price_level_dict = price_level_instance.to_dict()
|
||||
# create an instance of PriceLevel from a dict
|
||||
price_level_from_dict = PriceLevel.from_dict(price_level_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# PublicPool
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**account_type** | **int** | |
|
||||
**index** | **int** | |
|
||||
**l1_address** | **str** | |
|
||||
**cancel_all_time** | **int** | |
|
||||
**total_order_count** | **int** | |
|
||||
**total_isolated_order_count** | **int** | |
|
||||
**pending_order_count** | **int** | |
|
||||
**available_balance** | **str** | |
|
||||
**status** | **int** | |
|
||||
**collateral** | **str** | |
|
||||
**account_index** | **int** | |
|
||||
**name** | **str** | |
|
||||
**description** | **str** | |
|
||||
**can_invite** | **bool** | Remove After FE uses L1 meta endpoint |
|
||||
**referral_points_percentage** | **str** | Remove After FE uses L1 meta endpoint |
|
||||
**total_asset_value** | **str** | |
|
||||
**cross_asset_value** | **str** | |
|
||||
**pool_info** | [**PublicPoolInfo**](PublicPoolInfo.md) | |
|
||||
**account_share** | [**PublicPoolShare**](PublicPoolShare.md) | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.public_pool import PublicPool
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PublicPool from a JSON string
|
||||
public_pool_instance = PublicPool.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PublicPool.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
public_pool_dict = public_pool_instance.to_dict()
|
||||
# create an instance of PublicPool from a dict
|
||||
public_pool_from_dict = PublicPool.from_dict(public_pool_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# PublicPoolInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**status** | **int** | |
|
||||
**operator_fee** | **str** | |
|
||||
**min_operator_share_rate** | **str** | |
|
||||
**total_shares** | **int** | |
|
||||
**operator_shares** | **int** | |
|
||||
**annual_percentage_yield** | **float** | |
|
||||
**daily_returns** | [**List[DailyReturn]**](DailyReturn.md) | |
|
||||
**share_prices** | [**List[SharePrice]**](SharePrice.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.public_pool_info import PublicPoolInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PublicPoolInfo from a JSON string
|
||||
public_pool_info_instance = PublicPoolInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PublicPoolInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
public_pool_info_dict = public_pool_info_instance.to_dict()
|
||||
# create an instance of PublicPoolInfo from a dict
|
||||
public_pool_info_from_dict = PublicPoolInfo.from_dict(public_pool_info_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# PublicPoolMetadata
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**account_index** | **int** | |
|
||||
**account_type** | **int** | |
|
||||
**name** | **str** | |
|
||||
**l1_address** | **str** | |
|
||||
**annual_percentage_yield** | **float** | |
|
||||
**status** | **int** | |
|
||||
**operator_fee** | **str** | |
|
||||
**total_asset_value** | **str** | |
|
||||
**total_shares** | **int** | |
|
||||
**account_share** | [**PublicPoolShare**](PublicPoolShare.md) | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.public_pool_metadata import PublicPoolMetadata
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PublicPoolMetadata from a JSON string
|
||||
public_pool_metadata_instance = PublicPoolMetadata.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PublicPoolMetadata.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
public_pool_metadata_dict = public_pool_metadata_instance.to_dict()
|
||||
# create an instance of PublicPoolMetadata from a dict
|
||||
public_pool_metadata_from_dict = PublicPoolMetadata.from_dict(public_pool_metadata_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# PublicPoolShare
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**public_pool_index** | **int** | |
|
||||
**shares_amount** | **int** | |
|
||||
**entry_usdc** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.public_pool_share import PublicPoolShare
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PublicPoolShare from a JSON string
|
||||
public_pool_share_instance = PublicPoolShare.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PublicPoolShare.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
public_pool_share_dict = public_pool_share_instance.to_dict()
|
||||
# create an instance of PublicPoolShare from a dict
|
||||
public_pool_share_from_dict = PublicPoolShare.from_dict(public_pool_share_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# PublicPools
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **int** | |
|
||||
**message** | **str** | | [optional]
|
||||
**total** | **int** | |
|
||||
**public_pools** | [**List[PublicPool]**](PublicPool.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.public_pools import PublicPools
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PublicPools from a JSON string
|
||||
public_pools_instance = PublicPools.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(PublicPools.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
public_pools_dict = public_pools_instance.to_dict()
|
||||
# create an instance of PublicPools from a dict
|
||||
public_pools_from_dict = PublicPools.from_dict(public_pools_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# lighter.ReferralApi
|
||||
|
||||
All URIs are relative to *https://mainnet.zklighter.elliot.ai*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**referral_points**](ReferralApi.md#referral_points) | **GET** /api/v1/referral/points | referral_points
|
||||
|
||||
|
||||
# **referral_points**
|
||||
> ReferralPoints referral_points(account_index, authorization=authorization, auth=auth)
|
||||
|
||||
referral_points
|
||||
|
||||
Get referral points
|
||||
|
||||
### Example
|
||||
|
||||
|
||||
```python
|
||||
import lighter
|
||||
from lighter.models.referral_points import ReferralPoints
|
||||
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.ReferralApi(api_client)
|
||||
account_index = 56 # int |
|
||||
authorization = 'authorization_example' # str | make required after integ is done (optional)
|
||||
auth = 'auth_example' # str | made optional to support header auth clients (optional)
|
||||
|
||||
try:
|
||||
# referral_points
|
||||
api_response = await api_instance.referral_points(account_index, authorization=authorization, auth=auth)
|
||||
print("The response of ReferralApi->referral_points:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling ReferralApi->referral_points: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**account_index** | **int**| |
|
||||
**authorization** | **str**| make required after integ is done | [optional]
|
||||
**auth** | **str**| made optional to support header auth clients | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ReferralPoints**](ReferralPoints.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **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)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# ReferralPointEntry
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**l1_address** | **str** | |
|
||||
**total_points** | **int** | |
|
||||
**week_points** | **int** | |
|
||||
**total_reward_points** | **int** | |
|
||||
**week_reward_points** | **int** | |
|
||||
**reward_point_multiplier** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.referral_point_entry import ReferralPointEntry
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReferralPointEntry from a JSON string
|
||||
referral_point_entry_instance = ReferralPointEntry.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReferralPointEntry.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
referral_point_entry_dict = referral_point_entry_instance.to_dict()
|
||||
# create an instance of ReferralPointEntry from a dict
|
||||
referral_point_entry_from_dict = ReferralPointEntry.from_dict(referral_point_entry_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# ReferralPoints
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**referrals** | [**List[ReferralPointEntry]**](ReferralPointEntry.md) | |
|
||||
**user_total_points** | **int** | |
|
||||
**user_last_week_points** | **int** | |
|
||||
**user_total_referral_reward_points** | **int** | |
|
||||
**user_last_week_referral_reward_points** | **int** | |
|
||||
**reward_point_multiplier** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.referral_points import ReferralPoints
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReferralPoints from a JSON string
|
||||
referral_points_instance = ReferralPoints.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReferralPoints.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
referral_points_dict = referral_points_instance.to_dict()
|
||||
# create an instance of ReferralPoints from a dict
|
||||
referral_points_from_dict = ReferralPoints.from_dict(referral_points_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# ReqExportData
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**auth** | **str** | | [optional]
|
||||
**account_index** | **int** | | [optional] [default to -1]
|
||||
**market_id** | **int** | | [optional]
|
||||
**type** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_export_data import ReqExportData
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqExportData from a JSON string
|
||||
req_export_data_instance = ReqExportData.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqExportData.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_export_data_dict = req_export_data_instance.to_dict()
|
||||
# create an instance of ReqExportData from a dict
|
||||
req_export_data_from_dict = ReqExportData.from_dict(req_export_data_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetAccount
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account import ReqGetAccount
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccount from a JSON string
|
||||
req_get_account_instance = ReqGetAccount.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccount.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_dict = req_get_account_instance.to_dict()
|
||||
# create an instance of ReqGetAccount from a dict
|
||||
req_get_account_from_dict = ReqGetAccount.from_dict(req_get_account_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# ReqGetAccountActiveOrders
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**market_id** | **int** | |
|
||||
**auth** | **str** | made optional to support header auth clients | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountActiveOrders from a JSON string
|
||||
req_get_account_active_orders_instance = ReqGetAccountActiveOrders.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountActiveOrders.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_active_orders_dict = req_get_account_active_orders_instance.to_dict()
|
||||
# create an instance of ReqGetAccountActiveOrders from a dict
|
||||
req_get_account_active_orders_from_dict = ReqGetAccountActiveOrders.from_dict(req_get_account_active_orders_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetAccountApiKeys
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**api_key_index** | **int** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountApiKeys from a JSON string
|
||||
req_get_account_api_keys_instance = ReqGetAccountApiKeys.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountApiKeys.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_api_keys_dict = req_get_account_api_keys_instance.to_dict()
|
||||
# create an instance of ReqGetAccountApiKeys from a dict
|
||||
req_get_account_api_keys_from_dict = ReqGetAccountApiKeys.from_dict(req_get_account_api_keys_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# ReqGetAccountByL1Address
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**l1_address** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountByL1Address from a JSON string
|
||||
req_get_account_by_l1_address_instance = ReqGetAccountByL1Address.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountByL1Address.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_by_l1_address_dict = req_get_account_by_l1_address_instance.to_dict()
|
||||
# create an instance of ReqGetAccountByL1Address from a dict
|
||||
req_get_account_by_l1_address_from_dict = ReqGetAccountByL1Address.from_dict(req_get_account_by_l1_address_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# ReqGetAccountInactiveOrders
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**auth** | **str** | made optional to support header auth clients | [optional]
|
||||
**account_index** | **int** | |
|
||||
**market_id** | **int** | | [optional]
|
||||
**ask_filter** | **int** | | [optional]
|
||||
**between_timestamps** | **str** | | [optional]
|
||||
**cursor** | **str** | | [optional]
|
||||
**limit** | **int** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountInactiveOrders from a JSON string
|
||||
req_get_account_inactive_orders_instance = ReqGetAccountInactiveOrders.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountInactiveOrders.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_inactive_orders_dict = req_get_account_inactive_orders_instance.to_dict()
|
||||
# create an instance of ReqGetAccountInactiveOrders from a dict
|
||||
req_get_account_inactive_orders_from_dict = ReqGetAccountInactiveOrders.from_dict(req_get_account_inactive_orders_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetAccountLimits
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**auth** | **str** | made optional to support header auth clients | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_limits import ReqGetAccountLimits
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountLimits from a JSON string
|
||||
req_get_account_limits_instance = ReqGetAccountLimits.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountLimits.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_limits_dict = req_get_account_limits_instance.to_dict()
|
||||
# create an instance of ReqGetAccountLimits from a dict
|
||||
req_get_account_limits_from_dict = ReqGetAccountLimits.from_dict(req_get_account_limits_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# ReqGetAccountMetadata
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
**auth** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_metadata import ReqGetAccountMetadata
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountMetadata from a JSON string
|
||||
req_get_account_metadata_instance = ReqGetAccountMetadata.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountMetadata.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_metadata_dict = req_get_account_metadata_instance.to_dict()
|
||||
# create an instance of ReqGetAccountMetadata from a dict
|
||||
req_get_account_metadata_from_dict = ReqGetAccountMetadata.from_dict(req_get_account_metadata_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# ReqGetAccountPnL
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**auth** | **str** | | [optional]
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
**resolution** | **str** | |
|
||||
**start_timestamp** | **int** | |
|
||||
**end_timestamp** | **int** | |
|
||||
**count_back** | **int** | |
|
||||
**ignore_transfers** | **bool** | | [optional] [default to False]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_pn_l import ReqGetAccountPnL
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountPnL from a JSON string
|
||||
req_get_account_pn_l_instance = ReqGetAccountPnL.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountPnL.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_pn_l_dict = req_get_account_pn_l_instance.to_dict()
|
||||
# create an instance of ReqGetAccountPnL from a dict
|
||||
req_get_account_pn_l_from_dict = ReqGetAccountPnL.from_dict(req_get_account_pn_l_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# ReqGetAccountTxs
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**index** | **int** | | [optional]
|
||||
**limit** | **int** | | [optional]
|
||||
**by** | **str** | | [optional]
|
||||
**value** | **str** | | [optional]
|
||||
**types** | **List[int]** | | [optional]
|
||||
**auth** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_account_txs import ReqGetAccountTxs
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetAccountTxs from a JSON string
|
||||
req_get_account_txs_instance = ReqGetAccountTxs.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetAccountTxs.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_account_txs_dict = req_get_account_txs_instance.to_dict()
|
||||
# create an instance of ReqGetAccountTxs from a dict
|
||||
req_get_account_txs_from_dict = ReqGetAccountTxs.from_dict(req_get_account_txs_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetBlock
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_block import ReqGetBlock
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetBlock from a JSON string
|
||||
req_get_block_instance = ReqGetBlock.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetBlock.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_block_dict = req_get_block_instance.to_dict()
|
||||
# create an instance of ReqGetBlock from a dict
|
||||
req_get_block_from_dict = ReqGetBlock.from_dict(req_get_block_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetBlockTxs
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_block_txs import ReqGetBlockTxs
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetBlockTxs from a JSON string
|
||||
req_get_block_txs_instance = ReqGetBlockTxs.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetBlockTxs.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_block_txs_dict = req_get_block_txs_instance.to_dict()
|
||||
# create an instance of ReqGetBlockTxs from a dict
|
||||
req_get_block_txs_from_dict = ReqGetBlockTxs.from_dict(req_get_block_txs_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetByAccount
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**by** | **str** | |
|
||||
**value** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_by_account import ReqGetByAccount
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetByAccount from a JSON string
|
||||
req_get_by_account_instance = ReqGetByAccount.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetByAccount.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_by_account_dict = req_get_by_account_instance.to_dict()
|
||||
# create an instance of ReqGetByAccount from a dict
|
||||
req_get_by_account_from_dict = ReqGetByAccount.from_dict(req_get_by_account_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# ReqGetCandlesticks
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**market_id** | **int** | |
|
||||
**resolution** | **str** | |
|
||||
**start_timestamp** | **int** | |
|
||||
**end_timestamp** | **int** | |
|
||||
**count_back** | **int** | |
|
||||
**set_timestamp_to_end** | **bool** | | [optional] [default to False]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_candlesticks import ReqGetCandlesticks
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetCandlesticks from a JSON string
|
||||
req_get_candlesticks_instance = ReqGetCandlesticks.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetCandlesticks.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_candlesticks_dict = req_get_candlesticks_instance.to_dict()
|
||||
# create an instance of ReqGetCandlesticks from a dict
|
||||
req_get_candlesticks_from_dict = ReqGetCandlesticks.from_dict(req_get_candlesticks_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# ReqGetDepositHistory
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**auth** | **str** | made optional to support header auth clients | [optional]
|
||||
**l1_address** | **str** | |
|
||||
**cursor** | **str** | | [optional]
|
||||
**filter** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_deposit_history import ReqGetDepositHistory
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetDepositHistory from a JSON string
|
||||
req_get_deposit_history_instance = ReqGetDepositHistory.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetDepositHistory.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_deposit_history_dict = req_get_deposit_history_instance.to_dict()
|
||||
# create an instance of ReqGetDepositHistory from a dict
|
||||
req_get_deposit_history_from_dict = ReqGetDepositHistory.from_dict(req_get_deposit_history_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)
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ReqGetFastWithdrawInfo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**account_index** | **int** | |
|
||||
**auth** | **str** | made optional to support header auth clients | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from lighter.models.req_get_fast_withdraw_info import ReqGetFastWithdrawInfo
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ReqGetFastWithdrawInfo from a JSON string
|
||||
req_get_fast_withdraw_info_instance = ReqGetFastWithdrawInfo.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(ReqGetFastWithdrawInfo.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
req_get_fast_withdraw_info_dict = req_get_fast_withdraw_info_instance.to_dict()
|
||||
# create an instance of ReqGetFastWithdrawInfo from a dict
|
||||
req_get_fast_withdraw_info_from_dict = ReqGetFastWithdrawInfo.from_dict(req_get_fast_withdraw_info_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)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user