diff --git a/.gitignore b/.gitignore index ba10070..30e5089 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,6 @@ target/ #Ipython Notebook .ipynb_checkpoints openapi-generator-cli.jar + + +.idea \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 6f8645b..1559712 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,9 +1,3 @@ -.github/workflows/python.yml -.gitignore -.gitlab-ci.yml -.openapi-generator-ignore -.travis.yml -README.md docs/Account.md docs/AccountApi.md docs/AccountApiKeys.md @@ -24,6 +18,7 @@ docs/Candlesticks.md docs/ContractAddress.md docs/CurrentHeight.md docs/Cursor.md +docs/DailyReturn.md docs/DepositHistory.md docs/DepositHistoryItem.md docs/DetailedAccount.md @@ -52,7 +47,6 @@ docs/OrderBookStats.md docs/OrderBooks.md docs/Orders.md docs/PnLEntry.md -docs/PositionFunding.md docs/PriceLevel.md docs/PublicPool.md docs/PublicPoolInfo.md @@ -107,8 +101,6 @@ docs/WithdrawHistory.md docs/WithdrawHistoryCursor.md docs/WithdrawHistoryItem.md docs/ZkLighterInfo.md -git_push.sh -lighter/__init__.py lighter/api/__init__.py lighter/api/account_api.py lighter/api/block_api.py @@ -124,40 +116,28 @@ lighter/exceptions.py lighter/models/__init__.py lighter/models/account.py lighter/models/account_api_keys.py -lighter/models/account_market_stats.py -lighter/models/account_metadata.py lighter/models/account_pn_l.py lighter/models/account_position.py -lighter/models/account_stats.py -lighter/models/accounts.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/fee_bucket.py lighter/models/funding.py lighter/models/fundings.py -lighter/models/is_whitelisted.py -lighter/models/l1_provider_info.py lighter/models/layer2_basic_info.py -lighter/models/liquidation.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 @@ -165,168 +145,21 @@ 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/price_level.py lighter/models/public_pool.py lighter/models/public_pool_info.py lighter/models/public_pool_share.py lighter/models/public_pools.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_orders.py -lighter/models/req_get_account_pending_txs.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_fee_bucket.py -lighter/models/req_get_fundings.py -lighter/models/req_get_l1_tx.py -lighter/models/req_get_latest_deposit.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_public_pools.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_trades.py -lighter/models/req_get_tx.py -lighter/models/req_get_withdraw_history.py -lighter/models/req_is_whitelisted.py -lighter/models/result_code.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/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_cursor.py lighter/models/withdraw_history_item.py lighter/models/zk_lighter_info.py lighter/py.typed lighter/rest.py -pyproject.toml -requirements.txt -setup.cfg -setup.py -test-requirements.txt -test/__init__.py -test/test_account.py -test/test_account_api.py -test/test_account_api_keys.py -test/test_account_market_stats.py -test/test_account_metadata.py -test/test_account_pn_l.py -test/test_account_position.py -test/test_account_stats.py -test/test_accounts.py -test/test_api_key.py -test/test_block.py -test/test_block_api.py -test/test_blocks.py -test/test_bridge_supported_network.py -test/test_candlestick.py -test/test_candlestick_api.py -test/test_candlesticks.py -test/test_contract_address.py -test/test_current_height.py -test/test_cursor.py -test/test_deposit_history.py -test/test_deposit_history_item.py -test/test_detailed_account.py -test/test_detailed_accounts.py -test/test_detailed_candlestick.py -test/test_enriched_tx.py -test/test_exchange_stats.py -test/test_fee_bucket.py -test/test_funding.py -test/test_fundings.py -test/test_info_api.py -test/test_is_whitelisted.py -test/test_l1_provider_info.py -test/test_layer2_basic_info.py -test/test_liquidation.py -test/test_market_info.py -test/test_next_nonce.py -test/test_order.py -test/test_order_api.py -test/test_order_book.py -test/test_order_book_depth.py -test/test_order_book_detail.py -test/test_order_book_details.py -test/test_order_book_orders.py -test/test_order_book_stats.py -test/test_order_books.py -test/test_orders.py -test/test_pn_l_entry.py -test/test_position_funding.py -test/test_price_level.py -test/test_public_pool.py -test/test_public_pool_info.py -test/test_public_pool_share.py -test/test_public_pools.py -test/test_req_get_account.py -test/test_req_get_account_active_orders.py -test/test_req_get_account_api_keys.py -test/test_req_get_account_by_l1_address.py -test/test_req_get_account_inactive_orders.py -test/test_req_get_account_orders.py -test/test_req_get_account_pending_txs.py -test/test_req_get_account_pn_l.py -test/test_req_get_account_txs.py -test/test_req_get_block.py -test/test_req_get_block_txs.py -test/test_req_get_by_account.py -test/test_req_get_candlesticks.py -test/test_req_get_deposit_history.py -test/test_req_get_fee_bucket.py -test/test_req_get_fundings.py -test/test_req_get_l1_tx.py -test/test_req_get_latest_deposit.py -test/test_req_get_next_nonce.py -test/test_req_get_order_book_details.py -test/test_req_get_order_book_orders.py -test/test_req_get_order_books.py -test/test_req_get_public_pools.py -test/test_req_get_range_with_cursor.py -test/test_req_get_range_with_index.py -test/test_req_get_range_with_index_sortable.py -test/test_req_get_recent_trades.py -test/test_req_get_trades.py -test/test_req_get_tx.py -test/test_req_get_withdraw_history.py -test/test_req_is_whitelisted.py -test/test_result_code.py -test/test_root_api.py -test/test_simple_order.py -test/test_status.py -test/test_sub_accounts.py -test/test_ticker.py -test/test_trade.py -test/test_trades.py -test/test_transaction_api.py -test/test_tx.py -test/test_tx_hash.py -test/test_tx_hashes.py -test/test_txs.py -test/test_validator_info.py -test/test_withdraw_history.py -test/test_withdraw_history_cursor.py -test/test_withdraw_history_item.py -test/test_zk_lighter_info.py -tox.ini diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..b506b7c --- /dev/null +++ b/examples/README.md @@ -0,0 +1,24 @@ +## Setup steps for testnet +- Go to https://testnet.app.lighter.xyz/ and connect a wallet to receive $500 +- run `system_setup.py` with the correct ETH Private key configured + - set an API key index which is not 0, so you won't override the one used by [app.lighter.xyz](https://app.lighter.xyz/) + - this will require you to enter your Ethereum private key + - the eth private key will only be used in the Py SDK to sign a message + - the eth private key is not required in order to trade on the platform + - the eth private key is not passed to the binary + - copy the output of the script and post it into `create_cancel_order.py` + - the output should look like +``` +BASE_URL = 'https://testnet.zklighter.elliot.ai' +API_KEY_PRIVATE_KEY = '0xea5d2eca5be67eca056752eaf27b173518b8a5550117c09d2b58c7ea7d306cc4426f913ccf27ab19' +ACCOUNT_INDEX = 595 +API_KEY_INDEX = 1 +``` +- start trading using + - `create_cancel_order.py` has an example which created an order on testnet & cancels it + - you'll need to set up both your account index, api key index & API Key private key + +## Setup steps for mainnet +- deposit money on Lighter to create an account first +- change the URL to `mainnet.zklighter.elliot.ai` +- repeat setup step \ No newline at end of file diff --git a/examples/create_cancel_order.py b/examples/create_cancel_order.py index 94b5c2a..485a029 100644 --- a/examples/create_cancel_order.py +++ b/examples/create_cancel_order.py @@ -1,15 +1,15 @@ import asyncio import logging -import time -from lighter import SignerClient import lighter -import lighter.configuration logging.basicConfig(level=logging.DEBUG) - +# The API_KEY_PRIVATE_KEY provided belongs to a dummy account registered on Testnet. +# It was generated using the setup_system.py script, and servers as an example. BASE_URL = "https://testnet.zklighter.elliot.ai" -PRIVATE_KEY = "WALLET_PRIVATE_KEY" +API_KEY_PRIVATE_KEY = "0xc0a06468a5bbc9a7b785065a8b227a37fdfa18e2b81d51b018cb03ddd99bfbef4b7551f0f0765639" +ACCOUNT_INDEX = 595 +API_KEY_INDEX = 1 def trim_exception(e: Exception) -> str: @@ -17,42 +17,40 @@ def trim_exception(e: Exception) -> str: async def main(): - api_client = lighter.ApiClient( - configuration=lighter.Configuration(host=BASE_URL) + api_client = lighter.ApiClient(configuration=lighter.Configuration(host=BASE_URL)) + + client = lighter.SignerClient( + url=BASE_URL, + private_key=API_KEY_PRIVATE_KEY, + account_index=ACCOUNT_INDEX, + api_key_index=API_KEY_INDEX, ) - # assuring that client is created - account_created = False - new_account = False - while not account_created: - try: - client = SignerClient(url=BASE_URL, private_key=PRIVATE_KEY) - await client.set_account_index() - account_created = True - if new_account: - time.sleep(10) - except Exception as e: - new_account = True - print("Account not created yet", trim_exception(e)) - time.sleep(2) - - print("Account Index: ", client.account_index) - - tx = await client.create_order( + err = client.check_client() + if err is not None: + print(f"CheckClient error: {trim_exception(err)}") + return + + # create order + tx, tx_hash, err = await client.create_order( market_index=0, - client_order_index=0, - base_amount=10000, - price=250000, - is_ask=False, + client_order_index=123, + base_amount=100000, + price=200000, + is_ask=True, order_type=lighter.SignerClient.ORDER_TYPE_LIMIT, time_in_force=lighter.SignerClient.ORDER_TIME_IN_FORCE_GOOD_TILL_TIME, reduce_only=0, trigger_price=0, ) - print("Create Order Tx:", tx) + print(f"Create Order {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) - auth = client.create_auth_token_with_expiry(SignerClient.DEFAULT_10_MIN_AUTH_EXPIRY) - print("Auth:", auth) + auth, err = client.create_auth_token_with_expiry(lighter.SignerClient.DEFAULT_10_MIN_AUTH_EXPIRY) + print(f"{auth=}") + if err is not None: + raise Exception(err) active_orders = await lighter.OrderApi(api_client).account_active_orders( account_index=client.account_index, market_id=0, auth=auth @@ -61,16 +59,16 @@ async def main(): print("No active orders") return - print("Active Orders:", active_orders.orders) + print(f"{active_orders.orders=}") - last_order_index = active_orders.orders[0].order_index - - tx, response = await client.cancel_order( - market_index=0, order_index=last_order_index - ) - print( - f"code: {response.code} msg: {response.message} l2Hash: {response.tx_hash} tx: {tx.to_json()}" + # cancel order + tx, tx_hash, err = await client.cancel_order( + market_index=0, + order_index=123, ) + print(f"Cancel Order {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) await client.close() await api_client.close() diff --git a/examples/create_market_order.py b/examples/create_market_order.py new file mode 100644 index 0000000..1dcea08 --- /dev/null +++ b/examples/create_market_order.py @@ -0,0 +1,39 @@ +import asyncio +import logging +import lighter + +logging.basicConfig(level=logging.DEBUG) + +# The API_KEY_PRIVATE_KEY provided belongs to a dummy account registered on Testnet. +# It was generated using the setup_system.py script, and servers as an example. +BASE_URL = "https://testnet.zklighter.elliot.ai" +API_KEY_PRIVATE_KEY = "0xc0a06468a5bbc9a7b785065a8b227a37fdfa18e2b81d51b018cb03ddd99bfbef4b7551f0f0765639" +ACCOUNT_INDEX = 595 +API_KEY_INDEX = 1 + + +def trim_exception(e: Exception) -> str: + return str(e).strip().split("\n")[-1] + + +async def main(): + client = lighter.SignerClient( + url=BASE_URL, + private_key=API_KEY_PRIVATE_KEY, + account_index=ACCOUNT_INDEX, + api_key_index=API_KEY_INDEX, + ) + + tx = await client.create_market_order( + market_index=0, + client_order_index=0, + base_amount=1000, # 0.1 ETH + avg_execution_price=170000, # $1700 + is_ask=True, + ) + print("Create Order Tx:", tx) + await client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/get_info.py b/examples/get_info.py index 0572e71..bd16072 100644 --- a/examples/get_info.py +++ b/examples/get_info.py @@ -6,8 +6,10 @@ logging.basicConfig(level=logging.INFO) -L1_ADDRESS = "WALLET_L1_ADDRESS" -account_index = 0 +# The address provided belongs to a dummy account registered on Testnet. +L1_ADDRESS = "0x8D7f03FdE1A626223364E592740a233b72395235" +ACCOUNT_INDEX = 595 + async def print_api(method, *args, **kwargs): logging.info(f"{method.__name__}: {await method(*args, **kwargs)}") @@ -16,25 +18,15 @@ async def print_api(method, *args, **kwargs): async def account_apis(client: lighter.ApiClient): logging.info("ACCOUNT APIS") account_instance = lighter.AccountApi(client) - res = await account_instance.account(by="l1_address", value=L1_ADDRESS) - global account_index - if res.accounts: - account_index = res.accounts[0].index - else: - print("NO ACCOUNT FOUND") - exit(0) - await print_api(account_instance.account, by="index", value=str(account_index)) - await print_api(account_instance.accounts, index=0, limit=2, sort="asc") - await print_api( - account_instance.accounts_by_l1_address, - l1_address=L1_ADDRESS, - ) - await print_api(account_instance.apikeys, account_index=3, api_key_index=255) - await print_api(account_instance.fee_bucket, account_index=3) + await print_api(account_instance.account, by="l1_address", value=L1_ADDRESS) + await print_api(account_instance.account, by="index", value=str(ACCOUNT_INDEX)) + await print_api(account_instance.accounts_by_l1_address, l1_address=L1_ADDRESS) + await print_api(account_instance.apikeys, account_index=ACCOUNT_INDEX, api_key_index=1) + await print_api(account_instance.fee_bucket, account_index=ACCOUNT_INDEX) await print_api( account_instance.pnl, by="index", - value=str(account_index), + value=str(ACCOUNT_INDEX), resolution="1h", start_timestamp=int(datetime.datetime.now().timestamp() - 60 * 60 * 24), end_timestamp=int(datetime.datetime.now().timestamp()), @@ -93,24 +85,25 @@ async def transaction_apis(client: lighter.ApiClient): logging.info("TRANSACTION APIS") transaction_instance = lighter.TransactionApi(client) await print_api(transaction_instance.block_txs, by="block_height", value="1") - await print_api(transaction_instance.next_nonce, account_index=int(account_index), api_key_index=0) + await print_api( + transaction_instance.next_nonce, + account_index=int(ACCOUNT_INDEX), + api_key_index=0, + ) # use with a valid sequence index # await print_api(transaction_instance.tx, by="sequence_index", value="5") await print_api(transaction_instance.txs, index=0, limit=2) async def main(): - client = lighter.ApiClient( - configuration=lighter.Configuration( - host="https://testnet.zklighter.elliot.ai" - ) - ) + client = lighter.ApiClient(configuration=lighter.Configuration(host="https://testnet.zklighter.elliot.ai")) await account_apis(client) await block_apis(client) await candlestick_apis(client) await info_apis(client) await order_apis(client) await transaction_apis(client) + await client.close() if __name__ == "__main__": diff --git a/examples/system_setup.py b/examples/system_setup.py new file mode 100644 index 0000000..0c047a5 --- /dev/null +++ b/examples/system_setup.py @@ -0,0 +1,82 @@ +import asyncio +import logging +import time +import eth_account +import lighter + +logging.basicConfig(level=logging.DEBUG) + +# this is a dummy private key which is registered on Testnet. +# It serves as a good example +BASE_URL = "https://testnet.zklighter.elliot.ai" +ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678" +API_KEY_INDEX = 1 + + +async def main(): + # verify that the account exists & fetch account index + api_client = lighter.ApiClient(configuration=lighter.Configuration(host=BASE_URL)) + eth_acc = eth_account.Account.from_key(ETH_PRIVATE_KEY) + eth_address = eth_acc.address + + try: + response = await lighter.AccountApi(api_client).accounts_by_l1_address(l1_address=eth_address) + except lighter.ApiException as e: + if e.data.message == "account not found": + print(f"error: account not found for {eth_address}") + return + else: + raise e + + if len(response.sub_accounts) > 1: + for sub_account in response.sub_accounts: + print(f"found accountIndex: {sub_account.index}") + raise Exception(f"found found multiple account indexes: {len(response.sub_accounts)}") + else: + account_index = response.sub_accounts[0].index + + # create a private/public key pair for the new API key + # pass any string to be used as seed for create_api_key like + # create_api_key("Hello world random seed to make things more secure") + private_key, public_key, err = lighter.create_api_key() + if err is not None: + raise Exception(err) + + tx_client = lighter.SignerClient( + url=BASE_URL, + private_key=private_key, + account_index=account_index, + api_key_index=API_KEY_INDEX, + ) + + # change the API key + response, err = await tx_client.change_api_key( + eth_private_key=ETH_PRIVATE_KEY, + new_pubkey=public_key, + ) + if err is not None: + raise Exception(err) + + # wait some time so that we receive the new API key in the response + time.sleep(10) + + # check that the API key changed on the server + err = tx_client.check_client() + if err is not None: + raise Exception(err) + + print( + f""" +BASE_URL = '{BASE_URL}' +API_KEY_PRIVATE_KEY = '{private_key}' +ACCOUNT_INDEX = {account_index} +API_KEY_INDEX = {API_KEY_INDEX} + """ + ) + + await tx_client.close() + await api_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/ws.py b/examples/ws.py index bfa62c9..8fc6445 100644 --- a/examples/ws.py +++ b/examples/ws.py @@ -1,6 +1,6 @@ import json import logging -from lighter import WsClient +import lighter logging.basicConfig(level=logging.INFO) @@ -13,7 +13,7 @@ def on_account_update(account_id, account): logging.info(f"Account {account_id}:\n{json.dumps(account, indent=2)}") -client = WsClient( +client = lighter.WsClient( order_book_ids=[0, 1], account_ids=[1, 2], on_order_book_update=on_order_book_update, diff --git a/examples/ws_async.py b/examples/ws_async.py index 3be7989..3262192 100644 --- a/examples/ws_async.py +++ b/examples/ws_async.py @@ -1,8 +1,7 @@ import json import logging import asyncio - -from lighter import WsClient +import lighter logging.basicConfig(level=logging.INFO) @@ -15,7 +14,7 @@ def on_account_update(account_id, account): logging.info(f"Account {account_id}:\n{json.dumps(account, indent=2)}") -client = WsClient( +client = lighter.WsClient( order_book_ids=[0, 1], account_ids=[1, 2], on_order_book_update=on_order_book_update, diff --git a/lighter/__init__.py b/lighter/__init__.py index 0195a09..0801e32 100644 --- a/lighter/__init__.py +++ b/lighter/__init__.py @@ -3,11 +3,11 @@ # flake8: noqa """ - + zkLighter API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + Public APIs for Lighter - The version of the OpenAPI document: + The version of the OpenAPI document: 1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -39,40 +39,27 @@ # import models into sdk package from lighter.models.account import Account from lighter.models.account_api_keys import AccountApiKeys -from lighter.models.account_market_stats import AccountMarketStats -from lighter.models.account_metadata import AccountMetadata from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition -from lighter.models.account_stats import AccountStats -from lighter.models.account_trade_stats import AccountTradeStats -from lighter.models.accounts import Accounts from lighter.models.api_key import ApiKey from lighter.models.block import Block from lighter.models.blocks import Blocks -from lighter.models.bridge_supported_network import BridgeSupportedNetwork from lighter.models.candlestick import Candlestick from lighter.models.candlesticks import Candlesticks -from lighter.models.contract_address import ContractAddress from lighter.models.current_height import CurrentHeight -from lighter.models.cursor import Cursor +from lighter.models.daily_return import DailyReturn from lighter.models.deposit_history import DepositHistory from lighter.models.deposit_history_item import DepositHistoryItem from lighter.models.detailed_account import DetailedAccount from lighter.models.detailed_accounts import DetailedAccounts -from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_stats import ExchangeStats from lighter.models.fee_bucket import FeeBucket from lighter.models.funding import Funding from lighter.models.fundings import Fundings -from lighter.models.l1_provider_info import L1ProviderInfo -from lighter.models.layer2_basic_info import Layer2BasicInfo -from lighter.models.liquidation import Liquidation -from lighter.models.market_info import MarketInfo from lighter.models.next_nonce import NextNonce from lighter.models.order import Order from lighter.models.order_book import OrderBook -from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_detail import OrderBookDetail from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders @@ -80,57 +67,22 @@ from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders from lighter.models.pn_l_entry import PnLEntry -from lighter.models.position_funding import PositionFunding -from lighter.models.price_level import PriceLevel from lighter.models.public_pool import PublicPool from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare from lighter.models.public_pools import PublicPools -from lighter.models.req_get_account import ReqGetAccount -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders -from lighter.models.req_get_account_orders import ReqGetAccountOrders -from lighter.models.req_get_account_pending_txs import ReqGetAccountPendingTxs -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL -from lighter.models.req_get_account_txs import ReqGetAccountTxs -from lighter.models.req_get_block import ReqGetBlock -from lighter.models.req_get_block_txs import ReqGetBlockTxs -from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candlesticks import ReqGetCandlesticks -from lighter.models.req_get_deposit_history import ReqGetDepositHistory -from lighter.models.req_get_fee_bucket import ReqGetFeeBucket -from lighter.models.req_get_fundings import ReqGetFundings -from lighter.models.req_get_l1_tx import ReqGetL1Tx -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit -from lighter.models.req_get_next_nonce import ReqGetNextNonce -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders -from lighter.models.req_get_order_books import ReqGetOrderBooks -from lighter.models.req_get_public_pools import ReqGetPublicPools -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable -from lighter.models.req_get_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_trades import ReqGetTrades -from lighter.models.req_get_tx import ReqGetTx -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory -from lighter.models.result_code import ResultCode from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status from lighter.models.sub_accounts import SubAccounts -from lighter.models.ticker import Ticker from lighter.models.trade import Trade from lighter.models.trades import Trades from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes from lighter.models.txs import Txs -from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo from lighter.ws_client import WsClient -from lighter.signer_client import SignerClient +from lighter.signer_client import SignerClient, create_api_key diff --git a/lighter/api/__init__.py b/lighter/api/__init__.py index eb70861..2903967 100644 --- a/lighter/api/__init__.py +++ b/lighter/api/__init__.py @@ -4,7 +4,6 @@ from lighter.api.account_api import AccountApi from lighter.api.block_api import BlockApi from lighter.api.candlestick_api import CandlestickApi -from lighter.api.info_api import InfoApi from lighter.api.order_api import OrderApi from lighter.api.root_api import RootApi from lighter.api.transaction_api import TransactionApi diff --git a/lighter/api/account_api.py b/lighter/api/account_api.py index aece5b2..2d7efcb 100644 --- a/lighter/api/account_api.py +++ b/lighter/api/account_api.py @@ -21,7 +21,6 @@ from typing_extensions import Annotated from lighter.models.account_api_keys import AccountApiKeys from lighter.models.account_pn_l import AccountPnL -from lighter.models.accounts import Accounts from lighter.models.detailed_accounts import DetailedAccounts from lighter.models.fee_bucket import FeeBucket from lighter.models.public_pools import PublicPools @@ -325,303 +324,6 @@ def _account_serialize( - @validate_call - async def accounts( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Accounts: - """accounts - - Get accounts returns accounts by account index - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._accounts_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - async def accounts_with_http_info( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Accounts]: - """accounts - - Get accounts returns accounts by account index - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._accounts_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - await response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - async def accounts_without_preload_content( - self, - limit: Annotated[int, Field(le=100, strict=True, ge=1)], - index: Optional[StrictInt] = None, - sort: Optional[StrictStr] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """accounts - - Get accounts returns accounts by account index - - :param limit: (required) - :type limit: int - :param index: - :type index: int - :param sort: - :type sort: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._accounts_serialize( - limit=limit, - index=index, - sort=sort, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Accounts", - '400': "ResultCode", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _accounts_serialize( - self, - limit, - index, - sort, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, Union[str, bytes]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if index is not None: - - _query_params.append(('index', index)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if sort is not None: - - _query_params.append(('sort', sort)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/accounts', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call async def accounts_by_l1_address( self, @@ -889,7 +591,7 @@ def _accounts_by_l1_address_serialize( async def apikeys( self, account_index: StrictInt, - api_key_index: StrictInt, + api_key_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -909,7 +611,7 @@ async def apikeys( :param account_index: (required) :type account_index: int - :param api_key_index: (required) + :param api_key_index: :type api_key_index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -961,7 +663,7 @@ async def apikeys( async def apikeys_with_http_info( self, account_index: StrictInt, - api_key_index: StrictInt, + api_key_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -981,7 +683,7 @@ async def apikeys_with_http_info( :param account_index: (required) :type account_index: int - :param api_key_index: (required) + :param api_key_index: :type api_key_index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1033,7 +735,7 @@ async def apikeys_with_http_info( async def apikeys_without_preload_content( self, account_index: StrictInt, - api_key_index: StrictInt, + api_key_index: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1053,7 +755,7 @@ async def apikeys_without_preload_content( :param account_index: (required) :type account_index: int - :param api_key_index: (required) + :param api_key_index: :type api_key_index: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1434,9 +1136,10 @@ async def pnl( by: StrictStr, value: StrictStr, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, + auth: Optional[StrictStr] = None, ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, @@ -1467,6 +1170,8 @@ async def pnl( :type end_timestamp: int :param count_back: (required) :type count_back: int + :param auth: + :type auth: str :param ignore_transfers: :type ignore_transfers: bool :param _request_timeout: timeout setting for this request. If one @@ -1498,6 +1203,7 @@ async def pnl( start_timestamp=start_timestamp, end_timestamp=end_timestamp, count_back=count_back, + auth=auth, ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, @@ -1526,9 +1232,10 @@ async def pnl_with_http_info( by: StrictStr, value: StrictStr, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, + auth: Optional[StrictStr] = None, ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, @@ -1559,6 +1266,8 @@ async def pnl_with_http_info( :type end_timestamp: int :param count_back: (required) :type count_back: int + :param auth: + :type auth: str :param ignore_transfers: :type ignore_transfers: bool :param _request_timeout: timeout setting for this request. If one @@ -1590,6 +1299,7 @@ async def pnl_with_http_info( start_timestamp=start_timestamp, end_timestamp=end_timestamp, count_back=count_back, + auth=auth, ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, @@ -1618,9 +1328,10 @@ async def pnl_without_preload_content( by: StrictStr, value: StrictStr, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, + auth: Optional[StrictStr] = None, ignore_transfers: Optional[StrictBool] = None, _request_timeout: Union[ None, @@ -1651,6 +1362,8 @@ async def pnl_without_preload_content( :type end_timestamp: int :param count_back: (required) :type count_back: int + :param auth: + :type auth: str :param ignore_transfers: :type ignore_transfers: bool :param _request_timeout: timeout setting for this request. If one @@ -1682,6 +1395,7 @@ async def pnl_without_preload_content( start_timestamp=start_timestamp, end_timestamp=end_timestamp, count_back=count_back, + auth=auth, ignore_transfers=ignore_transfers, _request_auth=_request_auth, _content_type=_content_type, @@ -1708,6 +1422,7 @@ def _pnl_serialize( start_timestamp, end_timestamp, count_back, + auth, ignore_transfers, _request_auth, _content_type, @@ -1729,6 +1444,10 @@ def _pnl_serialize( # process the path parameters # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + if by is not None: _query_params.append(('by', by)) @@ -1791,13 +1510,12 @@ def _pnl_serialize( ) - - @validate_call async def public_pools( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1821,6 +1539,8 @@ async def public_pools( :type index: int :param limit: (required) :type limit: int + :param auth: + :type auth: str :param filter: :type filter: str :param account_index: @@ -1850,6 +1570,7 @@ async def public_pools( _param = self._public_pools_serialize( index=index, limit=limit, + auth=auth, filter=filter, account_index=account_index, _request_auth=_request_auth, @@ -1878,6 +1599,7 @@ async def public_pools_with_http_info( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1901,6 +1623,8 @@ async def public_pools_with_http_info( :type index: int :param limit: (required) :type limit: int + :param auth: + :type auth: str :param filter: :type filter: str :param account_index: @@ -1930,6 +1654,7 @@ async def public_pools_with_http_info( _param = self._public_pools_serialize( index=index, limit=limit, + auth=auth, filter=filter, account_index=account_index, _request_auth=_request_auth, @@ -1958,6 +1683,7 @@ async def public_pools_without_preload_content( self, index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, account_index: Optional[StrictInt] = None, _request_timeout: Union[ @@ -1981,6 +1707,8 @@ async def public_pools_without_preload_content( :type index: int :param limit: (required) :type limit: int + :param auth: + :type auth: str :param filter: :type filter: str :param account_index: @@ -2010,6 +1738,7 @@ async def public_pools_without_preload_content( _param = self._public_pools_serialize( index=index, limit=limit, + auth=auth, filter=filter, account_index=account_index, _request_auth=_request_auth, @@ -2033,6 +1762,7 @@ def _public_pools_serialize( self, index, limit, + auth, filter, account_index, _request_auth, @@ -2055,6 +1785,10 @@ def _public_pools_serialize( # process the path parameters # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + if filter is not None: _query_params.append(('filter', filter)) diff --git a/lighter/api/candlestick_api.py b/lighter/api/candlestick_api.py index 4ebfa02..c964c30 100644 --- a/lighter/api/candlestick_api.py +++ b/lighter/api/candlestick_api.py @@ -16,8 +16,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictBool, StrictInt, StrictStr, field_validator +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Optional +from typing_extensions import Annotated from lighter.models.candlesticks import Candlesticks from lighter.models.fundings import Fundings @@ -44,8 +45,8 @@ async def candlesticks( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, set_timestamp_to_end: Optional[StrictBool] = None, _request_timeout: Union[ @@ -132,8 +133,8 @@ async def candlesticks_with_http_info( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, set_timestamp_to_end: Optional[StrictBool] = None, _request_timeout: Union[ @@ -220,8 +221,8 @@ async def candlesticks_without_preload_content( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, set_timestamp_to_end: Optional[StrictBool] = None, _request_timeout: Union[ @@ -392,8 +393,8 @@ async def fundings( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, _request_timeout: Union[ None, @@ -476,8 +477,8 @@ async def fundings_with_http_info( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, _request_timeout: Union[ None, @@ -560,8 +561,8 @@ async def fundings_without_preload_content( self, market_id: StrictInt, resolution: StrictStr, - start_timestamp: StrictInt, - end_timestamp: StrictInt, + start_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], + end_timestamp: Annotated[int, Field(le=5000000000000, strict=True, ge=0)], count_back: StrictInt, _request_timeout: Union[ None, diff --git a/lighter/api/order_api.py b/lighter/api/order_api.py index dc9579c..fa247cb 100644 --- a/lighter/api/order_api.py +++ b/lighter/api/order_api.py @@ -344,6 +344,7 @@ def _account_active_orders_serialize( @validate_call async def account_inactive_orders( self, + auth: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], market_id: Optional[StrictInt] = None, @@ -367,6 +368,8 @@ async def account_inactive_orders( Get account inactive orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param limit: (required) @@ -402,6 +405,7 @@ async def account_inactive_orders( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + auth=auth, account_index=account_index, limit=limit, market_id=market_id, @@ -432,6 +436,7 @@ async def account_inactive_orders( @validate_call async def account_inactive_orders_with_http_info( self, + auth: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], market_id: Optional[StrictInt] = None, @@ -455,6 +460,8 @@ async def account_inactive_orders_with_http_info( Get account inactive orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param limit: (required) @@ -490,6 +497,7 @@ async def account_inactive_orders_with_http_info( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + auth=auth, account_index=account_index, limit=limit, market_id=market_id, @@ -520,6 +528,7 @@ async def account_inactive_orders_with_http_info( @validate_call async def account_inactive_orders_without_preload_content( self, + auth: StrictStr, account_index: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], market_id: Optional[StrictInt] = None, @@ -543,6 +552,8 @@ async def account_inactive_orders_without_preload_content( Get account inactive orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param limit: (required) @@ -578,6 +589,7 @@ async def account_inactive_orders_without_preload_content( """ # noqa: E501 _param = self._account_inactive_orders_serialize( + auth=auth, account_index=account_index, limit=limit, market_id=market_id, @@ -603,6 +615,7 @@ async def account_inactive_orders_without_preload_content( def _account_inactive_orders_serialize( self, + auth, account_index, limit, market_id, @@ -629,6 +642,10 @@ def _account_inactive_orders_serialize( # process the path parameters # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + if account_index is not None: _query_params.append(('account_index', account_index)) @@ -692,6 +709,7 @@ def _account_inactive_orders_serialize( @validate_call async def account_orders( self, + auth: StrictStr, account_index: StrictInt, market_id: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], @@ -713,6 +731,8 @@ async def account_orders( Get account orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param market_id: (required) @@ -744,6 +764,7 @@ async def account_orders( """ # noqa: E501 _param = self._account_orders_serialize( + auth=auth, account_index=account_index, market_id=market_id, limit=limit, @@ -772,6 +793,7 @@ async def account_orders( @validate_call async def account_orders_with_http_info( self, + auth: StrictStr, account_index: StrictInt, market_id: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], @@ -793,6 +815,8 @@ async def account_orders_with_http_info( Get account orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param market_id: (required) @@ -824,6 +848,7 @@ async def account_orders_with_http_info( """ # noqa: E501 _param = self._account_orders_serialize( + auth=auth, account_index=account_index, market_id=market_id, limit=limit, @@ -852,6 +877,7 @@ async def account_orders_with_http_info( @validate_call async def account_orders_without_preload_content( self, + auth: StrictStr, account_index: StrictInt, market_id: StrictInt, limit: Annotated[int, Field(le=100, strict=True, ge=1)], @@ -873,6 +899,8 @@ async def account_orders_without_preload_content( Get account orders + :param auth: (required) + :type auth: str :param account_index: (required) :type account_index: int :param market_id: (required) @@ -904,6 +932,7 @@ async def account_orders_without_preload_content( """ # noqa: E501 _param = self._account_orders_serialize( + auth=auth, account_index=account_index, market_id=market_id, limit=limit, @@ -927,6 +956,7 @@ async def account_orders_without_preload_content( def _account_orders_serialize( self, + auth, account_index, market_id, limit, @@ -951,6 +981,10 @@ def _account_orders_serialize( # process the path parameters # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + if account_index is not None: _query_params.append(('account_index', account_index)) @@ -2340,6 +2374,7 @@ async def trades( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2368,6 +2403,8 @@ async def trades( :type sort_by: str :param limit: (required) :type limit: int + :param auth: + :type auth: str :param market_id: :type market_id: int :param account_index: @@ -2407,6 +2444,7 @@ async def trades( _param = self._trades_serialize( sort_by=sort_by, limit=limit, + auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, @@ -2440,6 +2478,7 @@ async def trades_with_http_info( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2468,6 +2507,8 @@ async def trades_with_http_info( :type sort_by: str :param limit: (required) :type limit: int + :param auth: + :type auth: str :param market_id: :type market_id: int :param account_index: @@ -2507,6 +2548,7 @@ async def trades_with_http_info( _param = self._trades_serialize( sort_by=sort_by, limit=limit, + auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, @@ -2540,6 +2582,7 @@ async def trades_without_preload_content( self, sort_by: StrictStr, limit: Annotated[int, Field(le=100, strict=True, ge=1)], + auth: Optional[StrictStr] = None, market_id: Optional[StrictInt] = None, account_index: Optional[StrictInt] = None, order_index: Optional[StrictInt] = None, @@ -2568,6 +2611,8 @@ async def trades_without_preload_content( :type sort_by: str :param limit: (required) :type limit: int + :param auth: + :type auth: str :param market_id: :type market_id: int :param account_index: @@ -2607,6 +2652,7 @@ async def trades_without_preload_content( _param = self._trades_serialize( sort_by=sort_by, limit=limit, + auth=auth, market_id=market_id, account_index=account_index, order_index=order_index, @@ -2635,6 +2681,7 @@ def _trades_serialize( self, sort_by, limit, + auth, market_id, account_index, order_index, @@ -2662,6 +2709,10 @@ def _trades_serialize( # process the path parameters # process the query parameters + if auth is not None: + + _query_params.append(('auth', auth)) + if market_id is not None: _query_params.append(('market_id', market_id)) diff --git a/lighter/api/transaction_api.py b/lighter/api/transaction_api.py index 3e0f526..d146305 100644 --- a/lighter/api/transaction_api.py +++ b/lighter/api/transaction_api.py @@ -660,6 +660,8 @@ def _block_txs_serialize( @validate_call async def deposit_history( self, + account_index: StrictInt, + auth: StrictStr, l1_address: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, @@ -680,6 +682,10 @@ async def deposit_history( Get deposit history + :param account_index: (required) + :type account_index: int + :param auth: (required) + :type auth: str :param l1_address: (required) :type l1_address: str :param cursor: @@ -709,6 +715,8 @@ async def deposit_history( """ # noqa: E501 _param = self._deposit_history_serialize( + account_index=account_index, + auth=auth, l1_address=l1_address, cursor=cursor, filter=filter, @@ -736,6 +744,8 @@ async def deposit_history( @validate_call async def deposit_history_with_http_info( self, + account_index: StrictInt, + auth: StrictStr, l1_address: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, @@ -756,6 +766,10 @@ async def deposit_history_with_http_info( Get deposit history + :param account_index: (required) + :type account_index: int + :param auth: (required) + :type auth: str :param l1_address: (required) :type l1_address: str :param cursor: @@ -785,6 +799,8 @@ async def deposit_history_with_http_info( """ # noqa: E501 _param = self._deposit_history_serialize( + account_index=account_index, + auth=auth, l1_address=l1_address, cursor=cursor, filter=filter, @@ -812,6 +828,8 @@ async def deposit_history_with_http_info( @validate_call async def deposit_history_without_preload_content( self, + account_index: StrictInt, + auth: StrictStr, l1_address: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, @@ -832,6 +850,10 @@ async def deposit_history_without_preload_content( Get deposit history + :param account_index: (required) + :type account_index: int + :param auth: (required) + :type auth: str :param l1_address: (required) :type l1_address: str :param cursor: @@ -861,6 +883,8 @@ async def deposit_history_without_preload_content( """ # noqa: E501 _param = self._deposit_history_serialize( + account_index=account_index, + auth=auth, l1_address=l1_address, cursor=cursor, filter=filter, @@ -883,6 +907,8 @@ async def deposit_history_without_preload_content( def _deposit_history_serialize( self, + account_index, + auth, l1_address, cursor, filter, @@ -906,6 +932,14 @@ def _deposit_history_serialize( # process the path parameters # process the query parameters + if account_index is not None: + + _query_params.append(('account_index', account_index)) + + if auth is not None: + + _query_params.append(('auth', auth)) + if l1_address is not None: _query_params.append(('l1_address', l1_address)) @@ -2654,6 +2688,7 @@ def _txs_serialize( async def withdraw_history( self, account_index: StrictInt, + auth: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2675,6 +2710,8 @@ async def withdraw_history( :param account_index: (required) :type account_index: int + :param auth: (required) + :type auth: str :param cursor: :type cursor: str :param filter: @@ -2703,6 +2740,7 @@ async def withdraw_history( _param = self._withdraw_history_serialize( account_index=account_index, + auth=auth, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2730,6 +2768,7 @@ async def withdraw_history( async def withdraw_history_with_http_info( self, account_index: StrictInt, + auth: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2751,6 +2790,8 @@ async def withdraw_history_with_http_info( :param account_index: (required) :type account_index: int + :param auth: (required) + :type auth: str :param cursor: :type cursor: str :param filter: @@ -2779,6 +2820,7 @@ async def withdraw_history_with_http_info( _param = self._withdraw_history_serialize( account_index=account_index, + auth=auth, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2806,6 +2848,7 @@ async def withdraw_history_with_http_info( async def withdraw_history_without_preload_content( self, account_index: StrictInt, + auth: StrictStr, cursor: Optional[StrictStr] = None, filter: Optional[StrictStr] = None, _request_timeout: Union[ @@ -2827,6 +2870,8 @@ async def withdraw_history_without_preload_content( :param account_index: (required) :type account_index: int + :param auth: (required) + :type auth: str :param cursor: :type cursor: str :param filter: @@ -2855,6 +2900,7 @@ async def withdraw_history_without_preload_content( _param = self._withdraw_history_serialize( account_index=account_index, + auth=auth, cursor=cursor, filter=filter, _request_auth=_request_auth, @@ -2877,6 +2923,7 @@ async def withdraw_history_without_preload_content( def _withdraw_history_serialize( self, account_index, + auth, cursor, filter, _request_auth, @@ -2903,6 +2950,10 @@ def _withdraw_history_serialize( _query_params.append(('account_index', account_index)) + if auth is not None: + + _query_params.append(('auth', auth)) + if cursor is not None: _query_params.append(('cursor', cursor)) diff --git a/lighter/models/__init__.py b/lighter/models/__init__.py index 1a5bc23..19c157c 100644 --- a/lighter/models/__init__.py +++ b/lighter/models/__init__.py @@ -16,40 +16,28 @@ # import models into model package from lighter.models.account import Account from lighter.models.account_api_keys import AccountApiKeys -from lighter.models.account_market_stats import AccountMarketStats -from lighter.models.account_metadata import AccountMetadata from lighter.models.account_pn_l import AccountPnL from lighter.models.account_position import AccountPosition -from lighter.models.account_stats import AccountStats -from lighter.models.account_trade_stats import AccountTradeStats -from lighter.models.accounts import Accounts from lighter.models.api_key import ApiKey from lighter.models.block import Block from lighter.models.blocks import Blocks -from lighter.models.bridge_supported_network import BridgeSupportedNetwork from lighter.models.candlestick import Candlestick from lighter.models.candlesticks import Candlesticks -from lighter.models.contract_address import ContractAddress from lighter.models.current_height import CurrentHeight -from lighter.models.cursor import Cursor +from lighter.models.daily_return import DailyReturn from lighter.models.deposit_history import DepositHistory from lighter.models.deposit_history_item import DepositHistoryItem from lighter.models.detailed_account import DetailedAccount from lighter.models.detailed_accounts import DetailedAccounts -from lighter.models.detailed_candlestick import DetailedCandlestick from lighter.models.enriched_tx import EnrichedTx from lighter.models.exchange_stats import ExchangeStats from lighter.models.fee_bucket import FeeBucket from lighter.models.funding import Funding from lighter.models.fundings import Fundings -from lighter.models.l1_provider_info import L1ProviderInfo from lighter.models.layer2_basic_info import Layer2BasicInfo -from lighter.models.liquidation import Liquidation -from lighter.models.market_info import MarketInfo from lighter.models.next_nonce import NextNonce from lighter.models.order import Order from lighter.models.order_book import OrderBook -from lighter.models.order_book_depth import OrderBookDepth from lighter.models.order_book_detail import OrderBookDetail from lighter.models.order_book_details import OrderBookDetails from lighter.models.order_book_orders import OrderBookOrders @@ -57,54 +45,19 @@ from lighter.models.order_books import OrderBooks from lighter.models.orders import Orders from lighter.models.pn_l_entry import PnLEntry -from lighter.models.position_funding import PositionFunding -from lighter.models.price_level import PriceLevel from lighter.models.public_pool import PublicPool from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare from lighter.models.public_pools import PublicPools -from lighter.models.req_get_account import ReqGetAccount -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders -from lighter.models.req_get_account_orders import ReqGetAccountOrders -from lighter.models.req_get_account_pending_txs import ReqGetAccountPendingTxs -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL -from lighter.models.req_get_account_txs import ReqGetAccountTxs -from lighter.models.req_get_block import ReqGetBlock -from lighter.models.req_get_block_txs import ReqGetBlockTxs -from lighter.models.req_get_by_account import ReqGetByAccount -from lighter.models.req_get_candlesticks import ReqGetCandlesticks -from lighter.models.req_get_deposit_history import ReqGetDepositHistory -from lighter.models.req_get_fee_bucket import ReqGetFeeBucket -from lighter.models.req_get_fundings import ReqGetFundings -from lighter.models.req_get_l1_tx import ReqGetL1Tx -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit -from lighter.models.req_get_next_nonce import ReqGetNextNonce -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders -from lighter.models.req_get_order_books import ReqGetOrderBooks -from lighter.models.req_get_public_pools import ReqGetPublicPools -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable -from lighter.models.req_get_recent_trades import ReqGetRecentTrades -from lighter.models.req_get_trades import ReqGetTrades -from lighter.models.req_get_tx import ReqGetTx -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory -from lighter.models.result_code import ResultCode from lighter.models.simple_order import SimpleOrder from lighter.models.status import Status from lighter.models.sub_accounts import SubAccounts -from lighter.models.ticker import Ticker from lighter.models.trade import Trade from lighter.models.trades import Trades from lighter.models.tx import Tx from lighter.models.tx_hash import TxHash from lighter.models.tx_hashes import TxHashes from lighter.models.txs import Txs -from lighter.models.validator_info import ValidatorInfo from lighter.models.withdraw_history import WithdrawHistory from lighter.models.withdraw_history_item import WithdrawHistoryItem from lighter.models.zk_lighter_info import ZkLighterInfo diff --git a/lighter/models/account_market_stats.py b/lighter/models/account_market_stats.py deleted file mode 100644 index ea24c4b..0000000 --- a/lighter/models/account_market_stats.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class AccountMarketStats(BaseModel): - """ - AccountMarketStats - """ # noqa: E501 - market_id: StrictInt - daily_trades_count: StrictInt - daily_base_token_volume: Union[StrictFloat, StrictInt] - daily_quote_token_volume: Union[StrictFloat, StrictInt] - total_trades_count: StrictInt - total_base_token_volume: Union[StrictFloat, StrictInt] - total_quote_token_volume: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "daily_trades_count", "daily_base_token_volume", "daily_quote_token_volume", "total_trades_count", "total_base_token_volume", "total_quote_token_volume"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AccountMarketStats from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccountMarketStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "daily_trades_count": obj.get("daily_trades_count"), - "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume"), - "total_trades_count": obj.get("total_trades_count"), - "total_base_token_volume": obj.get("total_base_token_volume"), - "total_quote_token_volume": obj.get("total_quote_token_volume") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/account_metadata.py b/lighter/models/account_metadata.py deleted file mode 100644 index 1b68877..0000000 --- a/lighter/models/account_metadata.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class AccountMetadata(BaseModel): - """ - AccountMetadata - """ # noqa: E501 - name: StrictStr - description: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "description"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AccountMetadata from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccountMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "description": obj.get("description") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/account_position.py b/lighter/models/account_position.py index 3bc6b28..c0e590f 100644 --- a/lighter/models/account_position.py +++ b/lighter/models/account_position.py @@ -18,7 +18,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -31,14 +31,16 @@ class AccountPosition(BaseModel): initial_margin_fraction: StrictStr open_order_count: StrictInt pending_order_count: StrictInt + position_tied_order_count: StrictInt sign: StrictInt position: StrictStr avg_entry_price: StrictStr position_value: StrictStr unrealized_pnl: StrictStr realized_pnl: StrictStr + total_funding_paid_out: Optional[StrictStr] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl"] + __properties: ClassVar[List[str]] = ["market_id", "symbol", "initial_margin_fraction", "open_order_count", "pending_order_count", "position_tied_order_count", "sign", "position", "avg_entry_price", "position_value", "unrealized_pnl", "realized_pnl", "total_funding_paid_out"] model_config = ConfigDict( populate_by_name=True, @@ -103,12 +105,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "initial_margin_fraction": obj.get("initial_margin_fraction"), "open_order_count": obj.get("open_order_count"), "pending_order_count": obj.get("pending_order_count"), + "position_tied_order_count": obj.get("position_tied_order_count"), "sign": obj.get("sign"), "position": obj.get("position"), "avg_entry_price": obj.get("avg_entry_price"), "position_value": obj.get("position_value"), "unrealized_pnl": obj.get("unrealized_pnl"), - "realized_pnl": obj.get("realized_pnl") + "realized_pnl": obj.get("realized_pnl"), + "total_funding_paid_out": obj.get("total_funding_paid_out") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/account_stats.py b/lighter/models/account_stats.py deleted file mode 100644 index 85e14c2..0000000 --- a/lighter/models/account_stats.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class AccountStats(BaseModel): - """ - AccountStats - """ # noqa: E501 - collateral: StrictStr - portfolio_value: StrictStr - leverage: StrictStr - available_balance: StrictStr - margin_usage: StrictStr - buying_power: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["collateral", "portfolio_value", "leverage", "available_balance", "margin_usage", "buying_power"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AccountStats from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccountStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "collateral": obj.get("collateral"), - "portfolio_value": obj.get("portfolio_value"), - "leverage": obj.get("leverage"), - "available_balance": obj.get("available_balance"), - "margin_usage": obj.get("margin_usage"), - "buying_power": obj.get("buying_power") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/account_trade_stats.py b/lighter/models/account_trade_stats.py deleted file mode 100644 index 9ea3bdb..0000000 --- a/lighter/models/account_trade_stats.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class AccountTradeStats(BaseModel): - """ - AccountTradeStats - """ # noqa: E501 - total_trades_count: StrictInt - total_volume: Union[StrictFloat, StrictInt] - daily_trades_count: StrictInt - daily_volume: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["total_trades_count", "total_volume", "daily_trades_count", "daily_volume"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AccountTradeStats from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AccountTradeStats from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "total_trades_count": obj.get("total_trades_count"), - "total_volume": obj.get("total_volume"), - "daily_trades_count": obj.get("daily_trades_count"), - "daily_volume": obj.get("daily_volume") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/accounts.py b/lighter/models/accounts.py deleted file mode 100644 index c3b2e2c..0000000 --- a/lighter/models/accounts.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.account import Account -from typing import Optional, Set -from typing_extensions import Self - -class Accounts(BaseModel): - """ - Accounts - """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - total: StrictInt - accounts: List[Account] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "total", "accounts"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Accounts from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in accounts (list) - _items = [] - if self.accounts: - for _item in self.accounts: - if _item: - _items.append(_item.to_dict()) - _dict['accounts'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Accounts from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "total": obj.get("total"), - "accounts": [Account.from_dict(_item) for _item in obj["accounts"]] if obj.get("accounts") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/bridge_supported_network.py b/lighter/models/bridge_supported_network.py deleted file mode 100644 index 4e3533a..0000000 --- a/lighter/models/bridge_supported_network.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class BridgeSupportedNetwork(BaseModel): - """ - BridgeSupportedNetwork - """ # noqa: E501 - name: StrictStr - chain_id: StrictStr - explorer: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "chain_id", "explorer"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BridgeSupportedNetwork from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BridgeSupportedNetwork from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "chain_id": obj.get("chain_id"), - "explorer": obj.get("explorer") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/contract_address.py b/lighter/models/contract_address.py deleted file mode 100644 index 768652e..0000000 --- a/lighter/models/contract_address.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ContractAddress(BaseModel): - """ - ContractAddress - """ # noqa: E501 - name: StrictStr - address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["name", "address"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ContractAddress from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ContractAddress from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "address": obj.get("address") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/cursor.py b/lighter/models/cursor.py deleted file mode 100644 index a1ca1ef..0000000 --- a/lighter/models/cursor.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class Cursor(BaseModel): - """ - Cursor - """ # noqa: E501 - next_cursor: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["next_cursor"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Cursor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Cursor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "next_cursor": obj.get("next_cursor") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/price_level.py b/lighter/models/daily_return.py similarity index 83% rename from lighter/models/price_level.py rename to lighter/models/daily_return.py index dc5b081..0453381 100644 --- a/lighter/models/price_level.py +++ b/lighter/models/daily_return.py @@ -17,19 +17,19 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self -class PriceLevel(BaseModel): +class DailyReturn(BaseModel): """ - PriceLevel + DailyReturn """ # noqa: E501 - price: StrictStr - size: StrictStr + timestamp: StrictInt + daily_return: Union[StrictFloat, StrictInt] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["price", "size"] + __properties: ClassVar[List[str]] = ["timestamp", "daily_return"] model_config = ConfigDict( populate_by_name=True, @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PriceLevel from a JSON string""" + """Create an instance of DailyReturn from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -81,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PriceLevel from a dict""" + """Create an instance of DailyReturn from a dict""" if obj is None: return None @@ -89,8 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "price": obj.get("price"), - "size": obj.get("size") + "timestamp": obj.get("timestamp"), + "daily_return": obj.get("daily_return") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/detailed_account.py b/lighter/models/detailed_account.py index b74113c..aa1d9bb 100644 --- a/lighter/models/detailed_account.py +++ b/lighter/models/detailed_account.py @@ -17,9 +17,8 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.account_market_stats import AccountMarketStats from lighter.models.account_position import AccountPosition from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare @@ -42,13 +41,15 @@ class DetailedAccount(BaseModel): collateral: StrictStr name: StrictStr description: StrictStr + can_invite: StrictBool + referral_points_percentage: StrictStr + max_referral_usage_limit: StrictInt positions: List[AccountPosition] total_asset_value: StrictStr - market_stats: List[AccountMarketStats] pool_info: PublicPoolInfo shares: List[PublicPoolShare] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "positions", "total_asset_value", "market_stats", "pool_info", "shares"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "can_invite", "referral_points_percentage", "max_referral_usage_limit", "positions", "total_asset_value", "pool_info", "shares"] model_config = ConfigDict( populate_by_name=True, @@ -98,13 +99,6 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['positions'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in market_stats (list) - _items = [] - if self.market_stats: - for _item in self.market_stats: - if _item: - _items.append(_item.to_dict()) - _dict['market_stats'] = _items # override the default output from pydantic by calling `to_dict()` of pool_info if self.pool_info: _dict['pool_info'] = self.pool_info.to_dict() @@ -144,9 +138,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collateral": obj.get("collateral"), "name": obj.get("name"), "description": obj.get("description"), + "can_invite": obj.get("can_invite"), + "referral_points_percentage": obj.get("referral_points_percentage"), + "max_referral_usage_limit": obj.get("max_referral_usage_limit"), "positions": [AccountPosition.from_dict(_item) for _item in obj["positions"]] if obj.get("positions") is not None else None, "total_asset_value": obj.get("total_asset_value"), - "market_stats": [AccountMarketStats.from_dict(_item) for _item in obj["market_stats"]] if obj.get("market_stats") is not None else None, "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, "shares": [PublicPoolShare.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None }) diff --git a/lighter/models/detailed_candlestick.py b/lighter/models/detailed_candlestick.py deleted file mode 100644 index 36a84ca..0000000 --- a/lighter/models/detailed_candlestick.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class DetailedCandlestick(BaseModel): - """ - DetailedCandlestick - """ # noqa: E501 - timestamp: StrictInt - open: Union[StrictFloat, StrictInt] - high: Union[StrictFloat, StrictInt] - low: Union[StrictFloat, StrictInt] - close: Union[StrictFloat, StrictInt] - volume0: Union[StrictFloat, StrictInt] - volume1: Union[StrictFloat, StrictInt] - last_trade_id: StrictInt - trade_count: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "open", "high", "low", "close", "volume0", "volume1", "last_trade_id", "trade_count"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DetailedCandlestick from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DetailedCandlestick from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "open": obj.get("open"), - "high": obj.get("high"), - "low": obj.get("low"), - "close": obj.get("close"), - "volume0": obj.get("volume0"), - "volume1": obj.get("volume1"), - "last_trade_id": obj.get("last_trade_id"), - "trade_count": obj.get("trade_count") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/l1_provider_info.py b/lighter/models/l1_provider_info.py deleted file mode 100644 index 9620bfb..0000000 --- a/lighter/models/l1_provider_info.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class L1ProviderInfo(BaseModel): - """ - L1ProviderInfo - """ # noqa: E501 - chain_id: StrictInt = Field(alias="chainId") - network_id: StrictInt = Field(alias="networkId") - latest_block_number: StrictInt = Field(alias="latestBlockNumber") - network_rpc: StrictStr = Field(alias="NetworkRpc") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["chainId", "networkId", "latestBlockNumber", "NetworkRpc"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of L1ProviderInfo from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of L1ProviderInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "chainId": obj.get("chainId"), - "networkId": obj.get("networkId"), - "latestBlockNumber": obj.get("latestBlockNumber"), - "NetworkRpc": obj.get("NetworkRpc") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/liquidation.py b/lighter/models/liquidation.py deleted file mode 100644 index 96ed5e2..0000000 --- a/lighter/models/liquidation.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class Liquidation(BaseModel): - """ - Liquidation - """ # noqa: E501 - liquidation_id: StrictInt - account_index: StrictInt - liquidation_type: StrictInt - portfolio_value: StrictStr - margin_requirement: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["liquidation_id", "account_index", "liquidation_type", "portfolio_value", "margin_requirement"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Liquidation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Liquidation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "liquidation_id": obj.get("liquidation_id"), - "account_index": obj.get("account_index"), - "liquidation_type": obj.get("liquidation_type"), - "portfolio_value": obj.get("portfolio_value"), - "margin_requirement": obj.get("margin_requirement") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/market_info.py b/lighter/models/market_info.py deleted file mode 100644 index c836971..0000000 --- a/lighter/models/market_info.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class MarketInfo(BaseModel): - """ - MarketInfo - """ # noqa: E501 - market_id: StrictInt - index_price: StrictStr - mark_price: StrictStr - open_interest: StrictStr - last_trade_price: StrictStr - current_funding_rate: StrictStr - funding_rate: StrictStr - funding_timestamp: StrictInt - daily_base_token_volume: Union[StrictFloat, StrictInt] - daily_quote_token_volume: Union[StrictFloat, StrictInt] - daily_price_low: Union[StrictFloat, StrictInt] - daily_price_high: Union[StrictFloat, StrictInt] - daily_price_change: Union[StrictFloat, StrictInt] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "index_price", "mark_price", "open_interest", "last_trade_price", "current_funding_rate", "funding_rate", "funding_timestamp", "daily_base_token_volume", "daily_quote_token_volume", "daily_price_low", "daily_price_high", "daily_price_change"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of MarketInfo from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of MarketInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "index_price": obj.get("index_price"), - "mark_price": obj.get("mark_price"), - "open_interest": obj.get("open_interest"), - "last_trade_price": obj.get("last_trade_price"), - "current_funding_rate": obj.get("current_funding_rate"), - "funding_rate": obj.get("funding_rate"), - "funding_timestamp": obj.get("funding_timestamp"), - "daily_base_token_volume": obj.get("daily_base_token_volume"), - "daily_quote_token_volume": obj.get("daily_quote_token_volume"), - "daily_price_low": obj.get("daily_price_low"), - "daily_price_high": obj.get("daily_price_high"), - "daily_price_change": obj.get("daily_price_change") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/order.py b/lighter/models/order.py index 0b8e187..91d7885 100644 --- a/lighter/models/order.py +++ b/lighter/models/order.py @@ -28,6 +28,8 @@ class Order(BaseModel): """ # noqa: E501 order_index: StrictInt client_order_index: StrictInt + order_id: StrictStr + client_order_id: StrictStr market_index: StrictInt owner_account_index: StrictInt initial_base_amount: StrictStr @@ -46,12 +48,17 @@ class Order(BaseModel): trigger_price: StrictStr order_expiry: StrictInt status: StrictStr + trigger_status: StrictStr trigger_time: StrictInt parent_order_index: StrictInt + parent_order_id: StrictStr + to_trigger_order_id_0: StrictStr + to_trigger_order_id_1: StrictStr + to_cancel_order_id_0: StrictStr block_height: StrictInt timestamp: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_time", "parent_order_index", "block_height", "timestamp"] + __properties: ClassVar[List[str]] = ["order_index", "client_order_index", "order_id", "client_order_id", "market_index", "owner_account_index", "initial_base_amount", "price", "nonce", "remaining_base_amount", "is_ask", "base_size", "base_price", "filled_base_amount", "filled_quote_amount", "side", "type", "time_in_force", "reduce_only", "trigger_price", "order_expiry", "status", "trigger_status", "trigger_time", "parent_order_index", "parent_order_id", "to_trigger_order_id_0", "to_trigger_order_id_1", "to_cancel_order_id_0", "block_height", "timestamp"] @field_validator('type') def type_validate_enum(cls, value): @@ -70,8 +77,15 @@ def time_in_force_validate_enum(cls, value): @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value not in set(['in-progress', 'pending', 'open', 'filled', 'canceled', 'canceled-post-only', 'canceled-reduce-only', 'canceled-position-not-allowed', 'canceled-margin-not-allowed', 'canceled-too-much-slippage', 'canceled-not-enough-liquidity', 'canceled-self-trade', 'canceled-expired']): - raise ValueError("must be one of enum values ('in-progress', 'pending', 'open', 'filled', 'canceled', 'canceled-post-only', 'canceled-reduce-only', 'canceled-position-not-allowed', 'canceled-margin-not-allowed', 'canceled-too-much-slippage', 'canceled-not-enough-liquidity', 'canceled-self-trade', 'canceled-expired')") + if value not in set(['in-progress', 'pending', 'open', 'filled', 'canceled', 'canceled-post-only', 'canceled-reduce-only', 'canceled-position-not-allowed', 'canceled-margin-not-allowed', 'canceled-too-much-slippage', 'canceled-not-enough-liquidity', 'canceled-self-trade', 'canceled-expired', 'canceled-oco', 'canceled-child']): + raise ValueError("must be one of enum values ('in-progress', 'pending', 'open', 'filled', 'canceled', 'canceled-post-only', 'canceled-reduce-only', 'canceled-position-not-allowed', 'canceled-margin-not-allowed', 'canceled-too-much-slippage', 'canceled-not-enough-liquidity', 'canceled-self-trade', 'canceled-expired', 'canceled-oco', 'canceled-child')") + return value + + @field_validator('trigger_status') + def trigger_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['na', 'ready', 'mark-price', 'twap', 'parent-order']): + raise ValueError("must be one of enum values ('na', 'ready', 'mark-price', 'twap', 'parent-order')") return value model_config = ConfigDict( @@ -134,6 +148,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "order_index": obj.get("order_index"), "client_order_index": obj.get("client_order_index"), + "order_id": obj.get("order_id"), + "client_order_id": obj.get("client_order_id"), "market_index": obj.get("market_index"), "owner_account_index": obj.get("owner_account_index"), "initial_base_amount": obj.get("initial_base_amount"), @@ -152,8 +168,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "trigger_price": obj.get("trigger_price"), "order_expiry": obj.get("order_expiry"), "status": obj.get("status"), + "trigger_status": obj.get("trigger_status"), "trigger_time": obj.get("trigger_time"), "parent_order_index": obj.get("parent_order_index"), + "parent_order_id": obj.get("parent_order_id"), + "to_trigger_order_id_0": obj.get("to_trigger_order_id_0"), + "to_trigger_order_id_1": obj.get("to_trigger_order_id_1"), + "to_cancel_order_id_0": obj.get("to_cancel_order_id_0"), "block_height": obj.get("block_height"), "timestamp": obj.get("timestamp") }) diff --git a/lighter/models/order_book_depth.py b/lighter/models/order_book_depth.py deleted file mode 100644 index 214d798..0000000 --- a/lighter/models/order_book_depth.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from lighter.models.price_level import PriceLevel -from typing import Optional, Set -from typing_extensions import Self - -class OrderBookDepth(BaseModel): - """ - OrderBookDepth - """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - asks: List[PriceLevel] - bids: List[PriceLevel] - offset: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "asks", "bids", "offset"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrderBookDepth from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in asks (list) - _items = [] - if self.asks: - for _item in self.asks: - if _item: - _items.append(_item.to_dict()) - _dict['asks'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in bids (list) - _items = [] - if self.bids: - for _item in self.bids: - if _item: - _items.append(_item.to_dict()) - _dict['bids'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrderBookDepth from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "asks": [PriceLevel.from_dict(_item) for _item in obj["asks"]] if obj.get("asks") is not None else None, - "bids": [PriceLevel.from_dict(_item) for _item in obj["bids"]] if obj.get("bids") is not None else None, - "offset": obj.get("offset") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/pn_l_entry.py b/lighter/models/pn_l_entry.py index 1a8e292..e0b53fc 100644 --- a/lighter/models/pn_l_entry.py +++ b/lighter/models/pn_l_entry.py @@ -28,8 +28,12 @@ class PnLEntry(BaseModel): """ # noqa: E501 timestamp: StrictInt value: Union[StrictFloat, StrictInt] + trade_pnl: Union[StrictFloat, StrictInt] + pool_pnl: Union[StrictFloat, StrictInt] + inflow: Union[StrictFloat, StrictInt] + outflow: Union[StrictFloat, StrictInt] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "value"] + __properties: ClassVar[List[str]] = ["timestamp", "value", "trade_pnl", "pool_pnl", "inflow", "outflow"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "timestamp": obj.get("timestamp"), - "value": obj.get("value") + "value": obj.get("value"), + "trade_pnl": obj.get("trade_pnl"), + "pool_pnl": obj.get("pool_pnl"), + "inflow": obj.get("inflow"), + "outflow": obj.get("outflow") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/position_funding.py b/lighter/models/position_funding.py deleted file mode 100644 index 1fee27f..0000000 --- a/lighter/models/position_funding.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class PositionFunding(BaseModel): - """ - PositionFunding - """ # noqa: E501 - timestamp: StrictInt - market_id: StrictInt - funding_id: StrictInt - change: StrictStr - rate: StrictStr - position_size: StrictStr - position_side: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["timestamp", "market_id", "funding_id", "change", "rate", "position_size", "position_side"] - - @field_validator('position_side') - def position_side_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['long', 'short']): - raise ValueError("must be one of enum values ('long', 'short')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PositionFunding from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PositionFunding from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "market_id": obj.get("market_id"), - "funding_id": obj.get("funding_id"), - "change": obj.get("change"), - "rate": obj.get("rate"), - "position_size": obj.get("position_size"), - "position_side": obj.get("position_side") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/public_pool.py b/lighter/models/public_pool.py index 210aee3..16f611d 100644 --- a/lighter/models/public_pool.py +++ b/lighter/models/public_pool.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from lighter.models.public_pool_info import PublicPoolInfo from lighter.models.public_pool_share import PublicPoolShare @@ -40,11 +40,14 @@ class PublicPool(BaseModel): collateral: StrictStr name: StrictStr description: StrictStr + can_invite: StrictBool + referral_points_percentage: StrictStr + max_referral_usage_limit: StrictInt total_asset_value: StrictStr pool_info: PublicPoolInfo - account_share: PublicPoolShare + account_share: Optional[PublicPoolShare] = None additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "total_asset_value", "pool_info", "account_share"] + __properties: ClassVar[List[str]] = ["code", "message", "account_type", "index", "l1_address", "cancel_all_time", "total_order_count", "pending_order_count", "status", "collateral", "name", "description", "can_invite", "referral_points_percentage", "max_referral_usage_limit", "total_asset_value", "pool_info", "account_share"] model_config = ConfigDict( populate_by_name=True, @@ -122,6 +125,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "collateral": obj.get("collateral"), "name": obj.get("name"), "description": obj.get("description"), + "can_invite": obj.get("can_invite"), + "referral_points_percentage": obj.get("referral_points_percentage"), + "max_referral_usage_limit": obj.get("max_referral_usage_limit"), "total_asset_value": obj.get("total_asset_value"), "pool_info": PublicPoolInfo.from_dict(obj["pool_info"]) if obj.get("pool_info") is not None else None, "account_share": PublicPoolShare.from_dict(obj["account_share"]) if obj.get("account_share") is not None else None diff --git a/lighter/models/public_pool_info.py b/lighter/models/public_pool_info.py index b327707..9566848 100644 --- a/lighter/models/public_pool_info.py +++ b/lighter/models/public_pool_info.py @@ -17,8 +17,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from lighter.models.daily_return import DailyReturn from typing import Optional, Set from typing_extensions import Self @@ -31,8 +32,13 @@ class PublicPoolInfo(BaseModel): min_operator_share_rate: StrictStr total_shares: StrictInt operator_shares: StrictInt + share_price_1d: Union[StrictFloat, StrictInt] + share_price_7d: Union[StrictFloat, StrictInt] + share_price_30d: Union[StrictFloat, StrictInt] + annual_percentage_yield: Union[StrictFloat, StrictInt] + daily_returns: List[DailyReturn] additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares"] + __properties: ClassVar[List[str]] = ["status", "operator_fee", "min_operator_share_rate", "total_shares", "operator_shares", "share_price_1d", "share_price_7d", "share_price_30d", "annual_percentage_yield", "daily_returns"] model_config = ConfigDict( populate_by_name=True, @@ -75,6 +81,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in daily_returns (list) + _items = [] + if self.daily_returns: + for _item in self.daily_returns: + if _item: + _items.append(_item.to_dict()) + _dict['daily_returns'] = _items # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: for _key, _value in self.additional_properties.items(): @@ -96,7 +109,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "operator_fee": obj.get("operator_fee"), "min_operator_share_rate": obj.get("min_operator_share_rate"), "total_shares": obj.get("total_shares"), - "operator_shares": obj.get("operator_shares") + "operator_shares": obj.get("operator_shares"), + "share_price_1d": obj.get("share_price_1d"), + "share_price_7d": obj.get("share_price_7d"), + "share_price_30d": obj.get("share_price_30d"), + "annual_percentage_yield": obj.get("annual_percentage_yield"), + "daily_returns": [DailyReturn.from_dict(_item) for _item in obj["daily_returns"]] if obj.get("daily_returns") is not None else None }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/req_get_account.py b/lighter/models/req_get_account.py deleted file mode 100644 index c6108e6..0000000 --- a/lighter/models/req_get_account.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccount(BaseModel): - """ - ReqGetAccount - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['index', 'l1_address']): - raise ValueError("must be one of enum values ('index', 'l1_address')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccount from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccount from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_active_orders.py b/lighter/models/req_get_account_active_orders.py deleted file mode 100644 index d1193bb..0000000 --- a/lighter/models/req_get_account_active_orders.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountActiveOrders(BaseModel): - """ - ReqGetAccountActiveOrders - """ # noqa: E501 - account_index: StrictInt - market_id: StrictInt - auth: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "market_id", "auth"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountActiveOrders from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountActiveOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "auth": obj.get("auth") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_api_keys.py b/lighter/models/req_get_account_api_keys.py deleted file mode 100644 index a9c462e..0000000 --- a/lighter/models/req_get_account_api_keys.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountApiKeys(BaseModel): - """ - ReqGetAccountApiKeys - """ # noqa: E501 - account_index: StrictInt - api_key_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountApiKeys from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountApiKeys from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "api_key_index": obj.get("api_key_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_by_l1_address.py b/lighter/models/req_get_account_by_l1_address.py deleted file mode 100644 index a0b86eb..0000000 --- a/lighter/models/req_get_account_by_l1_address.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountByL1Address(BaseModel): - """ - ReqGetAccountByL1Address - """ # noqa: E501 - l1_address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountByL1Address from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountByL1Address from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "l1_address": obj.get("l1_address") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_inactive_orders.py b/lighter/models/req_get_account_inactive_orders.py deleted file mode 100644 index 4577704..0000000 --- a/lighter/models/req_get_account_inactive_orders.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountInactiveOrders(BaseModel): - """ - ReqGetAccountInactiveOrders - """ # noqa: E501 - account_index: StrictInt - market_id: Optional[StrictInt] = None - ask_filter: Optional[StrictInt] = None - between_timestamps: Optional[StrictStr] = None - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "market_id", "ask_filter", "between_timestamps", "cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountInactiveOrders from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountInactiveOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "ask_filter": obj.get("ask_filter"), - "between_timestamps": obj.get("between_timestamps"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_orders.py b/lighter/models/req_get_account_orders.py deleted file mode 100644 index 82052d2..0000000 --- a/lighter/models/req_get_account_orders.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountOrders(BaseModel): - """ - ReqGetAccountOrders - """ # noqa: E501 - account_index: StrictInt - market_id: StrictInt - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "market_id", "cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountOrders from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "market_id": obj.get("market_id"), - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_pending_txs.py b/lighter/models/req_get_account_pending_txs.py deleted file mode 100644 index 9f0f878..0000000 --- a/lighter/models/req_get_account_pending_txs.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountPendingTxs(BaseModel): - """ - ReqGetAccountPendingTxs - """ # noqa: E501 - by: Optional[StrictStr] = None - value: Optional[StrictStr] = None - types: Optional[List[StrictInt]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value", "types"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['account_index']): - raise ValueError("must be one of enum values ('account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountPendingTxs from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountPendingTxs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value"), - "types": obj.get("types") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_pn_l.py b/lighter/models/req_get_account_pn_l.py deleted file mode 100644 index c4e5b8f..0000000 --- a/lighter/models/req_get_account_pn_l.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountPnL(BaseModel): - """ - ReqGetAccountPnL - """ # noqa: E501 - by: StrictStr - value: StrictStr - resolution: StrictStr - start_timestamp: StrictInt - end_timestamp: StrictInt - count_back: StrictInt - ignore_transfers: Optional[StrictBool] = False - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value", "resolution", "start_timestamp", "end_timestamp", "count_back", "ignore_transfers"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['index']): - raise ValueError("must be one of enum values ('index')") - return value - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1m', '5m', '15m', '1h', '4h', '1d']): - raise ValueError("must be one of enum values ('1m', '5m', '15m', '1h', '4h', '1d')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountPnL from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountPnL from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back"), - "ignore_transfers": obj.get("ignore_transfers") if obj.get("ignore_transfers") is not None else False - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_account_txs.py b/lighter/models/req_get_account_txs.py deleted file mode 100644 index c83d7ae..0000000 --- a/lighter/models/req_get_account_txs.py +++ /dev/null @@ -1,119 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetAccountTxs(BaseModel): - """ - ReqGetAccountTxs - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None - by: Optional[StrictStr] = None - value: Optional[StrictStr] = None - types: Optional[List[StrictInt]] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit", "by", "value", "types"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['account_index']): - raise ValueError("must be one of enum values ('account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetAccountTxs from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetAccountTxs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "index": obj.get("index"), - "limit": obj.get("limit"), - "by": obj.get("by"), - "value": obj.get("value"), - "types": obj.get("types") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_block.py b/lighter/models/req_get_block.py deleted file mode 100644 index 574e2c7..0000000 --- a/lighter/models/req_get_block.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetBlock(BaseModel): - """ - ReqGetBlock - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['commitment', 'height']): - raise ValueError("must be one of enum values ('commitment', 'height')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetBlock from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetBlock from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_block_txs.py b/lighter/models/req_get_block_txs.py deleted file mode 100644 index b040c5e..0000000 --- a/lighter/models/req_get_block_txs.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetBlockTxs(BaseModel): - """ - ReqGetBlockTxs - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['block_height', 'block_commitment']): - raise ValueError("must be one of enum values ('block_height', 'block_commitment')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetBlockTxs from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetBlockTxs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_by_account.py b/lighter/models/req_get_by_account.py deleted file mode 100644 index 9e52c14..0000000 --- a/lighter/models/req_get_by_account.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetByAccount(BaseModel): - """ - ReqGetByAccount - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['account_index']): - raise ValueError("must be one of enum values ('account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetByAccount from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetByAccount from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_candlesticks.py b/lighter/models/req_get_candlesticks.py deleted file mode 100644 index 2b8861b..0000000 --- a/lighter/models/req_get_candlesticks.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetCandlesticks(BaseModel): - """ - ReqGetCandlesticks - """ # noqa: E501 - market_id: StrictInt - resolution: StrictStr - start_timestamp: StrictInt - end_timestamp: StrictInt - count_back: StrictInt - set_timestamp_to_end: Optional[StrictBool] = False - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back", "set_timestamp_to_end"] - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1m', '5m', '15m', '1h', '4h', '1d']): - raise ValueError("must be one of enum values ('1m', '5m', '15m', '1h', '4h', '1d')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetCandlesticks from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetCandlesticks from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back"), - "set_timestamp_to_end": obj.get("set_timestamp_to_end") if obj.get("set_timestamp_to_end") is not None else False - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_deposit_history.py b/lighter/models/req_get_deposit_history.py deleted file mode 100644 index 1511f92..0000000 --- a/lighter/models/req_get_deposit_history.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetDepositHistory(BaseModel): - """ - ReqGetDepositHistory - """ # noqa: E501 - l1_address: StrictStr - cursor: Optional[StrictStr] = None - filter: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address", "cursor", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'pending', 'claimable']): - raise ValueError("must be one of enum values ('all', 'pending', 'claimable')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetDepositHistory from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetDepositHistory from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "l1_address": obj.get("l1_address"), - "cursor": obj.get("cursor"), - "filter": obj.get("filter") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_fee_bucket.py b/lighter/models/req_get_fee_bucket.py deleted file mode 100644 index 17bb262..0000000 --- a/lighter/models/req_get_fee_bucket.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetFeeBucket(BaseModel): - """ - ReqGetFeeBucket - """ # noqa: E501 - account_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetFeeBucket from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetFeeBucket from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_fundings.py b/lighter/models/req_get_fundings.py deleted file mode 100644 index af9a20a..0000000 --- a/lighter/models/req_get_fundings.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetFundings(BaseModel): - """ - ReqGetFundings - """ # noqa: E501 - market_id: StrictInt - resolution: StrictStr - start_timestamp: StrictInt - end_timestamp: StrictInt - count_back: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "resolution", "start_timestamp", "end_timestamp", "count_back"] - - @field_validator('resolution') - def resolution_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['1h']): - raise ValueError("must be one of enum values ('1h')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetFundings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetFundings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "resolution": obj.get("resolution"), - "start_timestamp": obj.get("start_timestamp"), - "end_timestamp": obj.get("end_timestamp"), - "count_back": obj.get("count_back") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_l1_tx.py b/lighter/models/req_get_l1_tx.py deleted file mode 100644 index dda8501..0000000 --- a/lighter/models/req_get_l1_tx.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetL1Tx(BaseModel): - """ - ReqGetL1Tx - """ # noqa: E501 - hash: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["hash"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetL1Tx from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetL1Tx from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_latest_deposit.py b/lighter/models/req_get_latest_deposit.py deleted file mode 100644 index 6ce2506..0000000 --- a/lighter/models/req_get_latest_deposit.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetLatestDeposit(BaseModel): - """ - ReqGetLatestDeposit - """ # noqa: E501 - l1_address: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["l1_address"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetLatestDeposit from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetLatestDeposit from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "l1_address": obj.get("l1_address") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_next_nonce.py b/lighter/models/req_get_next_nonce.py deleted file mode 100644 index 90920a0..0000000 --- a/lighter/models/req_get_next_nonce.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetNextNonce(BaseModel): - """ - ReqGetNextNonce - """ # noqa: E501 - account_index: StrictInt - api_key_index: StrictInt - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "api_key_index"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetNextNonce from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetNextNonce from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "api_key_index": obj.get("api_key_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_book_details.py b/lighter/models/req_get_order_book_details.py deleted file mode 100644 index e38a012..0000000 --- a/lighter/models/req_get_order_book_details.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetOrderBookDetails(BaseModel): - """ - ReqGetOrderBookDetails - """ # noqa: E501 - market_id: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBookDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetOrderBookDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_book_orders.py b/lighter/models/req_get_order_book_orders.py deleted file mode 100644 index 52c008f..0000000 --- a/lighter/models/req_get_order_book_orders.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetOrderBookOrders(BaseModel): - """ - ReqGetOrderBookOrders - """ # noqa: E501 - market_id: StrictInt - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBookOrders from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetOrderBookOrders from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_order_books.py b/lighter/models/req_get_order_books.py deleted file mode 100644 index 9608c4b..0000000 --- a/lighter/models/req_get_order_books.py +++ /dev/null @@ -1,100 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetOrderBooks(BaseModel): - """ - ReqGetOrderBooks - """ # noqa: E501 - market_id: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetOrderBooks from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetOrderBooks from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_public_pools.py b/lighter/models/req_get_public_pools.py deleted file mode 100644 index cac0b25..0000000 --- a/lighter/models/req_get_public_pools.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetPublicPools(BaseModel): - """ - ReqGetPublicPools - """ # noqa: E501 - filter: Optional[StrictStr] = None - index: StrictInt - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - account_index: Optional[StrictInt] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["filter", "index", "limit", "account_index"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'user', 'protocol', 'account_index']): - raise ValueError("must be one of enum values ('all', 'user', 'protocol', 'account_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetPublicPools from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetPublicPools from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "filter": obj.get("filter"), - "index": obj.get("index"), - "limit": obj.get("limit"), - "account_index": obj.get("account_index") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_cursor.py b/lighter/models/req_get_range_with_cursor.py deleted file mode 100644 index dc7821e..0000000 --- a/lighter/models/req_get_range_with_cursor.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithCursor(BaseModel): - """ - ReqGetRangeWithCursor - """ # noqa: E501 - cursor: Optional[StrictStr] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["cursor", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithCursor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetRangeWithCursor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "cursor": obj.get("cursor"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_index.py b/lighter/models/req_get_range_with_index.py deleted file mode 100644 index e589449..0000000 --- a/lighter/models/req_get_range_with_index.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithIndex(BaseModel): - """ - ReqGetRangeWithIndex - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndex from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndex from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "index": obj.get("index"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_range_with_index_sortable.py b/lighter/models/req_get_range_with_index_sortable.py deleted file mode 100644 index d22bbb2..0000000 --- a/lighter/models/req_get_range_with_index_sortable.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRangeWithIndexSortable(BaseModel): - """ - ReqGetRangeWithIndexSortable - """ # noqa: E501 - index: Optional[StrictInt] = None - limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None - sort: Optional[StrictStr] = 'asc' - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["index", "limit", "sort"] - - @field_validator('sort') - def sort_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['asc', 'desc']): - raise ValueError("must be one of enum values ('asc', 'desc')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndexSortable from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetRangeWithIndexSortable from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "index": obj.get("index"), - "limit": obj.get("limit"), - "sort": obj.get("sort") if obj.get("sort") is not None else 'asc' - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_recent_trades.py b/lighter/models/req_get_recent_trades.py deleted file mode 100644 index 96dba79..0000000 --- a/lighter/models/req_get_recent_trades.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt -from typing import Any, ClassVar, Dict, List -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetRecentTrades(BaseModel): - """ - ReqGetRecentTrades - """ # noqa: E501 - market_id: StrictInt - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetRecentTrades from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetRecentTrades from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_trades.py b/lighter/models/req_get_trades.py deleted file mode 100644 index 16f5ed8..0000000 --- a/lighter/models/req_get_trades.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing_extensions import Annotated -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTrades(BaseModel): - """ - ReqGetTrades - """ # noqa: E501 - market_id: Optional[StrictInt] = None - account_index: Optional[StrictInt] = -1 - order_index: Optional[StrictInt] = None - sort_by: StrictStr - sort_dir: Optional[StrictStr] = 'asc' - cursor: Optional[StrictStr] = None - var_from: Optional[StrictInt] = Field(default=-1, alias="from") - ask_filter: Optional[StrictInt] = None - limit: Annotated[int, Field(le=100, strict=True, ge=1)] - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["market_id", "account_index", "order_index", "sort_by", "sort_dir", "cursor", "from", "ask_filter", "limit"] - - @field_validator('sort_by') - def sort_by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['block_height', 'timestamp', 'trade_id']): - raise ValueError("must be one of enum values ('block_height', 'timestamp', 'trade_id')") - return value - - @field_validator('sort_dir') - def sort_dir_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['asc', 'desc']): - raise ValueError("must be one of enum values ('asc', 'desc')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetTrades from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetTrades from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "market_id": obj.get("market_id"), - "account_index": obj.get("account_index") if obj.get("account_index") is not None else -1, - "order_index": obj.get("order_index"), - "sort_by": obj.get("sort_by"), - "sort_dir": obj.get("sort_dir") if obj.get("sort_dir") is not None else 'asc', - "cursor": obj.get("cursor"), - "from": obj.get("from") if obj.get("from") is not None else -1, - "ask_filter": obj.get("ask_filter"), - "limit": obj.get("limit") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_tx.py b/lighter/models/req_get_tx.py deleted file mode 100644 index 275c4ff..0000000 --- a/lighter/models/req_get_tx.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetTx(BaseModel): - """ - ReqGetTx - """ # noqa: E501 - by: StrictStr - value: StrictStr - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["by", "value"] - - @field_validator('by') - def by_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['hash', 'sequence_index']): - raise ValueError("must be one of enum values ('hash', 'sequence_index')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetTx from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetTx from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "by": obj.get("by"), - "value": obj.get("value") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/req_get_withdraw_history.py b/lighter/models/req_get_withdraw_history.py deleted file mode 100644 index 38ca57c..0000000 --- a/lighter/models/req_get_withdraw_history.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ReqGetWithdrawHistory(BaseModel): - """ - ReqGetWithdrawHistory - """ # noqa: E501 - account_index: StrictInt - cursor: Optional[StrictStr] = None - filter: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["account_index", "cursor", "filter"] - - @field_validator('filter') - def filter_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['all', 'pending', 'claimable']): - raise ValueError("must be one of enum values ('all', 'pending', 'claimable')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ReqGetWithdrawHistory from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ReqGetWithdrawHistory from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "account_index": obj.get("account_index"), - "cursor": obj.get("cursor"), - "filter": obj.get("filter") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/result_code.py b/lighter/models/result_code.py deleted file mode 100644 index a29a276..0000000 --- a/lighter/models/result_code.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ResultCode(BaseModel): - """ - ResultCode - """ # noqa: E501 - code: StrictInt - message: Optional[StrictStr] = None - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ResultCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ResultCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/simple_order.py b/lighter/models/simple_order.py index d5cd8b5..a10be5d 100644 --- a/lighter/models/simple_order.py +++ b/lighter/models/simple_order.py @@ -27,13 +27,14 @@ class SimpleOrder(BaseModel): SimpleOrder """ # noqa: E501 order_index: StrictInt + order_id: StrictStr owner_account_index: StrictInt initial_base_amount: StrictStr remaining_base_amount: StrictStr price: StrictStr order_expiry: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["order_index", "owner_account_index", "initial_base_amount", "remaining_base_amount", "price", "order_expiry"] + __properties: ClassVar[List[str]] = ["order_index", "order_id", "owner_account_index", "initial_base_amount", "remaining_base_amount", "price", "order_expiry"] model_config = ConfigDict( populate_by_name=True, @@ -94,6 +95,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "order_index": obj.get("order_index"), + "order_id": obj.get("order_id"), "owner_account_index": obj.get("owner_account_index"), "initial_base_amount": obj.get("initial_base_amount"), "remaining_base_amount": obj.get("remaining_base_amount"), diff --git a/lighter/models/status.py b/lighter/models/status.py index 2db4004..d2026f0 100644 --- a/lighter/models/status.py +++ b/lighter/models/status.py @@ -28,8 +28,9 @@ class Status(BaseModel): """ # noqa: E501 status: StrictInt network_id: StrictInt + timestamp: StrictInt additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["status", "network_id"] + __properties: ClassVar[List[str]] = ["status", "network_id", "timestamp"] model_config = ConfigDict( populate_by_name=True, @@ -90,7 +91,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "status": obj.get("status"), - "network_id": obj.get("network_id") + "network_id": obj.get("network_id"), + "timestamp": obj.get("timestamp") }) # store additional fields in additional_properties for _key in obj.keys(): diff --git a/lighter/models/ticker.py b/lighter/models/ticker.py deleted file mode 100644 index 96a5cd4..0000000 --- a/lighter/models/ticker.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List -from lighter.models.price_level import PriceLevel -from typing import Optional, Set -from typing_extensions import Self - -class Ticker(BaseModel): - """ - Ticker - """ # noqa: E501 - s: StrictStr - a: PriceLevel - b: PriceLevel - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["s", "a", "b"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Ticker from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of a - if self.a: - _dict['a'] = self.a.to_dict() - # override the default output from pydantic by calling `to_dict()` of b - if self.b: - _dict['b'] = self.b.to_dict() - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Ticker from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "s": obj.get("s"), - "a": PriceLevel.from_dict(obj["a"]) if obj.get("a") is not None else None, - "b": PriceLevel.from_dict(obj["b"]) if obj.get("b") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/models/validator_info.py b/lighter/models/validator_info.py deleted file mode 100644 index ca08bdf..0000000 --- a/lighter/models/validator_info.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class ValidatorInfo(BaseModel): - """ - ValidatorInfo - """ # noqa: E501 - address: StrictStr - is_active: StrictBool - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["address", "is_active"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ValidatorInfo from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. - """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ValidatorInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "address": obj.get("address"), - "is_active": obj.get("is_active") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj - - diff --git a/lighter/signer_client.py b/lighter/signer_client.py index be65e97..6ebdc6b 100644 --- a/lighter/signer_client.py +++ b/lighter/signer_client.py @@ -1,10 +1,13 @@ import ctypes +import json import platform import logging import os import time from eth_account import Account +from eth_account.messages import encode_defunct +from pydantic import StrictInt import lighter from lighter.configuration import Configuration from lighter.models import TxHash @@ -13,9 +16,54 @@ logging.basicConfig(level=logging.DEBUG) +class ApiKeyResponse(ctypes.Structure): + _fields_ = [("privateKey", ctypes.c_char_p), ("publicKey", ctypes.c_char_p), ("err", ctypes.c_char_p)] + + +class StrOrErr(ctypes.Structure): + _fields_ = [("str", ctypes.c_char_p), ("err", ctypes.c_char_p)] + + +def _initialize_signer(): + is_linux = platform.system() == "Linux" + is_mac = platform.system() == "Darwin" + is_x64 = platform.machine().lower() in ("amd64", "x86_64") + is_arm = platform.machine().lower() == "arm64" + + current_file_directory = os.path.dirname(os.path.abspath(__file__)) + path_to_signer_folders = os.path.join(current_file_directory, "signers") + + if is_arm and is_mac: + logging.debug("Detected ARM architecture on macOS.") + return ctypes.CDLL(os.path.join(path_to_signer_folders, "signer-arm64.dylib")) + elif is_linux and is_x64: + logging.debug("Detected x64/amd architecture on Linux.") + return ctypes.CDLL(os.path.join(path_to_signer_folders, "signer-amd64.so")) + else: + raise Exception( + f"Unsupported platform/architecture: {platform.system()}/{platform.machine()} only supports Linux(x86) and Darwin(arm64)" + ) + + +def create_api_key(seed=""): + signer = _initialize_signer() + signer.GenerateAPIKey.argtypes = [ + ctypes.c_char_p, + ] + signer.GenerateAPIKey.restype = ApiKeyResponse + result = signer.GenerateAPIKey(ctypes.c_char_p(seed.encode("utf-8"))) + + private_key_str = result.privateKey.decode("utf-8") if result.privateKey else None + public_key_str = result.publicKey.decode("utf-8") if result.publicKey else None + error = result.err.decode("utf-8") if result.err else None + + return private_key_str, public_key_str, error + + class SignerClient: USDC_TICKER_SCALE = 1e6 + TX_TYPE_CHANGE_PUB_KEY = 8 TX_TYPE_CREATE_SUB_ACCOUNT = 9 TX_TYPE_CREATE_PUBLIC_POOL = 10 TX_TYPE_UPDATE_PUBLIC_POOL = 11 @@ -42,12 +90,14 @@ class SignerClient: NIL_TRIGGER_PRICE = 0 DEFAULT_28_DAY_ORDER_EXPIRY = -1 + DEFAULT_IOC_EXPIRY = 0 DEFAULT_10_MIN_AUTH_EXPIRY = -1 MINUTE = 60 - def __init__( - self, url, private_key, chain_id=300, api_key_index=0, account_index=-1 - ): + def __init__(self, url, private_key, api_key_index, account_index): + chain_id = 304 if "mainnet" in url else 300 + + # api_key_index=0 is generally used by frontend if private_key.startswith("0x"): private_key = private_key[2:] self.url = url @@ -55,46 +105,10 @@ def __init__( self.chain_id = chain_id self.api_key_index = api_key_index self.account_index = account_index - self.signer = self._initialize_signer() + self.signer = _initialize_signer() self.api_client = lighter.ApiClient(configuration=Configuration(host=url)) self.tx_api = lighter.TransactionApi(self.api_client) self.create_client() - self.l1_address = Account.from_key(private_key).address - - def _initialize_signer(self): - is_linux = platform.system() == "Linux" - is_mac = platform.system() == "Darwin" - is_x64 = platform.machine().lower() in ("amd64", "x86_64") - is_arm = platform.machine().lower() == "arm64" - - current_file_directory = os.path.dirname(os.path.abspath(__file__)) - path_to_signer_folders = os.path.join(current_file_directory, "signers") - - if is_arm and is_mac: - logging.debug("Detected ARM architecture on macOS.") - return ctypes.CDLL( - os.path.join(path_to_signer_folders, "signer-arm64.dylib") - ) - elif is_linux and is_x64: - logging.debug("Detected x64/amd architecture on Linux.") - return ctypes.CDLL(os.path.join(path_to_signer_folders, "signer-amd64.so")) - else: - raise Exception( - f"Unsupported platform/architecture: {platform.system()}/{platform.machine()} only supports Linux(x86) and Darwin(arm64)" - ) - - async def set_account_index(self) -> int: - if self.account_index != -1: - return self.account_index - - accounts = await lighter.AccountApi(self.api_client).accounts_by_l1_address( - l1_address=self.l1_address - ) - if len(accounts.sub_accounts) > 0: - self.account_index = min(acc.index for acc in accounts.sub_accounts) - return self.account_index - - return -1 def create_client(self): self.signer.CreateClient.argtypes = [ @@ -104,8 +118,8 @@ def create_client(self): ctypes.c_int, ctypes.c_longlong, ] - self.signer.CreateClient.restype = ctypes.c_void_p - self.signer.CreateClient( + self.signer.CreateClient.restype = ctypes.c_char_p + err = self.signer.CreateClient( self.url.encode("utf-8"), self.private_key.encode("utf-8"), self.chain_id, @@ -113,6 +127,61 @@ def create_client(self): self.account_index, ) + if err is None: + return + + err_str = err.decode("utf-8") + raise Exception(err_str) + + # check_client verifies that the given API key associated with (api_key_index, account_index) matches the one on Lighter + def check_client(self): + self.signer.CheckClient.argtypes = [ + ctypes.c_int, + ctypes.c_longlong, + ] + self.signer.CheckClient.restype = ctypes.c_char_p + + result = self.signer.CheckClient(self.api_key_index, self.account_index) + return result.decode("utf-8") if result else None + + def create_api_key(self, seed=""): + self.signer.GenerateAPIKey.argtypes = [ + ctypes.c_char_p, + ] + self.signer.GenerateAPIKey.restype = ApiKeyResponse + result = self.signer.GenerateAPIKey(ctypes.c_char_p(seed.encode("utf-8"))) + + private_key_str = result.str.decode("utf-8") if result.privateKey else None + public_key_str = result.str.decode("utf-8") if result.publicKey else None + error = result.err.decode("utf-8") if result.err else None + + return private_key_str, public_key_str, error + + def sign_change_api_key(self, eth_private_key, new_pubkey: str, nonce: int): + self.signer.SignChangePubKey.argtypes = [ + ctypes.c_char_p, + ctypes.c_longlong, + ] + self.signer.SignChangePubKey.restype = StrOrErr + result = self.signer.SignChangePubKey(ctypes.c_char_p(new_pubkey.encode("utf-8")), nonce) + + tx_info_str = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + if error is not None: + return None, error + + # fetch message to sign + tx_info = json.loads(tx_info_str) + msg_to_sign = tx_info["MessageToSign"] + del tx_info["MessageToSign"] + + # sign the message + acct = Account.from_key(eth_private_key) + message = encode_defunct(text=msg_to_sign) + signature = acct.sign_message(message) + tx_info["L1Sig"] = signature.signature.to_0x_hex() + return json.dumps(tx_info), None + def sign_create_order( self, market_index, @@ -140,8 +209,9 @@ def sign_create_order( ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignCreateOrder.restype = ctypes.c_char_p - return self.signer.SignCreateOrder( + self.signer.SignCreateOrder.restype = StrOrErr + + result = self.signer.SignCreateOrder( market_index, client_order_index, base_amount, @@ -153,7 +223,12 @@ def sign_create_order( trigger_price, order_expiry, nonce, - ).decode("utf-8") + ) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_cancel_order(self, market_index, order_index, nonce=-1): self.signer.SignCancelOrder.argtypes = [ @@ -161,20 +236,36 @@ def sign_cancel_order(self, market_index, order_index, nonce=-1): ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignCancelOrder.restype = ctypes.c_char_p - return self.signer.SignCancelOrder(market_index, order_index, nonce).decode( - "utf-8" - ) + self.signer.SignCancelOrder.restype = StrOrErr + + result = self.signer.SignCancelOrder(market_index, order_index, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_withdraw(self, usdc_amount, nonce=-1): self.signer.SignWithdraw.argtypes = [ctypes.c_longlong, ctypes.c_longlong] - self.signer.SignWithdraw.restype = ctypes.c_char_p - return self.signer.SignWithdraw(usdc_amount, nonce).decode("utf-8") + self.signer.SignWithdraw.restype = StrOrErr + + result = self.signer.SignWithdraw(usdc_amount, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_create_sub_account(self, nonce=-1): self.signer.SignCreateSubAccount.argtypes = [ctypes.c_longlong] - self.signer.SignCreateSubAccount.restype = ctypes.c_char_p - return self.signer.SignCreateSubAccount(nonce).decode("utf-8") + self.signer.SignCreateSubAccount.restype = StrOrErr + + result = self.signer.SignCreateSubAccount(nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_cancel_all_orders(self, time_in_force, time, nonce=-1): self.signer.SignCancelAllOrders.argtypes = [ @@ -182,14 +273,16 @@ def sign_cancel_all_orders(self, time_in_force, time, nonce=-1): ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignCancelAllOrders.restype = ctypes.c_char_p - return self.signer.SignCancelAllOrders(time_in_force, time, nonce).decode( - "utf-8" - ) + self.signer.SignCancelAllOrders.restype = StrOrErr - def sign_modify_order( - self, market_index, order_index, base_amount, price, trigger_price, nonce=-1 - ): + result = self.signer.SignCancelAllOrders(time_in_force, time, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error + + def sign_modify_order(self, market_index, order_index, base_amount, price, trigger_price, nonce=-1): self.signer.SignModifyOrder.argtypes = [ ctypes.c_int, ctypes.c_longlong, @@ -198,10 +291,14 @@ def sign_modify_order( ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignModifyOrder.restype = ctypes.c_char_p - return self.signer.SignModifyOrder( - market_index, order_index, base_amount, price, trigger_price, nonce - ).decode("utf-8") + self.signer.SignModifyOrder.restype = StrOrErr + + result = self.signer.SignModifyOrder(market_index, order_index, base_amount, price, trigger_price, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_transfer(self, to_account_index, usdc_amount, nonce=-1): self.signer.SignTransfer.argtypes = [ @@ -209,28 +306,32 @@ def sign_transfer(self, to_account_index, usdc_amount, nonce=-1): ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignTransfer.restype = ctypes.c_char_p - return self.signer.SignTransfer(to_account_index, usdc_amount, nonce).decode( - "utf-8" - ) + self.signer.SignTransfer.restype = StrOrErr - def sign_create_public_pool( - self, operator_fee, initial_total_shares, min_operator_share_rate, nonce=-1 - ): + result = self.signer.SignTransfer(to_account_index, usdc_amount, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error + + def sign_create_public_pool(self, operator_fee, initial_total_shares, min_operator_share_rate, nonce=-1): self.signer.SignCreatePublicPool.argtypes = [ ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignCreatePublicPool.restype = ctypes.c_char_p - return self.signer.SignCreatePublicPool( - operator_fee, initial_total_shares, min_operator_share_rate, nonce - ).decode("utf-8") + self.signer.SignCreatePublicPool.restype = StrOrErr - def sign_update_public_pool( - self, public_pool_index, status, operator_fee, min_operator_share_rate, nonce=-1 - ): + result = self.signer.SignCreatePublicPool(operator_fee, initial_total_shares, min_operator_share_rate, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error + + def sign_update_public_pool(self, public_pool_index, status, operator_fee, min_operator_share_rate, nonce=-1): self.signer.SignUpdatePublicPool.argtypes = [ ctypes.c_longlong, ctypes.c_int, @@ -238,10 +339,16 @@ def sign_update_public_pool( ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignUpdatePublicPool.restype = ctypes.c_char_p - return self.signer.SignUpdatePublicPool( + self.signer.SignUpdatePublicPool.restype = StrOrErr + + result = self.signer.SignUpdatePublicPool( public_pool_index, status, operator_fee, min_operator_share_rate, nonce - ).decode("utf-8") + ) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_mint_shares(self, public_pool_index, share_amount, nonce=-1): self.signer.SignMintShares.argtypes = [ @@ -249,10 +356,14 @@ def sign_mint_shares(self, public_pool_index, share_amount, nonce=-1): ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignMintShares.restype = ctypes.c_char_p - return self.signer.SignMintShares( - public_pool_index, share_amount, nonce - ).decode("utf-8") + self.signer.SignMintShares.restype = StrOrErr + + result = self.signer.SignMintShares(public_pool_index, share_amount, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_burn_shares(self, public_pool_index, share_amount, nonce=-1): self.signer.SignBurnShares.argtypes = [ @@ -260,10 +371,14 @@ def sign_burn_shares(self, public_pool_index, share_amount, nonce=-1): ctypes.c_longlong, ctypes.c_longlong, ] - self.signer.SignBurnShares.restype = ctypes.c_char_p - return self.signer.SignBurnShares( - public_pool_index, share_amount, nonce - ).decode("utf-8") + self.signer.SignBurnShares.restype = StrOrErr + + result = self.signer.SignBurnShares(public_pool_index, share_amount, nonce) + + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error def sign_update_leverage(self, market_index, leverage, nonce=-1): self.signer.SignUpdateLeverage.argtypes = [ @@ -271,17 +386,38 @@ def sign_update_leverage(self, market_index, leverage, nonce=-1): ctypes.c_int, ctypes.c_longlong, ] - self.signer.SignUpdateLeverage.restype = ctypes.c_char_p - return self.signer.SignUpdateLeverage(market_index, leverage, nonce).decode( - "utf-8" - ) + self.signer.SignUpdateLeverage.restype = StrOrErr + + result = self.signer.SignUpdateLeverage(market_index, leverage, nonce) - def create_auth_token_with_expiry(self, deadline: int=DEFAULT_10_MIN_AUTH_EXPIRY): + tx_info = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return tx_info, error + + def create_auth_token_with_expiry(self, deadline: int = DEFAULT_10_MIN_AUTH_EXPIRY): if deadline == SignerClient.DEFAULT_10_MIN_AUTH_EXPIRY: deadline = int(time.time() + 10 * SignerClient.MINUTE) self.signer.CreateAuthToken.argtypes = [ctypes.c_longlong] - self.signer.CreateAuthToken.restype = ctypes.c_char_p - return self.signer.CreateAuthToken(deadline).decode("utf-8") + self.signer.CreateAuthToken.restype = StrOrErr + + result = self.signer.CreateAuthToken(deadline) + + auth = result.str.decode("utf-8") if result.str else None + error = result.err.decode("utf-8") if result.err else None + + return auth, error + + async def change_api_key(self, eth_private_key: str, new_pubkey: str, nonce=-1): + tx_info, error = self.sign_change_api_key(eth_private_key, new_pubkey, nonce) + if error is not None: + return None, error + + logging.debug(f"Change Pub Key Tx Info: {tx_info}") + + api_response = await self.send_tx(tx_type=self.TX_TYPE_CHANGE_PUB_KEY, tx_info=tx_info) + logging.debug(f"Change Pub Key Send Tx Response: {api_response}") + return api_response, None async def create_order( self, @@ -296,8 +432,8 @@ async def create_order( trigger_price=NIL_TRIGGER_PRICE, order_expiry=-1, nonce=-1, - ) -> (CreateOrder, TxHash): - tx_info = self.sign_create_order( + ) -> (CreateOrder, TxHash, str): + tx_info, error = self.sign_create_order( market_index, client_order_index, base_amount, @@ -310,131 +446,141 @@ async def create_order( order_expiry, nonce, ) + if error is not None: + return None, None, error logging.debug(f"Create Order Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_CREATE_ORDER, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_CREATE_ORDER, tx_info=tx_info) logging.debug(f"Create Order Send Tx Response: {api_response}") - return CreateOrder.from_json(tx_info), api_response + return CreateOrder.from_json(tx_info), api_response, None - async def cancel_order( - self, market_index, order_index, nonce=-1 - ) -> (CancelOrder, TxHash): - tx_info = self.sign_cancel_order(market_index, order_index, nonce) + async def create_market_order( + self, market_index, client_order_index, base_amount, avg_execution_price, is_ask, reduce_only: bool = False + ) -> (CreateOrder, TxHash, str): + return await self.create_order( + market_index, + client_order_index, + base_amount, + avg_execution_price, + is_ask, + order_type=self.ORDER_TYPE_MARKET, + time_in_force=self.ORDER_TIME_IN_FORCE_IMMEDIATE_OR_CANCEL, + order_expiry=self.DEFAULT_IOC_EXPIRY, + reduce_only=reduce_only, + ) + + async def cancel_order(self, market_index, order_index, nonce=-1) -> (CancelOrder, TxHash, str): + tx_info, error = self.sign_cancel_order(market_index, order_index, nonce) + if error is not None: + return None, None, error logging.debug(f"Cancel Order Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_CANCEL_ORDER, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_CANCEL_ORDER, tx_info=tx_info) logging.debug(f"Cancel Order Send Tx Response: {api_response}") - return CancelOrder.from_json(tx_info), api_response + return CancelOrder.from_json(tx_info), api_response, None async def withdraw(self, usdc_amount, nonce=-1) -> (Withdraw, TxHash): usdc_amount = int(usdc_amount * self.USDC_TICKER_SCALE) - tx_info = self.sign_withdraw(usdc_amount, nonce) + tx_info, error = self.sign_withdraw(usdc_amount, nonce) + if error is not None: + return None, None, error logging.debug(f"Withdraw Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_WITHDRAW, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_WITHDRAW, tx_info=tx_info) logging.debug(f"Withdraw Send Tx Response: {api_response}") - return Withdraw.from_json(tx_info), api_response + return Withdraw.from_json(tx_info), api_response, None async def create_sub_account(self, nonce=-1): - tx_info = self.sign_create_sub_account(nonce) + tx_info, error = self.sign_create_sub_account(nonce) + if error is not None: + return None, error logging.debug(f"Create Sub Account Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_CREATE_SUB_ACCOUNT, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_CREATE_SUB_ACCOUNT, tx_info=tx_info) logging.debug(f"Create Sub Account Send Tx Response: {api_response}") - return api_response + return api_response, None async def cancel_all_orders(self, time_in_force, time, nonce=-1): - tx_info = self.sign_cancel_all_orders(time_in_force, time, nonce) + tx_info, error = self.sign_cancel_all_orders(time_in_force, time, nonce) + if error is not None: + return None, error logging.debug(f"Cancel All Orders Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_CANCEL_ALL_ORDERS, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_CANCEL_ALL_ORDERS, tx_info=tx_info) logging.debug(f"Cancel All Orders Send Tx Response: {api_response}") - return api_response + return api_response, None - async def modify_order( - self, market_index, order_index, base_amount, price, trigger_price, nonce=-1 - ): - tx_info = self.sign_modify_order( - market_index, order_index, base_amount, price, trigger_price, nonce - ) + async def modify_order(self, market_index, order_index, base_amount, price, trigger_price, nonce=-1): + tx_info, error = self.sign_modify_order(market_index, order_index, base_amount, price, trigger_price, nonce) + if error is not None: + return None, error logging.debug(f"Modify Order Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_MODIFY_ORDER, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_MODIFY_ORDER, tx_info=tx_info) logging.debug(f"Modify Order Send Tx Response: {api_response}") - return api_response + return api_response, None async def transfer(self, to_account_index, usdc_amount, nonce=-1): usdc_amount = int(usdc_amount * self.USDC_TICKER_SCALE) - tx_info = self.sign_transfer(to_account_index, usdc_amount, nonce) + tx_info, error = self.sign_transfer(to_account_index, usdc_amount, nonce) + if error is not None: + return None, error logging.debug(f"Transfer Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_TRANSFER, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_TRANSFER, tx_info=tx_info) logging.debug(f"Transfer Send Tx Response: {api_response}") - return api_response + return api_response, None - async def create_public_pool( - self, operator_fee, initial_total_shares, min_operator_share_rate, nonce=-1 - ): - tx_info = self.sign_create_public_pool( + async def create_public_pool(self, operator_fee, initial_total_shares, min_operator_share_rate, nonce=-1): + tx_info, error = self.sign_create_public_pool( operator_fee, initial_total_shares, min_operator_share_rate, nonce ) + if error is not None: + return None, error logging.debug(f"Create Public Pool Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_CREATE_PUBLIC_POOL, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_CREATE_PUBLIC_POOL, tx_info=tx_info) logging.debug(f"Create Public Pool Send Tx Response: {api_response}") - return api_response + return api_response, None - async def update_public_pool( - self, public_pool_index, status, operator_fee, min_operator_share_rate, nonce=-1 - ): - tx_info = self.sign_update_public_pool( + async def update_public_pool(self, public_pool_index, status, operator_fee, min_operator_share_rate, nonce=-1): + tx_info, error = self.sign_update_public_pool( public_pool_index, status, operator_fee, min_operator_share_rate, nonce ) + if error is not None: + return None, error logging.debug(f"Update Public Pool Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_UPDATE_PUBLIC_POOL, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_UPDATE_PUBLIC_POOL, tx_info=tx_info) logging.debug(f"Update Public Pool Send Tx Response: {api_response}") - return api_response + return api_response, None async def mint_shares(self, public_pool_index, share_amount, nonce=-1): - tx_info = self.sign_mint_shares(public_pool_index, share_amount, nonce) + tx_info, error = self.sign_mint_shares(public_pool_index, share_amount, nonce) + if error is not None: + return None, error logging.debug(f"Mint Shares Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_MINT_SHARES, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_MINT_SHARES, tx_info=tx_info) logging.debug(f"Mint Shares Send Tx Response: {api_response}") - return api_response + return api_response, None async def burn_shares(self, public_pool_index, share_amount, nonce=-1): - tx_info = self.sign_burn_shares(public_pool_index, share_amount, nonce) + tx_info, error = self.sign_burn_shares(public_pool_index, share_amount, nonce) + if error is not None: + return None, error logging.debug(f"Burn Shares Tx Info: {tx_info}") - api_response = await self.tx_api.send_tx( - tx_type=self.TX_TYPE_BURN_SHARES, tx_info=tx_info - ) + api_response = await self.send_tx(tx_type=self.TX_TYPE_BURN_SHARES, tx_info=tx_info) logging.debug(f"Burn Shares Send Tx Response: {api_response}") - return api_response + return api_response, None + + async def send_tx(self, tx_type: StrictInt, tx_info: str) -> TxHash: + if tx_info[0] != "{": + raise Exception(tx_info) + return await self.tx_api.send_tx(tx_type=tx_type, tx_info=tx_info) async def close(self): await self.api_client.close() diff --git a/lighter/signers/README.md b/lighter/signers/README.md new file mode 100644 index 0000000..c1e3962 --- /dev/null +++ b/lighter/signers/README.md @@ -0,0 +1 @@ +Check the [go-sdk](https://github.com/elliottech/lighter-go) to see the source code for the binaries or to generate them youself. \ No newline at end of file diff --git a/lighter/signers/signer-amd64.so b/lighter/signers/signer-amd64.so index b98128e..85b688e 100644 Binary files a/lighter/signers/signer-amd64.so and b/lighter/signers/signer-amd64.so differ diff --git a/lighter/signers/signer-arm64.dylib b/lighter/signers/signer-arm64.dylib index d0176fa..bf526f7 100644 Binary files a/lighter/signers/signer-arm64.dylib and b/lighter/signers/signer-arm64.dylib differ diff --git a/openapi.json b/openapi.json index 8f6cbe6..870d264 100644 --- a/openapi.json +++ b/openapi.json @@ -130,7 +130,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get account active orders" + "description": "Get account active orders. `auth` can be generated using the SDK." } }, "/api/v1/accountInactiveOrders": { @@ -152,6 +152,12 @@ } }, "parameters": [ + { + "name": "auth", + "in": "query", + "required": true, + "type": "string" + }, { "name": "account_index", "in": "query", @@ -203,7 +209,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get account active orders" + "description": "Get account inactive orders" } }, "/api/v1/accountOrders": { @@ -225,6 +231,12 @@ } }, "parameters": [ + { + "name": "auth", + "in": "query", + "required": true, + "type": "string" + }, { "name": "account_index", "in": "query", @@ -264,60 +276,6 @@ "description": "Get account orders" } }, - "/api/v1/accountPendingTxs": { - "get": { - "summary": "accountPendingTxs", - "operationId": "accountPendingTxs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Txs" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "by", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "account_index" - ] - }, - { - "name": "value", - "in": "query", - "required": true, - "type": "string" - }, - { - "name": "types", - "in": "query", - "required": false, - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get pending transactions of a specific account" - } - }, "/api/v1/accountTxs": { "get": { "summary": "accountTxs", @@ -388,62 +346,6 @@ "description": "Get transactions of a specific account" } }, - "/api/v1/accounts": { - "get": { - "summary": "accounts", - "operationId": "accounts", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Accounts" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 - }, - { - "name": "sort", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get accounts returns accounts by account index" - } - }, "/api/v1/accountsByL1Address": { "get": { "summary": "accountsByL1Address", @@ -508,7 +410,7 @@ { "name": "api_key_index", "in": "query", - "required": true, + "required": false, "type": "integer", "format": "uint8", "default": "255" @@ -520,7 +422,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get account api key" + "description": "Get account api key. Set `api_key_index` to 255 to retrieve all api keys associated with the account." } }, "/api/v1/block": { @@ -714,14 +616,18 @@ "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "end_timestamp", "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "count_back", @@ -791,6 +697,19 @@ } }, "parameters": [ + { + "name": "account_index", + "in": "query", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "name": "auth", + "in": "query", + "required": true, + "type": "string" + }, { "name": "l1_address", "in": "query", @@ -924,14 +843,18 @@ "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "end_timestamp", "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "count_back", @@ -950,65 +873,6 @@ "description": "Get fundings" } }, - "/api/v1/isWhitelisted": { - "get": { - "summary": "isWhitelisted", - "operationId": "isWhitelisted", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/IsWhitelisted" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "l1_address", - "in": "query", - "required": true, - "type": "string" - } - ], - "tags": [ - "account" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get is account whitelisted" - } - }, - "/api/v1/layer2BasicInfo": { - "get": { - "summary": "layer2BasicInfo", - "operationId": "layer2BasicInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Layer2BasicInfo" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "tags": [ - "info" - ], - "description": "Get zklighter general info, including contract address, and count of transactions and active users" - } - }, "/api/v1/nextNonce": { "get": { "summary": "nextNonce", @@ -1049,7 +913,7 @@ "consumes": [ "multipart/form-data" ], - "description": "Get next nonce for a specific account" + "description": "Get next nonce for a specific account and api key" } }, "/api/v1/orderBookDetails": { @@ -1171,51 +1035,6 @@ "description": "Get order books metadata.
**Response Description:**

1) **Taker and maker fees** are in percentage.
2) **Min base amount:** The amount of base token that can be traded in a single order.
3) **Min quote amount:** The amount of quote token that can be traded in a single order.
4) **Supported size decimals:** The number of decimal places that can be used for the size of the order.
5) **Supported price decimals:** The number of decimal places that can be used for the price of the order.
6) **Supported quote decimals:** Size Decimals + Quote Decimals." } }, - "/api/v1/pendingTxs": { - "get": { - "summary": "pendingTxs", - "operationId": "pendingTxs", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/Txs" - } - }, - "400": { - "description": "Bad request", - "schema": { - "$ref": "#/definitions/ResultCode" - } - } - }, - "parameters": [ - { - "name": "index", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - }, - { - "name": "limit", - "in": "query", - "required": true, - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 100 - } - ], - "tags": [ - "transaction" - ], - "consumes": [ - "multipart/form-data" - ], - "description": "Get pending transactions" - } - }, "/api/v1/pnl": { "get": { "summary": "pnl", @@ -1235,6 +1054,12 @@ } }, "parameters": [ + { + "name": "auth", + "in": "query", + "required": false, + "type": "string" + }, { "name": "by", "in": "query", @@ -1269,14 +1094,18 @@ "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "end_timestamp", "in": "query", "required": true, "type": "integer", - "format": "int64" + "format": "int64", + "minimum": 0, + "maximum": 5000000000000 }, { "name": "count_back", @@ -1322,6 +1151,12 @@ } }, "parameters": [ + { + "name": "auth", + "in": "query", + "required": false, + "type": "string" + }, { "name": "filter", "in": "query", @@ -1505,6 +1340,12 @@ } }, "parameters": [ + { + "name": "auth", + "in": "query", + "required": false, + "type": "string" + }, { "name": "market_id", "in": "query", @@ -1742,6 +1583,12 @@ "type": "integer", "format": "int64" }, + { + "name": "auth", + "in": "query", + "required": true, + "type": "string" + }, { "name": "cursor", "in": "query", @@ -1882,58 +1729,10 @@ "api_keys" ] }, - "AccountMarketStats": { + "AccountPnL": { "type": "object", "properties": { - "market_id": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "daily_trades_count": { - "type": "integer", - "format": "int64", - "example": "68" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - } - }, - "title": "AccountMarketStats", - "required": [ - "market_id", - "daily_trades_count", - "daily_base_token_volume", - "daily_quote_token_volume" - ] - }, - "AccountMetadata": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "title": "AccountMetadata", - "required": [ - "name", - "description" - ] - }, - "AccountPnL": { - "type": "object", - "properties": { - "code": { + "code": { "type": "integer", "format": "int32", "example": "200" @@ -1985,6 +1784,11 @@ "format": "int64", "example": "3" }, + "position_tied_order_count": { + "type": "integer", + "format": "int64", + "example": "3" + }, "sign": { "type": "integer", "format": "int32", @@ -2009,6 +1813,10 @@ "realized_pnl": { "type": "string", "example": "2.000000" + }, + "total_funding_paid_out": { + "type": "string", + "example": "34.2" } }, "title": "AccountPosition", @@ -2018,6 +1826,7 @@ "initial_margin_fraction", "open_order_count", "pending_order_count", + "position_tied_order_count", "sign", "position", "avg_entry_price", @@ -2026,74 +1835,6 @@ "realized_pnl" ] }, - "AccountStats": { - "type": "object", - "properties": { - "collateral": { - "type": "string", - "example": "199955" - }, - "portfolio_value": { - "type": "string", - "example": "199955" - }, - "leverage": { - "type": "string", - "example": "1.0" - }, - "available_balance": { - "type": "string", - "example": "199955" - }, - "margin_usage": { - "type": "string", - "example": "0.0" - }, - "buying_power": { - "type": "string", - "example": "199955" - } - }, - "title": "AccountStats", - "required": [ - "collateral", - "portfolio_value", - "leverage", - "available_balance", - "margin_usage", - "buying_power" - ] - }, - "Accounts": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/Account" - } - } - }, - "title": "Accounts", - "required": [ - "code", - "total", - "accounts" - ] - }, "ApiKey": { "type": "object", "properties": { @@ -2223,29 +1964,6 @@ "blocks" ] }, - "BridgeSupportedNetwork": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "Arbitrum" - }, - "chain_id": { - "type": "string", - "example": "4164" - }, - "explorer": { - "type": "string", - "example": "https://arbiscan.io/" - } - }, - "title": "BridgeSupportedNetwork", - "required": [ - "name", - "chain_id", - "explorer" - ] - }, "Candlestick": { "type": "object", "properties": { @@ -2331,24 +2049,6 @@ "candlesticks" ] }, - "ContractAddress": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "1" - }, - "address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - } - }, - "title": "ContractAddress", - "required": [ - "name", - "address" - ] - }, "CurrentHeight": { "type": "object", "properties": { @@ -2371,14 +2071,25 @@ "height" ] }, - "Cursor": { + "DailyReturn": { "type": "object", "properties": { - "next_cursor": { - "type": "string" + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1640995200" + }, + "daily_return": { + "type": "number", + "format": "double", + "example": "0.0001" } }, - "title": "Cursor" + "title": "DailyReturn", + "required": [ + "timestamp", + "daily_return" + ] }, "DepositHistory": { "type": "object", @@ -2428,8 +2139,13 @@ "enum": [ "failed", "pending", - "completed" + "completed", + "claimable" ] + }, + "l1_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" } }, "title": "DepositHistoryItem", @@ -2437,7 +2153,8 @@ "id", "amount", "timestamp", - "status" + "status", + "l1_tx_hash" ] }, "DetailedAccount": { @@ -2495,6 +2212,17 @@ "description": { "type": "string" }, + "can_invite": { + "type": "boolean", + "format": "boolean" + }, + "referral_points_percentage": { + "type": "string" + }, + "max_referral_usage_limit": { + "type": "integer", + "format": "int32" + }, "positions": { "type": "array", "items": { @@ -2505,12 +2233,6 @@ "type": "string", "example": "19995" }, - "market_stats": { - "type": "array", - "items": { - "$ref": "#/definitions/AccountMarketStats" - } - }, "pool_info": { "$ref": "#/definitions/PublicPoolInfo" }, @@ -2534,9 +2256,11 @@ "collateral", "name", "description", + "can_invite", + "referral_points_percentage", + "max_referral_usage_limit", "positions", "total_asset_value", - "market_stats", "pool_info", "shares" ] @@ -2571,68 +2295,6 @@ "accounts" ] }, - "DetailedCandlestick": { - "type": "object", - "properties": { - "timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "open": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "high": { - "type": "number", - "format": "double", - "example": "3034.66" - }, - "low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "close": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "volume0": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "volume1": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "last_trade_id": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "trade_count": { - "type": "integer", - "format": "int64", - "example": "1503241" - } - }, - "title": "DetailedCandlestick", - "required": [ - "timestamp", - "open", - "high", - "low", - "close", - "volume0", - "volume1", - "last_trade_id", - "trade_count" - ] - }, "EnrichedTx": { "type": "object", "properties": { @@ -2873,7 +2535,7 @@ "fundings" ] }, - "IsWhitelisted": { + "NextNonce": { "type": "object", "properties": { "code": { @@ -2884,247 +2546,48 @@ "message": { "type": "string" }, - "whitelisted": { - "type": "boolean", - "format": "boolean" - }, - "deposit_amount_left": { - "type": "string" + "nonce": { + "type": "integer", + "format": "int64", + "example": "722" } }, - "title": "IsWhitelisted", + "title": "NextNonce", "required": [ "code", - "whitelisted", - "deposit_amount_left" + "nonce" ] }, - "L1ProviderInfo": { + "Order": { "type": "object", "properties": { - "chainId": { + "order_index": { "type": "integer", "format": "int64", "example": "1" }, - "networkId": { + "client_order_index": { "type": "integer", "format": "int64", + "example": "234" + }, + "order_id": { + "type": "string", "example": "1" }, - "latestBlockNumber": { - "type": "integer", - "format": "int64", - "example": "45434" + "client_order_id": { + "type": "string", + "example": "234" }, - "NetworkRpc": { - "type": "string" - } - }, - "title": "L1ProviderInfo", - "required": [ - "chainId", - "networkId", - "latestBlockNumber", - "NetworkRpc" - ] - }, - "Layer2BasicInfo": { - "type": "object", - "properties": { - "code": { + "market_index": { "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" + "format": "uint8", + "example": "1" }, - "block_committed": { + "owner_account_index": { "type": "integer", "format": "int64", - "example": "45434" - }, - "block_verified": { - "type": "integer", - "format": "int64", - "example": "45434" - }, - "total_transaction_count": { - "type": "integer", - "format": "int64", - "example": "75434" - } - }, - "title": "Layer2BasicInfo", - "required": [ - "code", - "block_committed", - "block_verified", - "total_transaction_count" - ] - }, - "Liquidation": { - "type": "object", - "properties": { - "liquidation_id": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "account_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "liquidation_type": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "portfolio_value": { - "type": "string", - "example": "1" - }, - "margin_requirement": { - "type": "string", - "example": "1" - } - }, - "title": "Liquidation", - "required": [ - "liquidation_id", - "account_index", - "liquidation_type", - "portfolio_value", - "margin_requirement" - ] - }, - "MarketInfo": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "index_price": { - "type": "string", - "example": "3024.66" - }, - "mark_price": { - "type": "string", - "example": "3024.66" - }, - "open_interest": { - "type": "string", - "example": "235.25" - }, - "last_trade_price": { - "type": "string", - "example": "3024.66" - }, - "current_funding_rate": { - "type": "string", - "example": "0.0001" - }, - "funding_rate": { - "type": "string", - "example": "0.0001" - }, - "funding_timestamp": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "daily_base_token_volume": { - "type": "number", - "format": "double", - "example": "235.25" - }, - "daily_quote_token_volume": { - "type": "number", - "format": "double", - "example": "93566.25" - }, - "daily_price_low": { - "type": "number", - "format": "double", - "example": "3014.66" - }, - "daily_price_high": { - "type": "number", - "format": "double", - "example": "3024.66" - }, - "daily_price_change": { - "type": "number", - "format": "double", - "example": "3.66" - } - }, - "title": "MarketInfo", - "required": [ - "market_id", - "index_price", - "mark_price", - "open_interest", - "last_trade_price", - "current_funding_rate", - "funding_rate", - "funding_timestamp", - "daily_base_token_volume", - "daily_quote_token_volume", - "daily_price_low", - "daily_price_high", - "daily_price_change" - ] - }, - "NextNonce": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "nonce": { - "type": "integer", - "format": "int64", - "example": "722" - } - }, - "title": "NextNonce", - "required": [ - "code", - "nonce" - ] - }, - "Order": { - "type": "object", - "properties": { - "order_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "client_order_index": { - "type": "integer", - "format": "int64", - "example": "234" - }, - "market_index": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "owner_account_index": { - "type": "integer", - "format": "int64", - "example": "1" + "example": "1" }, "initial_base_amount": { "type": "string", @@ -3227,7 +2690,20 @@ "canceled-too-much-slippage", "canceled-not-enough-liquidity", "canceled-self-trade", - "canceled-expired" + "canceled-expired", + "canceled-oco", + "canceled-child" + ] + }, + "trigger_status": { + "type": "string", + "example": "twap", + "enum": [ + "na", + "ready", + "mark-price", + "twap", + "parent-order" ] }, "trigger_time": { @@ -3240,6 +2716,22 @@ "format": "int64", "example": "1" }, + "parent_order_id": { + "type": "string", + "example": "1" + }, + "to_trigger_order_id_0": { + "type": "string", + "example": "1" + }, + "to_trigger_order_id_1": { + "type": "string", + "example": "1" + }, + "to_cancel_order_id_0": { + "type": "string", + "example": "1" + }, "block_height": { "type": "integer", "format": "int64", @@ -3255,6 +2747,8 @@ "required": [ "order_index", "client_order_index", + "order_id", + "client_order_id", "market_index", "owner_account_index", "initial_base_amount", @@ -3273,8 +2767,13 @@ "trigger_price", "order_expiry", "status", + "trigger_status", "trigger_time", "parent_order_index", + "parent_order_id", + "to_trigger_order_id_0", + "to_trigger_order_id_1", + "to_cancel_order_id_0", "block_height", "timestamp" ] @@ -3350,43 +2849,6 @@ "supported_quote_decimals" ] }, - "OrderBookDepth": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "asks": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "bids": { - "type": "array", - "items": { - "$ref": "#/definitions/PriceLevel" - } - }, - "offset": { - "type": "integer", - "format": "int64", - "example": "0" - } - }, - "title": "OrderBookDepth", - "required": [ - "code", - "asks", - "bids", - "offset" - ] - }, "OrderBookDetail": { "type": "object", "properties": { @@ -3730,988 +3192,254 @@ "type": "number", "format": "double", "example": "12.0" + }, + "trade_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "pool_pnl": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "inflow": { + "type": "number", + "format": "double", + "example": "12.0" + }, + "outflow": { + "type": "number", + "format": "double", + "example": "12.0" } }, "title": "PnLEntry", "required": [ "timestamp", - "value" + "value", + "trade_pnl", + "pool_pnl", + "inflow", + "outflow" ] }, - "PositionFunding": { + "PublicPool": { "type": "object", "properties": { - "timestamp": { + "code": { "type": "integer", - "format": "int64", - "example": "1640995200" + "format": "int32", + "example": "200" }, - "market_id": { + "message": { + "type": "string" + }, + "account_type": { "type": "integer", "format": "uint8", "example": "1" }, - "funding_id": { + "index": { "type": "integer", "format": "int64", "example": "1" }, - "change": { + "l1_address": { "type": "string", - "example": "1" + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" }, - "rate": { - "type": "string", - "example": "1" + "cancel_all_time": { + "type": "integer", + "format": "int64", + "example": "1640995200" }, - "position_size": { - "type": "string", + "total_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, + "pending_order_count": { + "type": "integer", + "format": "int64", + "example": "100" + }, + "status": { + "type": "integer", + "format": "uint8", "example": "1" }, - "position_side": { + "collateral": { "type": "string", - "example": "long", - "enum": [ - "long", - "short" - ] - } - }, - "title": "PositionFunding", - "required": [ - "timestamp", - "market_id", - "funding_id", - "change", - "rate", - "position_size", - "position_side" - ] - }, - "PriceLevel": { - "type": "object", - "properties": { - "price": { - "type": "string", - "example": "3024.66" - }, - "size": { - "type": "string", - "example": "0.1" - } - }, - "title": "PriceLevel", - "required": [ - "price", - "size" - ] - }, - "PublicPool": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "account_type": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "l1_address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "cancel_all_time": { - "type": "integer", - "format": "int64", - "example": "1640995200" - }, - "total_order_count": { - "type": "integer", - "format": "int64", - "example": "100" - }, - "pending_order_count": { - "type": "integer", - "format": "int64", - "example": "100" - }, - "status": { - "type": "integer", - "format": "uint8", - "example": "1" - }, - "collateral": { - "type": "string", - "example": "46342" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "total_asset_value": { - "type": "string", - "example": "19995" - }, - "pool_info": { - "$ref": "#/definitions/PublicPoolInfo" - }, - "account_share": { - "$ref": "#/definitions/PublicPoolShare" - } - }, - "title": "PublicPool", - "required": [ - "code", - "account_type", - "index", - "l1_address", - "cancel_all_time", - "total_order_count", - "pending_order_count", - "status", - "collateral", - "name", - "description", - "total_asset_value", - "pool_info", - "account_share" - ] - }, - "PublicPoolInfo": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "uint8", - "example": "0" - }, - "operator_fee": { - "type": "string", - "example": "100" - }, - "min_operator_share_rate": { - "type": "string", - "example": "200" - }, - "total_shares": { - "type": "integer", - "format": "int64", - "example": "100000" - }, - "operator_shares": { - "type": "integer", - "format": "int64", - "example": "20000" - } - }, - "title": "PublicPoolInfo", - "required": [ - "status", - "operator_fee", - "min_operator_share_rate", - "total_shares", - "operator_shares" - ] - }, - "PublicPoolShare": { - "type": "object", - "properties": { - "public_pool_index": { - "type": "integer", - "format": "int64", - "example": "1" - }, - "shares_amount": { - "type": "integer", - "format": "int64", - "example": "3000" - }, - "entry_usdc": { - "type": "string", - "example": "3000" - } - }, - "title": "PublicPoolShare", - "required": [ - "public_pool_index", - "shares_amount", - "entry_usdc" - ] - }, - "PublicPools": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "example": "200" - }, - "message": { - "type": "string" - }, - "total": { - "type": "integer", - "format": "int64" - }, - "public_pools": { - "type": "array", - "items": { - "$ref": "#/definitions/PublicPool" - } - } - }, - "title": "PublicPools", - "required": [ - "code", - "total", - "public_pools" - ] - }, - "ReqGetAccount": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "index", - "l1_address" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetAccount", - "required": [ - "by", - "value" - ] - }, - "ReqGetAccountActiveOrders": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "uint8" - }, - "auth": { - "type": "string" - } - }, - "title": "ReqGetAccountActiveOrders", - "required": [ - "account_index", - "market_id", - "auth" - ] - }, - "ReqGetAccountApiKeys": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "api_key_index": { - "type": "integer", - "format": "uint8", - "default": "255" - } - }, - "title": "ReqGetAccountApiKeys", - "required": [ - "account_index", - "api_key_index" - ] - }, - "ReqGetAccountByL1Address": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - } - }, - "title": "ReqGetAccountByL1Address", - "required": [ - "l1_address" - ] - }, - "ReqGetAccountInactiveOrders": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "uint8", - "default": "255" - }, - "ask_filter": { - "type": "integer", - "format": "int8", - "default": "-1" - }, - "between_timestamps": { - "type": "string" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetAccountInactiveOrders", - "required": [ - "account_index", - "limit" - ] - }, - "ReqGetAccountOrders": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "market_id": { - "type": "integer", - "format": "uint8" - }, - "cursor": { - "type": "string" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetAccountOrders", - "required": [ - "account_index", - "market_id", - "limit" - ] - }, - "ReqGetAccountPendingTxs": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "account_index" - ] - }, - "value": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - } - }, - "title": "ReqGetAccountPendingTxs" - }, - "ReqGetAccountPnL": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "index" - ] - }, - "value": { - "type": "string" - }, - "resolution": { - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "1h", - "4h", - "1d" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64" - }, - "end_timestamp": { - "type": "integer", - "format": "int64" - }, - "count_back": { - "type": "integer", - "format": "int64" - }, - "ignore_transfers": { - "type": "boolean", - "format": "boolean", - "default": "false" - } - }, - "title": "ReqGetAccountPnL", - "required": [ - "by", - "value", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetAccountTxs": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - }, - "by": { - "type": "string", - "enum": [ - "account_index" - ] - }, - "value": { - "type": "string" - }, - "types": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8" - } - } - }, - "title": "ReqGetAccountTxs" - }, - "ReqGetBlock": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "commitment", - "height" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetBlock", - "required": [ - "by", - "value" - ] - }, - "ReqGetBlockTxs": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "block_height", - "block_commitment" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetBlockTxs", - "required": [ - "by", - "value" - ] - }, - "ReqGetByAccount": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "account_index" - ] - }, - "value": { - "type": "string" - } - }, - "title": "ReqGetByAccount", - "required": [ - "by", - "value" - ] - }, - "ReqGetCandlesticks": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8" - }, - "resolution": { - "type": "string", - "enum": [ - "1m", - "5m", - "15m", - "1h", - "4h", - "1d" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64" - }, - "end_timestamp": { - "type": "integer", - "format": "int64" - }, - "count_back": { - "type": "integer", - "format": "int64" - }, - "set_timestamp_to_end": { - "type": "boolean", - "format": "boolean", - "default": "false" - } - }, - "title": "ReqGetCandlesticks", - "required": [ - "market_id", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetDepositHistory": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - }, - "cursor": { - "type": "string" - }, - "filter": { - "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] - } - }, - "title": "ReqGetDepositHistory", - "required": [ - "l1_address" - ] - }, - "ReqGetExchangeStats": { - "type": "object", - "title": "ReqGetExchangeStats" - }, - "ReqGetFeeBucket": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqGetFeeBucket", - "required": [ - "account_index" - ] - }, - "ReqGetFundings": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8" - }, - "resolution": { - "type": "string", - "enum": [ - "1h" - ] - }, - "start_timestamp": { - "type": "integer", - "format": "int64" - }, - "end_timestamp": { - "type": "integer", - "format": "int64" - }, - "count_back": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqGetFundings", - "required": [ - "market_id", - "resolution", - "start_timestamp", - "end_timestamp", - "count_back" - ] - }, - "ReqGetL1Tx": { - "type": "object", - "properties": { - "hash": { - "type": "string" - } - }, - "title": "ReqGetL1Tx", - "required": [ - "hash" - ] - }, - "ReqGetLatestDeposit": { - "type": "object", - "properties": { - "l1_address": { - "type": "string" - } - }, - "title": "ReqGetLatestDeposit", - "required": [ - "l1_address" - ] - }, - "ReqGetNextNonce": { - "type": "object", - "properties": { - "account_index": { - "type": "integer", - "format": "int64" - }, - "api_key_index": { - "type": "integer", - "format": "uint8" - } - }, - "title": "ReqGetNextNonce", - "required": [ - "account_index", - "api_key_index" - ] - }, - "ReqGetOrderBookDetails": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8", - "default": "255" - } - }, - "title": "ReqGetOrderBookDetails" - }, - "ReqGetOrderBookOrders": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8" - }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetOrderBookOrders", - "required": [ - "market_id", - "limit" - ] - }, - "ReqGetOrderBooks": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8", - "default": "255" - } - }, - "title": "ReqGetOrderBooks" - }, - "ReqGetPublicPools": { - "type": "object", - "properties": { - "filter": { - "type": "string", - "enum": [ - "all", - "user", - "protocol", - "account_index" - ] - }, - "index": { - "type": "integer", - "format": "int64" + "example": "46342" }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 + "name": { + "type": "string" }, - "account_index": { - "type": "integer", - "format": "int64" - } - }, - "title": "ReqGetPublicPools", - "required": [ - "index", - "limit" - ] - }, - "ReqGetRangeWithCursor": { - "type": "object", - "properties": { - "cursor": { + "description": { "type": "string" }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetRangeWithCursor", - "required": [ - "limit" - ] - }, - "ReqGetRangeWithIndex": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" + "can_invite": { + "type": "boolean", + "format": "boolean" }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetRangeWithIndex", - "required": [ - "limit" - ] - }, - "ReqGetRangeWithIndexSortable": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "format": "int64" + "referral_points_percentage": { + "type": "string" }, - "limit": { + "max_referral_usage_limit": { "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 + "format": "int32" }, - "sort": { + "total_asset_value": { "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - } - }, - "title": "ReqGetRangeWithIndexSortable" - }, - "ReqGetRecentTrades": { - "type": "object", - "properties": { - "market_id": { - "type": "integer", - "format": "uint8" + "example": "19995" }, - "limit": { - "type": "integer", - "format": "int64", - "maximum": 100, - "minimum": 1 + "pool_info": { + "$ref": "#/definitions/PublicPoolInfo" + }, + "account_share": { + "$ref": "#/definitions/PublicPoolShare" } }, - "title": "ReqGetRecentTrades", + "title": "PublicPool", "required": [ - "market_id", - "limit" + "code", + "account_type", + "index", + "l1_address", + "cancel_all_time", + "total_order_count", + "pending_order_count", + "status", + "collateral", + "name", + "description", + "can_invite", + "referral_points_percentage", + "max_referral_usage_limit", + "total_asset_value", + "pool_info" ] }, - "ReqGetTrades": { + "PublicPoolInfo": { "type": "object", "properties": { - "market_id": { + "status": { "type": "integer", "format": "uint8", - "default": "255" - }, - "account_index": { - "type": "integer", - "format": "int64", - "default": "-1" - }, - "order_index": { - "type": "integer", - "format": "int64" + "example": "0" }, - "sort_by": { + "operator_fee": { "type": "string", - "enum": [ - "block_height", - "timestamp", - "trade_id" - ] + "example": "100" }, - "sort_dir": { + "min_operator_share_rate": { "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - }, - "cursor": { - "type": "string" + "example": "200" }, - "from": { + "total_shares": { "type": "integer", "format": "int64", - "default": "-1" - }, - "ask_filter": { - "type": "integer", - "format": "int8", - "default": "-1" + "example": "100000" }, - "limit": { + "operator_shares": { "type": "integer", "format": "int64", - "maximum": 100, - "minimum": 1 - } - }, - "title": "ReqGetTrades", - "required": [ - "sort_by", - "limit" - ] - }, - "ReqGetTx": { - "type": "object", - "properties": { - "by": { - "type": "string", - "enum": [ - "hash", - "sequence_index" - ] + "example": "20000" }, - "value": { - "type": "string" + "share_price_1d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "share_price_7d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "share_price_30d": { + "type": "number", + "format": "double", + "example": "0.0001" + }, + "annual_percentage_yield": { + "type": "number", + "format": "double", + "example": "20.5000" + }, + "daily_returns": { + "type": "array", + "items": { + "$ref": "#/definitions/DailyReturn" + } } }, - "title": "ReqGetTx", + "title": "PublicPoolInfo", "required": [ - "by", - "value" + "status", + "operator_fee", + "min_operator_share_rate", + "total_shares", + "operator_shares", + "share_price_1d", + "share_price_7d", + "share_price_30d", + "annual_percentage_yield", + "daily_returns" ] }, - "ReqGetWithdrawHistory": { + "PublicPoolShare": { "type": "object", "properties": { - "account_index": { + "public_pool_index": { "type": "integer", - "format": "int64" + "format": "int64", + "example": "1" }, - "cursor": { - "type": "string" + "shares_amount": { + "type": "integer", + "format": "int64", + "example": "3000" }, - "filter": { + "entry_usdc": { "type": "string", - "enum": [ - "all", - "pending", - "claimable" - ] + "example": "3000" } }, - "title": "ReqGetWithdrawHistory", + "title": "PublicPoolShare", "required": [ - "account_index" + "public_pool_index", + "shares_amount", + "entry_usdc" ] }, - "ReqIsWhitelisted": { + "PublicPools": { "type": "object", "properties": { - "l1_address": { + "code": { + "type": "integer", + "format": "int32", + "example": "200" + }, + "message": { "type": "string" + }, + "total": { + "type": "integer", + "format": "int64" + }, + "public_pools": { + "type": "array", + "items": { + "$ref": "#/definitions/PublicPool" + } } }, - "title": "ReqIsWhitelisted", + "title": "PublicPools", "required": [ - "l1_address" + "code", + "total", + "public_pools" ] }, "ReqSendTx": { @@ -4777,6 +3505,10 @@ "format": "int64", "example": "1" }, + "order_id": { + "type": "string", + "example": "1" + }, "owner_account_index": { "type": "integer", "format": "int64", @@ -4803,6 +3535,7 @@ "title": "SimpleOrder", "required": [ "order_index", + "order_id", "owner_account_index", "initial_base_amount", "remaining_base_amount", @@ -4822,12 +3555,18 @@ "type": "integer", "format": "int32", "example": "1" + }, + "timestamp": { + "type": "integer", + "format": "int64", + "example": "1717777777" } }, "title": "Status", "required": [ "status", - "network_id" + "network_id", + "timestamp" ] }, "SubAccounts": { @@ -4860,27 +3599,6 @@ "sub_accounts" ] }, - "Ticker": { - "type": "object", - "properties": { - "s": { - "type": "string", - "example": "ETH" - }, - "a": { - "$ref": "#/definitions/PriceLevel" - }, - "b": { - "$ref": "#/definitions/PriceLevel" - } - }, - "title": "Ticker", - "required": [ - "s", - "a", - "b" - ] - }, "Trade": { "type": "object", "properties": { @@ -5165,25 +3883,6 @@ "txs" ] }, - "ValidatorInfo": { - "type": "object", - "properties": { - "address": { - "type": "string", - "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - }, - "is_active": { - "type": "boolean", - "format": "boolean", - "example": "true" - } - }, - "title": "ValidatorInfo", - "required": [ - "address", - "is_active" - ] - }, "WithdrawHistory": { "type": "object", "properties": { @@ -5202,7 +3901,7 @@ } }, "cursor": { - "$ref": "#/definitions/WithdrawHistoryCursor" + "type": "string" } }, "title": "WithdrawHistory", @@ -5212,24 +3911,6 @@ "cursor" ] }, - "WithdrawHistoryCursor": { - "type": "object", - "properties": { - "secure_id": { - "type": "string", - "example": "1" - }, - "fast_id": { - "type": "string", - "example": "1" - } - }, - "title": "WithdrawHistoryCursor", - "required": [ - "secure_id", - "fast_id" - ] - }, "WithdrawHistoryItem": { "type": "object", "properties": { @@ -5261,6 +3942,10 @@ "secure", "fast" ] + }, + "l1_tx_hash": { + "type": "string", + "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" } }, "title": "WithdrawHistoryItem", @@ -5269,7 +3954,8 @@ "amount", "timestamp", "status", - "type" + "type", + "l1_tx_hash" ] }, "ZkLighterInfo": { @@ -5294,4 +3980,4 @@ "in": "header" } } -} +} \ No newline at end of file diff --git a/test/test_account.py b/test/test_account.py index fcdc957..5c9f3d6 100644 --- a/test/test_account.py +++ b/test/test_account.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - + Lighter API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + Public APIs for Lighter - The version of the OpenAPI document: + The version of the OpenAPI document: 1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -27,7 +27,7 @@ def tearDown(self): def make_instance(self, include_optional) -> Account: """Test Account - include_optional is a boolean, when False only required + include_option is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `Account` @@ -35,28 +35,45 @@ def make_instance(self, include_optional) -> Account: model = Account() if include_optional: return Account( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342' + code = 100, + total = 1, + accounts = [ + lighter.models.single_account.SingleAccount( + code = 56, + index = 56, + l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', + pk = '3ad126b9f0a2cc8cb367ef67a6c77389a85e18e20ce8da2edf34d022e9bf1aa8', + status = 1, + nonce = 722, + collateral = '', + positions = [ + lighter.models.account_position.AccountPosition( + market_id = 0, + name = 'Ethereum', + symbol = 'ETH', + sign = -1, + position = '3.6955', + ask_order_size = '58933.9753', + bid_order_size = '59010.2588', + avg_entry_price = '3024.66', + market_value = '3019.92', + unrealized_pnl = '17.521309', + realized_pnl = '0.000000', ) + ], + total_asset_value = '199955234976240000000000000', + market_stats = [ + lighter.models.account_market_stats.AccountMarketStats( + market_id = 1, + daily_trades_count = 68, + daily_base_token_volume = 235.25, + daily_quote_token_volume = 93566.25, + open_position_base = 93.0, + open_position_quote = 1276.0, ) + ], ) + ] ) else: return Account( - code = 200, - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', ) """ diff --git a/test/test_account_api.py b/test/test_account_api.py deleted file mode 100644 index 843b408..0000000 --- a/test/test_account_api.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.account_api import AccountApi - - -class TestAccountApi(unittest.TestCase): - """AccountApi unit test stubs""" - - def setUp(self) -> None: - self.api = AccountApi() - - def tearDown(self) -> None: - pass - - def test_account(self) -> None: - """Test case for account - - account - """ - pass - - def test_accounts(self) -> None: - """Test case for accounts - - accounts - """ - pass - - def test_accounts_by_l1_address(self) -> None: - """Test case for accounts_by_l1_address - - accountsByL1Address - """ - pass - - def test_apikeys(self) -> None: - """Test case for apikeys - - apikeys - """ - pass - - def test_fee_bucket(self) -> None: - """Test case for fee_bucket - - feeBucket - """ - pass - - def test_is_whitelisted(self) -> None: - """Test case for is_whitelisted - - isWhitelisted - """ - pass - - def test_pnl(self) -> None: - """Test case for pnl - - pnl - """ - pass - - def test_public_pools(self) -> None: - """Test case for public_pools - - publicPools - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_api_keys.py b/test/test_account_api_keys.py deleted file mode 100644 index 499f3d5..0000000 --- a/test/test_account_api_keys.py +++ /dev/null @@ -1,67 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_api_keys import AccountApiKeys - -class TestAccountApiKeys(unittest.TestCase): - """AccountApiKeys unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountApiKeys: - """Test AccountApiKeys - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountApiKeys` - """ - model = AccountApiKeys() - if include_optional: - return AccountApiKeys( - code = 200, - message = '', - api_keys = [ - lighter.models.api_key.ApiKey( - account_index = 3, - api_key_index = 0, - nonce = 722, - public_key = '', ) - ] - ) - else: - return AccountApiKeys( - code = 200, - api_keys = [ - lighter.models.api_key.ApiKey( - account_index = 3, - api_key_index = 0, - nonce = 722, - public_key = '', ) - ], - ) - """ - - def testAccountApiKeys(self): - """Test AccountApiKeys""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_market_stats.py b/test/test_account_market_stats.py deleted file mode 100644 index 39a1302..0000000 --- a/test/test_account_market_stats.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_market_stats import AccountMarketStats - -class TestAccountMarketStats(unittest.TestCase): - """AccountMarketStats unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountMarketStats: - """Test AccountMarketStats - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountMarketStats` - """ - model = AccountMarketStats() - if include_optional: - return AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25 - ) - else: - return AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - ) - """ - - def testAccountMarketStats(self): - """Test AccountMarketStats""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_metadata.py b/test/test_account_metadata.py deleted file mode 100644 index 705f14d..0000000 --- a/test/test_account_metadata.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_metadata import AccountMetadata - -class TestAccountMetadata(unittest.TestCase): - """AccountMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountMetadata: - """Test AccountMetadata - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountMetadata` - """ - model = AccountMetadata() - if include_optional: - return AccountMetadata( - name = '', - description = '' - ) - else: - return AccountMetadata( - name = '', - description = '', - ) - """ - - def testAccountMetadata(self): - """Test AccountMetadata""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_pn_l.py b/test/test_account_pn_l.py deleted file mode 100644 index 970299f..0000000 --- a/test/test_account_pn_l.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_pn_l import AccountPnL - -class TestAccountPnL(unittest.TestCase): - """AccountPnL unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountPnL: - """Test AccountPnL - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountPnL` - """ - model = AccountPnL() - if include_optional: - return AccountPnL( - code = 200, - message = '', - resolution = '15m', - pnl = [ - lighter.models.pn_l_entry.PnLEntry( - timestamp = 1640995200, - value = 12.0, ) - ] - ) - else: - return AccountPnL( - code = 200, - resolution = '15m', - pnl = [ - lighter.models.pn_l_entry.PnLEntry( - timestamp = 1640995200, - value = 12.0, ) - ], - ) - """ - - def testAccountPnL(self): - """Test AccountPnL""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_position.py b/test/test_account_position.py deleted file mode 100644 index 10df1d1..0000000 --- a/test/test_account_position.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_position import AccountPosition - -class TestAccountPosition(unittest.TestCase): - """AccountPosition unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountPosition: - """Test AccountPosition - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountPosition` - """ - model = AccountPosition() - if include_optional: - return AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000' - ) - else: - return AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000', - ) - """ - - def testAccountPosition(self): - """Test AccountPosition""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_account_stats.py b/test/test_account_stats.py deleted file mode 100644 index 1e5ed39..0000000 --- a/test/test_account_stats.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.account_stats import AccountStats - -class TestAccountStats(unittest.TestCase): - """AccountStats unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AccountStats: - """Test AccountStats - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `AccountStats` - """ - model = AccountStats() - if include_optional: - return AccountStats( - collateral = '199955', - portfolio_value = '199955', - leverage = '1.0', - available_balance = '199955', - margin_usage = '0.0', - buying_power = '199955' - ) - else: - return AccountStats( - collateral = '199955', - portfolio_value = '199955', - leverage = '1.0', - available_balance = '199955', - margin_usage = '0.0', - buying_power = '199955', - ) - """ - - def testAccountStats(self): - """Test AccountStats""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_accounts.py b/test/test_accounts.py deleted file mode 100644 index aee7941..0000000 --- a/test/test_accounts.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.accounts import Accounts - -class TestAccounts(unittest.TestCase): - """Accounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Accounts: - """Test Accounts - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Accounts` - """ - model = Accounts() - if include_optional: - return Accounts( - code = 200, - message = '', - total = 1, - accounts = [ - lighter.models.account.Account( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', ) - ] - ) - else: - return Accounts( - code = 200, - total = 1, - accounts = [ - lighter.models.account.Account( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', ) - ], - ) - """ - - def testAccounts(self): - """Test Accounts""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_api_key.py b/test/test_api_key.py deleted file mode 100644 index 7c20d8a..0000000 --- a/test/test_api_key.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.api_key import ApiKey - -class TestApiKey(unittest.TestCase): - """ApiKey unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ApiKey: - """Test ApiKey - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ApiKey` - """ - model = ApiKey() - if include_optional: - return ApiKey( - account_index = 3, - api_key_index = 0, - nonce = 722, - public_key = '' - ) - else: - return ApiKey( - account_index = 3, - api_key_index = 0, - nonce = 722, - public_key = '', - ) - """ - - def testApiKey(self): - """Test ApiKey""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_block.py b/test/test_block.py deleted file mode 100644 index 2f92c55..0000000 --- a/test/test_block.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.block import Block - -class TestBlock(unittest.TestCase): - """Block unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Block: - """Test Block - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Block` - """ - model = Block() - if include_optional: - return Block( - commitment = '', - height = 56, - state_root = '', - priority_operations = 56, - on_chain_l2_operations = 56, - pending_on_chain_operations_pub_data = '', - committed_tx_hash = '', - committed_at = 56, - verified_tx_hash = '', - verified_at = 56, - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ], - status = 56, - size = 56 - ) - else: - return Block( - commitment = '', - height = 56, - state_root = '', - priority_operations = 56, - on_chain_l2_operations = 56, - pending_on_chain_operations_pub_data = '', - committed_tx_hash = '', - committed_at = 56, - verified_tx_hash = '', - verified_at = 56, - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ], - status = 56, - size = 56, - ) - """ - - def testBlock(self): - """Test Block""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_block_api.py b/test/test_block_api.py deleted file mode 100644 index e8da92d..0000000 --- a/test/test_block_api.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.block_api import BlockApi - - -class TestBlockApi(unittest.TestCase): - """BlockApi unit test stubs""" - - def setUp(self) -> None: - self.api = BlockApi() - - def tearDown(self) -> None: - pass - - def test_block(self) -> None: - """Test case for block - - block - """ - pass - - def test_blocks(self) -> None: - """Test case for blocks - - blocks - """ - pass - - def test_current_height(self) -> None: - """Test case for current_height - - currentHeight - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_blocks.py b/test/test_blocks.py deleted file mode 100644 index 1125923..0000000 --- a/test/test_blocks.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.blocks import Blocks - -class TestBlocks(unittest.TestCase): - """Blocks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Blocks: - """Test Blocks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Blocks` - """ - model = Blocks() - if include_optional: - return Blocks( - code = 200, - message = '', - total = 56, - blocks = [ - lighter.models.block.Block( - commitment = '', - height = 56, - state_root = '', - priority_operations = 56, - on_chain_l2_operations = 56, - pending_on_chain_operations_pub_data = '', - committed_tx_hash = '', - committed_at = 56, - verified_tx_hash = '', - verified_at = 56, - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ], - status = 56, - size = 56, ) - ] - ) - else: - return Blocks( - code = 200, - total = 56, - blocks = [ - lighter.models.block.Block( - commitment = '', - height = 56, - state_root = '', - priority_operations = 56, - on_chain_l2_operations = 56, - pending_on_chain_operations_pub_data = '', - committed_tx_hash = '', - committed_at = 56, - verified_tx_hash = '', - verified_at = 56, - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ], - status = 56, - size = 56, ) - ], - ) - """ - - def testBlocks(self): - """Test Blocks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_bridge_supported_network.py b/test/test_bridge_supported_network.py deleted file mode 100644 index b612138..0000000 --- a/test/test_bridge_supported_network.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.bridge_supported_network import BridgeSupportedNetwork - -class TestBridgeSupportedNetwork(unittest.TestCase): - """BridgeSupportedNetwork unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> BridgeSupportedNetwork: - """Test BridgeSupportedNetwork - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `BridgeSupportedNetwork` - """ - model = BridgeSupportedNetwork() - if include_optional: - return BridgeSupportedNetwork( - name = 'Arbitrum', - chain_id = '4164', - explorer = 'https://arbiscan.io/' - ) - else: - return BridgeSupportedNetwork( - name = 'Arbitrum', - chain_id = '4164', - explorer = 'https://arbiscan.io/', - ) - """ - - def testBridgeSupportedNetwork(self): - """Test BridgeSupportedNetwork""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_candlestick.py b/test/test_candlestick.py deleted file mode 100644 index 1630655..0000000 --- a/test/test_candlestick.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.candlestick import Candlestick - -class TestCandlestick(unittest.TestCase): - """Candlestick unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Candlestick: - """Test Candlestick - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Candlestick` - """ - model = Candlestick() - if include_optional: - return Candlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1 - ) - else: - return Candlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1, - ) - """ - - def testCandlestick(self): - """Test Candlestick""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_candlestick_api.py b/test/test_candlestick_api.py deleted file mode 100644 index 32f192d..0000000 --- a/test/test_candlestick_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.candlestick_api import CandlestickApi - - -class TestCandlestickApi(unittest.TestCase): - """CandlestickApi unit test stubs""" - - def setUp(self) -> None: - self.api = CandlestickApi() - - def tearDown(self) -> None: - pass - - def test_candlesticks(self) -> None: - """Test case for candlesticks - - candlesticks - """ - pass - - def test_fundings(self) -> None: - """Test case for fundings - - fundings - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_candlesticks.py b/test/test_candlesticks.py deleted file mode 100644 index 5c26092..0000000 --- a/test/test_candlesticks.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.candlesticks import Candlesticks - -class TestCandlesticks(unittest.TestCase): - """Candlesticks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Candlesticks: - """Test Candlesticks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Candlesticks` - """ - model = Candlesticks() - if include_optional: - return Candlesticks( - code = 200, - message = '', - resolution = '15m', - candlesticks = [ - lighter.models.candlestick.Candlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1, ) - ] - ) - else: - return Candlesticks( - code = 200, - resolution = '15m', - candlesticks = [ - lighter.models.candlestick.Candlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1, ) - ], - ) - """ - - def testCandlesticks(self): - """Test Candlesticks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_contract_address.py b/test/test_contract_address.py deleted file mode 100644 index bfb7a3c..0000000 --- a/test/test_contract_address.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.contract_address import ContractAddress - -class TestContractAddress(unittest.TestCase): - """ContractAddress unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ContractAddress: - """Test ContractAddress - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ContractAddress` - """ - model = ContractAddress() - if include_optional: - return ContractAddress( - name = '1', - address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' - ) - else: - return ContractAddress( - name = '1', - address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - ) - """ - - def testContractAddress(self): - """Test ContractAddress""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_current_height.py b/test/test_current_height.py deleted file mode 100644 index 0eb6f97..0000000 --- a/test/test_current_height.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.current_height import CurrentHeight - -class TestCurrentHeight(unittest.TestCase): - """CurrentHeight unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CurrentHeight: - """Test CurrentHeight - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `CurrentHeight` - """ - model = CurrentHeight() - if include_optional: - return CurrentHeight( - code = 200, - message = '', - height = 56 - ) - else: - return CurrentHeight( - code = 200, - height = 56, - ) - """ - - def testCurrentHeight(self): - """Test CurrentHeight""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_cursor.py b/test/test_cursor.py deleted file mode 100644 index 20d52a4..0000000 --- a/test/test_cursor.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.cursor import Cursor - -class TestCursor(unittest.TestCase): - """Cursor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Cursor: - """Test Cursor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Cursor` - """ - model = Cursor() - if include_optional: - return Cursor( - next_cursor = '' - ) - else: - return Cursor( - ) - """ - - def testCursor(self): - """Test Cursor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_deposit_history.py b/test/test_deposit_history.py deleted file mode 100644 index bfa40ad..0000000 --- a/test/test_deposit_history.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.deposit_history import DepositHistory - -class TestDepositHistory(unittest.TestCase): - """DepositHistory unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DepositHistory: - """Test DepositHistory - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DepositHistory` - """ - model = DepositHistory() - if include_optional: - return DepositHistory( - code = 200, - message = '', - deposits = [ - lighter.models.deposit_history_item.DepositHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', ) - ], - cursor = '' - ) - else: - return DepositHistory( - code = 200, - deposits = [ - lighter.models.deposit_history_item.DepositHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', ) - ], - cursor = '', - ) - """ - - def testDepositHistory(self): - """Test DepositHistory""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_deposit_history_item.py b/test/test_deposit_history_item.py deleted file mode 100644 index 6275d33..0000000 --- a/test/test_deposit_history_item.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.deposit_history_item import DepositHistoryItem - -class TestDepositHistoryItem(unittest.TestCase): - """DepositHistoryItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DepositHistoryItem: - """Test DepositHistoryItem - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DepositHistoryItem` - """ - model = DepositHistoryItem() - if include_optional: - return DepositHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed' - ) - else: - return DepositHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', - ) - """ - - def testDepositHistoryItem(self): - """Test DepositHistoryItem""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_detailed_account.py b/test/test_detailed_account.py deleted file mode 100644 index 9caad7d..0000000 --- a/test/test_detailed_account.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.detailed_account import DetailedAccount - -class TestDetailedAccount(unittest.TestCase): - """DetailedAccount unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DetailedAccount: - """Test DetailedAccount - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DetailedAccount` - """ - model = DetailedAccount() - if include_optional: - return DetailedAccount( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - positions = [ - lighter.models.account_position.AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000', ) - ], - total_asset_value = '19995', - market_stats = [ - lighter.models.account_market_stats.AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, ) - ], - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - shares = [ - lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ) - ] - ) - else: - return DetailedAccount( - code = 200, - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - positions = [ - lighter.models.account_position.AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000', ) - ], - total_asset_value = '19995', - market_stats = [ - lighter.models.account_market_stats.AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, ) - ], - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - shares = [ - lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ) - ], - ) - """ - - def testDetailedAccount(self): - """Test DetailedAccount""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_detailed_accounts.py b/test/test_detailed_accounts.py deleted file mode 100644 index 85e201d..0000000 --- a/test/test_detailed_accounts.py +++ /dev/null @@ -1,153 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.detailed_accounts import DetailedAccounts - -class TestDetailedAccounts(unittest.TestCase): - """DetailedAccounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DetailedAccounts: - """Test DetailedAccounts - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DetailedAccounts` - """ - model = DetailedAccounts() - if include_optional: - return DetailedAccounts( - code = 200, - message = '', - total = 1, - accounts = [ - lighter.models.detailed_account.DetailedAccount( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - positions = [ - lighter.models.account_position.AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000', ) - ], - total_asset_value = '19995', - market_stats = [ - lighter.models.account_market_stats.AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, ) - ], - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - shares = [ - lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ) - ], ) - ] - ) - else: - return DetailedAccounts( - code = 200, - total = 1, - accounts = [ - lighter.models.detailed_account.DetailedAccount( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - positions = [ - lighter.models.account_position.AccountPosition( - market_id = 1, - symbol = 'ETH', - initial_margin_fraction = '20.00', - open_order_count = 3, - pending_order_count = 3, - sign = 1, - position = '3.6956', - avg_entry_price = '3024.66', - position_value = '3019.92', - unrealized_pnl = '17.521309', - realized_pnl = '2.000000', ) - ], - total_asset_value = '19995', - market_stats = [ - lighter.models.account_market_stats.AccountMarketStats( - market_id = 1, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, ) - ], - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - shares = [ - lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ) - ], ) - ], - ) - """ - - def testDetailedAccounts(self): - """Test DetailedAccounts""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_detailed_candlestick.py b/test/test_detailed_candlestick.py deleted file mode 100644 index 5bbbf7b..0000000 --- a/test/test_detailed_candlestick.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.detailed_candlestick import DetailedCandlestick - -class TestDetailedCandlestick(unittest.TestCase): - """DetailedCandlestick unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DetailedCandlestick: - """Test DetailedCandlestick - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DetailedCandlestick` - """ - model = DetailedCandlestick() - if include_optional: - return DetailedCandlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1, - trade_count = 1503241 - ) - else: - return DetailedCandlestick( - timestamp = 1640995200, - open = 3024.66, - high = 3034.66, - low = 3014.66, - close = 3024.66, - volume0 = 235.25, - volume1 = 93566.25, - last_trade_id = 1, - trade_count = 1503241, - ) - """ - - def testDetailedCandlestick(self): - """Test DetailedCandlestick""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_enriched_tx.py b/test/test_enriched_tx.py deleted file mode 100644 index 6eacddf..0000000 --- a/test/test_enriched_tx.py +++ /dev/null @@ -1,87 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.enriched_tx import EnrichedTx - -class TestEnrichedTx(unittest.TestCase): - """EnrichedTx unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EnrichedTx: - """Test EnrichedTx - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `EnrichedTx` - """ - model = EnrichedTx() - if include_optional: - return EnrichedTx( - code = 200, - message = '', - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - committed_at = 1640995200, - verified_at = 1640995200 - ) - else: - return EnrichedTx( - code = 200, - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - committed_at = 1640995200, - verified_at = 1640995200, - ) - """ - - def testEnrichedTx(self): - """Test EnrichedTx""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_exchange_stats.py b/test/test_exchange_stats.py deleted file mode 100644 index 7f2ddeb..0000000 --- a/test/test_exchange_stats.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.exchange_stats import ExchangeStats - -class TestExchangeStats(unittest.TestCase): - """ExchangeStats unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ExchangeStats: - """Test ExchangeStats - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ExchangeStats` - """ - model = ExchangeStats() - if include_optional: - return ExchangeStats( - code = 200, - message = '', - total = 1, - order_book_stats = 1, - daily_usd_volume = 93566.25, - daily_trades_count = 68 - ) - else: - return ExchangeStats( - code = 200, - total = 1, - order_book_stats = 1, - daily_usd_volume = 93566.25, - daily_trades_count = 68, - ) - """ - - def testExchangeStats(self): - """Test ExchangeStats""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_fee_bucket.py b/test/test_fee_bucket.py deleted file mode 100644 index 425ec65..0000000 --- a/test/test_fee_bucket.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.fee_bucket import FeeBucket - -class TestFeeBucket(unittest.TestCase): - """FeeBucket unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> FeeBucket: - """Test FeeBucket - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `FeeBucket` - """ - model = FeeBucket() - if include_optional: - return FeeBucket( - vip_tier = 56, - taker_fee = 56, - maker_fee = 56 - ) - else: - return FeeBucket( - vip_tier = 56, - taker_fee = 56, - maker_fee = 56, - ) - """ - - def testFeeBucket(self): - """Test FeeBucket""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_funding.py b/test/test_funding.py deleted file mode 100644 index a5903f7..0000000 --- a/test/test_funding.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.funding import Funding - -class TestFunding(unittest.TestCase): - """Funding unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Funding: - """Test Funding - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Funding` - """ - model = Funding() - if include_optional: - return Funding( - timestamp = 1640995200, - value = '0.0001', - rate = '0.0001', - direction = 'long' - ) - else: - return Funding( - timestamp = 1640995200, - value = '0.0001', - rate = '0.0001', - direction = 'long', - ) - """ - - def testFunding(self): - """Test Funding""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_fundings.py b/test/test_fundings.py deleted file mode 100644 index ab9b6c3..0000000 --- a/test/test_fundings.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.fundings import Fundings - -class TestFundings(unittest.TestCase): - """Fundings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Fundings: - """Test Fundings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Fundings` - """ - model = Fundings() - if include_optional: - return Fundings( - code = 200, - message = '', - resolution = '1h', - fundings = [ - lighter.models.funding.Funding( - timestamp = 1640995200, - value = '0.0001', - rate = '0.0001', - direction = 'long', ) - ] - ) - else: - return Fundings( - code = 200, - resolution = '1h', - fundings = [ - lighter.models.funding.Funding( - timestamp = 1640995200, - value = '0.0001', - rate = '0.0001', - direction = 'long', ) - ], - ) - """ - - def testFundings(self): - """Test Fundings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_info_api.py b/test/test_info_api.py deleted file mode 100644 index 4f64ea8..0000000 --- a/test/test_info_api.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.info_api import InfoApi - - -class TestInfoApi(unittest.TestCase): - """InfoApi unit test stubs""" - - def setUp(self) -> None: - self.api = InfoApi() - - def tearDown(self) -> None: - pass - - def test_layer2_basic_info(self) -> None: - """Test case for layer2_basic_info - - layer2BasicInfo - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_l1_provider_info.py b/test/test_l1_provider_info.py deleted file mode 100644 index eec0df6..0000000 --- a/test/test_l1_provider_info.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.l1_provider_info import L1ProviderInfo - -class TestL1ProviderInfo(unittest.TestCase): - """L1ProviderInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> L1ProviderInfo: - """Test L1ProviderInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `L1ProviderInfo` - """ - model = L1ProviderInfo() - if include_optional: - return L1ProviderInfo( - chain_id = 1, - network_id = 1, - latest_block_number = 45434, - network_rpc = '' - ) - else: - return L1ProviderInfo( - chain_id = 1, - network_id = 1, - latest_block_number = 45434, - network_rpc = '', - ) - """ - - def testL1ProviderInfo(self): - """Test L1ProviderInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_layer2_basic_info.py b/test/test_layer2_basic_info.py deleted file mode 100644 index 85b19f7..0000000 --- a/test/test_layer2_basic_info.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.layer2_basic_info import Layer2BasicInfo - -class TestLayer2BasicInfo(unittest.TestCase): - """Layer2BasicInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Layer2BasicInfo: - """Test Layer2BasicInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Layer2BasicInfo` - """ - model = Layer2BasicInfo() - if include_optional: - return Layer2BasicInfo( - code = 200, - message = '', - block_committed = 45434, - block_verified = 45434, - total_transaction_count = 75434 - ) - else: - return Layer2BasicInfo( - code = 200, - block_committed = 45434, - block_verified = 45434, - total_transaction_count = 75434, - ) - """ - - def testLayer2BasicInfo(self): - """Test Layer2BasicInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_liquidation.py b/test/test_liquidation.py deleted file mode 100644 index 796de69..0000000 --- a/test/test_liquidation.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.liquidation import Liquidation - -class TestLiquidation(unittest.TestCase): - """Liquidation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Liquidation: - """Test Liquidation - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Liquidation` - """ - model = Liquidation() - if include_optional: - return Liquidation( - liquidation_id = 1, - account_index = 1, - liquidation_type = 1, - portfolio_value = '1', - margin_requirement = '1' - ) - else: - return Liquidation( - liquidation_id = 1, - account_index = 1, - liquidation_type = 1, - portfolio_value = '1', - margin_requirement = '1', - ) - """ - - def testLiquidation(self): - """Test Liquidation""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_market_info.py b/test/test_market_info.py deleted file mode 100644 index f160a26..0000000 --- a/test/test_market_info.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.market_info import MarketInfo - -class TestMarketInfo(unittest.TestCase): - """MarketInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MarketInfo: - """Test MarketInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `MarketInfo` - """ - model = MarketInfo() - if include_optional: - return MarketInfo( - market_id = 1, - index_price = '3024.66', - mark_price = '3024.66', - open_interest = '235.25', - last_trade_price = '3024.66', - current_funding_rate = '0.0001', - funding_rate = '0.0001', - funding_timestamp = 1640995200, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66 - ) - else: - return MarketInfo( - market_id = 1, - index_price = '3024.66', - mark_price = '3024.66', - open_interest = '235.25', - last_trade_price = '3024.66', - current_funding_rate = '0.0001', - funding_rate = '0.0001', - funding_timestamp = 1640995200, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66, - ) - """ - - def testMarketInfo(self): - """Test MarketInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_next_nonce.py b/test/test_next_nonce.py deleted file mode 100644 index d9ec857..0000000 --- a/test/test_next_nonce.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.next_nonce import NextNonce - -class TestNextNonce(unittest.TestCase): - """NextNonce unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> NextNonce: - """Test NextNonce - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `NextNonce` - """ - model = NextNonce() - if include_optional: - return NextNonce( - code = 200, - message = '', - nonce = 722 - ) - else: - return NextNonce( - code = 200, - nonce = 722, - ) - """ - - def testNextNonce(self): - """Test NextNonce""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order.py b/test/test_order.py deleted file mode 100644 index 4ab798b..0000000 --- a/test/test_order.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order import Order - -class TestOrder(unittest.TestCase): - """Order unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Order: - """Test Order - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Order` - """ - model = Order() - if include_optional: - return Order( - order_index = 1, - client_order_index = 234, - market_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - price = '3024.66', - nonce = 722, - remaining_base_amount = '0.1', - is_ask = True, - base_size = 12354, - base_price = 3024, - filled_base_amount = '0.1', - filled_quote_amount = '0.1', - side = 'buy', - type = 'limit', - time_in_force = 'good-till-time', - reduce_only = True, - trigger_price = '3024.66', - order_expiry = 1640995200, - status = 'open', - trigger_time = 1640995200, - parent_order_index = 1, - block_height = 45434, - timestamp = 1640995200 - ) - else: - return Order( - order_index = 1, - client_order_index = 234, - market_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - price = '3024.66', - nonce = 722, - remaining_base_amount = '0.1', - is_ask = True, - base_size = 12354, - base_price = 3024, - filled_base_amount = '0.1', - filled_quote_amount = '0.1', - side = 'buy', - type = 'limit', - time_in_force = 'good-till-time', - reduce_only = True, - trigger_price = '3024.66', - order_expiry = 1640995200, - status = 'open', - trigger_time = 1640995200, - parent_order_index = 1, - block_height = 45434, - timestamp = 1640995200, - ) - """ - - def testOrder(self): - """Test Order""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_api.py b/test/test_order_api.py deleted file mode 100644 index 2dfa8bc..0000000 --- a/test/test_order_api.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.order_api import OrderApi - - -class TestOrderApi(unittest.TestCase): - """OrderApi unit test stubs""" - - def setUp(self) -> None: - self.api = OrderApi() - - def tearDown(self) -> None: - pass - - def test_account_active_orders(self) -> None: - """Test case for account_active_orders - - accountActiveOrders - """ - pass - - def test_account_inactive_orders(self) -> None: - """Test case for account_inactive_orders - - accountInactiveOrders - """ - pass - - def test_account_orders(self) -> None: - """Test case for account_orders - - accountOrders - """ - pass - - def test_exchange_stats(self) -> None: - """Test case for exchange_stats - - exchangeStats - """ - pass - - def test_order_book_details(self) -> None: - """Test case for order_book_details - - orderBookDetails - """ - pass - - def test_order_book_orders(self) -> None: - """Test case for order_book_orders - - orderBookOrders - """ - pass - - def test_order_books(self) -> None: - """Test case for order_books - - orderBooks - """ - pass - - def test_recent_trades(self) -> None: - """Test case for recent_trades - - recentTrades - """ - pass - - def test_trades(self) -> None: - """Test case for trades - - trades - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book.py b/test/test_order_book.py deleted file mode 100644 index 3e1e633..0000000 --- a/test/test_order_book.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book import OrderBook - -class TestOrderBook(unittest.TestCase): - """OrderBook unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBook: - """Test OrderBook - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBook` - """ - model = OrderBook() - if include_optional: - return OrderBook( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4 - ) - else: - return OrderBook( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, - ) - """ - - def testOrderBook(self): - """Test OrderBook""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book_depth.py b/test/test_order_book_depth.py deleted file mode 100644 index b1013d0..0000000 --- a/test/test_order_book_depth.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book_depth import OrderBookDepth - -class TestOrderBookDepth(unittest.TestCase): - """OrderBookDepth unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBookDepth: - """Test OrderBookDepth - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBookDepth` - """ - model = OrderBookDepth() - if include_optional: - return OrderBookDepth( - code = 200, - message = '', - asks = [ - lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ) - ], - bids = [ - lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ) - ], - offset = 0 - ) - else: - return OrderBookDepth( - code = 200, - asks = [ - lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ) - ], - bids = [ - lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ) - ], - offset = 0, - ) - """ - - def testOrderBookDepth(self): - """Test OrderBookDepth""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book_detail.py b/test/test_order_book_detail.py deleted file mode 100644 index 020c144..0000000 --- a/test/test_order_book_detail.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book_detail import OrderBookDetail - -class TestOrderBookDetail(unittest.TestCase): - """OrderBookDetail unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBookDetail: - """Test OrderBookDetail - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBookDetail` - """ - model = OrderBookDetail() - if include_optional: - return OrderBookDetail( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, - size_decimals = 4, - price_decimals = 4, - quote_multiplier = 10000, - default_initial_margin_fraction = 100, - min_initial_margin_fraction = 100, - maintenance_margin_fraction = 50, - closeout_margin_fraction = 100, - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66, - open_interest = 93.0, - daily_chart = "{1640995200:3024.66}" - ) - else: - return OrderBookDetail( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, - size_decimals = 4, - price_decimals = 4, - quote_multiplier = 10000, - default_initial_margin_fraction = 100, - min_initial_margin_fraction = 100, - maintenance_margin_fraction = 50, - closeout_margin_fraction = 100, - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66, - open_interest = 93.0, - daily_chart = "{1640995200:3024.66}", - ) - """ - - def testOrderBookDetail(self): - """Test OrderBookDetail""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book_details.py b/test/test_order_book_details.py deleted file mode 100644 index 3c8a2df..0000000 --- a/test/test_order_book_details.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book_details import OrderBookDetails - -class TestOrderBookDetails(unittest.TestCase): - """OrderBookDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBookDetails: - """Test OrderBookDetails - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBookDetails` - """ - model = OrderBookDetails() - if include_optional: - return OrderBookDetails( - code = 200, - message = '', - order_book_details = [ - lighter.models.order_book_detail.OrderBookDetail( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, - size_decimals = 4, - price_decimals = 4, - quote_multiplier = 10000, - default_initial_margin_fraction = 100, - min_initial_margin_fraction = 100, - maintenance_margin_fraction = 50, - closeout_margin_fraction = 100, - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66, - open_interest = 93.0, - daily_chart = "{1640995200:3024.66}", ) - ] - ) - else: - return OrderBookDetails( - code = 200, - order_book_details = [ - lighter.models.order_book_detail.OrderBookDetail( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, - size_decimals = 4, - price_decimals = 4, - quote_multiplier = 10000, - default_initial_margin_fraction = 100, - min_initial_margin_fraction = 100, - maintenance_margin_fraction = 50, - closeout_margin_fraction = 100, - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_low = 3014.66, - daily_price_high = 3024.66, - daily_price_change = 3.66, - open_interest = 93.0, - daily_chart = "{1640995200:3024.66}", ) - ], - ) - """ - - def testOrderBookDetails(self): - """Test OrderBookDetails""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book_orders.py b/test/test_order_book_orders.py deleted file mode 100644 index 24681b9..0000000 --- a/test/test_order_book_orders.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book_orders import OrderBookOrders - -class TestOrderBookOrders(unittest.TestCase): - """OrderBookOrders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBookOrders: - """Test OrderBookOrders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBookOrders` - """ - model = OrderBookOrders() - if include_optional: - return OrderBookOrders( - code = 200, - message = '', - total_asks = 1, - asks = [ - lighter.models.simple_order.SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200, ) - ], - total_bids = 1, - bids = [ - lighter.models.simple_order.SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200, ) - ] - ) - else: - return OrderBookOrders( - code = 200, - total_asks = 1, - asks = [ - lighter.models.simple_order.SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200, ) - ], - total_bids = 1, - bids = [ - lighter.models.simple_order.SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200, ) - ], - ) - """ - - def testOrderBookOrders(self): - """Test OrderBookOrders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_book_stats.py b/test/test_order_book_stats.py deleted file mode 100644 index 0548229..0000000 --- a/test/test_order_book_stats.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_book_stats import OrderBookStats - -class TestOrderBookStats(unittest.TestCase): - """OrderBookStats unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBookStats: - """Test OrderBookStats - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBookStats` - """ - model = OrderBookStats() - if include_optional: - return OrderBookStats( - symbol = 'ETH', - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_change = 3.66 - ) - else: - return OrderBookStats( - symbol = 'ETH', - last_trade_price = 3024.66, - daily_trades_count = 68, - daily_base_token_volume = 235.25, - daily_quote_token_volume = 93566.25, - daily_price_change = 3.66, - ) - """ - - def testOrderBookStats(self): - """Test OrderBookStats""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_order_books.py b/test/test_order_books.py deleted file mode 100644 index f6f567a..0000000 --- a/test/test_order_books.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.order_books import OrderBooks - -class TestOrderBooks(unittest.TestCase): - """OrderBooks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrderBooks: - """Test OrderBooks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `OrderBooks` - """ - model = OrderBooks() - if include_optional: - return OrderBooks( - code = 200, - message = '', - order_books = [ - lighter.models.order_book.OrderBook( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, ) - ] - ) - else: - return OrderBooks( - code = 200, - order_books = [ - lighter.models.order_book.OrderBook( - symbol = 'ETH', - market_id = 1, - status = 'active', - taker_fee = '0.0001', - maker_fee = '0.0000', - liquidation_fee = '0.01', - min_base_amount = '0.01', - min_quote_amount = '0.1', - supported_size_decimals = 4, - supported_price_decimals = 4, - supported_quote_decimals = 4, ) - ], - ) - """ - - def testOrderBooks(self): - """Test OrderBooks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_orders.py b/test/test_orders.py deleted file mode 100644 index 4267278..0000000 --- a/test/test_orders.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.orders import Orders - -class TestOrders(unittest.TestCase): - """Orders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Orders: - """Test Orders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Orders` - """ - model = Orders() - if include_optional: - return Orders( - code = 200, - message = '', - next_cursor = '', - orders = [ - lighter.models.order.Order( - order_index = 1, - client_order_index = 234, - market_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - price = '3024.66', - nonce = 722, - remaining_base_amount = '0.1', - is_ask = True, - base_size = 12354, - base_price = 3024, - filled_base_amount = '0.1', - filled_quote_amount = '0.1', - side = 'buy', - type = 'limit', - time_in_force = 'good-till-time', - reduce_only = True, - trigger_price = '3024.66', - order_expiry = 1640995200, - status = 'open', - trigger_time = 1640995200, - parent_order_index = 1, - block_height = 45434, - timestamp = 1640995200, ) - ] - ) - else: - return Orders( - code = 200, - orders = [ - lighter.models.order.Order( - order_index = 1, - client_order_index = 234, - market_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - price = '3024.66', - nonce = 722, - remaining_base_amount = '0.1', - is_ask = True, - base_size = 12354, - base_price = 3024, - filled_base_amount = '0.1', - filled_quote_amount = '0.1', - side = 'buy', - type = 'limit', - time_in_force = 'good-till-time', - reduce_only = True, - trigger_price = '3024.66', - order_expiry = 1640995200, - status = 'open', - trigger_time = 1640995200, - parent_order_index = 1, - block_height = 45434, - timestamp = 1640995200, ) - ], - ) - """ - - def testOrders(self): - """Test Orders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_pn_l_entry.py b/test/test_pn_l_entry.py deleted file mode 100644 index 67a42a1..0000000 --- a/test/test_pn_l_entry.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.pn_l_entry import PnLEntry - -class TestPnLEntry(unittest.TestCase): - """PnLEntry unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PnLEntry: - """Test PnLEntry - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PnLEntry` - """ - model = PnLEntry() - if include_optional: - return PnLEntry( - timestamp = 1640995200, - value = 12.0 - ) - else: - return PnLEntry( - timestamp = 1640995200, - value = 12.0, - ) - """ - - def testPnLEntry(self): - """Test PnLEntry""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_position_funding.py b/test/test_position_funding.py deleted file mode 100644 index e825ff2..0000000 --- a/test/test_position_funding.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.position_funding import PositionFunding - -class TestPositionFunding(unittest.TestCase): - """PositionFunding unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PositionFunding: - """Test PositionFunding - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PositionFunding` - """ - model = PositionFunding() - if include_optional: - return PositionFunding( - timestamp = 1640995200, - market_id = 1, - funding_id = 1, - change = '1', - rate = '1', - position_size = '1', - position_side = 'long' - ) - else: - return PositionFunding( - timestamp = 1640995200, - market_id = 1, - funding_id = 1, - change = '1', - rate = '1', - position_size = '1', - position_side = 'long', - ) - """ - - def testPositionFunding(self): - """Test PositionFunding""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_price_level.py b/test/test_price_level.py deleted file mode 100644 index c4619a3..0000000 --- a/test/test_price_level.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.price_level import PriceLevel - -class TestPriceLevel(unittest.TestCase): - """PriceLevel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PriceLevel: - """Test PriceLevel - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PriceLevel` - """ - model = PriceLevel() - if include_optional: - return PriceLevel( - price = '3024.66', - size = '0.1' - ) - else: - return PriceLevel( - price = '3024.66', - size = '0.1', - ) - """ - - def testPriceLevel(self): - """Test PriceLevel""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_public_pool.py b/test/test_public_pool.py deleted file mode 100644 index b997fb9..0000000 --- a/test/test_public_pool.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.public_pool import PublicPool - -class TestPublicPool(unittest.TestCase): - """PublicPool unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PublicPool: - """Test PublicPool - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PublicPool` - """ - model = PublicPool() - if include_optional: - return PublicPool( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - total_asset_value = '19995', - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - account_share = lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ) - ) - else: - return PublicPool( - code = 200, - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - total_asset_value = '19995', - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - account_share = lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ), - ) - """ - - def testPublicPool(self): - """Test PublicPool""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_public_pool_info.py b/test/test_public_pool_info.py deleted file mode 100644 index 4545294..0000000 --- a/test/test_public_pool_info.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.public_pool_info import PublicPoolInfo - -class TestPublicPoolInfo(unittest.TestCase): - """PublicPoolInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PublicPoolInfo: - """Test PublicPoolInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PublicPoolInfo` - """ - model = PublicPoolInfo() - if include_optional: - return PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000 - ) - else: - return PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, - ) - """ - - def testPublicPoolInfo(self): - """Test PublicPoolInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_public_pool_share.py b/test/test_public_pool_share.py deleted file mode 100644 index 70ffb99..0000000 --- a/test/test_public_pool_share.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.public_pool_share import PublicPoolShare - -class TestPublicPoolShare(unittest.TestCase): - """PublicPoolShare unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PublicPoolShare: - """Test PublicPoolShare - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PublicPoolShare` - """ - model = PublicPoolShare() - if include_optional: - return PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000' - ) - else: - return PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', - ) - """ - - def testPublicPoolShare(self): - """Test PublicPoolShare""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_public_pools.py b/test/test_public_pools.py deleted file mode 100644 index fc5a599..0000000 --- a/test/test_public_pools.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.public_pools import PublicPools - -class TestPublicPools(unittest.TestCase): - """PublicPools unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> PublicPools: - """Test PublicPools - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `PublicPools` - """ - model = PublicPools() - if include_optional: - return PublicPools( - code = 200, - message = '', - total = 56, - public_pools = [ - lighter.models.public_pool.PublicPool( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - total_asset_value = '19995', - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - account_share = lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ), ) - ] - ) - else: - return PublicPools( - code = 200, - total = 56, - public_pools = [ - lighter.models.public_pool.PublicPool( - code = 200, - message = '', - account_type = 1, - index = 1, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - cancel_all_time = 1640995200, - total_order_count = 100, - pending_order_count = 100, - status = 1, - collateral = '46342', - name = '', - description = '', - total_asset_value = '19995', - pool_info = lighter.models.public_pool_info.PublicPoolInfo( - status = 0, - operator_fee = '100', - min_operator_share_rate = '200', - total_shares = 100000, - operator_shares = 20000, ), - account_share = lighter.models.public_pool_share.PublicPoolShare( - public_pool_index = 1, - shares_amount = 3000, - entry_usdc = '3000', ), ) - ], - ) - """ - - def testPublicPools(self): - """Test PublicPools""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account.py b/test/test_req_get_account.py deleted file mode 100644 index 1b1feb9..0000000 --- a/test/test_req_get_account.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account import ReqGetAccount - -class TestReqGetAccount(unittest.TestCase): - """ReqGetAccount unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccount: - """Test ReqGetAccount - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccount` - """ - model = ReqGetAccount() - if include_optional: - return ReqGetAccount( - by = 'index', - value = '' - ) - else: - return ReqGetAccount( - by = 'index', - value = '', - ) - """ - - def testReqGetAccount(self): - """Test ReqGetAccount""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_active_orders.py b/test/test_req_get_account_active_orders.py deleted file mode 100644 index 8e437e3..0000000 --- a/test/test_req_get_account_active_orders.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_active_orders import ReqGetAccountActiveOrders - -class TestReqGetAccountActiveOrders(unittest.TestCase): - """ReqGetAccountActiveOrders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountActiveOrders: - """Test ReqGetAccountActiveOrders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountActiveOrders` - """ - model = ReqGetAccountActiveOrders() - if include_optional: - return ReqGetAccountActiveOrders( - account_index = 56, - market_id = 56, - auth = '' - ) - else: - return ReqGetAccountActiveOrders( - account_index = 56, - market_id = 56, - auth = '', - ) - """ - - def testReqGetAccountActiveOrders(self): - """Test ReqGetAccountActiveOrders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_api_keys.py b/test/test_req_get_account_api_keys.py deleted file mode 100644 index 5ea31a7..0000000 --- a/test/test_req_get_account_api_keys.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_api_keys import ReqGetAccountApiKeys - -class TestReqGetAccountApiKeys(unittest.TestCase): - """ReqGetAccountApiKeys unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountApiKeys: - """Test ReqGetAccountApiKeys - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountApiKeys` - """ - model = ReqGetAccountApiKeys() - if include_optional: - return ReqGetAccountApiKeys( - account_index = 56, - api_key_index = 56 - ) - else: - return ReqGetAccountApiKeys( - account_index = 56, - api_key_index = 56, - ) - """ - - def testReqGetAccountApiKeys(self): - """Test ReqGetAccountApiKeys""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_by_l1_address.py b/test/test_req_get_account_by_l1_address.py deleted file mode 100644 index 4641859..0000000 --- a/test/test_req_get_account_by_l1_address.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_by_l1_address import ReqGetAccountByL1Address - -class TestReqGetAccountByL1Address(unittest.TestCase): - """ReqGetAccountByL1Address unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountByL1Address: - """Test ReqGetAccountByL1Address - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountByL1Address` - """ - model = ReqGetAccountByL1Address() - if include_optional: - return ReqGetAccountByL1Address( - l1_address = '' - ) - else: - return ReqGetAccountByL1Address( - l1_address = '', - ) - """ - - def testReqGetAccountByL1Address(self): - """Test ReqGetAccountByL1Address""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_inactive_orders.py b/test/test_req_get_account_inactive_orders.py deleted file mode 100644 index 55c841a..0000000 --- a/test/test_req_get_account_inactive_orders.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_inactive_orders import ReqGetAccountInactiveOrders - -class TestReqGetAccountInactiveOrders(unittest.TestCase): - """ReqGetAccountInactiveOrders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountInactiveOrders: - """Test ReqGetAccountInactiveOrders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountInactiveOrders` - """ - model = ReqGetAccountInactiveOrders() - if include_optional: - return ReqGetAccountInactiveOrders( - account_index = 56, - market_id = 56, - ask_filter = 56, - between_timestamps = '', - cursor = '', - limit = 1 - ) - else: - return ReqGetAccountInactiveOrders( - account_index = 56, - limit = 1, - ) - """ - - def testReqGetAccountInactiveOrders(self): - """Test ReqGetAccountInactiveOrders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_orders.py b/test/test_req_get_account_orders.py deleted file mode 100644 index 5a67948..0000000 --- a/test/test_req_get_account_orders.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_orders import ReqGetAccountOrders - -class TestReqGetAccountOrders(unittest.TestCase): - """ReqGetAccountOrders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountOrders: - """Test ReqGetAccountOrders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountOrders` - """ - model = ReqGetAccountOrders() - if include_optional: - return ReqGetAccountOrders( - account_index = 56, - market_id = 56, - cursor = '', - limit = 1 - ) - else: - return ReqGetAccountOrders( - account_index = 56, - market_id = 56, - limit = 1, - ) - """ - - def testReqGetAccountOrders(self): - """Test ReqGetAccountOrders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_pending_txs.py b/test/test_req_get_account_pending_txs.py deleted file mode 100644 index 6809634..0000000 --- a/test/test_req_get_account_pending_txs.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_pending_txs import ReqGetAccountPendingTxs - -class TestReqGetAccountPendingTxs(unittest.TestCase): - """ReqGetAccountPendingTxs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountPendingTxs: - """Test ReqGetAccountPendingTxs - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountPendingTxs` - """ - model = ReqGetAccountPendingTxs() - if include_optional: - return ReqGetAccountPendingTxs( - by = 'account_index', - value = '', - types = [ - 56 - ] - ) - else: - return ReqGetAccountPendingTxs( - ) - """ - - def testReqGetAccountPendingTxs(self): - """Test ReqGetAccountPendingTxs""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_pn_l.py b/test/test_req_get_account_pn_l.py deleted file mode 100644 index ca8eb13..0000000 --- a/test/test_req_get_account_pn_l.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_pn_l import ReqGetAccountPnL - -class TestReqGetAccountPnL(unittest.TestCase): - """ReqGetAccountPnL unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountPnL: - """Test ReqGetAccountPnL - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountPnL` - """ - model = ReqGetAccountPnL() - if include_optional: - return ReqGetAccountPnL( - by = 'index', - value = '', - resolution = '1m', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56, - ignore_transfers = True - ) - else: - return ReqGetAccountPnL( - by = 'index', - value = '', - resolution = '1m', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56, - ) - """ - - def testReqGetAccountPnL(self): - """Test ReqGetAccountPnL""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_account_txs.py b/test/test_req_get_account_txs.py deleted file mode 100644 index a895ef1..0000000 --- a/test/test_req_get_account_txs.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_account_txs import ReqGetAccountTxs - -class TestReqGetAccountTxs(unittest.TestCase): - """ReqGetAccountTxs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetAccountTxs: - """Test ReqGetAccountTxs - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetAccountTxs` - """ - model = ReqGetAccountTxs() - if include_optional: - return ReqGetAccountTxs( - index = 56, - limit = 1, - by = 'account_index', - value = '', - types = [ - 56 - ] - ) - else: - return ReqGetAccountTxs( - ) - """ - - def testReqGetAccountTxs(self): - """Test ReqGetAccountTxs""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_block.py b/test/test_req_get_block.py deleted file mode 100644 index 9a2af2c..0000000 --- a/test/test_req_get_block.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_block import ReqGetBlock - -class TestReqGetBlock(unittest.TestCase): - """ReqGetBlock unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetBlock: - """Test ReqGetBlock - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetBlock` - """ - model = ReqGetBlock() - if include_optional: - return ReqGetBlock( - by = 'commitment', - value = '' - ) - else: - return ReqGetBlock( - by = 'commitment', - value = '', - ) - """ - - def testReqGetBlock(self): - """Test ReqGetBlock""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_block_txs.py b/test/test_req_get_block_txs.py deleted file mode 100644 index 7e5ab09..0000000 --- a/test/test_req_get_block_txs.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_block_txs import ReqGetBlockTxs - -class TestReqGetBlockTxs(unittest.TestCase): - """ReqGetBlockTxs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetBlockTxs: - """Test ReqGetBlockTxs - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetBlockTxs` - """ - model = ReqGetBlockTxs() - if include_optional: - return ReqGetBlockTxs( - by = 'block_height', - value = '' - ) - else: - return ReqGetBlockTxs( - by = 'block_height', - value = '', - ) - """ - - def testReqGetBlockTxs(self): - """Test ReqGetBlockTxs""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_by_account.py b/test/test_req_get_by_account.py deleted file mode 100644 index 0aeb9fb..0000000 --- a/test/test_req_get_by_account.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_by_account import ReqGetByAccount - -class TestReqGetByAccount(unittest.TestCase): - """ReqGetByAccount unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetByAccount: - """Test ReqGetByAccount - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetByAccount` - """ - model = ReqGetByAccount() - if include_optional: - return ReqGetByAccount( - by = 'account_index', - value = '' - ) - else: - return ReqGetByAccount( - by = 'account_index', - value = '', - ) - """ - - def testReqGetByAccount(self): - """Test ReqGetByAccount""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_candlesticks.py b/test/test_req_get_candlesticks.py deleted file mode 100644 index 49f078d..0000000 --- a/test/test_req_get_candlesticks.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_candlesticks import ReqGetCandlesticks - -class TestReqGetCandlesticks(unittest.TestCase): - """ReqGetCandlesticks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetCandlesticks: - """Test ReqGetCandlesticks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetCandlesticks` - """ - model = ReqGetCandlesticks() - if include_optional: - return ReqGetCandlesticks( - market_id = 56, - resolution = '1m', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56, - set_timestamp_to_end = True - ) - else: - return ReqGetCandlesticks( - market_id = 56, - resolution = '1m', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56, - ) - """ - - def testReqGetCandlesticks(self): - """Test ReqGetCandlesticks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_deposit_history.py b/test/test_req_get_deposit_history.py deleted file mode 100644 index f1b674e..0000000 --- a/test/test_req_get_deposit_history.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_deposit_history import ReqGetDepositHistory - -class TestReqGetDepositHistory(unittest.TestCase): - """ReqGetDepositHistory unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetDepositHistory: - """Test ReqGetDepositHistory - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetDepositHistory` - """ - model = ReqGetDepositHistory() - if include_optional: - return ReqGetDepositHistory( - l1_address = '', - cursor = '', - filter = 'all' - ) - else: - return ReqGetDepositHistory( - l1_address = '', - ) - """ - - def testReqGetDepositHistory(self): - """Test ReqGetDepositHistory""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_fee_bucket.py b/test/test_req_get_fee_bucket.py deleted file mode 100644 index e85d07e..0000000 --- a/test/test_req_get_fee_bucket.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_fee_bucket import ReqGetFeeBucket - -class TestReqGetFeeBucket(unittest.TestCase): - """ReqGetFeeBucket unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetFeeBucket: - """Test ReqGetFeeBucket - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetFeeBucket` - """ - model = ReqGetFeeBucket() - if include_optional: - return ReqGetFeeBucket( - account_index = 56 - ) - else: - return ReqGetFeeBucket( - account_index = 56, - ) - """ - - def testReqGetFeeBucket(self): - """Test ReqGetFeeBucket""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_fundings.py b/test/test_req_get_fundings.py deleted file mode 100644 index f290c3d..0000000 --- a/test/test_req_get_fundings.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_fundings import ReqGetFundings - -class TestReqGetFundings(unittest.TestCase): - """ReqGetFundings unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetFundings: - """Test ReqGetFundings - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetFundings` - """ - model = ReqGetFundings() - if include_optional: - return ReqGetFundings( - market_id = 56, - resolution = '1h', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56 - ) - else: - return ReqGetFundings( - market_id = 56, - resolution = '1h', - start_timestamp = 56, - end_timestamp = 56, - count_back = 56, - ) - """ - - def testReqGetFundings(self): - """Test ReqGetFundings""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_l1_tx.py b/test/test_req_get_l1_tx.py deleted file mode 100644 index 768dac2..0000000 --- a/test/test_req_get_l1_tx.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_l1_tx import ReqGetL1Tx - -class TestReqGetL1Tx(unittest.TestCase): - """ReqGetL1Tx unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetL1Tx: - """Test ReqGetL1Tx - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetL1Tx` - """ - model = ReqGetL1Tx() - if include_optional: - return ReqGetL1Tx( - hash = '' - ) - else: - return ReqGetL1Tx( - hash = '', - ) - """ - - def testReqGetL1Tx(self): - """Test ReqGetL1Tx""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_latest_deposit.py b/test/test_req_get_latest_deposit.py deleted file mode 100644 index cdee5c9..0000000 --- a/test/test_req_get_latest_deposit.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_latest_deposit import ReqGetLatestDeposit - -class TestReqGetLatestDeposit(unittest.TestCase): - """ReqGetLatestDeposit unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetLatestDeposit: - """Test ReqGetLatestDeposit - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetLatestDeposit` - """ - model = ReqGetLatestDeposit() - if include_optional: - return ReqGetLatestDeposit( - l1_address = '' - ) - else: - return ReqGetLatestDeposit( - l1_address = '', - ) - """ - - def testReqGetLatestDeposit(self): - """Test ReqGetLatestDeposit""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_next_nonce.py b/test/test_req_get_next_nonce.py deleted file mode 100644 index 65e89c8..0000000 --- a/test/test_req_get_next_nonce.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_next_nonce import ReqGetNextNonce - -class TestReqGetNextNonce(unittest.TestCase): - """ReqGetNextNonce unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetNextNonce: - """Test ReqGetNextNonce - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetNextNonce` - """ - model = ReqGetNextNonce() - if include_optional: - return ReqGetNextNonce( - account_index = 56, - api_key_index = 56 - ) - else: - return ReqGetNextNonce( - account_index = 56, - api_key_index = 56, - ) - """ - - def testReqGetNextNonce(self): - """Test ReqGetNextNonce""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_order_book_details.py b/test/test_req_get_order_book_details.py deleted file mode 100644 index e75c23a..0000000 --- a/test/test_req_get_order_book_details.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_order_book_details import ReqGetOrderBookDetails - -class TestReqGetOrderBookDetails(unittest.TestCase): - """ReqGetOrderBookDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetOrderBookDetails: - """Test ReqGetOrderBookDetails - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetOrderBookDetails` - """ - model = ReqGetOrderBookDetails() - if include_optional: - return ReqGetOrderBookDetails( - market_id = 56 - ) - else: - return ReqGetOrderBookDetails( - ) - """ - - def testReqGetOrderBookDetails(self): - """Test ReqGetOrderBookDetails""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_order_book_orders.py b/test/test_req_get_order_book_orders.py deleted file mode 100644 index 20f955c..0000000 --- a/test/test_req_get_order_book_orders.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_order_book_orders import ReqGetOrderBookOrders - -class TestReqGetOrderBookOrders(unittest.TestCase): - """ReqGetOrderBookOrders unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetOrderBookOrders: - """Test ReqGetOrderBookOrders - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetOrderBookOrders` - """ - model = ReqGetOrderBookOrders() - if include_optional: - return ReqGetOrderBookOrders( - market_id = 56, - limit = 1 - ) - else: - return ReqGetOrderBookOrders( - market_id = 56, - limit = 1, - ) - """ - - def testReqGetOrderBookOrders(self): - """Test ReqGetOrderBookOrders""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_order_books.py b/test/test_req_get_order_books.py deleted file mode 100644 index fc0a2f6..0000000 --- a/test/test_req_get_order_books.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_order_books import ReqGetOrderBooks - -class TestReqGetOrderBooks(unittest.TestCase): - """ReqGetOrderBooks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetOrderBooks: - """Test ReqGetOrderBooks - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetOrderBooks` - """ - model = ReqGetOrderBooks() - if include_optional: - return ReqGetOrderBooks( - market_id = 56 - ) - else: - return ReqGetOrderBooks( - ) - """ - - def testReqGetOrderBooks(self): - """Test ReqGetOrderBooks""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_public_pools.py b/test/test_req_get_public_pools.py deleted file mode 100644 index d1356b9..0000000 --- a/test/test_req_get_public_pools.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_public_pools import ReqGetPublicPools - -class TestReqGetPublicPools(unittest.TestCase): - """ReqGetPublicPools unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetPublicPools: - """Test ReqGetPublicPools - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetPublicPools` - """ - model = ReqGetPublicPools() - if include_optional: - return ReqGetPublicPools( - filter = 'all', - index = 56, - limit = 1, - account_index = 56 - ) - else: - return ReqGetPublicPools( - index = 56, - limit = 1, - ) - """ - - def testReqGetPublicPools(self): - """Test ReqGetPublicPools""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_range_with_cursor.py b/test/test_req_get_range_with_cursor.py deleted file mode 100644 index 98171d5..0000000 --- a/test/test_req_get_range_with_cursor.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_range_with_cursor import ReqGetRangeWithCursor - -class TestReqGetRangeWithCursor(unittest.TestCase): - """ReqGetRangeWithCursor unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetRangeWithCursor: - """Test ReqGetRangeWithCursor - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetRangeWithCursor` - """ - model = ReqGetRangeWithCursor() - if include_optional: - return ReqGetRangeWithCursor( - cursor = '', - limit = 1 - ) - else: - return ReqGetRangeWithCursor( - limit = 1, - ) - """ - - def testReqGetRangeWithCursor(self): - """Test ReqGetRangeWithCursor""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_range_with_index.py b/test/test_req_get_range_with_index.py deleted file mode 100644 index 5afbe7e..0000000 --- a/test/test_req_get_range_with_index.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_range_with_index import ReqGetRangeWithIndex - -class TestReqGetRangeWithIndex(unittest.TestCase): - """ReqGetRangeWithIndex unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetRangeWithIndex: - """Test ReqGetRangeWithIndex - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetRangeWithIndex` - """ - model = ReqGetRangeWithIndex() - if include_optional: - return ReqGetRangeWithIndex( - index = 56, - limit = 1 - ) - else: - return ReqGetRangeWithIndex( - limit = 1, - ) - """ - - def testReqGetRangeWithIndex(self): - """Test ReqGetRangeWithIndex""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_range_with_index_sortable.py b/test/test_req_get_range_with_index_sortable.py deleted file mode 100644 index 2247167..0000000 --- a/test/test_req_get_range_with_index_sortable.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_range_with_index_sortable import ReqGetRangeWithIndexSortable - -class TestReqGetRangeWithIndexSortable(unittest.TestCase): - """ReqGetRangeWithIndexSortable unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetRangeWithIndexSortable: - """Test ReqGetRangeWithIndexSortable - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetRangeWithIndexSortable` - """ - model = ReqGetRangeWithIndexSortable() - if include_optional: - return ReqGetRangeWithIndexSortable( - index = 56, - limit = 1, - sort = 'asc' - ) - else: - return ReqGetRangeWithIndexSortable( - ) - """ - - def testReqGetRangeWithIndexSortable(self): - """Test ReqGetRangeWithIndexSortable""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_recent_trades.py b/test/test_req_get_recent_trades.py deleted file mode 100644 index 3f49979..0000000 --- a/test/test_req_get_recent_trades.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_recent_trades import ReqGetRecentTrades - -class TestReqGetRecentTrades(unittest.TestCase): - """ReqGetRecentTrades unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetRecentTrades: - """Test ReqGetRecentTrades - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetRecentTrades` - """ - model = ReqGetRecentTrades() - if include_optional: - return ReqGetRecentTrades( - market_id = 56, - limit = 1 - ) - else: - return ReqGetRecentTrades( - market_id = 56, - limit = 1, - ) - """ - - def testReqGetRecentTrades(self): - """Test ReqGetRecentTrades""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_trades.py b/test/test_req_get_trades.py deleted file mode 100644 index 37845fd..0000000 --- a/test/test_req_get_trades.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_trades import ReqGetTrades - -class TestReqGetTrades(unittest.TestCase): - """ReqGetTrades unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetTrades: - """Test ReqGetTrades - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetTrades` - """ - model = ReqGetTrades() - if include_optional: - return ReqGetTrades( - market_id = 56, - account_index = 56, - order_index = 56, - sort_by = 'block_height', - sort_dir = 'asc', - cursor = '', - var_from = 56, - ask_filter = 56, - limit = 1 - ) - else: - return ReqGetTrades( - sort_by = 'block_height', - limit = 1, - ) - """ - - def testReqGetTrades(self): - """Test ReqGetTrades""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_tx.py b/test/test_req_get_tx.py deleted file mode 100644 index c0560a5..0000000 --- a/test/test_req_get_tx.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_tx import ReqGetTx - -class TestReqGetTx(unittest.TestCase): - """ReqGetTx unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetTx: - """Test ReqGetTx - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetTx` - """ - model = ReqGetTx() - if include_optional: - return ReqGetTx( - by = 'hash', - value = '' - ) - else: - return ReqGetTx( - by = 'hash', - value = '', - ) - """ - - def testReqGetTx(self): - """Test ReqGetTx""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_req_get_withdraw_history.py b/test/test_req_get_withdraw_history.py deleted file mode 100644 index dfd7d85..0000000 --- a/test/test_req_get_withdraw_history.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.req_get_withdraw_history import ReqGetWithdrawHistory - -class TestReqGetWithdrawHistory(unittest.TestCase): - """ReqGetWithdrawHistory unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ReqGetWithdrawHistory: - """Test ReqGetWithdrawHistory - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ReqGetWithdrawHistory` - """ - model = ReqGetWithdrawHistory() - if include_optional: - return ReqGetWithdrawHistory( - account_index = 56, - cursor = '', - filter = 'all' - ) - else: - return ReqGetWithdrawHistory( - account_index = 56, - ) - """ - - def testReqGetWithdrawHistory(self): - """Test ReqGetWithdrawHistory""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_result_code.py b/test/test_result_code.py deleted file mode 100644 index 28f8b58..0000000 --- a/test/test_result_code.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.result_code import ResultCode - -class TestResultCode(unittest.TestCase): - """ResultCode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ResultCode: - """Test ResultCode - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ResultCode` - """ - model = ResultCode() - if include_optional: - return ResultCode( - code = 200, - message = '' - ) - else: - return ResultCode( - code = 200, - ) - """ - - def testResultCode(self): - """Test ResultCode""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_root_api.py b/test/test_root_api.py deleted file mode 100644 index cd32a7c..0000000 --- a/test/test_root_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.root_api import RootApi - - -class TestRootApi(unittest.TestCase): - """RootApi unit test stubs""" - - def setUp(self) -> None: - self.api = RootApi() - - def tearDown(self) -> None: - pass - - def test_info(self) -> None: - """Test case for info - - info - """ - pass - - def test_status(self) -> None: - """Test case for status - - status - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_simple_order.py b/test/test_simple_order.py deleted file mode 100644 index 64e4472..0000000 --- a/test/test_simple_order.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.simple_order import SimpleOrder - -class TestSimpleOrder(unittest.TestCase): - """SimpleOrder unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SimpleOrder: - """Test SimpleOrder - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SimpleOrder` - """ - model = SimpleOrder() - if include_optional: - return SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200 - ) - else: - return SimpleOrder( - order_index = 1, - owner_account_index = 1, - initial_base_amount = '0.1', - remaining_base_amount = '0.1', - price = '3024.66', - order_expiry = 1640995200, - ) - """ - - def testSimpleOrder(self): - """Test SimpleOrder""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_status.py b/test/test_status.py deleted file mode 100644 index 1e45bde..0000000 --- a/test/test_status.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.status import Status - -class TestStatus(unittest.TestCase): - """Status unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Status: - """Test Status - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Status` - """ - model = Status() - if include_optional: - return Status( - status = 1, - network_id = 1 - ) - else: - return Status( - status = 1, - network_id = 1, - ) - """ - - def testStatus(self): - """Test Status""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_sub_accounts.py b/test/test_sub_accounts.py deleted file mode 100644 index acc099f..0000000 --- a/test/test_sub_accounts.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.sub_accounts import SubAccounts - -class TestSubAccounts(unittest.TestCase): - """SubAccounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> SubAccounts: - """Test SubAccounts - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `SubAccounts` - """ - model = SubAccounts() - if include_optional: - return SubAccounts( - code = 200, - message = '', - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - sub_accounts = 1 - ) - else: - return SubAccounts( - code = 200, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - sub_accounts = 1, - ) - """ - - def testSubAccounts(self): - """Test SubAccounts""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_ticker.py b/test/test_ticker.py deleted file mode 100644 index 23e2407..0000000 --- a/test/test_ticker.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.ticker import Ticker - -class TestTicker(unittest.TestCase): - """Ticker unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Ticker: - """Test Ticker - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Ticker` - """ - model = Ticker() - if include_optional: - return Ticker( - s = 'ETH', - a = lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ), - b = lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ) - ) - else: - return Ticker( - s = 'ETH', - a = lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ), - b = lighter.models.price_level.PriceLevel( - price = '3024.66', - size = '0.1', ), - ) - """ - - def testTicker(self): - """Test Ticker""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_trade.py b/test/test_trade.py deleted file mode 100644 index fce5992..0000000 --- a/test/test_trade.py +++ /dev/null @@ -1,78 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.trade import Trade - -class TestTrade(unittest.TestCase): - """Trade unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Trade: - """Test Trade - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Trade` - """ - model = Trade() - if include_optional: - return Trade( - trade_id = 145, - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 'trade', - market_id = 1, - size = '0.1', - price = '3024.66', - usd_amount = '3024.66', - ask_id = 145, - bid_id = 245, - ask_account_id = 1, - bid_account_id = 3, - is_maker_ask = True, - block_height = 45434, - timestamp = 1640995200 - ) - else: - return Trade( - trade_id = 145, - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 'trade', - market_id = 1, - size = '0.1', - price = '3024.66', - usd_amount = '3024.66', - ask_id = 145, - bid_id = 245, - ask_account_id = 1, - bid_account_id = 3, - is_maker_ask = True, - block_height = 45434, - timestamp = 1640995200, - ) - """ - - def testTrade(self): - """Test Trade""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_trades.py b/test/test_trades.py deleted file mode 100644 index 9636c50..0000000 --- a/test/test_trades.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.trades import Trades - -class TestTrades(unittest.TestCase): - """Trades unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Trades: - """Test Trades - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Trades` - """ - model = Trades() - if include_optional: - return Trades( - code = 200, - message = '', - next_cursor = '', - trades = [ - lighter.models.trade.Trade( - trade_id = 145, - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 'trade', - market_id = 1, - size = '0.1', - price = '3024.66', - usd_amount = '3024.66', - ask_id = 145, - bid_id = 245, - ask_account_id = 1, - bid_account_id = 3, - is_maker_ask = True, - block_height = 45434, - timestamp = 1640995200, ) - ] - ) - else: - return Trades( - code = 200, - trades = [ - lighter.models.trade.Trade( - trade_id = 145, - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 'trade', - market_id = 1, - size = '0.1', - price = '3024.66', - usd_amount = '3024.66', - ask_id = 145, - bid_id = 245, - ask_account_id = 1, - bid_account_id = 3, - is_maker_ask = True, - block_height = 45434, - timestamp = 1640995200, ) - ], - ) - """ - - def testTrades(self): - """Test Trades""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transaction_api.py b/test/test_transaction_api.py deleted file mode 100644 index ff47d81..0000000 --- a/test/test_transaction_api.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.api.transaction_api import TransactionApi - - -class TestTransactionApi(unittest.TestCase): - """TransactionApi unit test stubs""" - - def setUp(self) -> None: - self.api = TransactionApi() - - def tearDown(self) -> None: - pass - - def test_account_pending_txs(self) -> None: - """Test case for account_pending_txs - - accountPendingTxs - """ - pass - - def test_account_txs(self) -> None: - """Test case for account_txs - - accountTxs - """ - pass - - def test_block_txs(self) -> None: - """Test case for block_txs - - blockTxs - """ - pass - - def test_deposit_history(self) -> None: - """Test case for deposit_history - - deposit_history - """ - pass - - def test_next_nonce(self) -> None: - """Test case for next_nonce - - nextNonce - """ - pass - - def test_pending_txs(self) -> None: - """Test case for pending_txs - - pendingTxs - """ - pass - - def test_send_tx(self) -> None: - """Test case for send_tx - - sendTx - """ - pass - - def test_send_tx_batch(self) -> None: - """Test case for send_tx_batch - - sendTxBatch - """ - pass - - def test_tx(self) -> None: - """Test case for tx - - tx - """ - pass - - def test_tx_from_l1_tx_hash(self) -> None: - """Test case for tx_from_l1_tx_hash - - txFromL1TxHash - """ - pass - - def test_txs(self) -> None: - """Test case for txs - - txs - """ - pass - - def test_withdraw_history(self) -> None: - """Test case for withdraw_history - - withdraw_history - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tx.py b/test/test_tx.py deleted file mode 100644 index f5da384..0000000 --- a/test/test_tx.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.tx import Tx - -class TestTx(unittest.TestCase): - """Tx unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Tx: - """Test Tx - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Tx` - """ - model = Tx() - if include_optional: - return Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' - ) - else: - return Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - ) - """ - - def testTx(self): - """Test Tx""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tx_hash.py b/test/test_tx_hash.py deleted file mode 100644 index 7a3eec4..0000000 --- a/test/test_tx_hash.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.tx_hash import TxHash - -class TestTxHash(unittest.TestCase): - """TxHash unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> TxHash: - """Test TxHash - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TxHash` - """ - model = TxHash() - if include_optional: - return TxHash( - code = 200, - message = '', - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' - ) - else: - return TxHash( - code = 200, - tx_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - ) - """ - - def testTxHash(self): - """Test TxHash""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tx_hashes.py b/test/test_tx_hashes.py deleted file mode 100644 index 0e2937a..0000000 --- a/test/test_tx_hashes.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.tx_hashes import TxHashes - -class TestTxHashes(unittest.TestCase): - """TxHashes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> TxHashes: - """Test TxHashes - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `TxHashes` - """ - model = TxHashes() - if include_optional: - return TxHashes( - code = 200, - message = '', - tx_hash = [ - '' - ] - ) - else: - return TxHashes( - code = 200, - tx_hash = [ - '' - ], - ) - """ - - def testTxHashes(self): - """Test TxHashes""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_txs.py b/test/test_txs.py deleted file mode 100644 index 69a9c2e..0000000 --- a/test/test_txs.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.txs import Txs - -class TestTxs(unittest.TestCase): - """Txs unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Txs: - """Test Txs - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `Txs` - """ - model = Txs() - if include_optional: - return Txs( - code = 200, - message = '', - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ] - ) - else: - return Txs( - code = 200, - txs = [ - lighter.models.tx.Tx( - hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - type = 1, - info = '{}', - event_info = '{}', - status = 1, - transaction_index = 8761, - l1_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - account_index = 1, - nonce = 722, - expire_at = 1640995200, - block_height = 45434, - queued_at = 1640995200, - executed_at = 1640995200, - sequence_index = 8761, - parent_hash = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', ) - ], - ) - """ - - def testTxs(self): - """Test Txs""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_validator_info.py b/test/test_validator_info.py deleted file mode 100644 index 3357aa3..0000000 --- a/test/test_validator_info.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.validator_info import ValidatorInfo - -class TestValidatorInfo(unittest.TestCase): - """ValidatorInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ValidatorInfo: - """Test ValidatorInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ValidatorInfo` - """ - model = ValidatorInfo() - if include_optional: - return ValidatorInfo( - address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - is_active = True - ) - else: - return ValidatorInfo( - address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - is_active = True, - ) - """ - - def testValidatorInfo(self): - """Test ValidatorInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_withdraw_history.py b/test/test_withdraw_history.py deleted file mode 100644 index 0e6b69b..0000000 --- a/test/test_withdraw_history.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.withdraw_history import WithdrawHistory - -class TestWithdrawHistory(unittest.TestCase): - """WithdrawHistory unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> WithdrawHistory: - """Test WithdrawHistory - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `WithdrawHistory` - """ - model = WithdrawHistory() - if include_optional: - return WithdrawHistory( - code = 200, - message = '', - withdraws = [ - lighter.models.withdraw_history_item.WithdrawHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', - type = 'secure', ) - ], - cursor = lighter.models.withdraw_history_cursor.WithdrawHistoryCursor( - secure_id = '1', - fast_id = '1', ) - ) - else: - return WithdrawHistory( - code = 200, - withdraws = [ - lighter.models.withdraw_history_item.WithdrawHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', - type = 'secure', ) - ], - cursor = lighter.models.withdraw_history_cursor.WithdrawHistoryCursor( - secure_id = '1', - fast_id = '1', ), - ) - """ - - def testWithdrawHistory(self): - """Test WithdrawHistory""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_withdraw_history_item.py b/test/test_withdraw_history_item.py deleted file mode 100644 index f0f5817..0000000 --- a/test/test_withdraw_history_item.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.withdraw_history_item import WithdrawHistoryItem - -class TestWithdrawHistoryItem(unittest.TestCase): - """WithdrawHistoryItem unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> WithdrawHistoryItem: - """Test WithdrawHistoryItem - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `WithdrawHistoryItem` - """ - model = WithdrawHistoryItem() - if include_optional: - return WithdrawHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', - type = 'secure' - ) - else: - return WithdrawHistoryItem( - id = '', - amount = '0.1', - timestamp = 1640995200, - status = 'failed', - type = 'secure', - ) - """ - - def testWithdrawHistoryItem(self): - """Test WithdrawHistoryItem""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_zk_lighter_info.py b/test/test_zk_lighter_info.py deleted file mode 100644 index 40d15af..0000000 --- a/test/test_zk_lighter_info.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from lighter.models.zk_lighter_info import ZkLighterInfo - -class TestZkLighterInfo(unittest.TestCase): - """ZkLighterInfo unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ZkLighterInfo: - """Test ZkLighterInfo - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `ZkLighterInfo` - """ - model = ZkLighterInfo() - if include_optional: - return ZkLighterInfo( - contract_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' - ) - else: - return ZkLighterInfo( - contract_address = '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', - ) - """ - - def testZkLighterInfo(self): - """Test ZkLighterInfo""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main()