aboutsummaryrefslogtreecommitdiff
path: root/utils/python-rpc/framework/wallet.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/python-rpc/framework/wallet.py')
-rw-r--r--utils/python-rpc/framework/wallet.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/utils/python-rpc/framework/wallet.py b/utils/python-rpc/framework/wallet.py
index 8fa3eaafd..2010dae05 100644
--- a/utils/python-rpc/framework/wallet.py
+++ b/utils/python-rpc/framework/wallet.py
@@ -1139,3 +1139,45 @@ class Wallet(object):
'id': '0'
}
return self.rpc.send_json_rpc_request(frozen)
+
+ class BackgroundSyncOptions(object):
+ def __init__(self):
+ self.off = 'off'
+ self.reuse_password = 'reuse-wallet-password'
+ self.custom_password = 'custom-background-password'
+ background_sync_options = BackgroundSyncOptions()
+
+ def setup_background_sync(self, background_sync_type = background_sync_options.off, wallet_password = '', background_cache_password = ''):
+ setup_background_sync = {
+ 'method': 'setup_background_sync',
+ 'jsonrpc': '2.0',
+ 'params' : {
+ 'background_sync_type': background_sync_type,
+ 'wallet_password': wallet_password,
+ 'background_cache_password': background_cache_password,
+ },
+ 'id': '0'
+ }
+ return self.rpc.send_json_rpc_request(setup_background_sync)
+
+ def start_background_sync(self):
+ start_background_sync = {
+ 'method': 'start_background_sync',
+ 'jsonrpc': '2.0',
+ 'params' : {},
+ 'id': '0'
+ }
+ return self.rpc.send_json_rpc_request(start_background_sync)
+
+ def stop_background_sync(self, wallet_password = '', seed = '', seed_offset = ''):
+ stop_background_sync = {
+ 'method': 'stop_background_sync',
+ 'jsonrpc': '2.0',
+ 'params' : {
+ 'wallet_password': wallet_password,
+ 'seed': seed,
+ 'seed_offset': seed_offset,
+ },
+ 'id': '0'
+ }
+ return self.rpc.send_json_rpc_request(stop_background_sync)