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

Commit 41cc47a

Browse files
authored
Merge pull request #285 from lzpap/docs_snapshot_update
docs: Add snapshot info to API methods
2 parents 8d13e68 + c5d6a5d commit 41cc47a

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

iota/api.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,20 @@ def get_account_data(self, start=0, stop=None, inclusion_states=False, security_
926926
included in the result.
927927
928928
If ``None`` (default), then this method will check every
929-
address until it finds one without any transfers.
929+
address until it finds one that is unused.
930+
931+
.. note::
932+
An unused address is an address that **has not been spent from**
933+
and **has no transactions** referencing it on the Tangle.
934+
935+
A snapshot removes transactions from the Tangle. As a
936+
consequence, after a snapshot, it may happen that this API does
937+
not return the correct account data with ``stop`` being ``None``.
938+
939+
As a workaround, you can save your used addresses and their
940+
``key_index`` attribute in a local database. Use the
941+
``start`` and ``stop`` parameters to tell the API from where to
942+
start checking and where to stop.
930943
931944
:param bool inclusion_states:
932945
Whether to also fetch the inclusion states of the transfers.
@@ -1028,6 +1041,19 @@ def get_inputs(
10281041
If ``None`` (default), then this method will not stop until
10291042
it finds an unused address.
10301043
1044+
.. note::
1045+
An unused address is an address that **has not been spent from**
1046+
and **has no transactions** referencing it on the Tangle.
1047+
1048+
A snapshot removes transactions from the Tangle. As a
1049+
consequence, after a snapshot, it may happen that this API does
1050+
not return the correct inputs with ``stop`` being ``None``.
1051+
1052+
As a workaround, you can save your used addresses and their
1053+
``key_index`` attribute in a local database. Use the
1054+
``start`` and ``stop`` parameters to tell the API from where to
1055+
start checking for inputs and where to stop.
1056+
10311057
:param Optional[int] threshold:
10321058
If set, determines the minimum threshold for a successful
10331059
result:
@@ -1236,7 +1262,20 @@ def get_transfers(self, start=0, stop=None, inclusion_states=False):
12361262
included in the result.
12371263
12381264
If ``None`` (default), then this method will check every
1239-
address until it finds one without any transfers.
1265+
address until it finds one that is unused.
1266+
1267+
.. note::
1268+
An unused address is an address that **has not been spent from**
1269+
and **has no transactions** referencing it on the Tangle.
1270+
1271+
A snapshot removes transactions from the Tangle. As a
1272+
consequence, after a snapshot, it may happen that this API does
1273+
not return the expected transfers with ``stop`` being ``None``.
1274+
1275+
As a workaround, you can save your used addresses and their
1276+
``key_index`` attribute in a local database. Use the
1277+
``start`` and ``stop`` parameters to tell the API from where to
1278+
start checking for transfers and where to stop.
12401279
12411280
:param bool inclusion_states:
12421281
Whether to also fetch the inclusion states of the transfers.

0 commit comments

Comments
 (0)