diff --git a/pyinjective/composer.py b/pyinjective/composer.py index 41140aea..000efcf6 100644 --- a/pyinjective/composer.py +++ b/pyinjective/composer.py @@ -900,6 +900,24 @@ def MsgVote( return cosmos_gov_tx_pb.MsgVote( proposal_id=proposal_id, voter=voter, option=option ) + + def MsgPrivilegedExecuteContract(self, sender: str, contract: str, msg: str, **kwargs) -> injective_exchange_tx_pb.MsgPrivilegedExecuteContract: + return injective_exchange_tx_pb.MsgPrivilegedExecuteContract( + sender=sender, + contract_address=contract, + data=msg, + funds=kwargs.get('funds') # funds is a string of Coin strings, comma separated, e.g 100000inj,20000000000usdt + ) + + def MsgInstantiateContract(self, sender: str, admin: str, code_id: int, label: str, message: bytes, **kwargs) -> wasm_tx_pb.MsgInstantiateContract: + return wasm_tx_pb.MsgInstantiateContract( + sender=sender, + admin=admin, + code_id=code_id, + label=label, + msg=message, + funds=kwargs.get('funds'), # funds is a list of cosmos_dot_base_dot_v1beta1_dot_coin__pb2.Coin. The coins in the list must be sorted in alphabetical order by denoms. + ) # data field format: [request-msg-header][raw-byte-msg-response] # you need to figure out this magic prefix number to trim request-msg-header off the data