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

docs: Add snapshot info to API methods #285

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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