mirror of
https://git.wownero.com/lza_menace/wownero-python.git
synced 2024-08-15 03:25:25 +00:00
Update to recent Monero project state
This commit is contained in:
parent
a16ae37a94
commit
090ef0c984
3 changed files with 13 additions and 1 deletions
|
@ -116,6 +116,10 @@ class JSONRPCWallet(object):
|
|||
def get_height(self):
|
||||
return self.raw_request('getheight')['height']
|
||||
|
||||
def get_spend_key(self):
|
||||
# NOTE: This will fail on 0.11.x, the method was missing
|
||||
return self.raw_request('query_key', {'key_type': 'spend_key'})['key']
|
||||
|
||||
def get_view_key(self):
|
||||
return self.raw_request('query_key', {'key_type': 'view_key'})['key']
|
||||
|
||||
|
@ -305,11 +309,11 @@ class MethodNotFound(RPCError):
|
|||
|
||||
_err2exc = {
|
||||
-2: exceptions.WrongAddress,
|
||||
-4: exceptions.NotEnoughUnlockedMoney,
|
||||
-5: exceptions.WrongPaymentId,
|
||||
-8: exceptions.TransactionNotFound,
|
||||
-16: exceptions.TransactionNotPossible,
|
||||
-17: exceptions.NotEnoughMoney,
|
||||
-20: exceptions.AmountIsZero,
|
||||
-37: exceptions.NotEnoughUnlockedMoney, # PR pending: https://github.com/monero-project/monero/pull/3197
|
||||
-32601: MethodNotFound,
|
||||
}
|
||||
|
|
|
@ -28,6 +28,12 @@ class Wallet(object):
|
|||
"""
|
||||
return self._backend.get_height()
|
||||
|
||||
def get_spend_key(self):
|
||||
"""
|
||||
Returns private spend key.
|
||||
"""
|
||||
return self._backend.get_spend_key()
|
||||
|
||||
def get_view_key(self):
|
||||
"""
|
||||
Returns private view key.
|
||||
|
|
|
@ -60,10 +60,12 @@ print(
|
|||
unlocked=w.get_balance(unlocked=True)))
|
||||
print(
|
||||
"Keys:\n" \
|
||||
" private spend: {ssk}\n" \
|
||||
" private view: {svk}\n" \
|
||||
" public spend: {psk}\n" \
|
||||
" public view: {pvk}\n\n" \
|
||||
"Seed:\n{seed}".format(
|
||||
ssk=w.get_spend_key(),
|
||||
svk=w.get_view_key(),
|
||||
psk=masteraddr.get_spend_key(),
|
||||
pvk=masteraddr.get_view_key(),
|
||||
|
|
Loading…
Reference in a new issue