def castvote(op): expiration = transactions.formatTimeFromNow(180) ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc) tx = transactions.Signed_Transaction(ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=[op]) tx = tx.sign([wif]) dobroadcast(tx)
def proceed(op): expiration = transactions.formatTimeFromNow(60) ops = [transactions.Operation(op)] ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc) tx = transactions.Signed_Transaction(ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=ops) tx = tx.sign([wif]) # Broadcast JSON to network rpc.broadcast_transaction(tx.json(), api="network_broadcast")
def constructTx(self): if isinstance(self.op, list): ops = [Operation(o) for o in self.op] else: ops = [Operation(self.op)] expiration = transactions.formatTimeFromNow(self.steem.expiration) ref_block_num, ref_block_prefix = transactions.getBlockParams( self.steem.rpc) tx = Signed_Transaction(ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=ops) super(TransactionBuilder, self).__init__(tx.json())
def constructTx(self): if isinstance(self.op, list): ops = [Operation(o) for o in self.op] else: ops = [Operation(self.op)] expiration = transactions.formatTimeFromNow(self.steem.expiration) ref_block_num, ref_block_prefix = transactions.getBlockParams(self.steem.rpc) tx = Signed_Transaction( ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=ops ) super(TransactionBuilder, self).__init__(tx.json())
def transfer(sender, recipient, amount, memo): expiration = transactions.formatTimeFromNow(60) op = transactions.Transfer(**{ "from": sender, "to": recipient, "amount": amount, "memo": memo }) ops = [transactions.Operation(op)] ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc) tx = transactions.Signed_Transaction(ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=ops) tx = tx.sign([wif]) # Broadcast JSON to network rpc.broadcast_transaction(tx.json(), api="network_broadcast")
def transfer(sender,recipient,amount,memo): expiration = transactions.formatTimeFromNow(60) op = transactions.Transfer( **{"from": sender, "to": recipient, "amount": amount, "memo": memo} ) ops = [transactions.Operation(op)] ref_block_num, ref_block_prefix = transactions.getBlockParams(rpc) tx = transactions.Signed_Transaction(ref_block_num=ref_block_num, ref_block_prefix=ref_block_prefix, expiration=expiration, operations=ops) tx = tx.sign([wif]) # Broadcast JSON to network rpc.broadcast_transaction(tx.json(), api="network_broadcast")