Skip to content

Commit cc6384e

Browse files
committed
add MsgBid to the composer
1 parent 211e3cc commit cc6384e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

pyinjective/composer.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,21 @@ def MsgWithdraw(
344344
amount=self.Coin(amount=be_amount, denom=peggy_denom)
345345
)
346346

347+
def MsgBid(
348+
self,
349+
sender: str,
350+
bid_amount: float,
351+
round: float
352+
):
353+
354+
be_amount = amount_to_backend(bid_amount, 18)
355+
356+
return injective_auction_tx_pb.MsgBid(
357+
sender=sender,
358+
round=round,
359+
bid_amount=self.Coin(amount=be_amount, denom="inj")
360+
)
361+
347362
# data field format: [request-msg-header][raw-byte-msg-response]
348363
# you need to figure out this magic prefix number to trim request-msg-header off the data
349364
# this method handles only exchange responses
@@ -365,7 +380,8 @@ def MsgResponses(data, simulation=False):
365380
"/injective.exchange.v1beta1.MsgWithdraw": injective_exchange_tx_pb.MsgWithdrawResponse,
366381
"/injective.exchange.v1beta1.MsgSubaccountTransfer": injective_exchange_tx_pb.MsgSubaccountTransferResponse,
367382
"/injective.exchange.v1beta1.MsgLiquidatePosition": injective_exchange_tx_pb.MsgLiquidatePosition,
368-
"/injective.exchange.v1beta1.MsgIncreasePositionMargin": injective_exchange_tx_pb.MsgIncreasePositionMargin
383+
"/injective.exchange.v1beta1.MsgIncreasePositionMargin": injective_exchange_tx_pb.MsgIncreasePositionMargin,
384+
"/injective.auction.v1beta1.MsgBid": injective_auction_tx_pb.MsgBidResponse,
369385
}
370386

371387
response = tx_response_pb.TxResponseData.FromString(data)

0 commit comments

Comments
 (0)