Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/binary-options/operator_create_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def main():
executed = await tx_api.tx(by="hash", value=tx_hash.tx_hash)
except lighter.ApiException:
continue
print(f"public market index: {json.loads(executed.event_info)['m']}")
print(f"market index: {json.loads(executed.event_info)['m']}")
break

await client.close()
Expand Down
4 changes: 2 additions & 2 deletions examples/binary-options/operator_settle_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from examples.utils import default_example_setup

MARKET_SLOT = 1900
PUBLIC_MARKET_INDEX = 0 # from operator_create_market.py
MARKET_INDEX = 0 # from operator_create_market.py
SETTLEMENT_CAP = 100


Expand All @@ -13,7 +13,7 @@ async def main():
# To void the market instead: settlement_price=0, is_refund=1 (everyone is paid default_price).
tx, tx_hash, err = await client.binary_options_operator_settle_market(
market_slot=MARKET_SLOT,
public_market_index=PUBLIC_MARKET_INDEX,
market_index=MARKET_INDEX,
settlement_price=SETTLEMENT_CAP,
is_refund=0,
)
Expand Down
20 changes: 10 additions & 10 deletions lighter/signer_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class BinaryOptionsOperatorCreateMarketTxReq(ctypes.Structure):
class BinaryOptionsOperatorUpdateMarketTxReq(ctypes.Structure):
_fields_ = [
("MarketSlot", ctypes.c_int16),
("PublicMarketIndex", ctypes.c_longlong),
("MarketIndex", ctypes.c_longlong),
("StartTimestampMs", ctypes.c_longlong),
("EndTimestampMs", ctypes.c_longlong),
("TakerFee", ctypes.c_uint32),
Expand All @@ -83,7 +83,7 @@ class BinaryOptionsOperatorUpdateMarketTxReq(ctypes.Structure):
class BinaryOptionsOperatorSettleMarketTxReq(ctypes.Structure):
_fields_ = [
("MarketSlot", ctypes.c_int16),
("PublicMarketIndex", ctypes.c_longlong),
("MarketIndex", ctypes.c_longlong),
("SettlementPrice", ctypes.c_uint32),
("IsRefund", ctypes.c_uint8),
]
Expand Down Expand Up @@ -746,10 +746,10 @@ def sign_binary_options_operator_create_market(self, market_slot: int, start_tim
)
return self.__decode_tx_info(self.signer.SignBinaryOptionsOperatorCreateMarket(ctypes.byref(req), skip_nonce, nonce, api_key_index, self.account_index))

def sign_binary_options_operator_update_market(self, market_slot: int, public_market_index: int, start_timestamp_ms: int, end_timestamp_ms: int, taker_fee: int, maker_fee: int, min_base_amount: int, min_quote_amount: int, order_quote_limit: int, open_interest_limit: int, is_frozen: 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]]:
def sign_binary_options_operator_update_market(self, market_slot: int, market_index: int, start_timestamp_ms: int, end_timestamp_ms: int, taker_fee: int, maker_fee: int, min_base_amount: int, min_quote_amount: int, order_quote_limit: int, open_interest_limit: int, is_frozen: 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]]:
Comment thread
mihaimarcu2004 marked this conversation as resolved.
req = BinaryOptionsOperatorUpdateMarketTxReq(
MarketSlot=market_slot,
PublicMarketIndex=public_market_index,
MarketIndex=market_index,
Comment thread
mihaimarcu2004 marked this conversation as resolved.
StartTimestampMs=start_timestamp_ms,
EndTimestampMs=end_timestamp_ms,
TakerFee=taker_fee,
Expand All @@ -762,10 +762,10 @@ def sign_binary_options_operator_update_market(self, market_slot: int, public_ma
)
return self.__decode_tx_info(self.signer.SignBinaryOptionsOperatorUpdateMarket(ctypes.byref(req), skip_nonce, nonce, api_key_index, self.account_index))

def sign_binary_options_operator_settle_market(self, market_slot: int, public_market_index: int, settlement_price: int, is_refund: 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]]:
def sign_binary_options_operator_settle_market(self, market_slot: int, market_index: int, settlement_price: int, is_refund: 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]]:
req = BinaryOptionsOperatorSettleMarketTxReq(
MarketSlot=market_slot,
PublicMarketIndex=public_market_index,
MarketIndex=market_index,
SettlementPrice=settlement_price,
IsRefund=is_refund,
)
Expand Down Expand Up @@ -1510,19 +1510,19 @@ async def binary_options_operator_create_market(self, market_slot: int, start_ti
return tx_info, api_response, None

@process_api_key_and_nonce
async def binary_options_operator_update_market(self, market_slot: int, public_market_index: int, start_timestamp_ms: int, end_timestamp_ms: int, taker_fee: int, maker_fee: int, min_base_amount: int, min_quote_amount: int, order_quote_limit: int, open_interest_limit: int, is_frozen: int, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX):
async def binary_options_operator_update_market(self, market_slot: int, market_index: int, start_timestamp_ms: int, end_timestamp_ms: int, taker_fee: int, maker_fee: int, min_base_amount: int, min_quote_amount: int, order_quote_limit: int, open_interest_limit: int, is_frozen: int, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX):
tx_type, tx_info, tx_hash, error = self.sign_binary_options_operator_update_market(
market_slot, public_market_index, start_timestamp_ms, end_timestamp_ms, taker_fee, maker_fee, min_base_amount, min_quote_amount, order_quote_limit, open_interest_limit, is_frozen, skip_nonce, nonce, api_key_index
market_slot, market_index, start_timestamp_ms, end_timestamp_ms, taker_fee, maker_fee, min_base_amount, min_quote_amount, order_quote_limit, open_interest_limit, is_frozen, skip_nonce, nonce, api_key_index
)
if error is not None:
return None, None, error
api_response = await self.send_tx(tx_type=tx_type, tx_info=tx_info)
return tx_info, api_response, None

@process_api_key_and_nonce
async def binary_options_operator_settle_market(self, market_slot: int, public_market_index: int, settlement_price: int, is_refund: int, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX):
async def binary_options_operator_settle_market(self, market_slot: int, market_index: int, settlement_price: int, is_refund: int, skip_nonce: int = SKIP_NONCE_OFF, nonce: int = DEFAULT_NONCE, api_key_index: int = DEFAULT_API_KEY_INDEX):
tx_type, tx_info, tx_hash, error = self.sign_binary_options_operator_settle_market(
market_slot, public_market_index, settlement_price, is_refund, skip_nonce, nonce, api_key_index
market_slot, market_index, settlement_price, is_refund, skip_nonce, nonce, api_key_index
)
if error is not None:
return None, None, error
Expand Down
Binary file modified lighter/signers/lighter-signer-darwin-amd64.dylib
Binary file not shown.
4 changes: 2 additions & 2 deletions lighter/signers/lighter-signer-darwin-amd64.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
int64_t StartTimestampMs;
int64_t EndTimestampMs;
uint32_t TakerFee;
Expand All @@ -90,7 +90,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
uint32_t SettlementPrice;
uint8_t IsRefund;
} BinaryOptionsOperatorSettleMarketTxReq;
Expand Down
Binary file modified lighter/signers/lighter-signer-darwin-arm64.dylib
Binary file not shown.
4 changes: 2 additions & 2 deletions lighter/signers/lighter-signer-darwin-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
int64_t StartTimestampMs;
int64_t EndTimestampMs;
uint32_t TakerFee;
Expand All @@ -92,7 +92,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
uint32_t SettlementPrice;
uint8_t IsRefund;
} BinaryOptionsOperatorSettleMarketTxReq;
Expand Down
4 changes: 2 additions & 2 deletions lighter/signers/lighter-signer-linux-amd64.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
int64_t StartTimestampMs;
int64_t EndTimestampMs;
uint32_t TakerFee;
Expand All @@ -90,7 +90,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
uint32_t SettlementPrice;
uint8_t IsRefund;
} BinaryOptionsOperatorSettleMarketTxReq;
Expand Down
Binary file modified lighter/signers/lighter-signer-linux-amd64.so
Binary file not shown.
4 changes: 2 additions & 2 deletions lighter/signers/lighter-signer-linux-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
int64_t StartTimestampMs;
int64_t EndTimestampMs;
uint32_t TakerFee;
Expand All @@ -90,7 +90,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
uint32_t SettlementPrice;
uint8_t IsRefund;
} BinaryOptionsOperatorSettleMarketTxReq;
Expand Down
Binary file modified lighter/signers/lighter-signer-linux-arm64.so
Binary file not shown.
Binary file modified lighter/signers/lighter-signer-windows-amd64.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions lighter/signers/lighter-signer-windows-amd64.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
int64_t StartTimestampMs;
int64_t EndTimestampMs;
uint32_t TakerFee;
Expand All @@ -90,7 +90,7 @@ typedef struct {

typedef struct {
int16_t MarketSlot;
int64_t PublicMarketIndex;
int64_t MarketIndex;
uint32_t SettlementPrice;
uint8_t IsRefund;
} BinaryOptionsOperatorSettleMarketTxReq;
Expand Down
Loading