Skip to content

Commit

Permalink
fix: Fixed obsolete info and broken links (#100)
Browse files Browse the repository at this point in the history
* fix: fixed obsolete info and broken links
* chore: remove purestake code
* chore: fix audit issues
---------

Co-authored-by: Larkin Young <[email protected]>
Co-authored-by: Neil Campbell <[email protected]>
  • Loading branch information
3 people authored Jul 5, 2024
1 parent 5a02bb3 commit 1d997d2
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ Bases: {py:obj}`algokit_utils.models.TransactionResponse`, {py:obj}`typing.Gener
:canonical: algokit_utils.models.Account.address
:type: str
:value: >
None
'field(...)'

```{autodoc2-docstring} algokit_utils.models.Account.address
:parser: myst
Expand Down
15 changes: 7 additions & 8 deletions docs/html/_sources/capabilities/client.md.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Client management

Client management is one of the core capabilities provided by AlgoKit Utils.
It allows you to create [algod](https://developer.algorand.org/docs/rest-apis/algod), [indexer](https://developer.algorand.org/docs/rest-apis/indexer)
Client management is one of the core capabilities provided by AlgoKit Utils.
It allows you to create [algod](https://developer.algorand.org/docs/rest-apis/algod), [indexer](https://developer.algorand.org/docs/rest-apis/indexer)
and [kmd](https://developer.algorand.org/docs/rest-apis/kmd) clients against various networks resolved from environment or specified configuration.

Any AlgoKit Utils function that needs one of these clients will take the underlying `algosdk` classes (`algosdk.v2client.algod.AlgodClient`, `algosdk.v2client.indexer.IndexerClient`,
`algosdk.kmd.KMDClient`) so inline with the [Modularity](../index.md#core-principles) principle you can use existing logic to get instances of these clients without needing to use the
Any AlgoKit Utils function that needs one of these clients will take the underlying `algosdk` classes (`algosdk.v2client.algod.AlgodClient`, `algosdk.v2client.indexer.IndexerClient`,
`algosdk.kmd.KMDClient`) so inline with the [Modularity](../index.md#core-principles) principle you can use existing logic to get instances of these clients without needing to use the
Client management capability if you prefer.

To see some usage examples check out the [automated tests](https://github.com/algorandfoundation/algokit-utils-py/blob/main/tests/test_network_clients.py).
Expand All @@ -16,10 +16,9 @@ The network configuration is specified using the `AlgoClientConfig` class. This

There are a number of ways to produce one of these configuration objects:

* Manually creating the object, e.g. `AlgoClientConfig(server="https://myalgodnode.com", token="SECRET_TOKEN")`
* `algokit_utils.get_algonode_config(network, config, token)`: Loads an Algod or indexer config against [AlgoNode](https://algonode.io/api/) to either MainNet or TestNet
* `algokit_utils.get_purestake_config(network, config, token)`: Loads an Algod or indexer config against [PureStake](https://developer.purestake.io/) to either MainNet or TestNet
* `algokit_utils.get_default_localnet_config(configOrPort)`: Loads an Algod, Indexer or Kmd config against [LocalNet](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md) using the default configuration
- Manually creating the object, e.g. `AlgoClientConfig(server="https://myalgodnode.com", token="SECRET_TOKEN")`
- `algokit_utils.get_algonode_config(network, config, token)`: Loads an Algod or indexer config against [Nodely](https://nodely.io/docs/free/start) to either MainNet or TestNet
- `algokit_utils.get_default_localnet_config(configOrPort)`: Loads an Algod, Indexer or Kmd config against [LocalNet](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md) using the default configuration

## Clients

Expand Down
4 changes: 2 additions & 2 deletions docs/html/apidocs/algokit_utils/algokit_utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ <h3>API<a class="headerlink" href="#api" title="Permalink to this heading"></
<dl class="py attribute">
<dt class="sig sig-object py" id="algokit_utils.Account.address">
<span class="sig-name descname"><span class="pre">address</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></em><a class="headerlink" href="#algokit_utils.Account.address" title="Permalink to this definition"></a></dt>
<dd><p>None</p>
<dd><p>‘field(…)’</p>
<p>Address for this account</p>
</dd></dl>

Expand Down Expand Up @@ -1508,7 +1508,7 @@ <h3>API<a class="headerlink" href="#api" title="Permalink to this heading"></

<dl class="py function">
<dt class="sig sig-object py" id="algokit_utils.execute_atc_with_logic_error">
<span class="sig-prename descclassname"><span class="pre">algokit_utils.</span></span><span class="sig-name descname"><span class="pre">execute_atc_with_logic_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">atc</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/atomic_transaction_composer.html#algosdk.atomic_transaction_composer.AtomicTransactionComposer" title="(in algosdk)"><span class="pre">algosdk.atomic_transaction_composer.AtomicTransactionComposer</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">algod_client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/v2client/algod.html#algosdk.v2client.algod.AlgodClient" title="(in algosdk)"><span class="pre">algosdk.v2client.algod.AlgodClient</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">approval_program</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_rounds</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">4</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">approval_source_map</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">algosdk.source_map.SourceMap</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Callable" title="(in Python v3.12)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">algosdk.source_map.SourceMap</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/atomic_transaction_composer.html#algosdk.atomic_transaction_composer.AtomicTransactionResponse" title="(in algosdk)"><span class="pre">algosdk.atomic_transaction_composer.AtomicTransactionResponse</span></a></span></span><a class="headerlink" href="#algokit_utils.execute_atc_with_logic_error" title="Permalink to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">algokit_utils.</span></span><span class="sig-name descname"><span class="pre">execute_atc_with_logic_error</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">atc</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/atomic_transaction_composer.html#algosdk.atomic_transaction_composer.AtomicTransactionComposer" title="(in algosdk)"><span class="pre">algosdk.atomic_transaction_composer.AtomicTransactionComposer</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">algod_client</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/v2client/algod.html#algosdk.v2client.algod.AlgodClient" title="(in algosdk)"><span class="pre">algosdk.v2client.algod.AlgodClient</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">approval_program</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.12)"><span class="pre">str</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">wait_rounds</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.12)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">4</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">approval_source_map</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/source_map.html#algosdk.source_map.SourceMap" title="(in algosdk)"><span class="pre">algosdk.source_map.SourceMap</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/typing.html#typing.Callable" title="(in Python v3.12)"><span class="pre">Callable</span></a><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">[</span></span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">,</span></span><span class="w"> </span><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/source_map.html#algosdk.source_map.SourceMap" title="(in algosdk)"><span class="pre">algosdk.source_map.SourceMap</span></a><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.12)"><span class="pre">None</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://py-algorand-sdk.readthedocs.io/en/latest/algosdk/atomic_transaction_composer.html#algosdk.atomic_transaction_composer.AtomicTransactionResponse" title="(in algosdk)"><span class="pre">algosdk.atomic_transaction_composer.AtomicTransactionResponse</span></a></span></span><a class="headerlink" href="#algokit_utils.execute_atc_with_logic_error" title="Permalink to this definition"></a></dt>
<dd><p>Calls <code class="xref py py-meth docutils literal notranslate"><span class="pre">AtomicTransactionComposer.execute()</span></code> on provided <code class="docutils literal notranslate"><span class="pre">atc</span></code>, but will parse any errors
and raise a <a class="reference internal" href="#algokit_utils.LogicError" title="algokit_utils.LogicError"><code class="xref py py-class docutils literal notranslate"><span class="pre">LogicError</span></code></a> if possible</p>
<div class="admonition note">
Expand Down
3 changes: 1 addition & 2 deletions docs/html/capabilities/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ <h2>Network configuration<a class="headerlink" href="#network-configuration" tit
<p>There are a number of ways to produce one of these configuration objects:</p>
<ul class="simple">
<li><p>Manually creating the object, e.g. <code class="docutils literal notranslate"><span class="pre">AlgoClientConfig(server=&quot;https://myalgodnode.com&quot;,</span> <span class="pre">token=&quot;SECRET_TOKEN&quot;)</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">algokit_utils.get_algonode_config(network,</span> <span class="pre">config,</span> <span class="pre">token)</span></code>: Loads an Algod or indexer config against <a class="reference external" href="https://algonode.io/api/">AlgoNode</a> to either MainNet or TestNet</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">algokit_utils.get_purestake_config(network,</span> <span class="pre">config,</span> <span class="pre">token)</span></code>: Loads an Algod or indexer config against <a class="reference external" href="https://developer.purestake.io/">PureStake</a> to either MainNet or TestNet</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">algokit_utils.get_algonode_config(network,</span> <span class="pre">config,</span> <span class="pre">token)</span></code>: Loads an Algod or indexer config against <a class="reference external" href="https://nodely.io/docs/free/start">Nodely</a> to either MainNet or TestNet</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">algokit_utils.get_default_localnet_config(configOrPort)</span></code>: Loads an Algod, Indexer or Kmd config against <a class="reference external" href="https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md">LocalNet</a> using the default configuration</p></li>
</ul>
</section>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h2>Types<a class="headerlink" href="#types" title="Permalink to this heading">
<li><p><a class="reference internal" href="capabilities/app-client.html"><span class="std std-doc"><strong>ARC-0032 Application Spec client</strong></span></a> - Builds on top of the App management and App deployment capabilities to provide a high productivity application client that works with ARC-0032 application spec defined smart contracts (e.g. via Beaker)</p></li>
<li><p><a class="reference internal" href="capabilities/app-deploy.html"><span class="std std-doc"><strong>App deployment</strong></span></a> - Idempotent (safely retryable) deployment of an app, including deploy-time immutability and permanence control and TEAL template substitution</p></li>
<li><p><a class="reference internal" href="capabilities/transfer.html"><span class="std std-doc"><strong>Algo transfers</strong></span></a> - Ability to easily initiate algo transfers between accounts, including dispenser management and idempotent account funding</p></li>
<li><p><span class="xref myst"><strong>Debugger</strong></span> - Provides a set of debugging tools that can be used to simulate and trace transactions on the Algorand blockchain. These tools and methods are optimized for developers who are building applications on Algorand and need to test and debug their smart contracts via <a class="reference internal" href="#link"><span class="xref myst">AVM Debugger extension</span></a>.</p></li>
<li><p><a class="reference internal" href="#capabilities/debugger.md"><span class="xref myst"><strong>Debugger</strong></span></a> - Provides a set of debugging tools that can be used to simulate and trace transactions on the Algorand blockchain. These tools and methods are optimized for developers who are building applications on Algorand and need to test and debug their smart contracts via <a class="reference internal" href="#link"><span class="xref myst">AVM Debugger extension</span></a>.</p></li>
</ul>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/searchindex.js

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions docs/source/capabilities/client.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Client management

Client management is one of the core capabilities provided by AlgoKit Utils.
It allows you to create [algod](https://developer.algorand.org/docs/rest-apis/algod), [indexer](https://developer.algorand.org/docs/rest-apis/indexer)
Client management is one of the core capabilities provided by AlgoKit Utils.
It allows you to create [algod](https://developer.algorand.org/docs/rest-apis/algod), [indexer](https://developer.algorand.org/docs/rest-apis/indexer)
and [kmd](https://developer.algorand.org/docs/rest-apis/kmd) clients against various networks resolved from environment or specified configuration.

Any AlgoKit Utils function that needs one of these clients will take the underlying `algosdk` classes (`algosdk.v2client.algod.AlgodClient`, `algosdk.v2client.indexer.IndexerClient`,
`algosdk.kmd.KMDClient`) so inline with the [Modularity](../index.md#core-principles) principle you can use existing logic to get instances of these clients without needing to use the
Any AlgoKit Utils function that needs one of these clients will take the underlying `algosdk` classes (`algosdk.v2client.algod.AlgodClient`, `algosdk.v2client.indexer.IndexerClient`,
`algosdk.kmd.KMDClient`) so inline with the [Modularity](../index.md#core-principles) principle you can use existing logic to get instances of these clients without needing to use the
Client management capability if you prefer.

To see some usage examples check out the [automated tests](https://github.com/algorandfoundation/algokit-utils-py/blob/main/tests/test_network_clients.py).
Expand All @@ -16,10 +16,9 @@ The network configuration is specified using the `AlgoClientConfig` class. This

There are a number of ways to produce one of these configuration objects:

* Manually creating the object, e.g. `AlgoClientConfig(server="https://myalgodnode.com", token="SECRET_TOKEN")`
* `algokit_utils.get_algonode_config(network, config, token)`: Loads an Algod or indexer config against [AlgoNode](https://algonode.io/api/) to either MainNet or TestNet
* `algokit_utils.get_purestake_config(network, config, token)`: Loads an Algod or indexer config against [PureStake](https://developer.purestake.io/) to either MainNet or TestNet
* `algokit_utils.get_default_localnet_config(configOrPort)`: Loads an Algod, Indexer or Kmd config against [LocalNet](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md) using the default configuration
- Manually creating the object, e.g. `AlgoClientConfig(server="https://myalgodnode.com", token="SECRET_TOKEN")`
- `algokit_utils.get_algonode_config(network, config, token)`: Loads an Algod or indexer config against [Nodely](https://nodely.io/docs/free/start) to either MainNet or TestNet
- `algokit_utils.get_default_localnet_config(configOrPort)`: Loads an Algod, Indexer or Kmd config against [LocalNet](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/localnet.md) using the default configuration

## Clients

Expand Down
Loading

1 comment on commit 1d997d2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/algokit_utils
   _debugging.py140795%20, 41, 76, 80, 89, 129, 157
   _ensure_funded.py69199%99
   _transfer.py67396%13, 76–77
   account.py851385%14–17, 61–65, 96, 109, 136, 139, 183
   application_client.py5287785%58–59, 166, 171, 200, 312, 317–318, 320, 322, 787, 802, 820–823, 913, 953, 965, 978, 1020, 1080–1086, 1090–1095, 1097, 1133, 1140, 1253, 1283, 1297, 1335–1337, 1339, 1349–1406, 1417–1422, 1442–1445
   application_specification.py971189%92, 94, 193–202, 206
   asset.py79594%9, 27–30
   common.py13192%13
   config.py511865%38–39, 50, 55, 60, 64–69, 100–109
   deploy.py4552495%30–33, 168, 172–173, 190, 205, 246, 402, 413–421, 438–441, 451, 459, 652–653, 677
   dispenser_api.py821285%112–113, 117–120, 155–157, 176–178
   logic_error.py38295%6, 29
   models.py125695%45, 50–52, 61–62
   network_clients.py63395%93–94, 125
src/algokit_utils/beta
   account_manager.py551475%39–40, 64, 123–130, 183–187, 198–200
   algorand_client.py1011585%111–112, 121–122, 143–145, 154–155, 224, 259, 274, 290, 303, 319
   client_manager.py371073%40, 61–63, 68–70, 75–78
   composer.py3207178%335–336, 339–340, 343–344, 347–348, 355–356, 359–360, 389, 391, 393, 396, 399, 404, 407, 411, 414, 456–489, 494–505, 510–516, 521–529, 549–562, 566, 590, 593–610, 618, 643, 659–660, 662–663, 665–666, 668–669, 671–672, 678–682
TOTAL241929388% 

Tests Skipped Failures Errors Time
204 0 💤 0 ❌ 0 🔥 1m 51s ⏱️

Please sign in to comment.