Skip to content
Merged
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
18 changes: 18 additions & 0 deletions pyinjective/composer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down