diff --git a/examples/cancel_all_orders_single_market.py b/examples/cancel_all_orders_single_market.py new file mode 100644 index 0000000..aef1469 --- /dev/null +++ b/examples/cancel_all_orders_single_market.py @@ -0,0 +1,49 @@ +import asyncio +from utils import default_example_setup + + +# Scope a cancel-all to a single market. +# +# cancel_all_market_index: +# NIL_MARKET_INDEX (255, default) - cancel resting orders across ALL markets +# 0..254 - cancel resting orders only in that perp market +# +# Note: a non-nil market index is only valid for an immediate cancel-all +# (TIME_IN_FORCE_IMMEDIATE_OR_CANCEL), not for a scheduled / dead-man's-switch one. +async def main(): + client, api_client, _ = default_example_setup() + client.check_client() + + market_index = 0 + + # cancel all of our resting orders, but only in market 0 (immediate uses timestamp_ms=0) + api_key_index, nonce = client.nonce_manager.next_nonce() + tx, tx_hash, err = await client.cancel_all_orders( + time_in_force=client.CANCEL_ALL_TIF_IMMEDIATE, + timestamp_ms=0, + cancel_all_market_index=market_index, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Cancel All (market {market_index}) {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + # for reference: omit cancel_all_market_index (defaults to all markets) + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.cancel_all_orders( + time_in_force=client.CANCEL_ALL_TIF_IMMEDIATE, + timestamp_ms=0, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Cancel All (all markets) {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/self_trade_create_modify_order.py b/examples/self_trade_create_modify_order.py new file mode 100644 index 0000000..8bb2d94 --- /dev/null +++ b/examples/self_trade_create_modify_order.py @@ -0,0 +1,78 @@ +import asyncio +import time +from utils import default_example_setup + + +# Self-trade prevention (STP) on order creation / modification. +# +# self_trade_behavior_mode: what happens when your incoming order would match +# one of your own resting orders. +# EXPIRE_MAKER (0, default) - cancel your resting (maker) order +# EXPIRE_TAKER (1) - cancel the incoming (taker) order +# EXPIRE_BOTH (2) - cancel both +# REDUCE (3) - net the two against each other (no booked self-fill) +# +# self_trade_equality_mode: what counts as "yourself" for the check above. +# ACCOUNT_INDEX (0, default) - only the exact same account +# MASTER_ACCOUNT_INDEX (1) - any sub-account under the same master +# +# Notes: +# * Defaults (EXPIRE_MAKER + ACCOUNT_INDEX) reproduce the previous behavior and +# do not change the signed payload. +# * REDUCE is not allowed together with MASTER_ACCOUNT_INDEX. +# * Self-trade modes cannot be combined with integrator fees on the same tx. +async def main(): + client, api_client, _ = default_example_setup() + market_index = 156 + + try: + client.check_client() + + base_client_order_index = int(time.time() * 1000) + resting_bid_order_index = base_client_order_index + incoming_ask_order_index = base_client_order_index + 1 + + api_key_index, nonce = client.nonce_manager.next_nonce() + tx, tx_hash, err = await client.create_order( + market_index=market_index, + client_order_index=resting_bid_order_index, + base_amount=500, + price=95_200, + is_ask=False, + order_type=client.ORDER_TYPE_LIMIT, + time_in_force=client.ORDER_TIME_IN_FORCE_POST_ONLY, + reduce_only=False, + trigger_price=0, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Resting Bid {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + + api_key_index, nonce = client.nonce_manager.next_nonce(api_key_index) + tx, tx_hash, err = await client.create_order( + market_index=market_index, + client_order_index=incoming_ask_order_index, + base_amount=500, + price=95_200, + 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, + self_trade_behavior_mode=client.SELF_TRADE_BEHAVIOR_EXPIRE_BOTH, + self_trade_equality_mode=client.SELF_TRADE_EQUALITY_MASTER_ACCOUNT_INDEX, + nonce=nonce, + api_key_index=api_key_index, + ) + print(f"Self-Cross Create {tx=} {tx_hash=} {err=}") + if err is not None: + raise Exception(err) + finally: + await client.close() + await api_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/self_trade_grouped_orders.py b/examples/self_trade_grouped_orders.py new file mode 100644 index 0000000..b36e91b --- /dev/null +++ b/examples/self_trade_grouped_orders.py @@ -0,0 +1,67 @@ +import asyncio +from lighter.signer_client import CreateOrderTxReq +from utils import default_example_setup + + +# Self-trade prevention applied to a grouped (OTOCO) order. +# +# For grouped orders the self-trade modes are specified once at the group level +# (a single value for the whole batch), matching the underlying signer. +async def main(): + client, api_client, _ = default_example_setup() + client.check_client() + + ioc_order = CreateOrderTxReq( + MarketIndex=0, + ClientOrderIndex=0, + BaseAmount=1000, # 0.1 ETH + Price=2500_00, # $2500 + IsAsk=1, # sell + Type=client.ORDER_TYPE_LIMIT, + TimeInForce=client.ORDER_TIME_IN_FORCE_IMMEDIATE_OR_CANCEL, + ReduceOnly=0, + TriggerPrice=0, + OrderExpiry=0, + ) + + take_profit_order = CreateOrderTxReq( + MarketIndex=0, + ClientOrderIndex=0, + BaseAmount=0, + Price=1550_00, + IsAsk=0, + Type=client.ORDER_TYPE_TAKE_PROFIT_LIMIT, + TimeInForce=client.ORDER_TIME_IN_FORCE_GOOD_TILL_TIME, + ReduceOnly=1, + TriggerPrice=1500_00, + OrderExpiry=-1, + ) + + stop_loss_order = CreateOrderTxReq( + MarketIndex=0, + ClientOrderIndex=0, + BaseAmount=0, + Price=5050_00, + IsAsk=0, + Type=client.ORDER_TYPE_STOP_LOSS_LIMIT, + TimeInForce=client.ORDER_TIME_IN_FORCE_GOOD_TILL_TIME, + ReduceOnly=1, + TriggerPrice=5000_00, + OrderExpiry=-1, + ) + + transaction = await client.create_grouped_orders( + grouping_type=client.GROUPING_TYPE_ONE_TRIGGERS_A_ONE_CANCELS_THE_OTHER, + orders=[ioc_order, take_profit_order, stop_loss_order], + self_trade_behavior_mode=client.SELF_TRADE_BEHAVIOR_EXPIRE_TAKER, + self_trade_equality_mode=client.SELF_TRADE_EQUALITY_ACCOUNT_INDEX, + ) + + print("Create Grouped Order Tx:", transaction) + + await client.close() + await api_client.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/lighter/signer_client.py b/lighter/signer_client.py index b598ccc..3bbcc1f 100644 --- a/lighter/signer_client.py +++ b/lighter/signer_client.py @@ -72,6 +72,8 @@ def __get_shared_library(): if is_arm and is_mac: return ctypes.CDLL(os.path.join(path_to_signer_folders, "lighter-signer-darwin-arm64.dylib")) + elif is_x64 and is_mac: + return ctypes.CDLL(os.path.join(path_to_signer_folders, "lighter-signer-darwin-amd64.dylib")) elif is_linux and is_x64: return ctypes.CDLL(os.path.join(path_to_signer_folders, "lighter-signer-linux-amd64.so")) elif is_linux and is_arm: @@ -81,7 +83,7 @@ def __get_shared_library(): else: raise Exception( f"Unsupported platform/architecture: {platform.system()}/{platform.machine()}. " - "Currently supported: Linux(x86_64), macOS(arm64), and Windows(x86_64)." + "Currently supported: Linux(x86_64/arm64), macOS(arm64/x86_64), and Windows(x86_64)." ) @@ -115,10 +117,10 @@ def __populate_shared_library_functions(signer): signer.SignChangePubKey.restype = SignedTxResponse signer.SignCreateOrder.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, - ctypes.c_int, ctypes.c_int, ctypes.c_longlong, ctypes.c_longlong, ctypes.c_int, ctypes.c_int, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] + ctypes.c_int, ctypes.c_int, 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.SignCreateOrder.restype = SignedTxResponse - signer.SignCreateGroupedOrders.argtypes = [ctypes.c_uint8, ctypes.POINTER(CreateOrderTxReq), ctypes.c_int, ctypes.c_longlong, ctypes.c_int, ctypes.c_int, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] + signer.SignCreateGroupedOrders.argtypes = [ctypes.c_uint8, ctypes.POINTER(CreateOrderTxReq), ctypes.c_int, 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.SignCreateGroupedOrders.restype = SignedTxResponse signer.SignCancelOrder.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] @@ -130,10 +132,10 @@ def __populate_shared_library_functions(signer): signer.SignCreateSubAccount.argtypes = [ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] signer.SignCreateSubAccount.restype = SignedTxResponse - signer.SignCancelAllOrders.argtypes = [ctypes.c_int, ctypes.c_longlong, ctypes.c_uint8, ctypes.c_longlong, ctypes.c_int, ctypes.c_longlong] + 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_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_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] @@ -292,6 +294,16 @@ class SignerClient: GROUPING_TYPE_ONE_CANCELS_THE_OTHER = 2 GROUPING_TYPE_ONE_TRIGGERS_A_ONE_CANCELS_THE_OTHER = 3 + SELF_TRADE_BEHAVIOR_EXPIRE_MAKER = 0 + SELF_TRADE_BEHAVIOR_EXPIRE_TAKER = 1 + SELF_TRADE_BEHAVIOR_EXPIRE_BOTH = 2 + SELF_TRADE_BEHAVIOR_REDUCE = 3 + + SELF_TRADE_EQUALITY_ACCOUNT_INDEX = 0 + SELF_TRADE_EQUALITY_MASTER_ACCOUNT_INDEX = 1 + + NIL_MARKET_INDEX = 255 + ROUTE_PERP = 0 ROUTE_SPOT = 1 @@ -475,6 +487,8 @@ def sign_create_order( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -493,6 +507,8 @@ def sign_create_order( integrator_account_index, integrator_taker_fee, integrator_maker_fee, + self_trade_behavior_mode, + self_trade_equality_mode, skip_nonce, nonce, api_key_index, @@ -506,6 +522,8 @@ def sign_create_grouped_orders( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index=DEFAULT_API_KEY_INDEX @@ -514,7 +532,7 @@ def sign_create_grouped_orders( orders_arr = arr_type(*orders) return self.__decode_tx_info(self.signer.SignCreateGroupedOrders( - grouping_type, orders_arr, len(orders), integrator_account_index, integrator_taker_fee, integrator_maker_fee, skip_nonce, nonce, api_key_index, self.account_index + grouping_type, orders_arr, len(orders), 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 )) def sign_cancel_order(self, market_index: int, order_index: int, 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]]: @@ -526,8 +544,8 @@ def sign_withdraw(self, asset_index: int, route_type: int, amount: int, skip_non def sign_create_sub_account(self, 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.SignCreateSubAccount(skip_nonce, nonce, api_key_index, self.account_index)) - def sign_cancel_all_orders(self, time_in_force: int, timestamp_ms: int, 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.SignCancelAllOrders(time_in_force, timestamp_ms, skip_nonce, nonce, api_key_index, self.account_index)) + def sign_cancel_all_orders(self, time_in_force: int, timestamp_ms: int, cancel_all_market_index: int = NIL_MARKET_INDEX, 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.SignCancelAllOrders(time_in_force, timestamp_ms, cancel_all_market_index, skip_nonce, nonce, api_key_index, self.account_index)) def sign_modify_order( self, @@ -540,11 +558,13 @@ def sign_modify_order( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, 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, 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, api_key_index, self.account_index)) def sign_approve_integrator( self, @@ -654,6 +674,8 @@ async def create_order( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce : int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -672,6 +694,8 @@ async def create_order( integrator_account_index=integrator_account_index, integrator_taker_fee=integrator_taker_fee, integrator_maker_fee=integrator_maker_fee, + self_trade_behavior_mode=self_trade_behavior_mode, + self_trade_equality_mode=self_trade_equality_mode, skip_nonce=skip_nonce, nonce=nonce, api_key_index=api_key_index, @@ -693,6 +717,8 @@ async def create_grouped_orders( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce : int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -703,6 +729,8 @@ async def create_grouped_orders( integrator_account_index=integrator_account_index, integrator_taker_fee=integrator_taker_fee, integrator_maker_fee=integrator_maker_fee, + self_trade_behavior_mode=self_trade_behavior_mode, + self_trade_equality_mode=self_trade_equality_mode, skip_nonce=skip_nonce, nonce=nonce, api_key_index=api_key_index @@ -727,6 +755,8 @@ async def create_market_order( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -744,6 +774,8 @@ async def create_market_order( integrator_account_index=integrator_account_index, integrator_taker_fee=integrator_taker_fee, integrator_maker_fee=integrator_maker_fee, + self_trade_behavior_mode=self_trade_behavior_mode, + self_trade_equality_mode=self_trade_equality_mode, skip_nonce=skip_nonce, nonce=nonce, api_key_index=api_key_index, @@ -1114,8 +1146,8 @@ async def create_sub_account(self, skip_nonce : int = SKIP_NONCE_OFF, nonce: int return tx_info, api_response, None @process_api_key_and_nonce - async def cancel_all_orders(self, time_in_force, timestamp_ms, skip_nonce : int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX)-> Union[Tuple[Withdraw, RespSendTx, None], Tuple[None, None, str]]: - tx_type, tx_info, tx_hash, error = self.sign_cancel_all_orders(time_in_force, timestamp_ms, skip_nonce, nonce, api_key_index) + async def cancel_all_orders(self, time_in_force, timestamp_ms, cancel_all_market_index: int = NIL_MARKET_INDEX, skip_nonce : int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX)-> Union[Tuple[Withdraw, RespSendTx, None], Tuple[None, None, str]]: + tx_type, tx_info, tx_hash, error = self.sign_cancel_all_orders(time_in_force, timestamp_ms, cancel_all_market_index, skip_nonce, nonce, api_key_index) if error is not None: return None, None, error @@ -1136,6 +1168,8 @@ async def modify_order( integrator_account_index: int = 0, integrator_taker_fee: int = 0, integrator_maker_fee: int = 0, + self_trade_behavior_mode: int = 0, + self_trade_equality_mode: int = 0, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX @@ -1149,6 +1183,8 @@ async def modify_order( integrator_account_index=integrator_account_index, integrator_taker_fee=integrator_taker_fee, integrator_maker_fee=integrator_maker_fee, + self_trade_behavior_mode=self_trade_behavior_mode, + self_trade_equality_mode=self_trade_equality_mode, 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 new file mode 100644 index 0000000..c7b6568 Binary files /dev/null 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 new file mode 100644 index 0000000..fcd087a --- /dev/null +++ b/lighter/signers/lighter-signer-darwin-amd64.h @@ -0,0 +1,150 @@ +/* Code generated by cmd/cgo; DO NOT EDIT. */ + +/* package command-line-arguments */ + + +#line 1 "cgo-builtin-export-prolog" + +#include + +#ifndef GO_CGO_EXPORT_PROLOGUE_H +#define GO_CGO_EXPORT_PROLOGUE_H + +#ifndef GO_CGO_GOSTRING_TYPEDEF +typedef struct { const char *p; ptrdiff_t n; } _GoString_; +extern size_t _GoStringLen(_GoString_ s); +extern const char *_GoStringPtr(_GoString_ s); +#endif + +#endif + +/* Start of preamble from import "C" comments. */ + + +#line 16 "main.go" + +#include +#include +typedef struct { + char* str; + char* err; +} StrOrErr; + +typedef struct { + uint8_t txType; + char* txInfo; + char* txHash; + char* messageToSign; + char* err; +} SignedTxResponse; + +typedef struct { + char* privateKey; + char* publicKey; + char* err; +} ApiKeyResponse; + +typedef struct { + int16_t MarketIndex; + int64_t ClientOrderIndex; + int64_t BaseAmount; + uint32_t Price; + uint8_t IsAsk; + uint8_t Type; + uint8_t TimeInForce; + uint8_t ReduceOnly; + uint32_t TriggerPrice; + int64_t OrderExpiry; +} CreateOrderTxReq; + +#line 1 "cgo-generated-wrapper" + + +/* End of preamble from import "C" comments. */ + + +/* Start of boilerplate cgo prologue. */ +#line 1 "cgo-gcc-export-header-prolog" + +#ifndef GO_CGO_PROLOGUE_H +#define GO_CGO_PROLOGUE_H + +typedef signed char GoInt8; +typedef unsigned char GoUint8; +typedef short GoInt16; +typedef unsigned short GoUint16; +typedef int GoInt32; +typedef unsigned int GoUint32; +typedef long long GoInt64; +typedef unsigned long long GoUint64; +typedef GoInt64 GoInt; +typedef GoUint64 GoUint; +typedef size_t GoUintptr; +typedef float GoFloat32; +typedef double GoFloat64; +#ifdef _MSC_VER +#if !defined(__cplusplus) || _MSVC_LANG <= 201402L +#include +typedef _Fcomplex GoComplex64; +typedef _Dcomplex GoComplex128; +#else +#include +typedef std::complex GoComplex64; +typedef std::complex GoComplex128; +#endif +#else +typedef float _Complex GoComplex64; +typedef double _Complex GoComplex128; +#endif + +/* + static assertion to make sure the file is being used on architecture + at least with matching size of GoInt. +*/ +typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; + +#ifndef GO_CGO_GOSTRING_TYPEDEF +typedef _GoString_ GoString; +#endif +typedef void *GoMap; +typedef void *GoChan; +typedef struct { void *t; void *v; } GoInterface; +typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; + +#endif + +/* End of boilerplate cgo prologue. */ + +#ifdef __cplusplus +extern "C" { +#endif + +extern ApiKeyResponse GenerateAPIKey(void); +extern char* CreateClient(char* cUrl, char* cPrivateKey, int cChainId, int cApiKeyIndex, long long cAccountIndex); +extern char* CheckClient(int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignChangePubKey(char* cPubKey, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long cClientOrderIndex, long long cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long cOrderExpiry, 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 SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, 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 SignCancelOrder(int cMarketIndex, long long cOrderIndex, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +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 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); +extern SignedTxResponse SignMintShares(long long cPublicPoolIndex, long long cShareAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignBurnShares(long long cPublicPoolIndex, long long cShareAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignUpdateLeverage(int cMarketIndex, int cInitialMarginFraction, int cMarginMode, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern StrOrErr CreateAuthToken(long long cDeadline, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignUpdateMargin(int cMarketIndex, long long cUSDCAmount, int cDirection, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignStakeAssets(long long cStakingPoolIndex, long long cShareAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignUnstakeAssets(long long cStakingPoolIndex, long long cShareAmount, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignApproveIntegrator(long long cIntegratorIndex, uint32_t cMaxPerpsTakerFee, uint32_t cMaxPerpsMakerFee, uint32_t cMaxSpotTakerFee, uint32_t cMaxSpotMakerFee, long long cApprovalExpiry, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignUpdateAccountConfig(uint8_t cAccountTradingMode, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignUpdateAccountAssetConfig(int16_t cAssetIndex, uint8_t cAssetMarginMode, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern void Free(void* ptr); + +#ifdef __cplusplus +} +#endif diff --git a/lighter/signers/lighter-signer-darwin-arm64.dylib b/lighter/signers/lighter-signer-darwin-arm64.dylib index 8e22156..ca2ac8b 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 ce31224..fcd087a 100644 --- a/lighter/signers/lighter-signer-darwin-arm64.h +++ b/lighter/signers/lighter-signer-darwin-arm64.h @@ -123,13 +123,13 @@ extern ApiKeyResponse GenerateAPIKey(void); extern char* CreateClient(char* cUrl, char* cPrivateKey, int cChainId, int cApiKeyIndex, long long cAccountIndex); extern char* CheckClient(int cApiKeyIndex, long long cAccountIndex); extern SignedTxResponse SignChangePubKey(char* cPubKey, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); -extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long cClientOrderIndex, long long cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long cOrderExpiry, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); -extern SignedTxResponse SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, long long cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); +extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long cClientOrderIndex, long long cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long cOrderExpiry, 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 SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, 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 SignCancelOrder(int cMarketIndex, long long cOrderIndex, uint8_t cSkipNonce, long long cNonce, int cApiKeyIndex, long long cAccountIndex); 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, 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 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 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 4888ef1..3803989 100644 --- a/lighter/signers/lighter-signer-linux-amd64.h +++ b/lighter/signers/lighter-signer-linux-amd64.h @@ -115,13 +115,13 @@ extern ApiKeyResponse GenerateAPIKey(); extern char* CreateClient(char* cUrl, char* cPrivateKey, int cChainId, int cApiKeyIndex, long long int cAccountIndex); extern char* CheckClient(int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignChangePubKey(char* cPubKey, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, 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 SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, 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 SignCancelOrder(int cMarketIndex, long long int cOrderIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); 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, 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 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 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 33612f7..4be00ef 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 4888ef1..3803989 100644 --- a/lighter/signers/lighter-signer-linux-arm64.h +++ b/lighter/signers/lighter-signer-linux-arm64.h @@ -115,13 +115,13 @@ extern ApiKeyResponse GenerateAPIKey(); extern char* CreateClient(char* cUrl, char* cPrivateKey, int cChainId, int cApiKeyIndex, long long int cAccountIndex); extern char* CheckClient(int cApiKeyIndex, long long int cAccountIndex); extern SignedTxResponse SignChangePubKey(char* cPubKey, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern SignedTxResponse SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, 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 SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, 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 SignCancelOrder(int cMarketIndex, long long int cOrderIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); 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, 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 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 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 685a1ba..f6036c3 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 8beb35b..1469234 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 1480ac9..4fcf8a5 100644 --- a/lighter/signers/lighter-signer-windows-amd64.h +++ b/lighter/signers/lighter-signer-windows-amd64.h @@ -1,6 +1,6 @@ /* Code generated by cmd/cgo; DO NOT EDIT. */ -/* package github.com/elliottech/lighter-go/sharedlib */ +/* package command-line-arguments */ #line 1 "cgo-builtin-export-prolog" @@ -115,13 +115,13 @@ extern __declspec(dllexport) ApiKeyResponse GenerateAPIKey(); extern __declspec(dllexport) char* CreateClient(char* cUrl, char* cPrivateKey, int cChainId, int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) char* CheckClient(int cApiKeyIndex, long long int cAccountIndex); extern __declspec(dllexport) SignedTxResponse SignChangePubKey(char* cPubKey, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern __declspec(dllexport) SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); -extern __declspec(dllexport) SignedTxResponse SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, long long int cIntegratorAccountIndex, int cIntegratorTakerFee, int cIntegratorMakerFee, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); +extern __declspec(dllexport) SignedTxResponse SignCreateOrder(int cMarketIndex, long long int cClientOrderIndex, long long int cBaseAmount, int cPrice, int cIsAsk, int cOrderType, int cTimeInForce, int cReduceOnly, int cTriggerPrice, long long int cOrderExpiry, 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 SignCreateGroupedOrders(uint8_t cGroupingType, CreateOrderTxReq* cOrders, int cLen, 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 SignCancelOrder(int cMarketIndex, long long int cOrderIndex, uint8_t cSkipNonce, long long int cNonce, int cApiKeyIndex, long long int cAccountIndex); 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, 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 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 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);