Skip to main content

Vision Python client library

Project description

vision-python-sdk (visionpy)

PyPI version

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. Decode contract function inputs;
  5. Asyncio support;
  6. Python 3.7.2 and late version required;
  7. 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.4.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

visionpy-0.0.4-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: visionpy-0.0.4.tar.gz
  • Upload date:
  • Size: 28.6 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.4.tar.gz
Algorithm Hash digest
SHA256 38d758f4f25f4baa525883227e3579aa97aa169b5c4d4b152ffa05f974bda3a9
MD5 1642e2c0497904868b0de5ec1ba7ff18
BLAKE2b-256 9f312a27ff4b90d4af6fbe8e8892b950ff3d9b85be02ebc7b928805498fe39fe

See more details on using hashes here.

File details

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

File metadata

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

Hashes for visionpy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 68e41311652eb8d7aaca2e18af6880f0c76ef79f0e73037ca66f8c3d5c4f64fb
MD5 3e39eb79859e3580409e18d8793c6638
BLAKE2b-256 2ee791cd953c9ef43b6f720980f03197adb306f9071ce3be73a3fba790f7b915

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