Skip to content

Commit

Permalink
Merge pull request PyWaves#74 from jansenmarc/master
Browse files Browse the repository at this point in the history
fixed bugs in transferring assets
  • Loading branch information
PyWaves authored Mar 18, 2019
2 parents 3fc80fc + f3b102e commit c6d1fdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion address.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ def sendWaves(self, recipient, amount, attachment='', txFee=pywaves.DEFAULT_TX_F
if timestamp == 0:
timestamp = int(time.time() * 1000)
sData = b'\4' + \
b'\2' + \
base58.b58decode(self.publicKey) + \
b'\0\0' + \
struct.pack(">Q", timestamp) + \
Expand All @@ -416,6 +417,7 @@ def sendWaves(self, recipient, amount, attachment='', txFee=pywaves.DEFAULT_TX_F
crypto.str2bytes(attachment)
signature = crypto.sign(self.privateKey, sData)
data = json.dumps({
"type": 4,
"version": 2,
"senderPublicKey": self.publicKey,
"recipient": recipient.address,
Expand All @@ -427,7 +429,7 @@ def sendWaves(self, recipient, amount, attachment='', txFee=pywaves.DEFAULT_TX_F
"proofs": [ signature ]
})

return pywaves.wrapper('/assets/broadcast/transfer', data)
return pywaves.wrapper('/transactions/broadcast', data)

def massTransferWaves(self, transfers, attachment='', timestamp=0):
txFee = 100000 + (math.ceil((len(transfers) + 1) / 2 - 0.5)) * 100000
Expand Down Expand Up @@ -521,6 +523,7 @@ def sendAsset(self, recipient, asset, amount, attachment='', feeAsset='', txFee=
if timestamp == 0:
timestamp = int(time.time() * 1000)
sData = b'\4' + \
b'\2' + \
base58.b58decode(self.publicKey) + \
(b'\1' + base58.b58decode(asset.assetId) if asset else b'\0') + \
(b'\1' + base58.b58decode(feeAsset.assetId) if feeAsset else b'\0') + \
Expand Down

0 comments on commit c6d1fdf

Please sign in to comment.