def to_pb2(self): return type_pb2.chain_properties( account_creation_fee=type_pb2.coin( value=self.account_creation_fee), stamina_free=self.stamina_free, tps_expected=self.tps_expected, top_n_acquire_free_token=self.top_n_acquire_free_token, epoch_duration=self.epoch_duration, per_ticket_price=type_pb2.coin(value=self.per_ticket_price), per_ticket_weight=self.per_ticket_weight)
def __init__(self, account_from, account_to, amount, memo): self.account_from, self.account_to = account_from, account_to self.amount, self.memo = amount, memo _operation = operation_pb2.transfer_to_vest_operation( to=type_pb2.account_name(value=account_to), amount=type_pb2.coin(value=amount), memo=memo) getattr(_operation, "from").CopyFrom(type_pb2.account_name(value=account_from)) self.operation = transaction_pb2.operation(op10=_operation)
def __init__(self, account_from, account_to, amount): self.account_from, self.account_to = account_from, account_to self.amount = amount _operation = operation_pb2.un_stake_operation( to=type_pb2.account_name(value=account_to), amount=type_pb2.coin(value=amount), ) getattr(_operation, "from").CopyFrom(type_pb2.account_name(value=account_from)) self.operation = transaction_pb2.operation(op18=_operation)
def __init__(self, fee, creator, new_account_name, pub_key, json_metadata): self.fee = fee self.creator, self.new_account_name = creator, new_account_name self.pub_key = pub_key self.json_metadata = json_metadata _operation = operation_pb2.account_create_operation( fee=type_pb2.coin(value=fee), creator=type_pb2.account_name(value=creator), new_account_name=type_pb2.account_name(value=new_account_name), pub_key=type_pb2.public_key_type(data=pub_key.serialize()), json_metadata=json_metadata) self.operation = transaction_pb2.operation(op1=_operation)
def __init__(self, caller, owner, contract, method, params, amount): self.caller, self.owner = caller, owner self.contract = contract self.method, self.params = method, params self.amount = amount _operation = operation_pb2.contract_apply_operation( caller=type_pb2.account_name(value=caller), owner=type_pb2.account_name(owner=owner), contract=contract, method=method, params=params, amount=type_pb2.coin(value=amount)) self.operation = transaction_pb2.operation(op14=_operation)