diff --git a/examples/README.md b/examples/README.md index 172319b..0105590 100644 --- a/examples/README.md +++ b/examples/README.md @@ -6,7 +6,7 @@ - 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 - - the API key config is saved in a local file `./api_key_config.json` + - the API key config is saved as `examples/api_key_config.json`; examples resolve this path from their source location, so they can be run from any working directory ## Start trading on testnet - `create_modify_cancel_order_http.py` diff --git a/examples/integrator/approve.py b/examples/integrator/approve.py index 270c8e8..cae610c 100644 --- a/examples/integrator/approve.py +++ b/examples/integrator/approve.py @@ -4,12 +4,11 @@ ETH_PRIVATE_KEY = "" -CONFIG_FILE = "../api_key_config.json" APPROVAL_EXPIRY = int(time.time() * 1000) + 90 * 24 * 60 * 60 * 1000 # now + 90 days, in ms async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() err = client.check_client() if err is not None: @@ -31,4 +30,4 @@ async def main(): await api_client.close() if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/examples/integrator/approve_same_master_account.py b/examples/integrator/approve_same_master_account.py index 7307a5f..a7e8d98 100644 --- a/examples/integrator/approve_same_master_account.py +++ b/examples/integrator/approve_same_master_account.py @@ -3,12 +3,11 @@ from examples.utils import default_example_setup -CONFIG_FILE = "../api_key_config.json" APPROVAL_EXPIRY = int(time.time() * 1000) + 90 * 24 * 60 * 60 * 1000 # now + 90 days, in ms async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() err = client.check_client() if err is not None: @@ -30,4 +29,4 @@ async def main(): await api_client.close() if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/examples/integrator/approve_zero_fees.py b/examples/integrator/approve_zero_fees.py index 8aeddca..c62a79d 100644 --- a/examples/integrator/approve_zero_fees.py +++ b/examples/integrator/approve_zero_fees.py @@ -4,12 +4,11 @@ from examples.utils import default_example_setup -CONFIG_FILE = "../api_key_config.json" APPROVAL_EXPIRY = int(time.time() * 1000) + 90 * 24 * 60 * 60 * 1000 # now + 90 days, in ms async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() err = client.check_client() if err is not None: @@ -32,4 +31,4 @@ async def main(): if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/examples/integrator/create_market_order.py b/examples/integrator/create_market_order.py index b6ec720..209239a 100644 --- a/examples/integrator/create_market_order.py +++ b/examples/integrator/create_market_order.py @@ -2,11 +2,8 @@ from examples.utils import default_example_setup -CONFIG_FILE = "../api_key_config.json" - - async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() client.check_client() # Note: change this to 2048 to trade spot ETH. Make sure you have at least 0.1 ETH to trade spot. diff --git a/examples/integrator/create_modify_order.py b/examples/integrator/create_modify_order.py index 042e9dd..529aed7 100644 --- a/examples/integrator/create_modify_order.py +++ b/examples/integrator/create_modify_order.py @@ -2,11 +2,8 @@ from examples.utils import default_example_setup -CONFIG_FILE = "../api_key_config.json" - - async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() client.check_client() # Note: change this to 2048 to trade spot ETH. Make sure you have at least 0.1 ETH to trade spot. diff --git a/examples/integrator/revoke.py b/examples/integrator/revoke.py index 903cc59..e3b19b9 100644 --- a/examples/integrator/revoke.py +++ b/examples/integrator/revoke.py @@ -2,11 +2,8 @@ from examples.utils import default_example_setup -CONFIG_FILE = "../api_key_config.json" - - async def main(): - client, api_client, _ = default_example_setup(CONFIG_FILE) + client, api_client, _ = default_example_setup() err = client.check_client() if err is not None: @@ -28,4 +25,4 @@ async def main(): await api_client.close() if __name__ == "__main__": - asyncio.run(main()) \ No newline at end of file + asyncio.run(main()) diff --git a/examples/orders/create_market_order_async_client.py b/examples/orders/create_market_order_async_client.py index 28b4ca4..409e3c6 100644 --- a/examples/orders/create_market_order_async_client.py +++ b/examples/orders/create_market_order_async_client.py @@ -1,17 +1,18 @@ import asyncio import lighter -from examples.utils import get_api_key_config, trim_exception +from examples.utils import DEFAULT_API_KEY_CONFIG, get_api_key_config, trim_exception -async def create_signer_for_user(config_file="./api_key_config.json"): +async def create_signer_for_user(config_file=DEFAULT_API_KEY_CONFIG): # Constructing the SignerClient performs no network I/O (nonces are # fetched lazily on first use), so it is safe inside a coroutine. - base_url, account_index, private_keys = get_api_key_config(config_file) + profile, account_index, private_keys = get_api_key_config(config_file) client = lighter.SignerClient( - url=base_url, + url=profile.api_url, account_index=account_index, api_private_keys=private_keys, + chain_id=profile.chain_id, ) err = client.check_client() @@ -22,7 +23,7 @@ async def create_signer_for_user(config_file="./api_key_config.json"): return client -async def place_market_order_for_user(config_file="./api_key_config.json"): +async def place_market_order_for_user(config_file=DEFAULT_API_KEY_CONFIG): client = await create_signer_for_user(config_file) try: @@ -32,7 +33,7 @@ async def place_market_order_for_user(config_file="./api_key_config.json"): tx, tx_hash, err = await client.create_market_order( market_index=market_index, client_order_index=0, - base_amount=100, # 0.1 ETH + base_amount=10, # 0.1 ETH avg_execution_price=4000_00, # $4000 -- worst acceptable price for the order is_ask=False, ) diff --git a/examples/orders/modify_order_version_http.py b/examples/orders/modify_order_version_http.py new file mode 100644 index 0000000..8e20e75 --- /dev/null +++ b/examples/orders/modify_order_version_http.py @@ -0,0 +1,108 @@ +import asyncio +import time +from examples.utils import default_example_setup + + +# Versioned order modification. +# +# order_version: a client-supplied, strictly increasing version guard for modify order. +# * A modify with order_version=V is applied only if V is greater than the order's +# current version. On success, the order's version becomes V. +# * The default (NIL_ORDER_VERSION = 0) skips the check and always applies. +# * A stale modify (version <= current) is rejected, which protects against +# out-of-order or retried modifies overwriting a newer one. +# +# A common pattern is to use a millisecond timestamp as the version. +async def main(): + client, api_client, _ = default_example_setup() + client.check_client() + + # Note: change this to 2048 to trade spot ETH. Make sure you have at least 0.1 ETH to trade spot. + market_index = 0 + client_order_index = int(time.time() * 1000) + + # create order + api_key_index, nonce = client.nonce_manager.next_nonce() + tx, tx_hash, err = await client.create_order( + market_index=market_index, + client_order_index=client_order_index, + base_amount=1000, # 0.1 ETH + price=4050_00, # $4050 + is_ask=True, + order_type=client.ORDER_TYPE_LIMIT, + time_in_force=client.ORDER_TIME_IN_FORCE_GOOD_TILL_TIME, + reduce_only=False, + trigger_price=0, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Create Order {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + ## modify order with version 100 + # use the same API key so the TX goes after the create order TX + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.modify_order( + market_index=market_index, + order_index=client_order_index, + base_amount=1100, # 0.11 ETH + price=4100_00, # $4100 + trigger_price=0, + order_version=100, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Modify Order (version=100) {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + ## stale modify: version 100 is not greater than the order's current version (100), + ## so this modify is rejected by the exchange and the order keeps its previous state + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.modify_order( + market_index=market_index, + order_index=client_order_index, + base_amount=1200, # 0.12 ETH + price=4150_00, # $4150 + trigger_price=0, + order_version=100, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Stale Modify Order (version=100, expected to be rejected) {tx=} {tx_hash=} {err=}") + + ## modify order with a higher version (200) succeeds + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.modify_order( + market_index=market_index, + order_index=client_order_index, + base_amount=1200, # 0.12 ETH + price=4150_00, # $4150 + trigger_price=0, + order_version=200, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Modify Order (version=200) {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + ## cancel order + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.cancel_order( + market_index=market_index, + order_index=client_order_index, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Cancel Order {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + await client.close() + await api_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/orders/modify_order_version_ws.py b/examples/orders/modify_order_version_ws.py new file mode 100644 index 0000000..a75d290 --- /dev/null +++ b/examples/orders/modify_order_version_ws.py @@ -0,0 +1,76 @@ +import time +import websockets +import asyncio +from examples.utils import default_example_setup, ws_send_tx + + +# this example does the same thing as the modify_order_version_http.py example, but sends the TX over WS instead of HTTP +async def main(): + client, api_client, ws_client_promise = default_example_setup() + client.check_client() + + # set up WS client and print a connected message + ws_client: websockets.ClientConnection = await ws_client_promise + print("Received:", await ws_client.recv()) + + # Note: change this to 2048 to trade spot ETH. Make sure you have at least 0.1 ETH to trade spot. + market_index = 0 + client_order_index = int(time.time() * 1000) + + # create order + api_key_index, nonce = client.nonce_manager.next_nonce() + tx_type, tx_info, tx_hash, err = client.sign_create_order( + market_index=market_index, + client_order_index=client_order_index, + base_amount=1000, # 0.1 ETH + price=4050_00, # $4050 + is_ask=True, + order_type=client.ORDER_TYPE_LIMIT, + time_in_force=client.ORDER_TIME_IN_FORCE_GOOD_TILL_TIME, + reduce_only=False, + trigger_price=0, + nonce=nonce, + api_key_index=api_key_index, + ) + if err is not None: + raise Exception(err) + await ws_send_tx(ws_client, tx_type, tx_info, tx_hash) + + ## modify order using a millisecond timestamp as the order version + # a modify is applied only if its order_version is greater than the order's current version + # use the same API key so the TX goes after the create order TX + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx_type, tx_info, tx_hash, err = client.sign_modify_order( + market_index=market_index, + order_index=client_order_index, + base_amount=1100, # 0.11 ETH + price=4100_00, # $4100 + trigger_price=0, + order_version=int(time.time() * 1000), + nonce=nonce, + api_key_index=api_key_index, + ) + if err is not None: + raise Exception(err) + await ws_send_tx(ws_client, tx_type, tx_info, tx_hash) + + ## cancel order + # use the same API key so the TX goes after the modify order TX + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx_type, tx_info, tx_hash, err = client.sign_cancel_order( + market_index=market_index, + order_index=client_order_index, + nonce=nonce, + api_key_index=api_key_index, + ) + if err is not None: + raise Exception(err) + await ws_send_tx(ws_client, tx_type, tx_info, tx_hash) + + await client.close() + await api_client.close() + await ws_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/utils.py b/examples/utils.py index 168a2e4..30ddd56 100644 --- a/examples/utils.py +++ b/examples/utils.py @@ -1,15 +1,19 @@ from typing import Tuple, Optional import logging import json +from pathlib import Path import websockets import lighter +DEFAULT_API_KEY_CONFIG = Path(__file__).resolve().with_name("api_key_config.json") + + def trim_exception(e: Exception) -> str: return str(e).strip().split("\n")[-1] -def save_api_key_config(endpoint_profile, account_index, private_keys, config_file="./api_key_config.json"): +def save_api_key_config(endpoint_profile, account_index, private_keys, config_file=DEFAULT_API_KEY_CONFIG): with open(config_file, "w", encoding="utf-8") as f: json.dump({ "endpointProfile": endpoint_profile.name, @@ -18,7 +22,7 @@ def save_api_key_config(endpoint_profile, account_index, private_keys, config_fi }, f, ensure_ascii=False, indent=2) -def get_api_key_config(config_file="./api_key_config.json"): +def get_api_key_config(config_file=DEFAULT_API_KEY_CONFIG): with open(config_file) as f: cfg = json.load(f) @@ -43,7 +47,7 @@ def get_api_key_config(config_file="./api_key_config.json"): return profile, cfg["accountIndex"], private_key -def default_example_setup(config_file="./api_key_config.json",nonce_management_type=lighter.nonce_manager.NonceManagerType.OPTIMISTIC,endpoint_profile=None,) -> Optional[Tuple[lighter.SignerClient, lighter.ApiClient, websockets.connect]]: +def default_example_setup(config_file=DEFAULT_API_KEY_CONFIG,nonce_management_type=lighter.nonce_manager.NonceManagerType.OPTIMISTIC,endpoint_profile=None,) -> Optional[Tuple[lighter.SignerClient, lighter.ApiClient, websockets.connect]]: logging.basicConfig(level=logging.DEBUG) config_endpoint, account_index, private_keys = get_api_key_config(config_file) diff --git a/lighter/signer_client.py b/lighter/signer_client.py index 53a172a..c8e83ab 100644 --- a/lighter/signer_client.py +++ b/lighter/signer_client.py @@ -135,7 +135,7 @@ def __populate_shared_library_functions(signer): signer.SignCancelAllOrders.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_int, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] signer.SignCancelAllOrders.restype = SignedTxResponse - signer.SignModifyOrder.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_int, ctypes.c_int, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] + signer.SignModifyOrder.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_int, ctypes.c_int, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] signer.SignModifyOrder.restype = SignedTxResponse signer.SignTransfer.argtypes = [ctypes.c_longlong, ctypes.c_int16, ctypes.c_int8, ctypes.c_int8, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_char_p, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] @@ -313,6 +313,8 @@ class SignerClient: NIL_MARKET_INDEX = 255 + NIL_ORDER_VERSION = 0 + ROUTE_PERP = 0 ROUTE_SPOT = 1 @@ -564,11 +566,12 @@ def sign_modify_order( integrator_maker_fee: int = 0, self_trade_behavior_mode: int = 0, self_trade_equality_mode: int = 0, + order_version: int = NIL_ORDER_VERSION, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX ) -> Union[Tuple[str, str, str, None], Tuple[None, None, None, str]]: - return self.__decode_tx_info(self.signer.SignModifyOrder(market_index, order_index, base_amount, price, trigger_price, integrator_account_index, integrator_taker_fee, integrator_maker_fee, self_trade_behavior_mode, self_trade_equality_mode, skip_nonce, nonce, api_key_index, self.account_index)) + return self.__decode_tx_info(self.signer.SignModifyOrder(market_index, order_index, base_amount, price, trigger_price, integrator_account_index, integrator_taker_fee, integrator_maker_fee, self_trade_behavior_mode, self_trade_equality_mode, skip_nonce, nonce, order_version, api_key_index, self.account_index)) def sign_approve_integrator( self, @@ -1176,6 +1179,7 @@ async def modify_order( integrator_maker_fee: int = 0, self_trade_behavior_mode: int = 0, self_trade_equality_mode: int = 0, + order_version: int = NIL_ORDER_VERSION, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -1191,6 +1195,7 @@ async def modify_order( integrator_maker_fee=integrator_maker_fee, self_trade_behavior_mode=self_trade_behavior_mode, self_trade_equality_mode=self_trade_equality_mode, + order_version=order_version, skip_nonce=skip_nonce, nonce=nonce, api_key_index=api_key_index diff --git a/lighter/signers/lighter-signer-darwin-amd64.dylib b/lighter/signers/lighter-signer-darwin-amd64.dylib index f3b47a4..848512a 100644 Binary files a/lighter/signers/lighter-signer-darwin-amd64.dylib and b/lighter/signers/lighter-signer-darwin-amd64.dylib differ diff --git a/lighter/signers/lighter-signer-darwin-amd64.h b/lighter/signers/lighter-signer-darwin-amd64.h index cd8e9ee..83ead9e 100644 --- a/lighter/signers/lighter-signer-darwin-amd64.h +++ b/lighter/signers/lighter-signer-darwin-amd64.h @@ -121,7 +121,7 @@ extern SignedTxResponse SignCancelOrder(int cMarketIndex, long long cOrderIndex, extern SignedTxResponse SignWithdraw(int cAssetIndex, int cRouteType, unsigned long long cAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCreateSubAccount(uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCancelAllOrders(int cTimeInForce, long long cTime, int cCancelAllMarketIndex, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); -extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long cIndex, long long cBaseAmount, long long cPrice, long long cTriggerPrice, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long cIndex, long long cBaseAmount, long long cPrice, long long cTriggerPrice, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long cNonce, long long cOrderVersion, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignTransfer(long long cToAccountIndex, int16_t cAssetIndex, uint8_t cFromRouteType, uint8_t cToRouteType, long long cAmount, long long cUsdcFee, char* cMemo, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCreatePublicPool(long long cOperatorFee, int cInitialTotalShares, long long cMinOperatorShareRate, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignUpdatePublicPool(long long cPublicPoolIndex, int cStatus, long long cOperatorFee, int cMinOperatorShareRate, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); diff --git a/lighter/signers/lighter-signer-darwin-arm64.dylib b/lighter/signers/lighter-signer-darwin-arm64.dylib index 315f66d..9f93c93 100644 Binary files a/lighter/signers/lighter-signer-darwin-arm64.dylib and b/lighter/signers/lighter-signer-darwin-arm64.dylib differ diff --git a/lighter/signers/lighter-signer-darwin-arm64.h b/lighter/signers/lighter-signer-darwin-arm64.h index fcd087a..6e1048c 100644 --- a/lighter/signers/lighter-signer-darwin-arm64.h +++ b/lighter/signers/lighter-signer-darwin-arm64.h @@ -129,7 +129,7 @@ extern SignedTxResponse SignCancelOrder(int cMarketIndex, long long cOrderIndex, extern SignedTxResponse SignWithdraw(int cAssetIndex, int cRouteType, unsigned long long cAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCreateSubAccount(uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCancelAllOrders(int cTimeInForce, long long cTime, int cCancelAllMarketIndex, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); -extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long cIndex, long long cBaseAmount, long long cPrice, long long cTriggerPrice, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long cIndex, long long cBaseAmount, long long cPrice, long long cTriggerPrice, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long cNonce, long long cOrderVersion, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignTransfer(long long cToAccountIndex, int16_t cAssetIndex, uint8_t cFromRouteType, uint8_t cToRouteType, long long cAmount, long long cUsdcFee, char* cMemo, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignCreatePublicPool(long long cOperatorFee, int cInitialTotalShares, long long cMinOperatorShareRate, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignUpdatePublicPool(long long cPublicPoolIndex, int cStatus, long long cOperatorFee, int cMinOperatorShareRate, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); diff --git a/lighter/signers/lighter-signer-linux-amd64.h b/lighter/signers/lighter-signer-linux-amd64.h index 3803989..df3db99 100644 --- a/lighter/signers/lighter-signer-linux-amd64.h +++ b/lighter/signers/lighter-signer-linux-amd64.h @@ -121,7 +121,7 @@ extern SignedTxResponse SignCancelOrder(int cMarketIndex, long long int cOrderIn extern SignedTxResponse SignWithdraw(int cAssetIndex, int cRouteType, long long unsigned int cAmount, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCreateSubAccount(uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCancelAllOrders(int cTimeInForce, long long int cTime, int cCancelAllMarketIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, long long int cOrderVersion, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignTransfer(long long int cToAccountIndex, int16_t cAssetIndex, uint8_t cFromRouteType, uint8_t cToRouteType, long long int cAmount, long long int cUsdcFee, char* cMemo, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCreatePublicPool(long long int cOperatorFee, int cInitialTotalShares, long long int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignUpdatePublicPool(long long int cPublicPoolIndex, int cStatus, long long int cOperatorFee, int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); diff --git a/lighter/signers/lighter-signer-linux-amd64.so b/lighter/signers/lighter-signer-linux-amd64.so index 384ab64..c0998b0 100644 Binary files a/lighter/signers/lighter-signer-linux-amd64.so and b/lighter/signers/lighter-signer-linux-amd64.so differ diff --git a/lighter/signers/lighter-signer-linux-arm64.h b/lighter/signers/lighter-signer-linux-arm64.h index 3803989..df3db99 100644 --- a/lighter/signers/lighter-signer-linux-arm64.h +++ b/lighter/signers/lighter-signer-linux-arm64.h @@ -121,7 +121,7 @@ extern SignedTxResponse SignCancelOrder(int cMarketIndex, long long int cOrderIn extern SignedTxResponse SignWithdraw(int cAssetIndex, int cRouteType, long long unsigned int cAmount, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCreateSubAccount(uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCancelAllOrders(int cTimeInForce, long long int cTime, int cCancelAllMarketIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, long long int cOrderVersion, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignTransfer(long long int cToAccountIndex, int16_t cAssetIndex, uint8_t cFromRouteType, uint8_t cToRouteType, long long int cAmount, long long int cUsdcFee, char* cMemo, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignCreatePublicPool(long long int cOperatorFee, int cInitialTotalShares, long long int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignUpdatePublicPool(long long int cPublicPoolIndex, int cStatus, long long int cOperatorFee, int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); diff --git a/lighter/signers/lighter-signer-linux-arm64.so b/lighter/signers/lighter-signer-linux-arm64.so index 515f36d..a6f4905 100644 Binary files a/lighter/signers/lighter-signer-linux-arm64.so and b/lighter/signers/lighter-signer-linux-arm64.so differ diff --git a/lighter/signers/lighter-signer-windows-amd64.dll b/lighter/signers/lighter-signer-windows-amd64.dll index 3f16e04..dfaac8a 100644 Binary files a/lighter/signers/lighter-signer-windows-amd64.dll and b/lighter/signers/lighter-signer-windows-amd64.dll differ diff --git a/lighter/signers/lighter-signer-windows-amd64.h b/lighter/signers/lighter-signer-windows-amd64.h index 95d8450..92c77f5 100644 --- a/lighter/signers/lighter-signer-windows-amd64.h +++ b/lighter/signers/lighter-signer-windows-amd64.h @@ -121,7 +121,7 @@ extern __declspec(dllexport) SignedTxResponse SignCancelOrder(int cMarketIndex, extern __declspec(dllexport) SignedTxResponse SignWithdraw(int cAssetIndex, int cRouteType, long long unsigned int cAmount, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignCreateSubAccount(uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignCancelAllOrders(int cTimeInForce, long long int cTime, int cCancelAllMarketIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern __declspec(dllexport) SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern __declspec(dllexport) SignedTxResponse SignModifyOrder(int cMarketIndex, long long int cIndex, long long int cBaseAmount, long long int cPrice, long long int cTriggerPrice, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSelfTradeBehaviorMode, uint8_t cSelfTradeEqualityMode, uint8_t cSkipNonce, long long int cNonce, long long int cOrderVersion, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignTransfer(long long int cToAccountIndex, int16_t cAssetIndex, uint8_t cFromRouteType, uint8_t cToRouteType, long long int cAmount, long long int cUsdcFee, char* cMemo, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignCreatePublicPool(long long int cOperatorFee, int cInitialTotalShares, long long int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignUpdatePublicPool(long long int cPublicPoolIndex, int cStatus, long long int cOperatorFee, int cMinOperatorShareRate, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex);