Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #285 from lzpap/docs_snapshot_update
Browse files Browse the repository at this point in the history
docs: Add snapshot info to API methods
  • Loading branch information
lzpap committed Jan 13, 2020
2 parents 8d13e68 + c5d6a5d commit 41cc47a
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions iota/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,20 @@ def get_account_data(self, start=0, stop=None, inclusion_states=False, security_
included in the result.
If ``None`` (default), then this method will check every
address until it finds one without any transfers.
address until it finds one that is unused.
.. note::
An unused address is an address that **has not been spent from**
and **has no transactions** referencing it on the Tangle.
A snapshot removes transactions from the Tangle. As a
consequence, after a snapshot, it may happen that this API does
not return the correct account data with ``stop`` being ``None``.
As a workaround, you can save your used addresses and their
``key_index`` attribute in a local database. Use the
``start`` and ``stop`` parameters to tell the API from where to
start checking and where to stop.
:param bool inclusion_states:
Whether to also fetch the inclusion states of the transfers.
Expand Down Expand Up @@ -1028,6 +1041,19 @@ def get_inputs(
If ``None`` (default), then this method will not stop until
it finds an unused address.
.. note::
An unused address is an address that **has not been spent from**
and **has no transactions** referencing it on the Tangle.
A snapshot removes transactions from the Tangle. As a
consequence, after a snapshot, it may happen that this API does
not return the correct inputs with ``stop`` being ``None``.
As a workaround, you can save your used addresses and their
``key_index`` attribute in a local database. Use the
``start`` and ``stop`` parameters to tell the API from where to
start checking for inputs and where to stop.
:param Optional[int] threshold:
If set, determines the minimum threshold for a successful
result:
Expand Down Expand Up @@ -1236,7 +1262,20 @@ def get_transfers(self, start=0, stop=None, inclusion_states=False):
included in the result.
If ``None`` (default), then this method will check every
address until it finds one without any transfers.
address until it finds one that is unused.
.. note::
An unused address is an address that **has not been spent from**
and **has no transactions** referencing it on the Tangle.
A snapshot removes transactions from the Tangle. As a
consequence, after a snapshot, it may happen that this API does
not return the expected transfers with ``stop`` being ``None``.
As a workaround, you can save your used addresses and their
``key_index`` attribute in a local database. Use the
``start`` and ``stop`` parameters to tell the API from where to
start checking for transfers and where to stop.
:param bool inclusion_states:
Whether to also fetch the inclusion states of the transfers.
Expand Down

0 comments on commit 41cc47a

Please sign in to comment.