From 90fba6988a08109bfb6646454557b43593f4604c Mon Sep 17 00:00:00 2001 From: Zeph Grunschlag Date: Sun, 7 May 2023 21:32:07 -0500 Subject: [PATCH 1/2] bugfix: incorrect indexer docs --- algosdk/v2client/indexer.py | 107 ++++++++++++++++++++---------------- docs/algosdk/index.rst | 1 - 2 files changed, 60 insertions(+), 48 deletions(-) diff --git a/algosdk/v2client/indexer.py b/algosdk/v2client/indexer.py index 9054fe4e..bb2a4ad9 100644 --- a/algosdk/v2client/indexer.py +++ b/algosdk/v2client/indexer.py @@ -108,7 +108,7 @@ def accounts( **kwargs ): """ - Return accounts that match the search; microalgos are the default + Return accounts that hold the asset; microalgos are the default currency unless asset_id is specified, in which case the asset will be used. @@ -123,19 +123,26 @@ def accounts( max_balance (int, optional): results should have an amount less than this value (results with an amount equal to this value are excluded) - block (int, optional): include results for the specified round; - for performance reasons, this parameter may be disabled on - some configurations + block (int, optional): this is a synonym for round_num. Do not + include both. auth_addr (str, optional): Include accounts configured to use this spending key. application_id (int, optional): results should filter on this application - round_num (int, optional): alias for block; only specify one of - these + round_num (int, optional): Include results for the specified round. + For performance reasons, this parameter may be disabled on some configurations. + Using application-id or asset-id filters will return both creator and opt-in accounts. + Filtering by include-all will return creator and opt-in accounts for deleted assets and accounts. + Non-opt-in managers are not included in the results when asset-id is used. + If specified, do not include block include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults to false. + exclude (str optional): Exclude additional items such as asset holdings, + application local data stored for this account, + asset parameters created by this account, + and application parameters created by this account. """ req = "/accounts" query = dict() @@ -186,11 +193,6 @@ def asset_balances( max_balance (int, optional): results should have an amount less than this value (results with an amount equal to this value are excluded) - block (int, optional): include results for the specified round; - for performance reasons, this parameter may be disabled on - some configurations - round_num (int, optional): alias for block; only specify one of - these include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults @@ -243,13 +245,16 @@ def account_info( Args: address (str): account public key - block (int, optional): use results from the specified round - round_num (int, optional): alias for block; only specify one of - these - include_all (bool, optional): include all items including closed - accounts, deleted applications, destroyed assets, opted-out - asset holdings, and closed-out application localstates. Defaults - to false. + block (int, optional): this is a synonym for round_num. Do not + include both. + round_num (int, optional): Include results for the specified round. + If specified, do not include block + include_all (bool, optional): Include all items including closed accounts, deleted applications, + destroyed assets, opted-out asset holdings, and closed-out application localstates. + Defaults to false. + exclude (str optional): Exclude additional items such as asset holdings, + application local data stored for this account, asset parameters created by this account, + and application parameters created by this account. """ req = "/accounts/" + address query = dict() @@ -282,9 +287,10 @@ def lookup_account_assets( token provided by the previous results asset_id (int): include transactions for the specified asset - block (int, optional): use results from the specified round - round_num (int, optional): alias for block; only specify one of - these + block (int, optional): this is a synonym for round_num. Do not + include both. + round_num (int, optional): Include results for the specified round. + If specified, do not include block include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults @@ -325,9 +331,10 @@ def lookup_account_asset_by_creator( token provided by the previous results asset_id (int): include transactions for the specified asset - block (int, optional): use results from the specified round - round_num (int, optional): alias for block; only specify one of - these + block (int, optional): this is a synonym for round_num. Do not + include both. + round_num (int, optional): Include results for the specified round. + If specified, do not include block include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults @@ -367,9 +374,10 @@ def lookup_account_application_local_state( next_page (str, optional): the next page of results; use the next token provided by the previous results application_id (int, optional): restrict search to application index - block (int, optional): use results from the specified round - round_num (int, optional): alias for block; only specify one of - these + block (int, optional): this is a synonym for round_num. Do not + include both. + round_num (int, optional): Include results for the specified round. + If specified, do not include block include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults @@ -409,9 +417,10 @@ def lookup_account_application_by_creator( next_page (str, optional): the next page of results; use the next token provided by the previous results application_id (int, optional): restrict search to application index - block (int, optional): use results from the specified round - round_num (int, optional): alias for block; only specify one of - these + block (int, optional): this is a synonym for round_num. Do not + include both. + round_num (int, optional): Include results for the specified round. + If specified, do not include block include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out asset holdings, and closed-out application localstates. Defaults @@ -487,10 +496,10 @@ def search_transactions( specified round asset_id (int, optional): include transactions for the specified asset - end_time (str, optional): include results before the given time; - must be an RFC 3339 formatted string start_time (str, optional): include results after the given time; must be an RFC 3339 formatted string + end_time (str, optional): include results before the given time; + must be an RFC 3339 formatted string min_amount (int, optional): results should have an amount greater than this value; microalgos are the default currency unless an asset-id is provided, in which case the asset will be used @@ -593,17 +602,18 @@ def search_transactions_by_address( sig_type (str, optional): type of signature; one of "sig", "msig", "lsig" txid (str, optional): lookup a specific transaction by ID - block (int, optional): include results for the specified round + block (int, optional): this is a synonym for round_num. Do not + include both. min_round (int, optional): include results at or after the specified round max_round (int, optional): include results at or before the specified round asset_id (int, optional): include transactions for the specified asset - end_time (str, optional): include results before the given time; - must be an RFC 3339 formatted string start_time (str, optional): include results after the given time; must be an RFC 3339 formatted string + end_time (str, optional): include results before the given time; + must be an RFC 3339 formatted string min_amount (int, optional): results should have an amount greater than this value; microalgos are the default currency unless an asset-id is provided, in which case the asset will be used @@ -612,8 +622,8 @@ def search_transactions_by_address( asset-id is provided, in which case the asset will be used rekey_to (bool, optional): include results which include the rekey-to field - round_num (int, optional): alias for block; only specify one of - these + round_num (int, optional): Include results for the specified round. + If specified, do not include block """ req = "/accounts/" + address + "/transactions" query = dict() @@ -688,17 +698,18 @@ def search_asset_transactions( sig_type (str, optional): type of signature; one of "sig", "msig", "lsig" txid (str, optional): lookup a specific transaction by ID - block (int, optional): include results for the specified round + block (int, optional): this is a synonym for round_num. Do not + include both. min_round (int, optional): include results at or after the specified round max_round (int, optional): include results at or before the specified round address (str, optional): only include transactions with this address in one of the transaction fields - end_time (str, optional): include results before the given time; - must be an RFC 3339 formatted string start_time (str, optional): include results after the given time; must be an RFC 3339 formatted string + end_time (str, optional): include results before the given time; + must be an RFC 3339 formatted string min_amount (int, optional): results should have an amount greater than this value; microalgos are the default currency unless an asset-id is provided, in which case the asset will be used @@ -715,8 +726,8 @@ def search_asset_transactions( to true rekey_to (bool, optional): include results which include the rekey-to field - round_num (int, optional): alias for block; only specify one of - these + round_num (int, optional): Include results for the specified round. + If specified, do not include block """ req = "/assets/" + str(asset_id) + "/transactions" query = dict() @@ -864,9 +875,11 @@ def search_applications( Args: application_id (int, optional): restrict search to application index + creator (str, optional): filter just assets with the given creator + address round (int, optional): not supported, DO NOT USE! limit (int, optional): restrict number of results to limit - next_page (string, optional): used for pagination + next_page (str, optional): used for pagination round_num (int, optional): not supported, DO NOT USE! include_all (bool, optional): include all items including closed accounts, deleted applications, destroyed assets, opted-out @@ -908,9 +921,9 @@ def application_logs( limit (int, optional): limit maximum number of results to return min_round (int, optional): only include results at or after the specified round max_round (int, optional): only include results at or before the specified round - next_page (string, optional): used for pagination - sender_addr (string, optional): only include transactions with this sender address - txid (string, optional): only include results with this transaction ID + next_page (str, optional): used for pagination + sender_addr (str, optional): only include transactions with this sender address + txid (str, optional): only include results with this transaction ID """ req = "/applications/{}/logs".format(application_id) query = dict() @@ -960,7 +973,7 @@ def application_boxes( application_id (int): The ID of the application to look up. limit (int, optional): Max number of box names to return. If max is not set, or max == 0, returns all box-names up to queried indexer's `defaultBoxesLimit`. - next_page (string, optional): used for pagination + next_page (str, optional): used for pagination """ req = "/applications/" + str(application_id) + "/boxes" params = {} diff --git a/docs/algosdk/index.rst b/docs/algosdk/index.rst index 18cd8399..2db26320 100644 --- a/docs/algosdk/index.rst +++ b/docs/algosdk/index.rst @@ -10,7 +10,6 @@ algosdk constants encoding error - future/index kmd logic mnemonic From 6370b17d163357ac7045c6173f9641a654eb19fd Mon Sep 17 00:00:00 2001 From: Zeph Grunschlag Date: Sun, 7 May 2023 21:44:33 -0500 Subject: [PATCH 2/2] Update algosdk/v2client/indexer.py --- algosdk/v2client/indexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algosdk/v2client/indexer.py b/algosdk/v2client/indexer.py index bb2a4ad9..d5cf67e8 100644 --- a/algosdk/v2client/indexer.py +++ b/algosdk/v2client/indexer.py @@ -108,7 +108,7 @@ def accounts( **kwargs ): """ - Return accounts that hold the asset; microalgos are the default + Return accounts that match the search; microalgos are the default currency unless asset_id is specified, in which case the asset will be used.