nanopy.rpc¶
A wrapper to make RPC requests to a node. Requires requests. Additionally, websocket-client for websocket connections, and pysocks for connecting via TOR network.
- class nanopy.rpc.RPC(url='http://localhost:7076', headers={}, tor=False)¶
RPC class
- Parameters:
Refer docs for information on methods.
Return type is
dict
for all methods exceptdisconnect
.- account_balance(account, include_only_confirmed=True)¶
https://docs.nano.org/commands/rpc-protocol/#account_balance
- account_block_count(account)¶
https://docs.nano.org/commands/rpc-protocol/#account_block_count
- account_create(wallet, index=0, work=True)¶
- account_get(key)¶
- account_history(account, count=1, raw=False, head=None, offset=0, reverse=False, account_filter=[])¶
https://docs.nano.org/commands/rpc-protocol/#account_history
- account_info(account, include_confirmed=False, representative=False, weight=False, pending=False)¶
- account_key(account)¶
- account_list(wallet)¶
- account_move(wallet, source, accounts)¶
- account_remove(wallet, account)¶
- account_representative(account)¶
https://docs.nano.org/commands/rpc-protocol/#account_representative
- account_representative_set(wallet, account, representative, work=None)¶
https://docs.nano.org/commands/rpc-protocol/#account_representative_set
- account_weight(account)¶
- accounts_balances(accounts, include_only_confirmed=True)¶
https://docs.nano.org/commands/rpc-protocol/#accounts_balances
- accounts_create(wallet, count=1, work=True)¶
https://docs.nano.org/commands/rpc-protocol/#accounts_create
- accounts_frontiers(accounts)¶
https://docs.nano.org/commands/rpc-protocol/#accounts_frontiers
- accounts_receivable(accounts, count=1, threshold=None, source=False, include_active=False, sorting=False, include_only_confirmed=True)¶
https://docs.nano.org/commands/rpc-protocol/#accounts_receivable
- accounts_representatives(accounts)¶
https://docs.nano.org/commands/rpc-protocol/#accounts_representatives
- available_supply()¶
https://docs.nano.org/commands/rpc-protocol/#available_supply
- block_account(_hash)¶
- block_confirm(_hash)¶
- block_count(include_cemented=True)¶
- block_create(balance, representative, previous, wallet=None, account=None, key=None, source=None, destination=None, link=None, work=None, version='work_1', json_block=False, difficulty=None)¶
- block_hash(block, json_block=False)¶
- block_info(_hash, json_block=False)¶
- blocks(hashes, json_block=False)¶
- blocks_info(hashes, pending=False, source=False, receive_hash=False, json_block=False, include_not_found=False)¶
- bootstrap(address, port, bypass_frontier_confirmation=False, _id='')¶
- bootstrap_any(force=False, _id='', account='')¶
- bootstrap_lazy(hash_, force=False, _id='')¶
- bootstrap_status()¶
https://docs.nano.org/commands/rpc-protocol/#bootstrap_status
- chain(block, count=1, offset=0, reverse=False)¶
- confirmation_active(announcements=0)¶
https://docs.nano.org/commands/rpc-protocol/#confirmation_active
- confirmation_height_currently_processing()¶
https://docs.nano.org/commands/rpc-protocol/#confirmation_height_currently_processing
- confirmation_history(_hash=None)¶
https://docs.nano.org/commands/rpc-protocol/#confirmation_history
- confirmation_info(root, contents=True, representatives=False, json_block=False)¶
https://docs.nano.org/commands/rpc-protocol/#confirmation_info
- confirmation_quorum(peer_details=False)¶
https://docs.nano.org/commands/rpc-protocol/#confirmation_quorum
- database_txn_tracker(min_read_time, min_write_time)¶
https://docs.nano.org/commands/rpc-protocol/#database_txn_tracker
- delegators(account, threshold=0, count=0, start='')¶
- delegators_count(account)¶
https://docs.nano.org/commands/rpc-protocol/#delegators_count
- deterministic_key(seed, index)¶
https://docs.nano.org/commands/rpc-protocol/#deterministic_key
- disconnect()¶
Close RPC connection. Only necessary for websocket connections.
- election_statistics()¶
https://docs.nano.org/commands/rpc-protocol/#election_statistics
- epoch_upgrade(epoch, key, count=0, threads=0)¶
- frontier_count()¶
- frontiers(account, count=1)¶
- keepalive(address, port)¶
- key_expand(key)¶
- ledger(account, count=1, representative=False, weight=False, receivable=False, modified_since=0, sorting=False, threshold=0)¶
- nano_to_raw(amount)¶
- node_id_delete()¶
- password_change(wallet, password)¶
https://docs.nano.org/commands/rpc-protocol/#password_change
- password_enter(wallet, password)¶
- password_valid(wallet)¶
- peers(peer_details=False)¶
- populate_backlog()¶
https://docs.nano.org/commands/rpc-protocol/#populate_backlog
- process(block, force=False, subtype=None, json_block=False, watch_work=True, _async=False)¶
- raw_to_nano(amount)¶
- receivable(account, count=0, threshold=0, source=False, include_active=False, min_version=False, sorting=False, include_only_confirmed=True)¶
- receivable_exists(_hash, include_active=False, include_only_confirmed=True)¶
https://docs.nano.org/commands/rpc-protocol/#receivable_exists
- receive(wallet, account, block, work=None)¶
- receive_minimum()¶
https://docs.nano.org/commands/rpc-protocol/#receive_minimum
- receive_minimum_set(amount)¶
https://docs.nano.org/commands/rpc-protocol/#receive_minimum_set
- representatives(count=1, sorting=False)¶
https://docs.nano.org/commands/rpc-protocol/#representatives
- representatives_online(weight=False, accounts=[])¶
https://docs.nano.org/commands/rpc-protocol/#representatives_online
- republish(_hash, count=1, sources=0, destinations=0)¶
- search_receivable(wallet)¶
https://docs.nano.org/commands/rpc-protocol/#search_receivable
- search_receivable_all()¶
https://docs.nano.org/commands/rpc-protocol/#search_receivable_all
- send(wallet, source, destination, amount, _id=None, work=None)¶
- sign(key='', wallet='', account='', block='', _hash='', json_block=False)¶
- stats(_type)¶
- successors(block, count=1, offset=0, reverse=False)¶
- telemetry(raw=False, address=0, port='7075')¶
- unchecked(json_block=False, count=1)¶
- unchecked_clear()¶
https://docs.nano.org/commands/rpc-protocol/#unchecked_clear
- unchecked_get(_hash, json_block=False)¶
- unchecked_keys(key, count=1, json_block=False)¶
- unopened(account=None, count=1, threshold=0)¶
- validate_account_number(account)¶
https://docs.nano.org/commands/rpc-protocol/#validate_account_number
- wallet_add(wallet, key, work=False)¶
- wallet_add_watch(wallet, accounts)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_add_watch
- wallet_balances(wallet, threshold=0)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_balances
- wallet_change_seed(wallet, seed, count=0)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_change_seed
- wallet_contains(wallet, account)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_contains
- wallet_create(seed='')¶
- wallet_destroy(wallet)¶
- wallet_export(wallet)¶
- wallet_frontiers(wallet)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_frontiers
- wallet_history(wallet, modified_since=0)¶
- wallet_info(wallet)¶
- wallet_ledger(wallet, representative=False, weight=False, receivable=False, modified_since=None)¶
- wallet_lock(wallet)¶
- wallet_locked(wallet)¶
- 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
- wallet_representative(wallet)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_representative
- wallet_representative_set(wallet, representative, update_existing_accounts=False)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_representative_set
- wallet_republish(wallet, count=1)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_republish
- wallet_work_get(wallet)¶
https://docs.nano.org/commands/rpc-protocol/#wallet_work_get
- work_cancel(_hash)¶
- work_generate(_hash, use_peers=False, difficulty=None, multiplier=0, account=None, version='work_1', block=None, json_block=False)¶
- work_get(wallet, account)¶
- work_peer_add(address, port)¶
- work_peers_clear()¶
https://docs.nano.org/commands/rpc-protocol/#work_peers_clear
- work_set(wallet, account, work)¶
- work_validate(work, _hash, difficulty=None, multiplier=0, version='work_1')¶