nanopy.rpc

A wrapper to make RPC requests to a node.

class nanopy.rpc.HTTP(url='http://localhost:7076')

HTTP RPC class

Parameters:

url (str) – URL of the nano node

request(data)

Overridden from base class

Parameters:

data (dict[str, Any]) – dict like object

Return type:

Any

Returns:

JSON reponse as dict

class nanopy.rpc.RPC

RPC base class

account_balance(account, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#account_balance

Return type:

Any

account_block_count(account)

https://docs.nano.org/commands/rpc-protocol/#account_block_count

Return type:

Any

account_create(wallet, index=0, work=True)

https://docs.nano.org/commands/rpc-protocol/#account_create

Return type:

Any

account_history(account, count=1, raw=False, head='', include_linked_account=False, offset=0, reverse=False, account_filter=None)

https://docs.nano.org/commands/rpc-protocol/#account_history

Return type:

Any

account_info(account, include_confirmed=False, representative=False, weight=False, pending=False)

https://docs.nano.org/commands/rpc-protocol/#account_info

Return type:

Any

account_key(account)

https://docs.nano.org/commands/rpc-protocol/#account_key

Return type:

Any

account_list(wallet)

https://docs.nano.org/commands/rpc-protocol/#account_list

Return type:

Any

account_move(wallet, source, accounts)

https://docs.nano.org/commands/rpc-protocol/#account_move

Return type:

Any

account_remove(wallet, account)

https://docs.nano.org/commands/rpc-protocol/#account_remove

Return type:

Any

account_representative(account)

https://docs.nano.org/commands/rpc-protocol/#account_representative

Return type:

Any

account_representative_set(wallet, account, representative, work='')

https://docs.nano.org/commands/rpc-protocol/#account_representative_set

Return type:

Any

account_weight(account)

https://docs.nano.org/commands/rpc-protocol/#account_weight

Return type:

Any

accountget(key)

https://docs.nano.org/commands/rpc-protocol/#accountget

Return type:

Any

accounts_balances(accounts, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#accounts_balances

Return type:

Any

accounts_create(wallet, count=1, work=True)

https://docs.nano.org/commands/rpc-protocol/#accounts_create

Return type:

Any

accounts_frontiers(accounts)

https://docs.nano.org/commands/rpc-protocol/#accounts_frontiers

Return type:

Any

accounts_receivable(accounts, count=1, threshold='', source=False, include_active=False, sorting=False, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#accounts_receivable

Return type:

Any

accounts_representatives(accounts)

https://docs.nano.org/commands/rpc-protocol/#accounts_representatives

Return type:

Any

available_supply()

https://docs.nano.org/commands/rpc-protocol/#available_supply

Return type:

Any

block_account(_hash)

https://docs.nano.org/commands/rpc-protocol/#block_account

Return type:

Any

block_confirm(_hash)

https://docs.nano.org/commands/rpc-protocol/#block_confirm

Return type:

Any

block_count(include_cemented=True)

https://docs.nano.org/commands/rpc-protocol/#block_count

Return type:

Any

block_create(balance, representative, previous, wallet='', account='', key='', source='', destination='', link='', work='', version='work_1', json_block=False, difficulty='')

https://docs.nano.org/commands/rpc-protocol/#block_create

Return type:

Any

block_hash(block, json_block=False)

https://docs.nano.org/commands/rpc-protocol/#block_hash

Return type:

Any

block_info(_hash, json_block=False, include_linked_account=False)

https://docs.nano.org/commands/rpc-protocol/#block_info

Return type:

Any

blocks(hashes, json_block=False)

https://docs.nano.org/commands/rpc-protocol/#blocks

Return type:

Any

blocks_info(hashes, include_linked_account=False, pending=False, source=False, receive_hash=False, json_block=False, include_not_found=False)

https://docs.nano.org/commands/rpc-protocol/#blocks_info

Return type:

Any

bootstrap(address, port, bypass_frontier_confirmation=False, _id='')

https://docs.nano.org/commands/rpc-protocol/#bootstrap

Return type:

Any

bootstrap_any(force=False, _id='', account='')

https://docs.nano.org/commands/rpc-protocol/#bootstrap_any

Return type:

Any

bootstrap_lazy(hash_, force=False, _id='')

https://docs.nano.org/commands/rpc-protocol/#bootstrap_lazy

Return type:

Any

bootstrap_priorities()

https://docs.nano.org/commands/rpc-protocol/#bootstrap_priorities

Return type:

Any

bootstrap_reset()

https://docs.nano.org/commands/rpc-protocol/#bootstrap_reset

Return type:

Any

bootstrap_status()

https://docs.nano.org/commands/rpc-protocol/#bootstrap_status

Return type:

Any

chain(block, count=1, offset=0, reverse=False)

https://docs.nano.org/commands/rpc-protocol/#chain

Return type:

Any

confirmation_active(announcements=0)

https://docs.nano.org/commands/rpc-protocol/#confirmation_active

Return type:

Any

confirmation_height_currently_processing()

https://docs.nano.org/commands/rpc-protocol/#confirmation_height_currently_processing

Return type:

Any

confirmation_history(_hash='')

https://docs.nano.org/commands/rpc-protocol/#confirmation_history

Return type:

Any

confirmation_info(root, contents=True, representatives=False, json_block=False)

https://docs.nano.org/commands/rpc-protocol/#confirmation_info

Return type:

Any

confirmation_quorum(peer_details=False)

https://docs.nano.org/commands/rpc-protocol/#confirmation_quorum

Return type:

Any

database_txn_tracker(min_read_time, min_write_time)

https://docs.nano.org/commands/rpc-protocol/#database_txn_tracker

Return type:

Any

delegators(account, threshold=0, count=0, start='')

https://docs.nano.org/commands/rpc-protocol/#delegators

Return type:

Any

delegators_count(account)

https://docs.nano.org/commands/rpc-protocol/#delegators_count

Return type:

Any

deterministic_key(seed, index)

https://docs.nano.org/commands/rpc-protocol/#deterministic_key

Return type:

Any

election_statistics()

https://docs.nano.org/commands/rpc-protocol/#election_statistics

Return type:

Any

epoch_upgrade(epoch, key, count=0, threads=0)

https://docs.nano.org/commands/rpc-protocol/#epoch_upgrade

Return type:

Any

frontier_count()

https://docs.nano.org/commands/rpc-protocol/#frontier_count

Return type:

Any

frontiers(account, count=1)

https://docs.nano.org/commands/rpc-protocol/#frontiers

Return type:

Any

keepalive(address, port)

https://docs.nano.org/commands/rpc-protocol/#keepalive

Return type:

Any

key_create()

https://docs.nano.org/commands/rpc-protocol/#key_create

Return type:

Any

key_expand(key)

https://docs.nano.org/commands/rpc-protocol/#key_expand

Return type:

Any

ledger(account, count=1, representative=False, weight=False, receivable=False, modified_since=0, sorting=False, threshold=0)

https://docs.nano.org/commands/rpc-protocol/#ledger

Return type:

Any

nano_to_raw(amount)

https://docs.nano.org/commands/rpc-protocol/#nano_to_raw

Return type:

Any

node_id()

https://docs.nano.org/commands/rpc-protocol/#node_id

Return type:

Any

node_id_delete()

https://docs.nano.org/commands/rpc-protocol/#node_id_delete

Return type:

Any

password_change(wallet, password)

https://docs.nano.org/commands/rpc-protocol/#password_change

Return type:

Any

password_enter(wallet, password)

https://docs.nano.org/commands/rpc-protocol/#password_enter

Return type:

Any

password_valid(wallet)

https://docs.nano.org/commands/rpc-protocol/#password_valid

Return type:

Any

peers(peer_details=False)

https://docs.nano.org/commands/rpc-protocol/#peers

Return type:

Any

populate_backlog()

https://docs.nano.org/commands/rpc-protocol/#populate_backlog

Return type:

Any

process(block, force=False, subtype='', json_block=False, watch_work=True, _async=False)

https://docs.nano.org/commands/rpc-protocol/#process

Return type:

Any

raw_to_nano(amount)

https://docs.nano.org/commands/rpc-protocol/#raw_to_nano

Return type:

Any

receivable(account, count=0, threshold=0, source=False, include_active=False, min_version=False, sorting=False, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#receivable

Return type:

Any

receivable_exists(_hash, include_active=False, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#receivable_exists

Return type:

Any

receive(wallet, account, block, work='')

https://docs.nano.org/commands/rpc-protocol/#receive

Return type:

Any

receive_minimum()

https://docs.nano.org/commands/rpc-protocol/#receive_minimum

Return type:

Any

receive_minimum_set(amount)

https://docs.nano.org/commands/rpc-protocol/#receive_minimum_set

Return type:

Any

representatives(count=1, sorting=False)

https://docs.nano.org/commands/rpc-protocol/#representatives

Return type:

Any

representatives_online(weight=False, accounts=None)

https://docs.nano.org/commands/rpc-protocol/#representatives_online

Return type:

Any

republish(_hash, count=1, sources=0, destinations=0)

https://docs.nano.org/commands/rpc-protocol/#republish

Return type:

Any

abstractmethod request(data)

Make RPC request to nano node. Overridden in derived class

Parameters:

data (dict[str, Any]) – dict like object

Return type:

Any

Returns:

JSON reponse as dict

search_receivable(wallet)

https://docs.nano.org/commands/rpc-protocol/#search_receivable

Return type:

Any

search_receivable_all()

https://docs.nano.org/commands/rpc-protocol/#search_receivable_all

Return type:

Any

send(wallet, source, destination, amount, _id='', work='')

https://docs.nano.org/commands/rpc-protocol/#send

Return type:

Any

sign(key='', wallet='', account='', block='', _hash='', json_block=False)

https://docs.nano.org/commands/rpc-protocol/#sign

Return type:

Any

stats(_type)

https://docs.nano.org/commands/rpc-protocol/#stats

Return type:

Any

stats_clear()

https://docs.nano.org/commands/rpc-protocol/#stats_clear

Return type:

Any

stop()

https://docs.nano.org/commands/rpc-protocol/#stop

Return type:

Any

successors(block, count=1, offset=0, reverse=False)

https://docs.nano.org/commands/rpc-protocol/#successors

Return type:

Any

telemetry(raw=False, address=0, port=7075)

https://docs.nano.org/commands/rpc-protocol/#telemetry

Return type:

Any

unchecked(json_block=False, count=1)

https://docs.nano.org/commands/rpc-protocol/#unchecked

Return type:

Any

unchecked_clear()

https://docs.nano.org/commands/rpc-protocol/#unchecked_clear

Return type:

Any

unchecked_keys(key, count=1, json_block=False)

https://docs.nano.org/commands/rpc-protocol/#unchecked_keys

Return type:

Any

uncheckedget(_hash, json_block=False)

https://docs.nano.org/commands/rpc-protocol/#uncheckedget

Return type:

Any

unopened(account='', count=1, threshold=0)

https://docs.nano.org/commands/rpc-protocol/#unopened

Return type:

Any

uptime()

https://docs.nano.org/commands/rpc-protocol/#uptime

Return type:

Any

validate_account_number(account)

https://docs.nano.org/commands/rpc-protocol/#validate_account_number

Return type:

Any

version()

https://docs.nano.org/commands/rpc-protocol/#version

Return type:

Any

wallet_add(wallet, key, work=False)

https://docs.nano.org/commands/rpc-protocol/#wallet_add

Return type:

Any

wallet_add_watch(wallet, accounts)

https://docs.nano.org/commands/rpc-protocol/#wallet_add_watch

Return type:

Any

wallet_balances(wallet, threshold=0)

https://docs.nano.org/commands/rpc-protocol/#wallet_balances

Return type:

Any

wallet_change_seed(wallet, seed, count=0)

https://docs.nano.org/commands/rpc-protocol/#wallet_change_seed

Return type:

Any

wallet_contains(wallet, account)

https://docs.nano.org/commands/rpc-protocol/#wallet_contains

Return type:

Any

wallet_create(seed='')

https://docs.nano.org/commands/rpc-protocol/#wallet_create

Return type:

Any

wallet_destroy(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_destroy

Return type:

Any

wallet_export(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_export

Return type:

Any

wallet_frontiers(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_frontiers

Return type:

Any

wallet_history(wallet, modified_since=0)

https://docs.nano.org/commands/rpc-protocol/#wallet_history

Return type:

Any

wallet_info(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_info

Return type:

Any

wallet_ledger(wallet, representative=False, weight=False, receivable=False, modified_since='')

https://docs.nano.org/commands/rpc-protocol/#wallet_ledger

Return type:

Any

wallet_lock(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_lock

Return type:

Any

wallet_locked(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_locked

Return type:

Any

wallet_receivable(wallet, count=1, threshold=0, source=False, include_active=False, min_version=False, include_only_confirmed=True)

https://docs.nano.org/commands/rpc-protocol/#wallet_receivable

Return type:

Any

wallet_representative(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_representative

Return type:

Any

wallet_representative_set(wallet, representative, update_existing_accounts=False)

https://docs.nano.org/commands/rpc-protocol/#wallet_representative_set

Return type:

Any

wallet_republish(wallet, count=1)

https://docs.nano.org/commands/rpc-protocol/#wallet_republish

Return type:

Any

wallet_work_get(wallet)

https://docs.nano.org/commands/rpc-protocol/#wallet_work_get

Return type:

Any

work_cancel(_hash)

https://docs.nano.org/commands/rpc-protocol/#work_cancel

Return type:

Any

work_generate(_hash, use_peers=False, difficulty='', multiplier=0, account='', version='work_1', block='', json_block=False)

https://docs.nano.org/commands/rpc-protocol/#work_generate

Return type:

Any

work_get(wallet, account)

https://docs.nano.org/commands/rpc-protocol/#workget

Return type:

Any

work_peer_add(address, port)

https://docs.nano.org/commands/rpc-protocol/#work_peer_add

Return type:

Any

work_peers()

https://docs.nano.org/commands/rpc-protocol/#work_peers

Return type:

Any

work_peers_clear()

https://docs.nano.org/commands/rpc-protocol/#work_peers_clear

Return type:

Any

work_set(wallet, account, work)

https://docs.nano.org/commands/rpc-protocol/#work_set

Return type:

Any

work_validate(work, _hash, difficulty='', multiplier=0, version='work_1')

https://docs.nano.org/commands/rpc-protocol/#work_validate

Return type:

Any

class nanopy.rpc.WS(url='ws://localhost:7078')

WS RPC class

Parameters:

url (str) – URL of the nano node

request(data)

Overridden from base class

Parameters:

data (dict[str, Any]) – dict like object

Return type:

Any

Returns:

JSON reponse as dict