Skip to content

Commit

Permalink
(fix) Rename all methods having v2 in the middle of the name to have …
Browse files Browse the repository at this point in the history
…v2 as suffix
  • Loading branch information
aarmoa committed Nov 13, 2024
1 parent 7d7fc08 commit 4980b41
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 72 deletions.
8 changes: 4 additions & 4 deletions examples/chain_client/1_LocalOrderHash.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def main() -> None:
fee_recipient = "inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"

spot_orders = [
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -50,7 +50,7 @@ async def main() -> None:
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -62,7 +62,7 @@ async def main() -> None:
]

derivative_orders = [
composer.create_v2_derivative_order(
composer.create_derivative_order_v2(
market_id=deriv_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -74,7 +74,7 @@ async def main() -> None:
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.create_v2_derivative_order(
composer.create_derivative_order_v2(
market_id=deriv_market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down
4 changes: 2 additions & 2 deletions examples/chain_client/3_MessageBroadcaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def main() -> None:
spot_market_id_create = "0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe"

spot_orders_to_create = [
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -44,7 +44,7 @@ async def main() -> None:
order_type="BUY",
cid=(str(uuid.uuid4())),
),
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def main() -> None:
spot_market_id_create = "0x0611780ba69656949525013d947713300f56c37b6175e02f26bffa495c3208fe"

spot_orders_to_create = [
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -44,7 +44,7 @@ async def main() -> None:
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down
2 changes: 1 addition & 1 deletion examples/chain_client/exchange/19_MsgLiquidatePosition.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def main() -> None:
fee_recipient = "inj1hkhdaj2a2clmq5jq6mspsggqs32vynpk228q3r"
cid = str(uuid.uuid4())

order = composer.create_v2_derivative_order(
order = composer.create_derivative_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down
16 changes: 8 additions & 8 deletions examples/chain_client/exchange/9_MsgBatchUpdateOrders.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ async def main() -> None:
spot_market_id_cancel_2 = "0x7a57e705bb4e09c88aecfc295569481dbf2fe1d5efe364651fbe72385938e9b0"

derivative_orders_to_cancel = [
composer.create_v2_order_data_without_mask(
composer.create_order_data_without_mask_v2(
market_id=derivative_market_id_cancel,
subaccount_id=subaccount_id,
order_hash="0x48690013c382d5dbaff9989db04629a16a5818d7524e027d517ccc89fd068103",
),
composer.create_v2_order_data_without_mask(
composer.create_order_data_without_mask_v2(
market_id=derivative_market_id_cancel_2,
subaccount_id=subaccount_id,
order_hash="0x7ee76255d7ca763c56b0eab9828fca89fdd3739645501c8a80f58b62b4f76da5",
),
]

spot_orders_to_cancel = [
composer.create_v2_order_data_without_mask(
composer.create_order_data_without_mask_v2(
market_id=spot_market_id_cancel,
subaccount_id=subaccount_id,
cid="0e5c3ad5-2cc4-4a2a-bbe5-b12697739163",
),
composer.create_v2_order_data_without_mask(
composer.create_order_data_without_mask_v2(
market_id=spot_market_id_cancel_2,
subaccount_id=subaccount_id,
order_hash="0x222daa22f60fe9f075ed0ca583459e121c23e64431c3fbffdedda04598ede0d2",
),
]

derivative_orders_to_create = [
composer.create_v2_derivative_order(
composer.create_derivative_order_v2(
market_id=derivative_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -82,7 +82,7 @@ async def main() -> None:
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.create_v2_derivative_order(
composer.create_derivative_order_v2(
market_id=derivative_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -97,7 +97,7 @@ async def main() -> None:
]

spot_orders_to_create = [
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand All @@ -106,7 +106,7 @@ async def main() -> None:
order_type="BUY",
cid=str(uuid.uuid4()),
),
composer.create_v2_spot_order(
composer.create_spot_order_v2(
market_id=spot_market_id_create,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down
28 changes: 14 additions & 14 deletions pyinjective/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def order_data_without_mask(
cid=cid,
)

def create_v2_order_data(
def create_order_data_v2(
self,
market_id: str,
subaccount_id: str,
Expand All @@ -425,7 +425,7 @@ def create_v2_order_data(
cid=cid,
)

def create_v2_order_data_without_mask(
def create_order_data_without_mask_v2(
self,
market_id: str,
subaccount_id: str,
Expand Down Expand Up @@ -479,7 +479,7 @@ def spot_order(
trigger_price=chain_trigger_price,
)

def create_v2_spot_order(
def create_spot_order_v2(
self,
market_id: str,
subaccount_id: str,
Expand Down Expand Up @@ -557,7 +557,7 @@ def derivative_order(
chain_trigger_price=chain_trigger_price,
)

def create_v2_derivative_order(
def create_derivative_order_v2(
self,
market_id: str,
subaccount_id: str,
Expand All @@ -571,7 +571,7 @@ def create_v2_derivative_order(
) -> injective_order_v2_pb.DerivativeOrder:
trigger_price = trigger_price or Decimal(0)

return self._basic_v2_derivative_order(
return self._basic_derivative_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -622,7 +622,7 @@ def binary_options_order(
chain_trigger_price=chain_trigger_price,
)

def create_v2_binary_options_order(
def create_binary_options_order_v2(
self,
market_id: str,
subaccount_id: str,
Expand All @@ -636,7 +636,7 @@ def create_v2_binary_options_order(
) -> injective_order_v2_pb.DerivativeOrder:
trigger_price = trigger_price or Decimal(0)

return self._basic_v2_derivative_order(
return self._basic_derivative_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1113,7 +1113,7 @@ def msg_create_spot_limit_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateSpotLimitOrder:
return injective_exchange_tx_v2_pb.MsgCreateSpotLimitOrder(
sender=sender,
order=self.create_v2_spot_order(
order=self.create_spot_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def msg_create_spot_market_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateSpotMarketOrder:
return injective_exchange_tx_v2_pb.MsgCreateSpotMarketOrder(
sender=sender,
order=self.create_v2_spot_order(
order=self.create_spot_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1404,7 +1404,7 @@ def msg_create_derivative_limit_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateDerivativeLimitOrder:
return injective_exchange_tx_v2_pb.MsgCreateDerivativeLimitOrder(
sender=sender,
order=self.create_v2_derivative_order(
order=self.create_derivative_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1493,7 +1493,7 @@ def msg_create_derivative_market_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateDerivativeMarketOrder:
return injective_exchange_tx_v2_pb.MsgCreateDerivativeMarketOrder(
sender=sender,
order=self.create_v2_derivative_order(
order=self.create_derivative_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1730,7 +1730,7 @@ def msg_create_binary_options_limit_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateDerivativeLimitOrder:
return injective_exchange_tx_v2_pb.MsgCreateDerivativeLimitOrder(
sender=sender,
order=self.create_v2_binary_options_order(
order=self.create_binary_options_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -1798,7 +1798,7 @@ def msg_create_binary_options_market_order_v2(
) -> injective_exchange_tx_v2_pb.MsgCreateBinaryOptionsMarketOrder:
return injective_exchange_tx_v2_pb.MsgCreateBinaryOptionsMarketOrder(
sender=sender,
order=self.create_v2_binary_options_order(
order=self.create_binary_options_order_v2(
market_id=market_id,
subaccount_id=subaccount_id,
fee_recipient=fee_recipient,
Expand Down Expand Up @@ -3056,7 +3056,7 @@ def _basic_derivative_order(
trigger_price=formatted_trigger_price,
)

def _basic_v2_derivative_order(
def _basic_derivative_order_v2(
self,
market_id: str,
subaccount_id: str,
Expand Down
Loading

0 comments on commit 4980b41

Please sign in to comment.