def leaseCancel(self, leaseId, txFee=pywaves.DEFAULT_LEASE_FEE, timestamp=0):
if not self.privateKey:
logging.error('Private key required')
elif not pywaves.OFFLINE and self.balance() < txFee:
logging.error('Insufficient Waves balance')
else:
if timestamp == 0:
timestamp = int(time.time() * 1000)
sData = b'\x09' + \
base58.b58decode(self.publicKey) + \
struct.pack(">Q", txFee) + \
struct.pack(">Q", timestamp) + \
base58.b58decode(leaseId)
signature = crypto.sign(self.privateKey, sData)
data = json.dumps({
"senderPublicKey": self.publicKey,
"txId": leaseId,
"fee": txFee,
"timestamp": timestamp,
"signature": signature
})
req = pywaves.wrapper('/leasing/broadcast/cancel', data)
if pywaves.OFFLINE:
return req
elif 'leaseId' in req:
return req['leaseId']
评论列表
文章目录