コード例 #1
0
 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)
コード例 #2
0
ファイル: _transaction.py プロジェクト: sorawit/cosmospy
 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)
コード例 #3
0
ファイル: cosmos.py プロジェクト: antonioandara/aleph-client
 def get_address(self):
     return privkey_to_address(self.private_key)