@@ -371,6 +371,7 @@ def MsgGrant(self, granter: str, grantee: str, msg_type: str, expire_in: int):
371371
372372 def MsgExec (self , grantee : str , msgs : List ):
373373 any_msgs : List [any_pb2 .Any ] = []
374+
374375 for msg in msgs :
375376 any_msg = any_pb2 .Any ()
376377 any_msg .Pack (msg , type_url_prefix = "" )
@@ -409,8 +410,9 @@ def MsgResponses(data, simulation=False):
409410 "/injective.exchange.v1beta1.MsgIncreasePositionMargin" : injective_exchange_tx_pb .MsgIncreasePositionMarginResponse ,
410411 "/injective.auction.v1beta1.MsgBid" : injective_auction_tx_pb .MsgBidResponse ,
411412 "/cosmos.bank.v1beta1.MsgSend" : cosmos_bank_tx_pb .MsgSendResponse ,
412- "/cosmos.authz.v1beta1.MsgGrant" : cosmos_authz_tx_pb .MsgGrantResponse ,
413- "/cosmos.authz.v1beta1.MsgRevoke" : cosmos_authz_tx_pb .MsgRevokeResponse ,
413+ "/cosmos.authz.v1beta1.MsgGrant" : cosmos_authz_tx_pb .MsgGrant ,
414+ "/cosmos.authz.v1beta1.MsgExec" : cosmos_authz_tx_pb .MsgExec ,
415+ "/cosmos.authz.v1beta1.MsgRevoke" : cosmos_authz_tx_pb .MsgRevoke ,
414416 }
415417
416418 response = tx_response_pb .TxResponseData .FromString (data )
@@ -419,3 +421,27 @@ def MsgResponses(data, simulation=False):
419421 msgs .append (header_map [msg .header ].FromString (msg .data ))
420422
421423 return msgs
424+
425+ @staticmethod
426+ def UnpackMsgExecResponse (msg_type , data ):
427+ header_map = {
428+ "MsgCreateSpotLimitOrder" : injective_exchange_tx_pb .MsgCreateSpotLimitOrderResponse ,
429+ "MsgCreateSpotMarketOrder" : injective_exchange_tx_pb .MsgCreateSpotMarketOrderResponse ,
430+ "MsgCreateDerivativeLimitOrder" : injective_exchange_tx_pb .MsgCreateDerivativeLimitOrderResponse ,
431+ "MsgCreateDerivativeMarketOrder" : injective_exchange_tx_pb .MsgCreateDerivativeMarketOrderResponse ,
432+ "MsgCancelSpotOrder" : injective_exchange_tx_pb .MsgCancelSpotOrderResponse ,
433+ "MsgCancelDerivativeOrder" : injective_exchange_tx_pb .MsgCancelDerivativeOrderResponse ,
434+ "MsgBatchCancelSpotOrders" : injective_exchange_tx_pb .MsgBatchCancelSpotOrdersResponse ,
435+ "MsgBatchCancelDerivativeOrders" : injective_exchange_tx_pb .MsgBatchCancelDerivativeOrdersResponse ,
436+ "MsgBatchCreateSpotLimitOrders" : injective_exchange_tx_pb .MsgBatchCreateSpotLimitOrdersResponse ,
437+ "MsgBatchCreateDerivativeLimitOrders" : injective_exchange_tx_pb .MsgBatchCreateDerivativeLimitOrdersResponse ,
438+ "MsgBatchUpdateOrders" : injective_exchange_tx_pb .MsgBatchUpdateOrdersResponse ,
439+ "MsgDeposit" : injective_exchange_tx_pb .MsgDepositResponse ,
440+ "MsgWithdraw" : injective_exchange_tx_pb .MsgWithdrawResponse ,
441+ "MsgSubaccountTransfer" : injective_exchange_tx_pb .MsgSubaccountTransferResponse ,
442+ "MsgLiquidatePosition" : injective_exchange_tx_pb .MsgLiquidatePositionResponse ,
443+ "MsgIncreasePositionMargin" : injective_exchange_tx_pb .MsgIncreasePositionMarginResponse ,
444+ "MsgBid" : injective_auction_tx_pb .MsgBidResponse ,
445+ }
446+
447+ return header_map [msg_type ].FromString (bytes (data , "utf-8" ))
0 commit comments