From 7b257602dcacc2bd87f9aadfb153f1a562631f5a Mon Sep 17 00:00:00 2001 From: npy <42086377+npy0@users.noreply.github.com> Date: Mon, 6 Feb 2023 17:06:11 +0100 Subject: [PATCH] rpc 08f1930, v24 --- LICENSE | 2 +- nanopy/rpc.py | 42 ++++++++++++++++++++++++------------------ setup.py | 2 +- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/LICENSE b/LICENSE index 6dbcb26..d044e33 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 npy0 +Copyright (c) 2023 npy0 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/nanopy/rpc.py b/nanopy/rpc.py index f15b134..3394509 100644 --- a/nanopy/rpc.py +++ b/nanopy/rpc.py @@ -177,7 +177,7 @@ def accounts_frontiers(self, accounts): data["accounts"] = accounts return self._post(data) - def accounts_pending( + def accounts_receivable( self, accounts, count=1, @@ -187,9 +187,9 @@ def accounts_pending( sorting=False, include_only_confirmed=True, ): - "https://docs.nano.org/commands/rpc-protocol/#accounts_pending" + "https://docs.nano.org/commands/rpc-protocol/#accounts_receivable" data = {} - data["action"] = "accounts_pending" + data["action"] = "accounts_receivable" data["accounts"] = accounts data["count"] = count if threshold: @@ -319,7 +319,7 @@ def blocks_info( hashes, pending=False, source=False, - balance=False, + receive_hash=False, json_block=False, include_not_found=False, ): @@ -331,8 +331,8 @@ def blocks_info( data["pending"] = True if source: data["source"] = True - if balance: - data["balance"] = True + if receive_hash: + data["receive_hash"] = True if json_block: data["json_block"] = True if include_not_found: @@ -568,6 +568,12 @@ def peers(self, peer_details=False): data["peer_details"] = True return self._post(data) + def populate_backlog(self): + "https://docs.nano.org/commands/rpc-protocol/#populate_backlog" + data = {} + data["action"] = "populate_backlog" + return self._post(data) + def process( self, block, @@ -978,17 +984,17 @@ def receive_minimum_set(self, amount): data["amount"] = amount return self._post(data) - def search_pending(self, wallet): - "https://docs.nano.org/commands/rpc-protocol/#search_pending" + def search_receivable(self, wallet): + "https://docs.nano.org/commands/rpc-protocol/#search_receivable" data = {} - data["action"] = "search_pending" + data["action"] = "search_receivable" data["wallet"] = wallet return self._post(data) - def search_pending_all(self): - "https://docs.nano.org/commands/rpc-protocol/#search_pending_all" + def search_receivable_all(self): + "https://docs.nano.org/commands/rpc-protocol/#search_receivable_all" data = {} - data["action"] = "search_pending_all" + data["action"] = "search_receivable_all" return self._post(data) def send(self, wallet, source, destination, amount, _id=None, work=None): @@ -1005,14 +1011,14 @@ def send(self, wallet, source, destination, amount, _id=None, work=None): data["work"] = work return self._post(data) - def wallet_add(self, wallet, key, work=True): + def wallet_add(self, wallet, key, work=False): "https://docs.nano.org/commands/rpc-protocol/#wallet_add" data = {} data["action"] = "wallet_add" data["wallet"] = wallet data["key"] = key - if not work: - data["work"] = False + if work: + data["work"] = True return self._post(data) def wallet_add_watch(self, wallet, accounts): @@ -1131,7 +1137,7 @@ def wallet_locked(self, wallet): data["wallet"] = wallet return self._post(data) - def wallet_pending( + def wallet_receivable( self, wallet, count=1, @@ -1141,9 +1147,9 @@ def wallet_pending( min_version=False, include_only_confirmed=True, ): - "https://docs.nano.org/commands/rpc-protocol/#wallet_pending" + "https://docs.nano.org/commands/rpc-protocol/#wallet_receivable" data = {} - data["action"] = "wallet_pending" + data["action"] = "wallet_receivable" data["wallet"] = wallet data["count"] = count if threshold: diff --git a/setup.py b/setup.py index f7f2184..9999c63 100644 --- a/setup.py +++ b/setup.py @@ -162,7 +162,7 @@ def get_ed25519_blake2b_ext_kwargs(use_vc=False, platform=None): setup( name="nanopy", - version="23.0", + version="24.0", packages=["nanopy"], url="https://github.com/npy0/nanopy", license="MIT",