From 4f918ed3d49dfa74963c0725c32fedba6453a362 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 17 Aug 2018 18:04:36 +0200 Subject: [PATCH 1/3] Minor correction to IssueAsset method --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01a3672..170dbcc 100644 --- a/README.md +++ b/README.md @@ -257,7 +257,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 ) From 50160dfcb12eb51a00edb2f65cc7771dad99420b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=90ogecoin=20Millionaire=E2=84=A2?= Date: Wed, 29 Aug 2018 14:50:03 -0700 Subject: [PATCH 2/3] buy / sell decimal fix fix calculation for decimals in buy and sell --- address.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/address.py b/address.py index 66fa1f8..c361333 100644 --- a/address.py +++ b/address.py @@ -744,7 +744,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 @@ -753,7 +753,7 @@ 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) + normPrice = int(pow(10, assetPair.asset2.decimals - assetPair.asset1.decimals) * price) id = self._postOrder(assetPair.asset1, assetPair.asset2, b'\1', amount, normPrice, maxLifetime, matcherFee, timestamp) if pywaves.OFFLINE: return id From bf182165bc95572b966c91f9ca6edd33a868834a Mon Sep 17 00:00:00 2001 From: James Date: Wed, 10 Oct 2018 12:51:38 +0200 Subject: [PATCH 3/3] Add Data Transaction Code Sample Demonstrate how to perform a DataTransaction (Type 12) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 170dbcc..647475b 100644 --- a/README.md +++ b/README.md @@ -316,7 +316,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