aboutsummaryrefslogtreecommitdiff
path: root/utils/python-rpc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/python-rpc')
-rw-r--r--utils/python-rpc/framework/daemon.py3
-rw-r--r--utils/python-rpc/framework/wallet.py24
2 files changed, 22 insertions, 5 deletions
diff --git a/utils/python-rpc/framework/daemon.py b/utils/python-rpc/framework/daemon.py
index f4d5e90f0..04fc5b5cf 100644
--- a/utils/python-rpc/framework/daemon.py
+++ b/utils/python-rpc/framework/daemon.py
@@ -50,10 +50,11 @@ class Daemon(object):
}
return self.rpc.send_json_rpc_request(getblocktemplate)
- def send_raw_transaction(self, tx_as_hex, do_not_relay = False):
+ def send_raw_transaction(self, tx_as_hex, do_not_relay = False, do_sanity_checks = True):
send_raw_transaction = {
'tx_as_hex': tx_as_hex,
'do_not_relay': do_not_relay,
+ 'do_sanity_checks': do_sanity_checks,
}
return self.rpc.send_request("/send_raw_transaction", send_raw_transaction)
diff --git a/utils/python-rpc/framework/wallet.py b/utils/python-rpc/framework/wallet.py
index 29f97e982..695325a86 100644
--- a/utils/python-rpc/framework/wallet.py
+++ b/utils/python-rpc/framework/wallet.py
@@ -286,7 +286,7 @@ class Wallet(object):
}
return self.rpc.send_json_rpc_request(query_key)
- def restore_deterministic_wallet(self, seed = '', seed_offset = '', filename = '', restore_height = 0, password = '', language = ''):
+ def restore_deterministic_wallet(self, seed = '', seed_offset = '', filename = '', restore_height = 0, password = '', language = '', autosave_current = True):
restore_deterministic_wallet = {
'method': 'restore_deterministic_wallet',
'params' : {
@@ -295,14 +295,15 @@ class Wallet(object):
'seed': seed,
'seed_offset': seed_offset,
'password': password,
- 'language': language
+ 'language': language,
+ 'autosave_current': autosave_current,
},
'jsonrpc': '2.0',
'id': '0'
}
return self.rpc.send_json_rpc_request(restore_deterministic_wallet)
- def generate_from_keys(self, restore_height = 0, filename = "", password = "", address = "", spendkey = "", viewkey = ""):
+ def generate_from_keys(self, restore_height = 0, filename = "", password = "", address = "", spendkey = "", viewkey = "", autosave_current = True):
generate_from_keys = {
'method': 'generate_from_keys',
'params' : {
@@ -312,16 +313,31 @@ class Wallet(object):
'spendkey': spendkey,
'viewkey': viewkey,
'password': password,
+ 'autosave_current': autosave_current,
},
'jsonrpc': '2.0',
'id': '0'
}
return self.rpc.send_json_rpc_request(generate_from_keys)
- def close_wallet(self):
+ def open_wallet(self, filename, password='', autosave_current = True):
+ open_wallet = {
+ 'method': 'open_wallet',
+ 'params' : {
+ 'filename': filename,
+ 'password': password,
+ 'autosave_current': autosave_current,
+ },
+ 'jsonrpc': '2.0',
+ 'id': '0'
+ }
+ return self.rpc.send_json_rpc_request(open_wallet)
+
+ def close_wallet(self, autosave_current = True):
close_wallet = {
'method': 'close_wallet',
'params' : {
+ 'autosave_current': autosave_current
},
'jsonrpc': '2.0',
'id': '0'