def add_wasm_execute(self, contract: str, amount: int, denom: str = "ucosm") -> None: transfer = { "type": "wasm/MsgExecuteContract", "value": { "sender": privkey_to_address(self._privkey), "contract": contract, "msg": {"approve":{"quantity":[{"amount":str(amount),"denom":denom}]}}, "sent_funds": [{"denom": denom, "amount": str(amount)}], #"sent_funds": [{"denom": denom, "amount": str(amount)}], }, } self._msgs.append(transfer)
def add_transfer(self, recipient: str, amount: int, denom: str = "uatom") -> None: transfer = { "type": "cosmos-sdk/MsgSend", "value": { "from_address": privkey_to_address(self._privkey), "to_address": recipient, "amount": [{ "denom": denom, "amount": str(amount) }], }, } self._msgs.append(transfer)
def get_address(self): return privkey_to_address(self.private_key)