2021-12-25 02:16:58 +01:00
|
|
|
#!/bin/python3
|
2022-06-09 23:04:49 +02:00
|
|
|
from collections import namedtuple
|
2022-06-14 23:26:57 +02:00
|
|
|
import json, uuid, requests, hashlib
|
2022-06-07 19:25:14 +02:00
|
|
|
from pprint import pprint
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
CURRENT_VERSION = 1
|
|
|
|
|
2022-06-11 03:07:55 +02:00
|
|
|
WalletState = namedtuple('WalletState', ['sequence', 'encrypted_wallet'])
|
|
|
|
|
2022-06-14 02:42:56 +02:00
|
|
|
class LBRYSDK():
|
|
|
|
# TODO - error checking
|
|
|
|
@staticmethod
|
|
|
|
def get_wallet(wallet_id, password):
|
|
|
|
response = requests.post('http://localhost:5279', json.dumps({
|
|
|
|
"method": "sync_apply",
|
|
|
|
"params": {
|
|
|
|
"password": password,
|
|
|
|
"wallet_id": wallet_id,
|
|
|
|
},
|
|
|
|
}))
|
|
|
|
return response.json()['result']['data']
|
|
|
|
|
|
|
|
# TODO - error checking
|
|
|
|
@staticmethod
|
|
|
|
def update_wallet(wallet_id, password, data):
|
|
|
|
response = requests.post('http://localhost:5279', json.dumps({
|
|
|
|
"method": "sync_apply",
|
|
|
|
"params": {
|
|
|
|
"data": data,
|
|
|
|
"password": password,
|
|
|
|
"wallet_id": wallet_id,
|
|
|
|
},
|
|
|
|
}))
|
|
|
|
return response.json()['result']['data']
|
|
|
|
|
|
|
|
# TODO - error checking
|
|
|
|
@staticmethod
|
2022-06-16 04:21:00 +02:00
|
|
|
def set_preference(wallet_id, key, value):
|
2022-06-14 02:42:56 +02:00
|
|
|
response = requests.post('http://localhost:5279', json.dumps({
|
|
|
|
"method": "preference_set",
|
|
|
|
"params": {
|
|
|
|
"key": key,
|
|
|
|
"value": value,
|
2022-06-16 04:21:00 +02:00
|
|
|
"wallet_id": wallet_id,
|
2022-06-14 02:42:56 +02:00
|
|
|
},
|
|
|
|
}))
|
|
|
|
return response.json()['result']
|
|
|
|
|
|
|
|
# TODO - error checking
|
|
|
|
@staticmethod
|
2022-06-16 04:21:00 +02:00
|
|
|
def get_preferences(wallet_id):
|
2022-06-14 02:42:56 +02:00
|
|
|
response = requests.post('http://localhost:5279', json.dumps({
|
|
|
|
"method": "preference_get",
|
2022-06-16 04:21:00 +02:00
|
|
|
"params": {
|
|
|
|
"wallet_id": wallet_id,
|
|
|
|
},
|
2022-06-14 02:42:56 +02:00
|
|
|
}))
|
|
|
|
return response.json()['result']
|
|
|
|
|
2022-06-11 03:07:55 +02:00
|
|
|
class WalletSync():
|
2022-06-16 17:46:29 +02:00
|
|
|
def __init__(self, local):
|
|
|
|
if local:
|
|
|
|
BASE_URL = 'http://localhost:8090'
|
|
|
|
else:
|
|
|
|
BASE_URL = 'https://dev.lbry.id:8091'
|
|
|
|
self.AUTH_URL = BASE_URL + '/auth/full'
|
|
|
|
self.REGISTER_URL = BASE_URL + '/signup'
|
|
|
|
self.WALLET_URL = BASE_URL + '/wallet'
|
2022-06-11 03:07:55 +02:00
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
def register(self, email, password):
|
2022-06-11 03:07:55 +02:00
|
|
|
body = json.dumps({
|
|
|
|
'email': email,
|
|
|
|
'password': password,
|
|
|
|
})
|
2022-06-16 17:46:29 +02:00
|
|
|
response = requests.post(self.REGISTER_URL, body)
|
2022-06-11 03:07:55 +02:00
|
|
|
if response.status_code != 201:
|
|
|
|
print ('Error', response.status_code)
|
|
|
|
print (response.content)
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
def get_auth_token(self, email, password, device_id):
|
2022-06-11 03:07:55 +02:00
|
|
|
body = json.dumps({
|
|
|
|
'email': email,
|
|
|
|
'password': password,
|
|
|
|
'deviceId': device_id,
|
|
|
|
})
|
2022-06-16 17:46:29 +02:00
|
|
|
response = requests.post(self.AUTH_URL, body)
|
2022-06-11 03:07:55 +02:00
|
|
|
if response.status_code != 200:
|
|
|
|
print ('Error', response.status_code)
|
|
|
|
print (response.content)
|
|
|
|
return None
|
|
|
|
|
|
|
|
return response.json()['token']
|
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
def get_wallet(self, token):
|
2022-06-11 03:07:55 +02:00
|
|
|
params = {
|
|
|
|
'token': token,
|
|
|
|
}
|
2022-06-16 17:46:29 +02:00
|
|
|
response = requests.get(self.WALLET_URL, params=params)
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
# TODO check response version on client side now
|
2022-06-14 16:58:45 +02:00
|
|
|
if response.status_code == 404:
|
|
|
|
print ('Wallet not found')
|
|
|
|
# "No wallet" is not an error, so no exception raised
|
|
|
|
return None, None
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
if response.status_code != 200:
|
|
|
|
print ('Error', response.status_code)
|
|
|
|
print (response.content)
|
2022-06-14 16:58:45 +02:00
|
|
|
raise Exception("Unexpected status code")
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
wallet_state = WalletState(
|
|
|
|
encrypted_wallet=response.json()['encryptedWallet'],
|
|
|
|
sequence=response.json()['sequence'],
|
|
|
|
)
|
|
|
|
hmac = response.json()['hmac']
|
|
|
|
return wallet_state, hmac
|
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
def update_wallet(self, wallet_state, hmac, token):
|
2022-06-11 03:07:55 +02:00
|
|
|
body = json.dumps({
|
|
|
|
'version': CURRENT_VERSION,
|
|
|
|
'token': token,
|
|
|
|
"encryptedWallet": wallet_state.encrypted_wallet,
|
|
|
|
"sequence": wallet_state.sequence,
|
|
|
|
"hmac": hmac,
|
|
|
|
})
|
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
response = requests.post(self.WALLET_URL, body)
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
# TODO check that response.json().version == CURRENT_VERSION
|
|
|
|
|
|
|
|
if response.status_code == 200:
|
|
|
|
conflict = False
|
|
|
|
print ('Successfully updated wallet state on server')
|
|
|
|
elif response.status_code == 409:
|
|
|
|
conflict = True
|
|
|
|
print ('Wallet state out of date. Getting updated wallet state. Try posting again after this.')
|
|
|
|
# Not an error! We still want to merge in the returned wallet.
|
|
|
|
else:
|
|
|
|
print ('Error', response.status_code)
|
|
|
|
print (response.content)
|
2022-06-14 16:58:45 +02:00
|
|
|
raise Exception("Unexpected status code")
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
wallet_state = WalletState(
|
|
|
|
encrypted_wallet=response.json()['encryptedWallet'],
|
|
|
|
sequence=response.json()['sequence'],
|
|
|
|
)
|
|
|
|
hmac = response.json()['hmac']
|
|
|
|
return wallet_state, hmac, conflict
|
2022-06-09 23:04:49 +02:00
|
|
|
|
|
|
|
# TODO - do this correctly. This is a hack example.
|
|
|
|
def derive_login_password(root_password):
|
2022-06-14 16:59:15 +02:00
|
|
|
return hashlib.sha256(('login:' + root_password).encode('utf-8')).hexdigest()
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
# TODO - do this correctly. This is a hack example.
|
|
|
|
def derive_sdk_password(root_password):
|
2022-06-14 16:59:15 +02:00
|
|
|
return hashlib.sha256(('sdk:' + root_password).encode('utf-8')).hexdigest()
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
# TODO - do this correctly. This is a hack example.
|
2022-06-14 16:59:15 +02:00
|
|
|
# TODO - wallet_id in this? or in all of the derivations?
|
2022-06-09 23:04:49 +02:00
|
|
|
def derive_hmac_key(root_password):
|
2022-06-14 16:59:15 +02:00
|
|
|
return hashlib.sha256(('hmac:' + root_password).encode('utf-8')).hexdigest()
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
# TODO - do this correctly. This is a hack example.
|
|
|
|
def create_hmac(wallet_state, hmac_key):
|
|
|
|
input_str = hmac_key + ':' + str(wallet_state.sequence) + ':' + wallet_state.encrypted_wallet
|
|
|
|
return hashlib.sha256(input_str.encode('utf-8')).hexdigest()
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
def check_hmac(wallet_state, hmac_key, hmac):
|
|
|
|
return hmac == create_hmac(wallet_state, hmac_key)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
|
|
|
class Client():
|
2022-06-10 21:05:07 +02:00
|
|
|
# If you want to get the lastSynced stuff back, see:
|
|
|
|
# 512ebe3e95bf4e533562710a7f91c59616a9a197
|
|
|
|
# It's mostly simple, but the _validate_new_wallet_state changes may be worth
|
|
|
|
# looking at.
|
2021-12-25 02:16:58 +01:00
|
|
|
def _validate_new_wallet_state(self, new_wallet_state):
|
2022-06-13 02:37:18 +02:00
|
|
|
if self.synced_wallet_state is None:
|
2021-12-25 02:16:58 +01:00
|
|
|
# All of the validations here are in reference to what the device already
|
|
|
|
# has. If this device is getting a wallet state for the first time, there
|
|
|
|
# is no basis for comparison.
|
|
|
|
return True
|
|
|
|
|
|
|
|
# Make sure that the new sequence is overall later.
|
2022-06-13 02:37:18 +02:00
|
|
|
if new_wallet_state.sequence <= self.synced_wallet_state.sequence:
|
2021-12-25 02:16:58 +01:00
|
|
|
return False
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
def __init__(self, email, root_password, wallet_id='default_wallet', local=False):
|
2021-12-25 02:16:58 +01:00
|
|
|
# Represents normal client behavior (though a real client will of course save device id)
|
|
|
|
self.device_id = str(uuid.uuid4())
|
|
|
|
|
|
|
|
self.auth_token = 'bad token'
|
|
|
|
|
2022-06-13 02:37:18 +02:00
|
|
|
self.synced_wallet_state = None
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
self.email = email
|
|
|
|
self.root_password = root_password
|
|
|
|
self.wallet_id = wallet_id
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-16 17:46:29 +02:00
|
|
|
self.wallet_sync_api = WalletSync(local=local)
|
|
|
|
|
2022-06-07 19:25:14 +02:00
|
|
|
# TODO - This does not deal with the question of tying accounts to wallets.
|
|
|
|
# Does a new wallet state mean a we're creating a new account? What happens
|
|
|
|
# if we create a new wallet state tied to an existing account? Do we merge it
|
|
|
|
# with what's on the server anyway? Do we refuse to merge, or warn the user?
|
|
|
|
# Etc. This sort of depends on how the LBRY Desktop/SDK usually behave. For
|
|
|
|
# now, it'll end up just merging any un-saved local changes with whatever is
|
|
|
|
# on the server.
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
# TODO - Later, we should be saving the synced_wallet_state to disk, or
|
|
|
|
# something like that, so we know whether there are unpushed changes on
|
|
|
|
# startup (which should be uncommon but possible if crash or network problem
|
|
|
|
# in previous run). This will be important when the client is responsible for
|
|
|
|
# merging what comes from the server with those local unpushed changes. For
|
|
|
|
# now, the SDK handles merges with timestamps and such so it's as safe as
|
|
|
|
# always to just merge in.
|
|
|
|
|
|
|
|
# TODO - Be careful of cases where get_remote_wallet comes back with "Not
|
|
|
|
# Found" even though a wallet is actually on the server. We would start with
|
|
|
|
# sequence=0 with the local encrypted wallet. Then next time we
|
|
|
|
# get_remote_wallet, it returns the actual wallet, let's say sequence=5, and
|
|
|
|
# it would write over what's locally saved. With the SDK as it is using
|
|
|
|
# sync_apply, that's okay because it has a decent way of merging it. However
|
|
|
|
# when the Desktop is in charge of merging, this could be a hazard. Saving
|
|
|
|
# the state to disk could help. Or perhaps pushing first before pulling. Or
|
|
|
|
# maybe if we're writing over sequence=0, we can know we should be "merging"
|
|
|
|
# the local encrypted wallet with whatever comes from the server.
|
2022-06-16 04:21:00 +02:00
|
|
|
|
|
|
|
# TODO - what if two clients initialize, make changes, and then both push?
|
|
|
|
# We'll need a way to "merge" from a merge base of an empty wallet.
|
2022-06-14 23:26:57 +02:00
|
|
|
def init_wallet_state(self):
|
|
|
|
if self.get_remote_wallet() == "Not Found":
|
|
|
|
print("No wallet found on the server for this account. Starting a new one.")
|
|
|
|
|
|
|
|
# Represents what's been synced to the wallet sync server. It starts with
|
|
|
|
# sequence=0 which means nothing has been synced yet. We start with
|
|
|
|
# whatever is in the SDK. Whether it's new or not, we (who choose to run
|
|
|
|
# this method) are assuming it's not synced yet.
|
|
|
|
self.synced_wallet_state = WalletState(
|
|
|
|
sequence=0,
|
|
|
|
encrypted_wallet=self.get_local_encrypted_wallet()
|
|
|
|
)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
|
|
|
def register(self):
|
2022-06-16 17:46:29 +02:00
|
|
|
success = self.wallet_sync_api.register(
|
2022-06-11 03:07:55 +02:00
|
|
|
self.email,
|
|
|
|
derive_login_password(self.root_password),
|
|
|
|
)
|
|
|
|
if success:
|
|
|
|
print ("Registered")
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-08 00:24:01 +02:00
|
|
|
def get_auth_token(self):
|
2022-06-16 17:46:29 +02:00
|
|
|
token = self.wallet_sync_api.get_auth_token(
|
2022-06-11 03:07:55 +02:00
|
|
|
self.email,
|
|
|
|
derive_login_password(self.root_password),
|
|
|
|
self.device_id,
|
|
|
|
)
|
|
|
|
if not token:
|
2021-12-25 02:16:58 +01:00
|
|
|
return
|
2022-06-11 03:07:55 +02:00
|
|
|
self.auth_token = token
|
2021-12-25 02:16:58 +01:00
|
|
|
print ("Got auth token: ", self.auth_token)
|
|
|
|
|
2022-06-07 19:25:14 +02:00
|
|
|
# TODO - What about cases where we are managing multiple different wallets?
|
|
|
|
# Some will have lower sequences. If you accidentally mix it up client-side,
|
2022-06-14 23:26:57 +02:00
|
|
|
# you might end up overwriting one wallet with another if the former has a
|
|
|
|
# higher sequence number. Maybe we want to annotate them with which account
|
|
|
|
# we're talking about. Again, we should see how LBRY Desktop/SDK deal with
|
|
|
|
# it.
|
|
|
|
|
|
|
|
# Returns: status
|
|
|
|
def get_remote_wallet(self):
|
2022-06-16 17:46:29 +02:00
|
|
|
new_wallet_state, hmac = self.wallet_sync_api.get_wallet(self.auth_token)
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
if not new_wallet_state:
|
2022-06-14 23:26:57 +02:00
|
|
|
# Wallet not found, but this is not an error
|
|
|
|
return "Not Found"
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
hmac_key = derive_hmac_key(self.root_password)
|
|
|
|
if not check_hmac(new_wallet_state, hmac_key, hmac):
|
2022-06-07 19:25:14 +02:00
|
|
|
print ('Error - bad hmac on new wallet')
|
2022-06-11 03:07:55 +02:00
|
|
|
print (new_wallet_state, hmac)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Error"
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-13 02:37:18 +02:00
|
|
|
if self.synced_wallet_state != new_wallet_state and not self._validate_new_wallet_state(new_wallet_state):
|
2021-12-25 02:16:58 +01:00
|
|
|
print ('Error - new wallet does not validate')
|
2022-06-13 02:37:18 +02:00
|
|
|
print ('current:', self.synced_wallet_state)
|
2022-06-11 03:07:55 +02:00
|
|
|
print ('got:', new_wallet_state)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Error"
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-13 02:37:18 +02:00
|
|
|
self.synced_wallet_state = new_wallet_state
|
2022-06-14 23:26:57 +02:00
|
|
|
# TODO errors? sequence of events? This isn't gonna be quite right. Look at state diagrams.
|
|
|
|
self.update_local_encrypted_wallet(new_wallet_state.encrypted_wallet)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-07 19:25:14 +02:00
|
|
|
print ("Got latest walletState:")
|
2022-06-13 02:37:18 +02:00
|
|
|
pprint(self.synced_wallet_state)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Success"
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
# Returns: status
|
|
|
|
def update_remote_wallet(self):
|
2021-12-25 02:16:58 +01:00
|
|
|
# Create a *new* wallet state, indicating that it was last updated by this
|
|
|
|
# device, with the updated sequence, and include our local encrypted wallet changes.
|
2022-06-13 02:37:18 +02:00
|
|
|
# Don't set self.synced_wallet_state to this until we know that it's accepted by
|
2021-12-25 02:16:58 +01:00
|
|
|
# the server.
|
2022-06-13 02:37:18 +02:00
|
|
|
if not self.synced_wallet_state:
|
2022-06-07 19:25:14 +02:00
|
|
|
print ("No wallet state to post.")
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Error"
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
hmac_key = derive_hmac_key(self.root_password)
|
2022-06-07 19:25:14 +02:00
|
|
|
|
2022-06-09 23:04:49 +02:00
|
|
|
submitted_wallet_state = WalletState(
|
2022-06-14 23:26:57 +02:00
|
|
|
encrypted_wallet=self.get_local_encrypted_wallet(),
|
2022-06-13 02:37:18 +02:00
|
|
|
sequence=self.synced_wallet_state.sequence + 1
|
2022-06-09 23:04:49 +02:00
|
|
|
)
|
2022-06-11 03:07:55 +02:00
|
|
|
hmac = create_hmac(submitted_wallet_state, hmac_key)
|
2022-06-09 23:04:49 +02:00
|
|
|
|
2022-06-11 03:07:55 +02:00
|
|
|
# Submit our wallet, get the latest wallet back as a response
|
2022-06-16 17:46:29 +02:00
|
|
|
new_wallet_state, new_hmac, conflict = self.wallet_sync_api.update_wallet(submitted_wallet_state, hmac, self.auth_token)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
# TODO - there's some code in common here with the get_remote_wallet function. factor it out.
|
2022-06-11 03:07:55 +02:00
|
|
|
|
|
|
|
if not check_hmac(new_wallet_state, hmac_key, new_hmac):
|
2022-06-07 19:25:14 +02:00
|
|
|
print ('Error - bad hmac on new wallet')
|
2022-06-11 03:07:55 +02:00
|
|
|
print (new_wallet_state, hmac)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Error"
|
2021-12-25 02:16:58 +01:00
|
|
|
|
|
|
|
if submitted_wallet_state != new_wallet_state and not self._validate_new_wallet_state(new_wallet_state):
|
|
|
|
print ('Error - new wallet does not validate')
|
2022-06-13 02:37:18 +02:00
|
|
|
print ('current:', self.synced_wallet_state)
|
2022-06-11 03:07:55 +02:00
|
|
|
print ('got:', new_wallet_state)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Error"
|
2022-06-13 02:37:18 +02:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
# TODO - `concflict` determines whether we need to a smart merge here.
|
|
|
|
# However for now the SDK handles all of that.
|
2022-06-13 02:37:18 +02:00
|
|
|
self.synced_wallet_state = new_wallet_state
|
2022-06-14 23:26:57 +02:00
|
|
|
# TODO errors? sequence of events? This isn't gonna be quite right. Look at state diagrams.
|
|
|
|
self.update_local_encrypted_wallet(new_wallet_state.encrypted_wallet)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-07 19:25:14 +02:00
|
|
|
print ("Got new walletState:")
|
2022-06-13 02:37:18 +02:00
|
|
|
pprint(self.synced_wallet_state)
|
2022-06-14 23:26:57 +02:00
|
|
|
return "Success"
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
def set_preference(self, key, value):
|
|
|
|
# TODO - error checking
|
2022-06-16 04:21:00 +02:00
|
|
|
return LBRYSDK.set_preference(self.wallet_id, key, value)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
def get_preferences(self):
|
|
|
|
# TODO - error checking
|
2022-06-16 04:21:00 +02:00
|
|
|
return LBRYSDK.get_preferences(self.wallet_id)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
def update_local_encrypted_wallet(self, encrypted_wallet):
|
|
|
|
# TODO - error checking
|
|
|
|
return LBRYSDK.update_wallet(self.wallet_id, derive_sdk_password(self.root_password), encrypted_wallet)
|
2021-12-25 02:16:58 +01:00
|
|
|
|
2022-06-14 23:26:57 +02:00
|
|
|
def get_local_encrypted_wallet(self):
|
|
|
|
# TODO - error checking
|
|
|
|
return LBRYSDK.get_wallet(self.wallet_id, derive_sdk_password(self.root_password))
|