Skip to main content

Vision Python client library

Project description

vision-python-sdk (visionpy)

Vision Python Client Library.

Features

  1. Get Block, Transaction, TransactionInfo, Node;
  2. Build and transfer VS, VRC10, VRC20;
  3. Parse event logs of TransactionInfo;
  4. Asyncio support;
  5. Python 3.7.2 and late version required;
  6. 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


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.2.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

visionpy-0.0.2-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file visionpy-0.0.2.tar.gz.

File metadata

  • Download URL: visionpy-0.0.2.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

Hashes for visionpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0a711dbdd4dda24f927eaa3095925fe11c994ab36e2034c3c173a543a9260777
MD5 99231511fc373d6cd206190e9eca4826
BLAKE2b-256 b02f59c9964ec3d7b753f639e9d9cdbba5d7561ad5d2289338e1ff461044e01e

See more details on using hashes here.

File details

Details for the file visionpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: visionpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 30.2 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

Hashes for visionpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 20347cec89c18bc46383d9adbdd331d6ba2b0ab3288451841ac7b2b877b25eb8
MD5 4e3c1a585dc7f55ebbcec4890990166a
BLAKE2b-256 d290d5b7ebccc2645008257dc34be6d400d371680647eed142cf910a863633da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page