Skip to content

Commit

Permalink
rpc 08f1930, v24
Browse files Browse the repository at this point in the history
  • Loading branch information
npy0 committed Feb 6, 2023
1 parent 7c602bc commit 7b25760
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
42 changes: 24 additions & 18 deletions nanopy/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down Expand Up @@ -319,7 +319,7 @@ def blocks_info(
hashes,
pending=False,
source=False,
balance=False,
receive_hash=False,
json_block=False,
include_not_found=False,
):
Expand All @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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,
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7b25760

Please sign in to comment.