Remove compatibility and most references to archaic version of Monero
This commit is contained in:
parent
864829b858
commit
3358e5a30a
|
@ -1,9 +1,6 @@
|
||||||
Addresses and payment IDs
|
Addresses and payment IDs
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
In Monero v0.11.x the wallet had only one address. This is changing now. A
|
|
||||||
concept of **subaddress** has been introduced.
|
|
||||||
|
|
||||||
The first, original address of the wallet is usually known as the *master
|
The first, original address of the wallet is usually known as the *master
|
||||||
address*. All others are just *subaddresses*, even if they represent a separate
|
address*. All others are just *subaddresses*, even if they represent a separate
|
||||||
account within the wallet.
|
account within the wallet.
|
||||||
|
|
|
@ -84,7 +84,7 @@ Or limit by both criteria at the same time:
|
||||||
In [3]: wallet.incoming(payment_id='f75ad90e25d71a12', min_height=1087601)
|
In [3]: wallet.incoming(payment_id='f75ad90e25d71a12', min_height=1087601)
|
||||||
Out[3]: [in: f34b495cec77822a70f829ec8a5a7f1e727128d62e6b1438e9cb7799654d610e @ 1087601 3.000000000000 id=f75ad90e25d71a12]
|
Out[3]: [in: f34b495cec77822a70f829ec8a5a7f1e727128d62e6b1438e9cb7799654d610e @ 1087601 3.000000000000 id=f75ad90e25d71a12]
|
||||||
|
|
||||||
With Monero releases > 0.11.x you will be also able to filter payments by the address:
|
You may also filter payments by the address:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
Using wallet and accounts
|
Using wallet and accounts
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
The wallet, up to Monero 'Helium Hydra' (0.11.x) release, had only single
|
Since Monero 'Helium Hydra' (0.11.x) the wallet handles accounts and deterministically
|
||||||
address and no concept of accounts. This will change with the next version
|
generated addresses, known as *subaddresses*.
|
||||||
which is planned to be published in March 2018 and already is available for
|
|
||||||
testing.
|
|
||||||
|
|
||||||
The wallet
|
The wallet
|
||||||
----------
|
----------
|
||||||
|
@ -26,15 +24,11 @@ addresses:
|
||||||
Accounts and subaddresses
|
Accounts and subaddresses
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
The following part may look strange if you are still using v0.11.x, because the
|
|
||||||
concept of multiple accounts and subaddresses didn't exist back then.
|
|
||||||
|
|
||||||
The accounts are stored in wallet's ``accounts`` attribute, which is a list.
|
The accounts are stored in wallet's ``accounts`` attribute, which is a list.
|
||||||
|
|
||||||
Regardless of the version, **the wallet by default operates on its account of
|
Regardless of the version, **the wallet by default operates on its account of
|
||||||
index 0**, which makes it consistent with the behavior of the CLI wallet
|
index 0**, which makes it consistent with the behavior of the CLI wallet
|
||||||
client. On v0.11 the following code will work, even though it doesn't make much
|
client.
|
||||||
sense.
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -58,8 +52,6 @@ Every wallet can have separate accounts and each account can have numerous
|
||||||
addresses. The ``Wallet.new_account()`` and ``Account.new_address()`` will
|
addresses. The ``Wallet.new_account()`` and ``Account.new_address()`` will
|
||||||
create new instances.
|
create new instances.
|
||||||
|
|
||||||
(This snippet will fail on Monero v0.11.x)
|
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
In [9]: w.new_address()
|
In [9]: w.new_address()
|
||||||
|
|
|
@ -130,7 +130,6 @@ class JSONRPCWallet(object):
|
||||||
return self.raw_request('getheight')['height']
|
return self.raw_request('getheight')['height']
|
||||||
|
|
||||||
def spend_key(self):
|
def 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']
|
return self.raw_request('query_key', {'key_type': 'spend_key'})['key']
|
||||||
|
|
||||||
def view_key(self):
|
def view_key(self):
|
||||||
|
@ -158,10 +157,6 @@ class JSONRPCWallet(object):
|
||||||
|
|
||||||
def addresses(self, account=0):
|
def addresses(self, account=0):
|
||||||
_addresses = self.raw_request('getaddress', {'account_index': account})
|
_addresses = self.raw_request('getaddress', {'account_index': account})
|
||||||
if 'addresses' not in _addresses:
|
|
||||||
# monero <= 0.11
|
|
||||||
_log.debug('Monero <= 0.11 found, assuming single address')
|
|
||||||
return [Address(_addresses['address'])]
|
|
||||||
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
|
addresses = [None] * (max(map(operator.itemgetter('address_index'), _addresses['addresses'])) + 1)
|
||||||
for _addr in _addresses['addresses']:
|
for _addr in _addresses['addresses']:
|
||||||
addresses[_addr['address_index']] = address(
|
addresses[_addr['address_index']] = address(
|
||||||
|
@ -329,10 +324,6 @@ class JSONRPCWallet(object):
|
||||||
if 'error' in result:
|
if 'error' in result:
|
||||||
err = result['error']
|
err = result['error']
|
||||||
_log.error(u"JSON RPC error:\n{result}".format(result=_ppresult))
|
_log.error(u"JSON RPC error:\n{result}".format(result=_ppresult))
|
||||||
# XXX: workaround for 0.11 bug throwing a wrong error code
|
|
||||||
if err['code'] == -4 and 'not enough money' in err['message']:
|
|
||||||
raise exceptions.NotEnoughMoney(err['message'])
|
|
||||||
#
|
|
||||||
if err['code'] in _err2exc:
|
if err['code'] in _err2exc:
|
||||||
raise _err2exc[err['code']](err['message'])
|
raise _err2exc[err['code']](err['message'])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -15,9 +15,10 @@ class Wallet(object):
|
||||||
|
|
||||||
Provides interface to operate on a wallet.
|
Provides interface to operate on a wallet.
|
||||||
|
|
||||||
Wallet consists of :class:`accounts <monero.account.Account>`. In Monero 0.11 and earlier the wallet has only a single account
|
A wallet consists of :class:`accounts <monero.account.Account>`. Fresh wallets start
|
||||||
with index 0. In later versions there might be multiple accounts, but a fresh wallet starts
|
with only one account but you may create more. Although it's possible to combine funds
|
||||||
with only one.
|
from different accounts, or even wallets, in a single transaction, this code closely
|
||||||
|
follows the idea of separation introduced in the original wallet software.
|
||||||
|
|
||||||
The list of accounts will be initialized under the `accounts` attribute.
|
The list of accounts will be initialized under the `accounts` attribute.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue