示例#1
0
 def from_data(cls, data: dict) -> MsgDelegate:
     data = data["value"]
     return cls(
         delegator_address=data["delegator_address"],
         validator_address=data["validator_address"],
         amount=Coin.from_data(data["amount"]),
     )
示例#2
0
 def from_data(cls, data: dict) -> PolicyConstraints:
     return cls(
         rate_min=Dec(data["rate_min"]),
         rate_max=Dec(data["rate_max"]),
         cap=Coin.from_data(data["cap"]),
         change_max=Dec(data["change_max"]),
     )
示例#3
0
 def from_data(cls, data: dict) -> MsgSwap:
     data = data["value"]
     return cls(
         trader=data["trader"],
         offer_coin=Coin.from_data(data["offer_coin"]),
         ask_denom=data["ask_denom"],
     )
示例#4
0
 def from_data(cls, data: dict) -> MsgCreateValidator:
     data = data["value"]
     return cls(
         description=Description.from_data(data["description"]),
         commission=CommissionRates.from_data(data["commission"]),
         min_self_delegation=int(data["min_self_delegation"]),
         delegator_address=data["delegator_address"],
         validator_address=data["validator_address"],
         pubkey=data["pubkey"],
         value=Coin.from_data(data["value"]),
     )