Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jansenmarc/PyWaves
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenmarc committed May 9, 2019
2 parents 19d40ef + 2bb8354 commit 713a9b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ myAddress.sendAsset(recipient = pw.Address('3PNTcNiUzppQXDL9RZrK3BcftbujiFqrAfM'
```python
import pywaves as pw

myToken = myAddress.issueToken( name = "MyToken",
myToken = myAddress.issueAsset( name = "MyToken",
description = "This is my first token",
quantity = 1000000,
decimals = 2 )
Expand Down Expand Up @@ -322,7 +322,21 @@ transfers = [
address = pw.Address(privateKey = "CtMQWJZqfc7PRzSWiMKaGmWFm4q2VN5fMcYyKDBPDx6S")
address.massTransferAssets(transfers, pw.Asset('9DtBNdyBCyViLZHptyF1HbQk73F6s7nQ5dXhNHubtBhd'))
```
#### Data Transaction:
```python
import pywaves as py

myAddress = py.Address(privateKey='CtMQWJZqfc7PRzSWiMKaGmWFm4q2VN5fMcYyKDBPDx6S')

data = [{
'type':'string',
'key': 'test',
'value':'testval'
}]

myAddress.dataTransaction(data)

```
#### Token airdrop:
```python
import pywaves as pw
Expand Down
3 changes: 1 addition & 2 deletions address.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def cancelOrderByID(self, assetPair, orderId):

def buy(self, assetPair, amount, price, maxLifetime=30 * 86400, matcherFee=pywaves.DEFAULT_MATCHER_FEE, timestamp=0):
assetPair.refresh()
normPrice = int(pow(10, 8 + assetPair.asset2.decimals - assetPair.asset1.decimals) * price)
normPrice = int(pow(10, assetPair.asset2.decimals - assetPair.asset1.decimals) * price)
id = self._postOrder(assetPair.asset1, assetPair.asset2, b'\0', amount, normPrice, maxLifetime, matcherFee, timestamp)
if pywaves.OFFLINE:
return id
Expand All @@ -772,7 +772,6 @@ def buy(self, assetPair, amount, price, maxLifetime=30 * 86400, matcherFee=pywav
def sell(self, assetPair, amount, price, maxLifetime=30 * 86400, matcherFee=pywaves.DEFAULT_MATCHER_FEE, timestamp=0):
assetPair.refresh()
normPrice = int(pow(10, 8 + assetPair.asset2.decimals - assetPair.asset1.decimals) * price)
print('normPrice: ' + str(normPrice))
id = self._postOrder(assetPair.asset1, assetPair.asset2, b'\1', amount, normPrice, maxLifetime, matcherFee, timestamp)
if pywaves.OFFLINE:
return id
Expand Down

0 comments on commit 713a9b8

Please sign in to comment.