Skip to main content

An asynchronous nano currency library

Project description

aio-nano

Overview

This library contains an asynchronous python RPC client for Nano nodes, allowing you to more easily develop on the Nano network with fully type annnotated methods and responses.

Installation

PIP

pip install aio-nano

Poetry

poetry add aio-nano

Example Async HTTP RPC Call

from aio_nano import Client
import asyncio

async def main():
  api_key = ...
  client = Client('https://mynano.ninja/api/node', {'Authorization': api_key})

  supply = await client.available_supply()
  print(supply)

asyncio.run(main())

Example Async WebSocket RPC Subscription

import asyncio
from time import time

from aio_nano import WSClient


async def main():
  ws = await WSClient("ws://localhost:7078").connect()
  start = time() * 1000
  await ws.subscribe("confirmation", lambda x: print(x), ack=True)
  print(f"Acked in {time() * 1000 - start}ms")

  await asyncio.Future()


asyncio.run(main())

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

aio-nano-0.1.9.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

aio_nano-0.1.9-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file aio-nano-0.1.9.tar.gz.

File metadata

  • Download URL: aio-nano-0.1.9.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.4 Linux/5.19.0-76051900-generic

File hashes

Hashes for aio-nano-0.1.9.tar.gz
Algorithm Hash digest
SHA256 3fa17d57053335a811dd763de48beb8525ff8669098f1edada68095209dacd4c
MD5 fa64800e4099f3c2c292446980aeee23
BLAKE2b-256 940deb3a91f79de6b2aa89a51561935c55b75a91a98fb3b13e4f58843825f8f1

See more details on using hashes here.

File details

Details for the file aio_nano-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: aio_nano-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.4 Linux/5.19.0-76051900-generic

File hashes

Hashes for aio_nano-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 24cdbe22860f5de9f0f5f449dee09008cfe048c3c094f643b24081ea319289b0
MD5 2e84f7141fae3dabaaa3727edf2c226e
BLAKE2b-256 1e223008937a55a915fda7cb0e425104caf369123ad602e237326295c2328e52

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