Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PyWaves authored Jul 31, 2017
1 parent 5861602 commit 6f959e3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ __pywaves.Address(address, publicKey, privateKey, seed)__ _Creates a new Address

`createAlias(alias, txFee=DEFAULT_ALIAS_FEE)` create alias

`uniqueAsset(Asset, txFee=DEFAULT_UNIQUE_FEE)` make asset name unique

### Asset Class
__pywaves.Asset(assetId)__ _Creates a new Asset object_

Expand Down Expand Up @@ -164,7 +162,6 @@ The fees for waves/asset transfers, asset issue/reissue/burn and matcher transac
* DEFAULT_MATCHER_FEE = 1000000
* DEFAULT_LEASE_FEE = 100000
* DEFAULT_ALIAS_FEE = 100000
* DEFAULT_UNIQUE_FEE = 100000

## More Examples

Expand Down Expand Up @@ -229,16 +226,6 @@ myToken = myAddress.issueToken( name = "MyToken",
decimals = 2 )
```

#### Making asset name unique:
```python
import pywaves as pw

pw.setNode(node = 'http://127.0.0.1:6869', chain = 'testnet')

myToken = pw.Asset("8dzLYRNtYR6ASG2W4h3FqeeY49paRxNheQwRW6CpP1HT")
myAddress.uniqueAsset(myToken)
```

#### Create an alias:
```python
import pywaves as pw
Expand Down
1 change: 0 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
DEFAULT_MATCHER_FEE = 100000
DEFAULT_LEASE_FEE = 100000
DEFAULT_ALIAS_FEE = 100000
DEFAULT_UNIQUE_FEE = 100000
VALID_TIMEFRAMES = (5, 15, 30, 60, 240, 1440)
MAX_WDF_REQUEST = 100

Expand Down
20 changes: 1 addition & 19 deletions address.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,22 +624,4 @@ def createAlias(self, alias, txFee=pywaves.DEFAULT_ALIAS_FEE):
"timestamp": timestamp,
"signature": signature
})
return pywaves.wrapper('/alias/broadcast/create', data)

def uniqueAsset(self, Asset, txFee=pywaves.DEFAULT_UNIQUE_FEE):
timestamp = int(time.time() * 1000)
sData = b'\x0b' + str(pywaves.CHAIN_ID) + \
base58.b58decode(self.publicKey) + \
base58.b58decode(Asset.assetId) + \
struct.pack(">Q", txFee) + \
struct.pack(">Q", timestamp)
signature = crypto.sign(self.privateKey, sData)
data = json.dumps({
"senderPublicKey": self.publicKey,
"assetId": Asset.assetId,
"timestamp": timestamp,
"networkByte": ord(pywaves.CHAIN_ID),
"fee": txFee,
"signature": signature
})
return pywaves.wrapper('/assets/broadcast/make-asset-name-unique', data)
return pywaves.wrapper('/alias/broadcast/create', data)

0 comments on commit 6f959e3

Please sign in to comment.