예제 #1
0
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)
예제 #2
0
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")
예제 #3
0
 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())
예제 #4
0
 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())
예제 #5
0
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")
예제 #6
0
파일: watch.py 프로젝트: pharesim/steemdice
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")