Python SDK for Lighter
Python 3.8+
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/LingSanSui/lighter-python.gitThen import the package:
import lighterExecute pytest to run the tests.
Please follow the installation procedure and then run the following:
import lighter
import asyncio
async def main():
client = lighter.ApiClient()
try:
account_api = lighter.AccountApi(client)
account = await account_api.account(by="index", value="1")
print(account)
finally:
await client.close() # Make sure connection is cleanly closed
if __name__ == "__main__":
asyncio.run(main())python examples/get_info.pypython examples/ws.pypython examples/create_cancel_order.pyAll URIs are relative to https://mainnet.zklighter.elliot.ai
- Account
- AccountApiKeys
- AccountMarketStats
- AccountMetadata
- AccountPnL
- AccountPosition
- AccountStats
- ApiKey
- Block
- Blocks
- BridgeSupportedNetwork
- Candlestick
- Candlesticks
- ContractAddress
- CurrentHeight
- Cursor
- DepositHistory
- DepositHistoryItem
- DetailedAccount
- DetailedAccounts
- DetailedCandlestick
- EnrichedTx
- ExchangeStats
- Funding
- Fundings
- L1ProviderInfo
- Liquidation
- MarketInfo
- NextNonce
- Order
- OrderBook
- OrderBookDepth
- OrderBookDetail
- OrderBookDetails
- OrderBookOrders
- OrderBookStats
- OrderBooks
- Orders
- PnLEntry
- PositionFunding
- PriceLevel
- PublicPool
- PublicPoolInfo
- PublicPoolShare
- PublicPools
- ReqGetAccount
- ReqGetAccountApiKeys
- ReqGetAccountByL1Address
- ReqGetAccountInactiveOrders
- ReqGetAccountPnL
- ReqGetAccountTxs
- ReqGetBlock
- ReqGetBlockTxs
- ReqGetByAccount
- ReqGetCandlesticks
- ReqGetDepositHistory
- ReqGetFundings
- ReqGetL1Tx
- ReqGetLatestDeposit
- ReqGetNextNonce
- ReqGetOrderBookDetails
- ReqGetOrderBookOrders
- ReqGetOrderBooks
- ReqGetPublicPools
- ReqGetRangeWithCursor
- ReqGetRangeWithIndex
- ReqGetRangeWithIndexSortable
- ReqGetRecentTrades
- ReqGetTrades
- ReqGetTx
- ReqGetWithdrawHistory
- ResultCode
- SimpleOrder
- Status
- SubAccounts
- Ticker
- Trade
- Trades
- Tx
- TxHash
- TxHashes
- Txs
- ValidatorInfo
- WithdrawHistory
- WithdrawHistoryItem
- ZkLighterInfo
