Vision Python client library
Project description
vision-python-sdk (visionpy)
Vision Python Client Library.
Features
- Get Block, Transaction, TransactionInfo, Node;
- Build and transfer VS, VRC10, VRC20;
- Parse event logs of TransactionInfo;
- Asyncio support;
- Python 3.7.2 and late version required;
- Poetry for package management.
How to use
More examples please check example
folder.
from visionpy import Vision
from visionpy.keys import PrivateKey
# Private key of VDGXn73Qgf6V1aGbm8eigoHyPJRJpALN9F
priv_key = PrivateKey(bytes.fromhex("eed06aebdef88683ff5678b353d1281bb2b730113c9283f7ea96600a0d2c104f"))
def transfer():
client = Vision(network='vpioneer')
txn_ret = (
client.vs.transfer("VTCYvEK2ZuWvZ5LXqrLpU2GoRkFeJ1NrD2", "VSfD1o6FPChqdqLgwJaztjckyyo2GSM1KP", 1_000)
.memo("test memo")
.build()
.inspect()
.sign(priv_key)
.broadcast()
)
print(txn_ret)
print(txn_ret.result())
Async Client
import asyncio
from visionpy import AsyncVision
from visionpy.keys import PrivateKey
# private key of VTCYvEK2ZuWvZ5LXqrLpU2GoRkFeJ1NrD2
priv_key = PrivateKey(bytes.fromhex("eed06aebdef88683ff5678b353d1281bb2b730113c9283f7ea96600a0d2c104f"))
async def transfer():
async with AsyncVision(network='vpioneer') as client:
print(client)
txb = (
client.trx.transfer("VTCYvEK2ZuWvZ5LXqrLpU2GoRkFeJ1NrD2", "VSfD1o6FPChqdqLgwJaztjckyyo2GSM1KP", 1_000)
.memo("test memo")
.fee_limit(100_000_000)
)
txn = await txb.build()
print(txn)
txn_ret = await txn.sign(priv_key).broadcast()
print(txn_ret)
print(await txn_ret.wait())
if __name__ == '__main__':
asyncio.run(transfer())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
visionpy-0.0.3.tar.gz
(27.7 kB
view details)
Built Distribution
visionpy-0.0.3-py3-none-any.whl
(30.3 kB
view details)
File details
Details for the file visionpy-0.0.3.tar.gz
.
File metadata
- Download URL: visionpy-0.0.3.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.15.25-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1010c78cb3a2340f0667e999e218d6e54eaf9af0994846b3c3174c1d97a83cf |
|
MD5 | c33cb6a57e17630c97119b411f57f5e0 |
|
BLAKE2b-256 | a1810084b3e891236df88b49656fa93e9cbb50d5758ea79e6798548116f38ce4 |
File details
Details for the file visionpy-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: visionpy-0.0.3-py3-none-any.whl
- Upload date:
- Size: 30.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.15.25-1-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e08a15071528ccd418f57e18400f20420b5c115f20f9c65ecccd140126949e3 |
|
MD5 | 7b46e4151c6d27c7a3ab6ee2f1a66978 |
|
BLAKE2b-256 | 926253cf6cedd3ec8e6f1a0d1a8d8ff6cba4d97d092c138db46e1e74f0724bbd |