Skip to main content

A python nanoclient to easily interact with the nano blockchain.

Project description

Nanoclient Python

This project was made to make it easier to interact with nano blockchain in python.

Getting Started

import NanoClient from nanoclient

# get your nanswap node api here, https://nanswap.com/nodes
client = NanoClient({"nodeUrl": "https://nodes.nanswap.com/XNO", "currency": "xno", "nanswapApi": "your_nanswap_api","workUrl": "https://nodes.nanswap.com/XNO"});

# this should only be called once and seed should be backed up
client.setRetrieveSeed(client.randomSeed()) # a file is created with the seed in your directory. i.e, after running this code once, remove this line

 # 0 is the index, you can continue deriving as many wallets as you need, the number is the index and each derives unique wallet on the seed stored in file
wallet = client.wallet(0) # while 0=0 and 1=1, returns json with keys

Key Commands

seed = client.randomSeed()
privateKey = client.derivePrivateKey(seed, 0)
publicKey = client.derivePublicKey(privateKey)
deriveAddress = client.deriveAddress(publicKey)

RPC Commands

node actions after '#'

client.rpc.account_info(nanoAddress) # account_info
client.rpc.work_generate(blockHash) # work_generate
client.rpc.recievable(nanoAddress) # pending
client.rpc.process(block, "(send/recieve)") # process
client.rpc.req(any_json_rpc_command)

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

nanoclient-0.0.2.tar.gz (3.2 kB view hashes)

Uploaded Source

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