A Python wrapper for the TurtleCoin JSON-RPC interface
Project description
turtlecoin-python
=================
A Python wrapper for the TurtleCoin JSON-RPC interface
Requires Python 3.6
**In development**
TODO:
* create_address: creating address from a spend key doesnt work
Quickstart
----------
You need to have walletd running with rpc enabled:
```
# generate a test wallet
$ ./walletd -w test.wallet -p any_password_you_want -g
# launch walletd with test wallet
$ ./walletd -w test.wallet -p any_password_you_want --local --rpc-password test
```
Usage
-----
Example for creating and deleting an address:
```python
from turtlecoin import TurtleCoinWallet
wallet = TurtleCoinWallet(password='test')
address = wallet.create_address()
wallet.get_balance(address)
wallet.get_view_key()
wallet.get_spend_keys(address)
wallet.delete_address(address)
```
Transactions
------------
```python
>>> wallet = TurtleCoinWallet(password='test')
# transfer 10.00 TRTL
>>> recipients = [{'address': destination_address, 'amount': 1000}]
# mixin/anonymity is 3 and fee is 0.1 TRTL
>>> wallet.send_transaction(
anonymity=3,
transfers=recipients,
fee=10
)
'aebb47d5a975f0ac0c27806b7abf9107adbd7a8a0c7c8ea91ca363eacda7f79x'
```
Sending a transaction will return a transactionHash. You can enter the hash on the https://turtle-coin.com block explorer to see more details.
Delayed Transactions
--------------------
```python
# Create a delayed transaction
>>> tx_hash = wallet.create_delayed_transaction(
anonymity=3,
transfers=[
{
'address': 'TRTL...',
'amount': 50
}
]
)
# List all delayed transactions
>>> wallet.get_delayed_transaction_hashes()
['bfcc4735a975f0ac0c27806b7abf9107adbd7a8a0c7c8ea91ca363eacda7f79x']
# Send delayed transaction
>>> wallet.send_delayed_transaction(tx_hash)
```
Developer setup
---------------
Install dependencies with pipenv:
```
pipenv install
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
turtlecoin-0.0.1.tar.gz
(6.1 kB
view details)
Built Distribution
File details
Details for the file turtlecoin-0.0.1.tar.gz
.
File metadata
- Download URL: turtlecoin-0.0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3343d275d8e5ef9f42d701fab52ca11c1503c4c79d7545ab838f57f5f646630 |
|
MD5 | 487482a839f9c8fc3e391a1bbe0f8cdc |
|
BLAKE2b-256 | 87f0b6eff53333e84bec91f63686c543228d306d45c2515278ef692b592a6eb4 |
File details
Details for the file turtlecoin-0.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: turtlecoin-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 725706443fc83cfce6083edf621a446df2729b54b1f9e7c407d94cd28d64d0e7 |
|
MD5 | d9308db2e22a18a9d7d56fe8b32e18c0 |
|
BLAKE2b-256 | e39f56855b464538333b5a3a884728d12873536fe46c31e5d3e5cbb650db5f8f |