From 9e856e456cdc91d5f91d49f45220fcccc9be7553 Mon Sep 17 00:00:00 2001 From: Al Date: Fri, 15 Dec 2023 10:01:15 +0100 Subject: [PATCH] feat: debugger related helpers and utils (#61) * chore: wip * Auto stash before merge of "feat/debugger-support" and "origin/main" * feat: initial draft implementation for debugger support * refactor: addressing pr comments, adding extra tests * chore: regen docs; fix spinx docs bug * chore: renaming back to .tok.map * chore: updating name for traces files * chore: addressing pr comments * chore: update src/algokit_utils/_debug_utils.py Co-authored-by: Neil Campbell * refactor: addressing pr comments * chore: typo fix * chore: addressing pr comments * chore: windows runner * chore: testing ci * chore: testing ci * chore: removing windows as its unsupported by official images, adding more py versions * chore: merge conflict fixes * chore: minor tweaks * refactor: minor improvements * chore: bumping cryptography for pip-audit * chore: fixing tests * refactor: propagating comments from utils ts pr review * chore: refining links to debugger * docs: regen docs * chore: fixing typo * docs: updating information on how to read trace files * chore: refining links to the marketplace --------- Co-authored-by: Neil Campbell --- .github/workflows/build-python.yaml | 25 +- .vscode/settings.json | 11 +- .../algokit_utils/algokit_utils.md.txt | 205 ++++++++- .../_sources/capabilities/debugger.md.txt | 30 ++ .../_sources/capabilities/debugging.md.txt | 46 ++ docs/html/_sources/index.md.txt | 1 + .../apidocs/algokit_utils/algokit_utils.html | 411 +++++++++++++----- docs/html/capabilities/account.html | 1 + docs/html/capabilities/app-client.html | 1 + docs/html/capabilities/client.html | 1 + docs/html/capabilities/debugger.html | 137 ++++++ docs/html/capabilities/debugging.html | 151 +++++++ docs/html/genindex.html | 58 ++- docs/html/index.html | 1 + docs/html/objects.inv | Bin 3122 -> 3366 bytes docs/html/searchindex.js | 2 +- docs/source/capabilities/debugging.md | 46 ++ docs/source/index.md | 1 + poetry.lock | 108 +++-- pyproject.toml | 4 + src/algokit_utils/__init__.py | 12 +- src/algokit_utils/_debugging.py | 280 ++++++++++++ src/algokit_utils/application_client.py | 110 +++-- src/algokit_utils/common.py | 28 ++ src/algokit_utils/config.py | 101 ++++- tests/test_app_client_call.py | 1 + .../test_build_teal_sourcemaps.approved.txt | 1 + ...al_sourcemaps_without_sources.approved.txt | 1 + tests/test_debug_utils.py | 177 ++++++++ tests/test_deploy_scenarios.py | 6 +- 30 files changed, 1730 insertions(+), 227 deletions(-) create mode 100644 docs/html/_sources/capabilities/debugger.md.txt create mode 100644 docs/html/_sources/capabilities/debugging.md.txt create mode 100644 docs/html/capabilities/debugger.html create mode 100644 docs/html/capabilities/debugging.html create mode 100644 docs/source/capabilities/debugging.md create mode 100644 src/algokit_utils/_debugging.py create mode 100644 src/algokit_utils/common.py create mode 100644 tests/test_debug_utils.approvals/test_build_teal_sourcemaps.approved.txt create mode 100644 tests/test_debug_utils.approvals/test_build_teal_sourcemaps_without_sources.approved.txt create mode 100644 tests/test_debug_utils.py diff --git a/.github/workflows/build-python.yaml b/.github/workflows/build-python.yaml index d7745bb8..a0e2c6e9 100644 --- a/.github/workflows/build-python.yaml +++ b/.github/workflows/build-python.yaml @@ -6,21 +6,34 @@ jobs: build-python: strategy: matrix: - os: ["ubuntu-latest" ] - python: ["3.10"] + os: ["ubuntu-latest"] + python: ["3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }} steps: - name: Checkout source code uses: actions/checkout@v3 - - name: Install poetry - run: pipx install poetry - - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - cache: "poetry" + + - name: Install pipx + run: | + python -m pip install --upgrade pip + python -m pip install pipx + python -m pipx ensurepath + + - name: Cache Poetry + uses: actions/cache@v2 + with: + path: ~/.local/share/pipx/venvs/poetry + key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + ${{ runner.os }}-poetry- + + - name: Install poetry + run: pipx install poetry - name: Install dependencies run: poetry install --no-interaction diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a1aa409..6f0c035d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -54,9 +54,10 @@ ] }, - // PowerShell - "[powershell]": { - "editor.defaultFormatter": "ms-vscode.powershell" - }, - "powershell.codeFormatting.preset": "Stroustrup" + // PowerShell + "[powershell]": { + "editor.defaultFormatter": "ms-vscode.powershell" + }, + "powershell.codeFormatting.preset": "Stroustrup", + "python.testing.pytestArgs": ["."] } diff --git a/docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt b/docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt index edbc218b..9eab990e 100644 --- a/docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt +++ b/docs/html/_sources/apidocs/algokit_utils/algokit_utils.md.txt @@ -175,8 +175,8 @@ orphan: true :parser: myst :summary: ``` -* - {py:obj}`Program ` - - ```{autodoc2-docstring} algokit_utils.application_client.Program +* - {py:obj}`Program ` + - ```{autodoc2-docstring} algokit_utils.common.Program :parser: myst :summary: ``` @@ -190,6 +190,11 @@ orphan: true :parser: myst :summary: ``` +* - {py:obj}`TransactionParametersDict ` + - ```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict + :parser: myst + :summary: + ``` * - {py:obj}`TransactionResponse ` - ```{autodoc2-docstring} algokit_utils.models.TransactionResponse :parser: myst @@ -318,11 +323,31 @@ orphan: true :parser: myst :summary: ``` +* - {py:obj}`opt_in ` + - ```{autodoc2-docstring} algokit_utils.asset.opt_in + :parser: myst + :summary: + ``` +* - {py:obj}`opt_out ` + - ```{autodoc2-docstring} algokit_utils.asset.opt_out + :parser: myst + :summary: + ``` +* - {py:obj}`persist_sourcemaps ` + - ```{autodoc2-docstring} algokit_utils._debugging.persist_sourcemaps + :parser: myst + :summary: + ``` * - {py:obj}`replace_template_variables ` - ```{autodoc2-docstring} algokit_utils.deploy.replace_template_variables :parser: myst :summary: ``` +* - {py:obj}`simulate_and_persist_response ` + - ```{autodoc2-docstring} algokit_utils._debugging.simulate_and_persist_response + :parser: myst + :summary: + ``` * - {py:obj}`transfer ` - ```{autodoc2-docstring} algokit_utils._transfer.transfer :parser: myst @@ -1502,16 +1527,16 @@ Bases: {py:obj}`enum.Enum` ````` ````{py:class} Program(program: str, client: algosdk.v2client.algod.AlgodClient) -:canonical: algokit_utils.application_client.Program +:canonical: algokit_utils.common.Program -```{autodoc2-docstring} algokit_utils.application_client.Program +```{autodoc2-docstring} algokit_utils.common.Program :parser: myst ``` ```{rubric} Initialization ``` -```{autodoc2-docstring} algokit_utils.application_client.Program.__init__ +```{autodoc2-docstring} algokit_utils.common.Program.__init__ :parser: myst ``` @@ -1713,6 +1738,144 @@ Bases: {py:obj}`enum.Enum` ````` +`````{py:class} TransactionParametersDict() +:canonical: algokit_utils.models.TransactionParametersDict + +Bases: {py:obj}`typing.TypedDict` + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict +:parser: myst +``` + +```{rubric} Initialization +``` + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.__init__ +:parser: myst +``` + +````{py:attribute} accounts +:canonical: algokit_utils.models.TransactionParametersDict.accounts +:type: list[str] +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.accounts +:parser: myst +``` + +```` + +````{py:attribute} boxes +:canonical: algokit_utils.models.TransactionParametersDict.boxes +:type: collections.abc.Sequence[tuple[int, bytes | bytearray | str | int]] +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.boxes +:parser: myst +``` + +```` + +````{py:attribute} foreign_apps +:canonical: algokit_utils.models.TransactionParametersDict.foreign_apps +:type: list[int] +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.foreign_apps +:parser: myst +``` + +```` + +````{py:attribute} foreign_assets +:canonical: algokit_utils.models.TransactionParametersDict.foreign_assets +:type: list[int] +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.foreign_assets +:parser: myst +``` + +```` + +````{py:attribute} lease +:canonical: algokit_utils.models.TransactionParametersDict.lease +:type: bytes | str +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.lease +:parser: myst +``` + +```` + +````{py:attribute} note +:canonical: algokit_utils.models.TransactionParametersDict.note +:type: bytes | str +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.note +:parser: myst +``` + +```` + +````{py:attribute} rekey_to +:canonical: algokit_utils.models.TransactionParametersDict.rekey_to +:type: str +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.rekey_to +:parser: myst +``` + +```` + +````{py:attribute} sender +:canonical: algokit_utils.models.TransactionParametersDict.sender +:type: str +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.sender +:parser: myst +``` + +```` + +````{py:attribute} signer +:canonical: algokit_utils.models.TransactionParametersDict.signer +:type: algosdk.atomic_transaction_composer.TransactionSigner +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.signer +:parser: myst +``` + +```` + +````{py:attribute} suggested_params +:canonical: algokit_utils.models.TransactionParametersDict.suggested_params +:type: algosdk.transaction.SuggestedParams +:value: > + None + +```{autodoc2-docstring} algokit_utils.models.TransactionParametersDict.suggested_params +:parser: myst +``` + +```` + +````` + `````{py:class} TransactionResponse :canonical: algokit_utils.models.TransactionResponse @@ -1957,6 +2120,30 @@ Bases: {py:obj}`algokit_utils._transfer.TransferParametersBase` ``` ```` +````{py:function} opt_in(algod_client: algosdk.v2client.algod.AlgodClient, account: algokit_utils.models.Account, asset_ids: list[int]) -> dict[int, str] +:canonical: algokit_utils.asset.opt_in + +```{autodoc2-docstring} algokit_utils.asset.opt_in +:parser: myst +``` +```` + +````{py:function} opt_out(algod_client: algosdk.v2client.algod.AlgodClient, account: algokit_utils.models.Account, asset_ids: list[int]) -> dict[int, str] +:canonical: algokit_utils.asset.opt_out + +```{autodoc2-docstring} algokit_utils.asset.opt_out +:parser: myst +``` +```` + +````{py:function} persist_sourcemaps(*, sources: list[algokit_utils._debugging.PersistSourceMapInput], project_root: pathlib.Path, client: algosdk.v2client.algod.AlgodClient, with_sources: bool = True) -> None +:canonical: algokit_utils._debugging.persist_sourcemaps + +```{autodoc2-docstring} algokit_utils._debugging.persist_sourcemaps +:parser: myst +``` +```` + ````{py:function} replace_template_variables(program: str, template_values: algokit_utils.deploy.TemplateValueMapping) -> str :canonical: algokit_utils.deploy.replace_template_variables @@ -1965,6 +2152,14 @@ Bases: {py:obj}`algokit_utils._transfer.TransferParametersBase` ``` ```` +````{py:function} simulate_and_persist_response(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, project_root: pathlib.Path, algod_client: algosdk.v2client.algod.AlgodClient, buffer_size_mb: float = 256) -> algosdk.atomic_transaction_composer.SimulateAtomicTransactionResponse +:canonical: algokit_utils._debugging.simulate_and_persist_response + +```{autodoc2-docstring} algokit_utils._debugging.simulate_and_persist_response +:parser: myst +``` +```` + ````{py:function} transfer(client: algosdk.v2client.algod.AlgodClient, parameters: algokit_utils._transfer.TransferParameters) -> algosdk.transaction.PaymentTxn :canonical: algokit_utils._transfer.transfer diff --git a/docs/html/_sources/capabilities/debugger.md.txt b/docs/html/_sources/capabilities/debugger.md.txt new file mode 100644 index 00000000..8116feec --- /dev/null +++ b/docs/html/_sources/capabilities/debugger.md.txt @@ -0,0 +1,30 @@ +# Debugger + +The AlgoKit Python Utilities package 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 [AVM Debugger extension](link to vscode extension). + +## Configuration + +The `config.py` file contains the `UpdatableConfig` class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes: + +- `debug`: Indicates whether debug mode is enabled. +- `project_root`: The path to the project root directory. Can be ignored if you are using `algokit_utils` inside an `algokit` compliant project (containing `.algokit.toml` file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [`AVM Debugger`](links to extension). Alternatively you can also set the value via the `ALGOKIT_PROJECT_ROOT` environment variable. +- `trace_all`: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via `algokit_utils` will store responses from `simulate` endpoint. These files are called traces, and can be used with [AVM Debugger](link to vscode extension) to debug TEAL source codes, transactions in the atomic group and etc. +- `trace_buffer_size_mb`: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption. +- `max_search_depth`: The maximum depth to search for a an `algokit` config file. By default it will traverse at most 10 folders searching for `.algokit.toml` file which will be used to assume algokit compliant project root path. + +The `configure` method can be used to set these attributes. + +To enable debug mode in your project you can configure it as follows: + +```py +from algokit_utils.config import config + +config.configure(debug=True) +``` + +## Debugging Utilities + +Debugging utilities can be used to simplify gathering artifacts to be used with [AVM Debugger](link to vscode extension) in non algokit compliant projects. The following methods are provided: + +- `persist_sourcemaps`: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. +- `simulate_and_persist_response`: This method simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, and persists the simulation response to an AVM Debugger compliant JSON file. diff --git a/docs/html/_sources/capabilities/debugging.md.txt b/docs/html/_sources/capabilities/debugging.md.txt new file mode 100644 index 00000000..e56b797b --- /dev/null +++ b/docs/html/_sources/capabilities/debugging.md.txt @@ -0,0 +1,46 @@ +# Debugger + +The AlgoKit Python Utilities package 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 [AVM Debugger extension](link to vscode extension). + +## Configuration + +The `config.py` file contains the `UpdatableConfig` class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes: + +- `debug`: Indicates whether debug mode is enabled. +- `project_root`: The path to the project root directory. Can be ignored if you are using `algokit_utils` inside an `algokit` compliant project (containing `.algokit.toml` file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [`AVM Debugger`](links to extension). Alternatively you can also set the value via the `ALGOKIT_PROJECT_ROOT` environment variable. +- `trace_all`: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via `algokit_utils` will store responses from `simulate` endpoint. These files are called traces, and can be used with [AVM Debugger](link to vscode extension) to debug TEAL source codes, transactions in the atomic group and etc. +- `trace_buffer_size_mb`: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption. +- `max_search_depth`: The maximum depth to search for a an `algokit` config file. By default it will traverse at most 10 folders searching for `.algokit.toml` file which will be used to assume algokit compliant project root path. + +The `configure` method can be used to set these attributes. + +To enable debug mode in your project you can configure it as follows: + +```py +from algokit_utils.config import config + +config.configure(debug=True) +``` + +## Debugging Utilities + +Debugging utilities can be used to simplify gathering artifacts to be used with [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) in non algokit compliant projects. The following methods are provided: + +- `persist_sourcemaps`: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. It takes a list of `PersistSourceMapInput` objects, a `Path` object representing the root directory of the project, an `AlgodClient` object for interacting with the Algorand blockchain, and a boolean indicating whether to dump teal source files along with sourcemaps. +- `simulate_and_persist_response`: This method simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an `AtomicTransactionComposer` object representing the atomic transactions to be simulated and persisted, a `Path` object representing the root directory of the project, an `AlgodClient` object representing the Algorand client, and a float representing the size of the trace buffer in megabytes. + +### Trace filename format + +The trace files are named in a specific format to provide useful information about the transactions they contain. The format is as follows: + +```ts +`${timestamp}_lr${last_round}_${transaction_types}.trace.avm.json`; +``` + +Where: + +- `timestamp`: The time when the trace file was created, in ISO 8601 format, with colons and periods removed. +- `last_round`: The last round when the simulation was performed. +- `transaction_types`: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as `${count}#${type}`, and different transaction types are separated by underscores. + +For example, a trace file might be named `20220301T123456Z_lr1000_2#pay_1#axfer.trace.avm.json`, indicating that the trace file was created at `2022-03-01T12:34:56Z`, the last round was `1000`, and the atomic group contained 2 payment transactions and 1 asset transfer transaction. diff --git a/docs/html/_sources/index.md.txt b/docs/html/_sources/index.md.txt index e71fa039..c260e516 100644 --- a/docs/html/_sources/index.md.txt +++ b/docs/html/_sources/index.md.txt @@ -79,6 +79,7 @@ The library helps you with the following capabilities: - [**ARC-0032 Application Spec client**](capabilities/app-client.md) - 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) - [**App deployment**](capabilities/app-deploy.md) - Idempotent (safely retryable) deployment of an app, including deploy-time immutability and permanence control and TEAL template substitution - [**Algo transfers**](capabilities/transfer.md) - Ability to easily initiate algo transfers between accounts, including dispenser management and idempotent account funding + - [**Debugger**](capabilities/debugger.md) - 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 [AVM Debugger extension](link). (reference-documentation)= diff --git a/docs/html/apidocs/algokit_utils/algokit_utils.html b/docs/html/apidocs/algokit_utils/algokit_utils.html index 2d0f20e2..9a4aebc1 100644 --- a/docs/html/apidocs/algokit_utils/algokit_utils.html +++ b/docs/html/apidocs/algokit_utils/algokit_utils.html @@ -99,6 +99,7 @@
  • TemplateValueMapping
  • TestNetDispenserApiClient
  • TransactionParameters
  • +
  • TransactionParametersDict
  • TransactionResponse
  • TransferAssetParameters
  • TransferParameters
  • @@ -124,7 +125,11 @@
  • is_mainnet()
  • is_testnet()
  • num_extra_program_pages()
  • +
  • opt_in()
  • +
  • opt_out()
  • +
  • persist_sourcemaps()
  • replace_template_variables()
  • +
  • simulate_and_persist_response()
  • transfer()
  • transfer_asset()
  • @@ -270,7 +275,7 @@

    Classes

    OperationPerformed

    Describes the actions taken during deployment

    -

    Program

    +

    Program

    A compiled TEAL program

    TestNetDispenserApiClient

    @@ -283,13 +288,16 @@

    Classes

    TransactionParameters

    Additional parameters that can be included in a transaction

    -

    TransactionResponse

    +

    TransactionParametersDict

    +

    Additional parameters that can be included in a transaction

    + +

    TransactionResponse

    Response for a non ABI call

    -

    TransferAssetParameters

    +

    TransferAssetParameters

    Parameters for transferring assets between accounts

    -

    TransferParameters

    +

    TransferParameters

    Parameters for transferring µALGOs between accounts

    @@ -366,9 +374,32 @@

    Functions

    num_extra_program_pages

    Calculate minimum number of extra_pages required for provided approval and clear programs

    -

    replace_template_variables

    +

    opt_in

    +

    Opt-in to a list of assets on the Algorand blockchain. Before an account can receive a specific asset, +it must opt-in to receive it. An opt-in transaction places an asset holding of 0 into the account and increases +its minimum balance by 100,000 microAlgos.

    + +

    opt_out

    +

    Opt out from a list of Algorand Standard Assets (ASAs) by transferring them back to their creators. +The account also recovers the Minimum Balance Requirement for the asset (100,000 microAlgos) +The optOut function manages the opt-out process, permitting the account to discontinue holding a group of assets.

    + +

    persist_sourcemaps

    +

    Persist the sourcemaps for the given sources as an AlgoKit AVM Debugger compliant artifacts. +Args: +sources (list[PersistSourceMapInput]): A list of PersistSourceMapInput objects. +project_root (Path): The root directory of the project. +client (AlgodClient): An AlgodClient object for interacting with the Algorand blockchain. +with_sources (bool): If True, it will dump teal source files along with sourcemaps. +Default is True, as needed by an AlgoKit AVM debugger.

    + +

    replace_template_variables

    Replaces TMPL_* variables in program with template_values

    +

    simulate_and_persist_response

    +

    Simulates the atomic transactions using the provided AtomicTransactionComposer object and AlgodClient object, +and persists the simulation response to an AlgoKit AVM Debugger compliant JSON file.

    +

    transfer

    Transfer µALGOs between accounts

    @@ -425,7 +456,7 @@

    API
    class algokit_utils.ABICallArgsDict
    -

    Bases: algokit_utils.deploy.DeployCallArgsDict, typing.TypedDict

    +

    Bases: algokit_utils.deploy.DeployCallArgsDict, typing.TypedDict

    ABI Parameters used to update or delete an application when calling deploy()

    Initialization

    @@ -442,7 +473,7 @@

    API
    class algokit_utils.ABICreateCallArgsDict
    -

    Bases: algokit_utils.deploy.DeployCreateCallArgsDict, typing.TypedDict

    +

    Bases: algokit_utils.deploy.DeployCreateCallArgsDict, typing.TypedDict

    ABI Parameters used to create an application when calling deploy()

    Initialization

    Initialize self. See help(type(self)) for accurate signature.

    @@ -451,11 +482,11 @@

    API
    class algokit_utils.ABITransactionResponse
    -

    Bases: algokit_utils.models.TransactionResponse, typing.Generic[algokit_utils.models.ReturnType]

    +

    Bases: algokit_utils.models.TransactionResponse, typing.Generic[algokit_utils.models.ReturnType]

    Response for an ABI call

    -decode_error: Exception | None
    +decode_error: Exception | None

    None

    Details of error that occurred when attempting to decode raw_value

    @@ -469,7 +500,7 @@

    API
    -raw_value: bytes
    +raw_value: bytes

    None

    The raw response before ABI decoding

    @@ -483,7 +514,7 @@

    API
    -tx_info: dict
    +tx_info: dict

    None

    Details of transaction

    @@ -496,21 +527,21 @@

    API

    Holds the private_key and address for an account

    -address: str
    +address: str

    None

    Address for this account

    -private_key: str
    +private_key: str

    None

    Base64 encoded private key

    -property public_key: bytes
    +property public_key: bytes

    The public key for this account

    @@ -529,14 +560,14 @@

    APIalgosdk.v2client.indexer.IndexerClient

    -server: str
    +server: str

    None

    URL for the service e.g. http://localhost:4001 or https://testnet-api.algonode.cloud

    -token: str
    +token: str

    None

    API Token to authenticate with the service

    @@ -574,14 +605,14 @@

    API
    -algokit_utils.AppSpecStateDict: TypeAlias
    +algokit_utils.AppSpecStateDict: TypeAlias

    None

    Type defining Application Specification state entries

    -class algokit_utils.ApplicationClient(algod_client: algosdk.v2client.algod.AlgodClient, app_spec: algokit_utils.application_specification.ApplicationSpecification | pathlib.Path, *, app_id: int = 0, creator: str | algokit_utils.models.Account | None = None, indexer_client: IndexerClient | None = None, existing_deployments: algokit_utils.deploy.AppLookup | None = None, signer: algosdk.atomic_transaction_composer.TransactionSigner | algokit_utils.models.Account | None = None, sender: str | None = None, suggested_params: algosdk.transaction.SuggestedParams | None = None, template_values: algokit_utils.deploy.TemplateValueMapping | None = None, app_name: str | None = None)
    +class algokit_utils.ApplicationClient(algod_client: algosdk.v2client.algod.AlgodClient, app_spec: algokit_utils.application_specification.ApplicationSpecification | pathlib.Path, *, app_id: int = 0, creator: str | algokit_utils.models.Account | None = None, indexer_client: IndexerClient | None = None, existing_deployments: algokit_utils.deploy.AppLookup | None = None, signer: algosdk.atomic_transaction_composer.TransactionSigner | algokit_utils.models.Account | None = None, sender: str | None = None, suggested_params: algosdk.transaction.SuggestedParams | None = None, template_values: algokit_utils.deploy.TemplateValueMapping | None = None, app_name: str | None = None)

    A class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app

    Initialization

    ApplicationClient can be created with an app_id to interact with an existing application, alternatively @@ -591,104 +622,104 @@

    API
    • algod_client (AlgodClient) – AlgoSDK algod client

    • app_spec (ApplicationSpecification | Path) – An Application Specification or the path to one

    • -
    • app_id (int) – The app_id of an existing application, to instead find the application by creator and name +

    • app_id (int) – The app_id of an existing application, to instead find the application by creator and name use the creator and indexer_client parameters

    • -
    • creator (str | Account) – The address or Account of the app creator to resolve the app_id

    • +
    • creator (str | Account) – The address or Account of the app creator to resolve the app_id

    • indexer_client (IndexerClient) – AlgoSDK indexer client, only required if deploying or finding app_id by creator and app name

    • existing_deployments (AppLookup) –

    • signer (TransactionSigner | Account) – Account or signer to use to sign transactions, if not specified and creator was passed as an Account will use that.

    • -
    • sender (str) – Address to use as the sender for all transactions, will use the address associated with the +

    • sender (str) – Address to use as the sender for all transactions, will use the address associated with the signer if not specified.

    • template_values (TemplateValueMapping) – Values to use for TMPL_* template variables, dictionary keys should NOT include the TMPL_ prefix

    • -
    • app_name (str | None) – Name of application to use when deploying, defaults to name defined on the +

    • app_name (str | None) – Name of application to use when deploying, defaults to name defined on the Application Specification

    -add_method_call(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, abi_method: algokit_utils.models.ABIMethod | bool | None = None, *, abi_args: algokit_utils.models.ABIArgsDict | None = None, app_id: int | None = None, parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, on_complete: algosdk.transaction.OnComplete = transaction.OnComplete.NoOpOC, local_schema: algosdk.transaction.StateSchema | None = None, global_schema: algosdk.transaction.StateSchema | None = None, approval_program: bytes | None = None, clear_program: bytes | None = None, extra_pages: int | None = None, app_args: list[bytes] | None = None, call_config: algokit_utils.application_specification.CallConfig = au_spec.CallConfig.CALL) None
    +add_method_call(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, abi_method: algokit_utils.models.ABIMethod | bool | None = None, *, abi_args: algokit_utils.models.ABIArgsDict | None = None, app_id: int | None = None, parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, on_complete: algosdk.transaction.OnComplete = transaction.OnComplete.NoOpOC, local_schema: algosdk.transaction.StateSchema | None = None, global_schema: algosdk.transaction.StateSchema | None = None, approval_program: bytes | None = None, clear_program: bytes | None = None, extra_pages: int | None = None, app_args: list[bytes] | None = None, call_config: algokit_utils.application_specification.CallConfig = au_spec.CallConfig.CALL) None

    Adds a transaction to the AtomicTransactionComposer passed

    -call(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.OnCompleteCallParameters | algokit_utils.models.OnCompleteCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +call(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.OnCompleteCallParameters | algokit_utils.models.OnCompleteCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with specified parameters

    -clear_state(transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, app_args: list[bytes] | None = None) algokit_utils.models.TransactionResponse
    +clear_state(transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, app_args: list[bytes] | None = None) algokit_utils.models.TransactionResponse

    Submits a signed transaction with on_complete=ClearState

    -close_out(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +close_out(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with on_complete=CloseOut

    -compose_call(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.OnCompleteCallParameters | algokit_utils.models.OnCompleteCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_call(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.OnCompleteCallParameters | algokit_utils.models.OnCompleteCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with specified parameters to atc

    -compose_clear_state(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, app_args: list[bytes] | None = None) None
    +compose_clear_state(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, app_args: list[bytes] | None = None) None

    Adds a signed transaction with on_complete=ClearState to atc

    -compose_close_out(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_close_out(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with on_complete=CloseOut to ac

    -compose_create(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.CreateCallParameters | algokit_utils.models.CreateCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_create(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.CreateCallParameters | algokit_utils.models.CreateCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with application id == 0 and the schema and source of client’s app_spec to atc

    -compose_delete(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_delete(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with on_complete=DeleteApplication to atc

    -compose_opt_in(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_opt_in(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with on_complete=OptIn to atc

    -compose_update(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None
    +compose_update(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, /, call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) None

    Adds a signed transaction with on_complete=UpdateApplication to atc

    -create(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.CreateCallParameters | algokit_utils.models.CreateCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +create(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.CreateCallParameters | algokit_utils.models.CreateCallParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with application id == 0 and the schema and source of client’s app_spec

    -delete(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +delete(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with on_complete=DeleteApplication

    -deploy(version: str | None = None, *, signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None, allow_update: bool | None = None, allow_delete: bool | None = None, on_update: algokit_utils.deploy.OnUpdate = au_deploy.OnUpdate.Fail, on_schema_break: algokit_utils.deploy.OnSchemaBreak = au_deploy.OnSchemaBreak.Fail, template_values: algokit_utils.deploy.TemplateValueMapping | None = None, create_args: algokit_utils.deploy.ABICreateCallArgs | algokit_utils.deploy.ABICreateCallArgsDict | algokit_utils.deploy.DeployCreateCallArgs | None = None, update_args: algokit_utils.deploy.ABICallArgs | algokit_utils.deploy.ABICallArgsDict | algokit_utils.deploy.DeployCallArgs | None = None, delete_args: algokit_utils.deploy.ABICallArgs | algokit_utils.deploy.ABICallArgsDict | algokit_utils.deploy.DeployCallArgs | None = None) algokit_utils.deploy.DeployResponse
    +deploy(version: str | None = None, *, signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None, allow_update: bool | None = None, allow_delete: bool | None = None, on_update: algokit_utils.deploy.OnUpdate = au_deploy.OnUpdate.Fail, on_schema_break: algokit_utils.deploy.OnSchemaBreak = au_deploy.OnSchemaBreak.Fail, template_values: algokit_utils.deploy.TemplateValueMapping | None = None, create_args: algokit_utils.deploy.ABICreateCallArgs | algokit_utils.deploy.ABICreateCallArgsDict | algokit_utils.deploy.DeployCreateCallArgs | None = None, update_args: algokit_utils.deploy.ABICallArgs | algokit_utils.deploy.ABICallArgsDict | algokit_utils.deploy.DeployCallArgs | None = None, delete_args: algokit_utils.deploy.ABICallArgs | algokit_utils.deploy.ABICallArgsDict | algokit_utils.deploy.DeployCallArgs | None = None) algokit_utils.deploy.DeployResponse

    Deploy an application and update client to reference it.

    Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions. @@ -707,18 +738,18 @@

    API
    Parameters:
      -
    • version (str) – version to use when creating or updating app, if None version will be auto incremented

    • +
    • version (str) – version to use when creating or updating app, if None version will be auto incremented

    • signer (algosdk.atomic_transaction_composer.TransactionSigner) – signer to use when deploying app , if None uses self.signer

    • -
    • sender (str) – sender address to use when deploying app, if None uses self.sender

    • -
    • allow_delete (bool) – Used to set the TMPL_DELETABLE template variable to conditionally control if an app +

    • sender (str) – sender address to use when deploying app, if None uses self.sender

    • +
    • allow_delete (bool) – Used to set the TMPL_DELETABLE template variable to conditionally control if an app can be deleted

    • -
    • allow_update (bool) – Used to set the TMPL_UPDATABLE template variable to conditionally control if an app +

    • allow_update (bool) – Used to set the TMPL_UPDATABLE template variable to conditionally control if an app can be updated

    • on_update (OnUpdate) – Determines what action to take if an application update is required

    • on_schema_break (OnSchemaBreak) – Determines what action to take if an application schema requirements has increased beyond the current allocation

    • -
    • template_values (dict[str, int|str|bytes]) – Values to use for TMPL_* template variables, dictionary keys +

    • template_values (dict[str, int|str|bytes]) – Values to use for TMPL_* template variables, dictionary keys should NOT include the TMPL_ prefix

    • create_args (ABICreateCallArgs) – Arguments used when creating an application

    • update_args (ABICallArgs | ABICallArgsDict) – Arguments used when updating an application

    • @@ -736,25 +767,25 @@

      API
      -export_source_map() str | None
      +export_source_map() str | None

      Export approval source map to JSON, can be later re-imported with import_source_map

    -get_global_state(*, raw: bool = False) dict[bytes | str, bytes | str | int]
    +get_global_state(*, raw: bool = False) dict[bytes | str, bytes | str | int]

    Gets the global state info associated with app_id

    -get_local_state(account: str | None = None, *, raw: bool = False) dict[bytes | str, bytes | str | int]
    +get_local_state(account: str | None = None, *, raw: bool = False) dict[bytes | str, bytes | str | int]

    Gets the local state info for associated app_id and account/sender

    -get_signer_sender(signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None) tuple[algosdk.atomic_transaction_composer.TransactionSigner | None, str | None]
    +get_signer_sender(signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None) tuple[algosdk.atomic_transaction_composer.TransactionSigner | None, str | None]

    Return signer and sender, using default values on client if not specified

    Will use provided values if given, otherwise will fall back to values defined on client. If no sender is specified then will attempt to obtain sender from signer

    @@ -762,38 +793,38 @@

    API
    -import_source_map(source_map_json: str) None
    +import_source_map(source_map_json: str) None

    Import approval source from JSON exported by export_source_map

    -opt_in(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +opt_in(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with on_complete=OptIn

    -prepare(signer: algosdk.atomic_transaction_composer.TransactionSigner | algokit_utils.models.Account | None = None, sender: str | None = None, app_id: int | None = None, template_values: algokit_utils.deploy.TemplateValueDict | None = None) algokit_utils.application_client.ApplicationClient
    +prepare(signer: algosdk.atomic_transaction_composer.TransactionSigner | algokit_utils.models.Account | None = None, sender: str | None = None, app_id: int | None = None, template_values: algokit_utils.deploy.TemplateValueDict | None = None) algokit_utils.application_client.ApplicationClient

    Creates a copy of this ApplicationClient, using the new signer, sender and app_id values if provided. Will also substitute provided template_values into the associated app_spec in the copy

    -resolve(to_resolve: algokit_utils.application_specification.DefaultArgumentDict) int | str | bytes
    +resolve(to_resolve: algokit_utils.application_specification.DefaultArgumentDict) int | str | bytes

    Resolves the default value for an ABI method, based on app_spec

    -resolve_signer_sender(signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None) tuple[algosdk.atomic_transaction_composer.TransactionSigner, str]
    +resolve_signer_sender(signer: algosdk.atomic_transaction_composer.TransactionSigner | None = None, sender: str | None = None) tuple[algosdk.atomic_transaction_composer.TransactionSigner, str]

    Return signer and sender, using default values on client if not specified

    Will use provided values if given, otherwise will fall back to values defined on client. If no sender is specified then will attempt to obtain sender from signer

    Raises:
    -

    ValueError – Raised if a signer or sender is not provided. See get_signer_sender +

    ValueError – Raised if a signer or sender is not provided. See get_signer_sender for variant with no exception

    @@ -801,7 +832,7 @@

    API
    -update(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse
    +update(call_abi_method: algokit_utils.models.ABIMethod | bool | None = None, transaction_parameters: algokit_utils.models.TransactionParameters | algokit_utils.models.TransactionParametersDict | None = None, **abi_kwargs: algokit_utils.models.ABIArgType) algokit_utils.models.TransactionResponse | algokit_utils.models.ABITransactionResponse

    Submits a signed transaction with on_complete=UpdateApplication

    @@ -814,7 +845,7 @@

    APISee https://github.com/algorandfoundation/ARCs/pull/150

    -export(directory: pathlib.Path | str | None = None) None
    +export(directory: pathlib.Path | str | None = None) None

    write out the artifacts generated by the application to disk

    Args: directory(optional): path to the directory where the artifacts should be written

    @@ -825,7 +856,7 @@

    API
    class algokit_utils.CallConfig
    -

    Bases: enum.IntFlag

    +

    Bases: enum.IntFlag

    Describes the type of calls a method can be used for based on algosdk.transaction.OnComplete type

    Initialization

    Initialize self. See help(type(self)) for accurate signature.

    @@ -870,7 +901,7 @@

    API
    class algokit_utils.CreateCallParametersDict
    -

    Bases: typing.TypedDict, algokit_utils.models.OnCompleteCallParametersDict

    +

    Bases: typing.TypedDict, algokit_utils.models.OnCompleteCallParametersDict

    Additional parameters that can be included in a transaction when using the ApplicationClient.create/compose_create methods

    Initialization

    @@ -894,7 +925,7 @@

    API
    class algokit_utils.DefaultArgumentDict
    -

    Bases: typing.TypedDict

    +

    Bases: typing.TypedDict

    DefaultArgument is a container for any arguments that may be resolved prior to calling some target method

    Initialization

    @@ -903,7 +934,7 @@

    API
    -algokit_utils.DefaultArgumentType: TypeAlias
    +algokit_utils.DefaultArgumentType: TypeAlias

    None

    Literal values describing the types of default argument sources

    @@ -918,7 +949,7 @@

    API
    class algokit_utils.DeployCallArgsDict
    -

    Bases: typing.TypedDict

    +

    Bases: typing.TypedDict

    Parameters used to update or delete an application when calling deploy()

    Initialization

    @@ -935,7 +966,7 @@

    API
    class algokit_utils.DeployCreateCallArgsDict
    -

    Bases: algokit_utils.deploy.DeployCallArgsDict, typing.TypedDict

    +

    Bases: algokit_utils.deploy.DeployCallArgsDict, typing.TypedDict

    Parameters used to create an application when calling deploy()

    Initialization

    Initialize self. See help(type(self)) for accurate signature.

    @@ -950,7 +981,7 @@

    API
    exception algokit_utils.DeploymentFailedError
    -

    Bases: Exception

    +

    Bases: Exception

    @@ -959,21 +990,21 @@

    API

    Parameters for ensuring an account has a minimum number of µALGOs

    -account_to_fund: algokit_utils.models.Account | algosdk.atomic_transaction_composer.AccountTransactionSigner | str
    +account_to_fund: algokit_utils.models.Account | algosdk.atomic_transaction_composer.AccountTransactionSigner | str

    None

    The account address that will receive the µALGOs

    -fee_micro_algos: int | None
    +fee_micro_algos: int | None

    None

    (optional) The flat fee you want to pay, useful for covering extra fees in a transaction group or app call

    -funding_source: algokit_utils.models.Account | algosdk.atomic_transaction_composer.AccountTransactionSigner | algokit_utils.dispenser_api.TestNetDispenserApiClient | None
    +funding_source: algokit_utils.models.Account | algosdk.atomic_transaction_composer.AccountTransactionSigner | algokit_utils.dispenser_api.TestNetDispenserApiClient | None

    None

    The account (with private key) or signer that will send the µALGOs, will use get_dispenser_account by default. Alternatively you can pass an instance of TestNetDispenserApiClient @@ -982,7 +1013,7 @@

    API
    -max_fee_micro_algos: int | None
    +max_fee_micro_algos: int | None

    None

    (optional)The maximum fee that you are happy to pay (default: unbounded) - if this is set it’s possible the transaction could get rejected during network congestion

    @@ -990,7 +1021,7 @@

    API
    -min_funding_increment_micro_algos: int
    +min_funding_increment_micro_algos: int

    0

    When issuing a funding amount, the minimum amount to transfer (avoids many small transfers if this gets called often on an active account)

    @@ -998,7 +1029,7 @@

    API
    -min_spending_balance_micro_algos: int
    +min_spending_balance_micro_algos: int

    None

    The minimum balance of ALGOs that the account should have available to spend (i.e. on top of minimum balance requirement)

    @@ -1006,14 +1037,14 @@

    API
    -note: str | bytes | None
    +note: str | bytes | None

    None

    The (optional) transaction note, default: “Funding account to meet minimum requirement

    -suggested_params: algosdk.transaction.SuggestedParams | None
    +suggested_params: algosdk.transaction.SuggestedParams | None

    None

    (optional) transaction parameters

    @@ -1026,7 +1057,7 @@

    API

    Response for ensuring an account has a minimum number of µALGOs

    -transaction_id: str
    +transaction_id: str

    None

    The amount of µALGOs that were funded

    @@ -1035,13 +1066,13 @@

    API
    -exception algokit_utils.LogicError(*, logic_error_str: str, program: str, source_map: AlgoSourceMap | None, transaction_id: str, message: str, pc: int, logic_error: Exception | None = None, traces: list | None = None)
    -

    Bases: Exception

    +exception algokit_utils.LogicError(*, logic_error_str: str, program: str, source_map: AlgoSourceMap | None, transaction_id: str, message: str, pc: int, logic_error: Exception | None = None, traces: list | None = None) +

    Bases: Exception

    -algokit_utils.MethodConfigDict: TypeAlias
    +algokit_utils.MethodConfigDict: TypeAlias

    None

    Dictionary of dict[OnCompletionActionName, CallConfig] representing allowed actions for each on completion type

    @@ -1061,7 +1092,7 @@

    API
    -algokit_utils.OnCompleteActionName: TypeAlias
    +algokit_utils.OnCompleteActionName: TypeAlias

    None

    String literals representing on completion transaction types

    @@ -1077,7 +1108,7 @@

    API
    class algokit_utils.OnCompleteCallParametersDict
    -

    Bases: typing.TypedDict, algokit_utils.models.TransactionParametersDict

    +

    Bases: typing.TypedDict, algokit_utils.models.TransactionParametersDict

    Additional parameters that can be included in a transaction when using the ApplicationClient.call/compose_call methods

    Initialization

    @@ -1087,7 +1118,7 @@

    API
    class algokit_utils.OnSchemaBreak(*args, **kwds)
    -

    Bases: enum.Enum

    +

    Bases: enum.Enum

    Action to take if an Application’s schema has breaking changes

    Initialization

    @@ -1116,7 +1147,7 @@

    API
    class algokit_utils.OnUpdate(*args, **kwds)
    -

    Bases: enum.Enum

    +

    Bases: enum.Enum

    Action to take if an Application has been updated

    Initialization

    @@ -1152,7 +1183,7 @@

    API
    class algokit_utils.OperationPerformed(*args, **kwds)
    -

    Bases: enum.Enum

    +

    Bases: enum.Enum

    Describes the actions taken during deployment

    Initialization

    @@ -1187,7 +1218,7 @@

    API
    -class algokit_utils.Program(program: str, client: algosdk.v2client.algod.AlgodClient)
    +class algokit_utils.Program(program: str, client: algosdk.v2client.algod.AlgodClient)

    A compiled TEAL program

    Initialization

    Fully compile the program source to binary and generate a @@ -1196,21 +1227,21 @@

    API
    -algokit_utils.TemplateValueDict: TypeAlias
    +algokit_utils.TemplateValueDict: TypeAlias

    None

    Dictionary of dict[str, int | str | bytes] representing template variable names and values

    -algokit_utils.TemplateValueMapping: TypeAlias
    +algokit_utils.TemplateValueMapping: TypeAlias

    None

    Mapping of str to int | str | bytes representing template variable names and values

    -class algokit_utils.TestNetDispenserApiClient(auth_token: str | None = None, request_timeout: int = DISPENSER_REQUEST_TIMEOUT)
    +class algokit_utils.TestNetDispenserApiClient(auth_token: str | None = None, request_timeout: int = DISPENSER_REQUEST_TIMEOUT)

    Client for interacting with the AlgoKit TestNet Dispenser API. To get started create a new access token via algokit dispenser login --ci and pass it to the client constructor as auth_token. @@ -1220,19 +1251,19 @@

    APIInitialization

    -fund(address: str, amount: int, asset_id: int) algokit_utils.dispenser_api.DispenserFundResponse
    +fund(address: str, amount: int, asset_id: int) algokit_utils.dispenser_api.DispenserFundResponse

    Fund an account with Algos from the dispenser API

    -get_limit(address: str) algokit_utils.dispenser_api.DispenserLimitResponse
    +get_limit(address: str) algokit_utils.dispenser_api.DispenserLimitResponse

    Get current limit for an account with Algos from the dispenser API

    -refund(refund_txn_id: str) None
    +refund(refund_txn_id: str) None

    Register a refund for a transaction with the dispenser API

    @@ -1244,70 +1275,149 @@

    API

    Additional parameters that can be included in a transaction

    -accounts: list[str] | None
    +accounts: list[str] | None

    None

    Accounts to include in transaction

    -boxes: collections.abc.Sequence[tuple[int, bytes | bytearray | str | int]] | None
    +boxes: collections.abc.Sequence[tuple[int, bytes | bytearray | str | int]] | None

    None

    Box references to include in transaction. A sequence of (app id, box key) tuples

    -foreign_apps: list[int] | None
    +foreign_apps: list[int] | None

    None

    List of foreign apps (by app id) to include in transaction

    -foreign_assets: list[int] | None
    +foreign_assets: list[int] | None

    None

    List of foreign assets (by asset id) to include in transaction

    -lease: bytes | str | None
    +lease: bytes | str | None

    None

    Lease value for this transaction

    -note: bytes | str | None
    +note: bytes | str | None

    None

    Note for this transaction

    -rekey_to: str | None
    +rekey_to: str | None

    None

    Address to rekey to

    -sender: str | None
    +sender: str | None

    None

    Sender of this transaction

    -signer: algosdk.atomic_transaction_composer.TransactionSigner | None
    +signer: algosdk.atomic_transaction_composer.TransactionSigner | None

    None

    Signer to use when signing this transaction

    -suggested_params: algosdk.transaction.SuggestedParams | None
    +suggested_params: algosdk.transaction.SuggestedParams | None +

    None

    +

    SuggestedParams to use for this transaction

    +
    + +

    + +
    +
    +class algokit_utils.TransactionParametersDict
    +

    Bases: typing.TypedDict

    +

    Additional parameters that can be included in a transaction

    +

    Initialization

    +

    Initialize self. See help(type(self)) for accurate signature.

    +
    +
    +accounts: list[str]
    +

    None

    +

    Accounts to include in transaction

    +
    + +
    +
    +boxes: collections.abc.Sequence[tuple[int, bytes | bytearray | str | int]]
    +

    None

    +

    Box references to include in transaction. A sequence of (app id, box key) tuples

    +
    + +
    +
    +foreign_apps: list[int]
    +

    None

    +

    List of foreign apps (by app id) to include in transaction

    +
    + +
    +
    +foreign_assets: list[int]
    +

    None

    +

    List of foreign assets (by asset id) to include in transaction

    +
    + +
    +
    +lease: bytes | str
    +

    None

    +

    Lease value for this transaction

    +
    + +
    +
    +note: bytes | str
    +

    None

    +

    Note for this transaction

    +
    + +
    +
    +rekey_to: str
    +

    None

    +

    Address to rekey to

    +
    + +
    +
    +sender: str
    +

    None

    +

    Sender of this transaction

    +
    + +
    +
    +signer: algosdk.atomic_transaction_composer.TransactionSigner
    +

    None

    +

    Signer to use when signing this transaction

    +
    + +
    +
    +suggested_params: algosdk.transaction.SuggestedParams

    None

    SuggestedParams to use for this transaction

    @@ -1320,21 +1430,21 @@

    API

    Response for a non ABI call

    -confirmed_round: int | None
    +confirmed_round: int | None

    None

    Round transaction was confirmed, None if call was a from a dry-run

    -static from_atr(result: algosdk.atomic_transaction_composer.AtomicTransactionResponse | algosdk.atomic_transaction_composer.SimulateAtomicTransactionResponse, transaction_index: int = -1) algokit_utils.models.TransactionResponse
    +static from_atr(result: algosdk.atomic_transaction_composer.AtomicTransactionResponse | algosdk.atomic_transaction_composer.SimulateAtomicTransactionResponse, transaction_index: int = -1) algokit_utils.models.TransactionResponse

    Returns either an ABITransactionResponse or a TransactionResponse based on the type of the transaction referred to by transaction_index

    Parameters:
    • result (AtomicTransactionResponse) – Result containing one or more transactions

    • -
    • transaction_index (int) – Which transaction in the result to return, defaults to -1 (the last transaction)

    • +
    • transaction_index (int) – Which transaction in the result to return, defaults to -1 (the last transaction)

    @@ -1342,7 +1452,7 @@

    API
    -tx_id: str
    +tx_id: str

    None

    Transaction Id

    @@ -1377,13 +1487,13 @@

    API
    -algokit_utils.create_kmd_wallet_account(kmd_client: algosdk.kmd.KMDClient, name: str) algokit_utils.models.Account
    +algokit_utils.create_kmd_wallet_account(kmd_client: algosdk.kmd.KMDClient, name: str) algokit_utils.models.Account

    Creates a wallet with specified name

    -algokit_utils.ensure_funded(client: algosdk.v2client.algod.AlgodClient, parameters: algokit_utils._ensure_funded.EnsureBalanceParameters) algokit_utils._ensure_funded.EnsureFundedResponse | None
    +algokit_utils.ensure_funded(client: algosdk.v2client.algod.AlgodClient, parameters: algokit_utils._ensure_funded.EnsureBalanceParameters) algokit_utils._ensure_funded.EnsureFundedResponse | None

    Funds a given account using a funding source such that it has a certain amount of algos free to spend (accounting for ALGOs locked in minimum balance requirement) see https://developer.algorand.org/docs/get-details/accounts/#minimum-balance

    @@ -1398,7 +1508,7 @@

    API
    -algokit_utils.execute_atc_with_logic_error(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, algod_client: algosdk.v2client.algod.AlgodClient, approval_program: str, wait_rounds: int = 4, approval_source_map: algosdk.source_map.SourceMap | Callable[[], algosdk.source_map.SourceMap | None] | None = None) algosdk.atomic_transaction_composer.AtomicTransactionResponse
    +algokit_utils.execute_atc_with_logic_error(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, algod_client: algosdk.v2client.algod.AlgodClient, approval_program: str, wait_rounds: int = 4, approval_source_map: algosdk.source_map.SourceMap | Callable[[], algosdk.source_map.SourceMap | None] | None = None) algosdk.atomic_transaction_composer.AtomicTransactionResponse

    Calls AtomicTransactionComposer.execute() on provided atc, but will parse any errors and raise a LogicError if possible

    @@ -1410,7 +1520,7 @@

    API
    -algokit_utils.get_account(client: algosdk.v2client.algod.AlgodClient, name: str, fund_with_algos: float = 1000, kmd_client: KMDClient | None = None) algokit_utils.models.Account
    +algokit_utils.get_account(client: algosdk.v2client.algod.AlgodClient, name: str, fund_with_algos: float = 1000, kmd_client: KMDClient | None = None) algokit_utils.models.Account

    Returns an Algorand account with private key loaded by convention based on the given name identifier.

    Convention

    @@ -1436,33 +1546,33 @@

    Example
    -algokit_utils.get_account_from_mnemonic(mnemonic: str) algokit_utils.models.Account
    +algokit_utils.get_account_from_mnemonic(mnemonic: str) algokit_utils.models.Account

    Convert a mnemonic (25 word passphrase) into an Account

    -algokit_utils.get_algod_client(config: algokit_utils.network_clients.AlgoClientConfig | None = None) algosdk.v2client.algod.AlgodClient
    +algokit_utils.get_algod_client(config: algokit_utils.network_clients.AlgoClientConfig | None = None) algosdk.v2client.algod.AlgodClient

    Returns an algosdk.v2client.algod.AlgodClient from config or environment

    If no configuration provided will use environment variables ALGOD_SERVER, ALGOD_PORT and ALGOD_TOKEN

    -algokit_utils.get_app_id_from_tx_id(algod_client: algosdk.v2client.algod.AlgodClient, tx_id: str) int
    +algokit_utils.get_app_id_from_tx_id(algod_client: algosdk.v2client.algod.AlgodClient, tx_id: str) int

    Finds the app_id for provided transaction id

    -algokit_utils.get_creator_apps(indexer: algosdk.v2client.indexer.IndexerClient, creator_account: algokit_utils.models.Account | str) algokit_utils.deploy.AppLookup
    +algokit_utils.get_creator_apps(indexer: algosdk.v2client.indexer.IndexerClient, creator_account: algokit_utils.models.Account | str) algokit_utils.deploy.AppLookup

    Returns a mapping of Application names to AppMetaData for all Applications created by specified creator that have a transaction note containing AppDeployMetaData

    -algokit_utils.get_default_localnet_config(config: Literal[algod, indexer, kmd]) algokit_utils.network_clients.AlgoClientConfig
    +algokit_utils.get_default_localnet_config(config: Literal[algod, indexer, kmd]) algokit_utils.network_clients.AlgoClientConfig

    Returns the client configuration to point to the default LocalNet

    @@ -1474,7 +1584,7 @@

    Example
    -algokit_utils.get_indexer_client(config: algokit_utils.network_clients.AlgoClientConfig | None = None) algosdk.v2client.indexer.IndexerClient
    +algokit_utils.get_indexer_client(config: algokit_utils.network_clients.AlgoClientConfig | None = None) algosdk.v2client.indexer.IndexerClient

    Returns an algosdk.v2client.indexer.IndexerClient from config or environment.

    If no configuration provided will use environment variables INDEXER_SERVER, INDEXER_PORT and INDEXER_TOKEN

    @@ -1489,7 +1599,7 @@

    Example
    -algokit_utils.get_kmd_wallet_account(client: algosdk.v2client.algod.AlgodClient, kmd_client: algosdk.kmd.KMDClient, name: str, predicate: Callable[[dict[str, Any]], bool] | None = None) algokit_utils.models.Account | None
    +algokit_utils.get_kmd_wallet_account(client: algosdk.v2client.algod.AlgodClient, kmd_client: algosdk.kmd.KMDClient, name: str, predicate: Callable[[dict[str, Any]], bool] | None = None) algokit_utils.models.Account | None

    Returns wallet matching specified name and predicate or None if not found

    @@ -1501,7 +1611,7 @@

    Example
    -algokit_utils.get_next_version(current_version: str) str
    +algokit_utils.get_next_version(current_version: str) str

    Calculates the next version from current_version

    Next version is calculated by finding a semver like version string and incrementing the lower. This function is used by ApplicationClient.deploy() when @@ -1525,43 +1635,86 @@

    Example
    -algokit_utils.get_or_create_kmd_wallet_account(client: algosdk.v2client.algod.AlgodClient, name: str, fund_with_algos: float = 1000, kmd_client: KMDClient | None = None) algokit_utils.models.Account
    +algokit_utils.get_or_create_kmd_wallet_account(client: algosdk.v2client.algod.AlgodClient, name: str, fund_with_algos: float = 1000, kmd_client: KMDClient | None = None) algokit_utils.models.Account

    Returns a wallet with specified name, or creates one if not found

    -algokit_utils.get_sender_from_signer(signer: algosdk.atomic_transaction_composer.TransactionSigner | None) str | None
    +algokit_utils.get_sender_from_signer(signer: algosdk.atomic_transaction_composer.TransactionSigner | None) str | None

    Returns the associated address of a signer, return None if no address found

    -algokit_utils.is_localnet(client: algosdk.v2client.algod.AlgodClient) bool
    +algokit_utils.is_localnet(client: algosdk.v2client.algod.AlgodClient) bool

    Returns True if client genesis is devnet-v1 or sandnet-v1

    -algokit_utils.is_mainnet(client: algosdk.v2client.algod.AlgodClient) bool
    +algokit_utils.is_mainnet(client: algosdk.v2client.algod.AlgodClient) bool

    Returns True if client genesis is mainnet-v1

    -algokit_utils.is_testnet(client: algosdk.v2client.algod.AlgodClient) bool
    +algokit_utils.is_testnet(client: algosdk.v2client.algod.AlgodClient) bool

    Returns True if client genesis is testnet-v1

    -algokit_utils.num_extra_program_pages(approval: bytes, clear: bytes) int
    +algokit_utils.num_extra_program_pages(approval: bytes, clear: bytes) int

    Calculate minimum number of extra_pages required for provided approval and clear programs

    +
    +
    +algokit_utils.opt_in(algod_client: algosdk.v2client.algod.AlgodClient, account: algokit_utils.models.Account, asset_ids: list[int]) dict[int, str]
    +

    Opt-in to a list of assets on the Algorand blockchain. Before an account can receive a specific asset, +it must opt-in to receive it. An opt-in transaction places an asset holding of 0 into the account and increases +its minimum balance by 100,000 microAlgos.

    +

    Args: +algod_client (AlgodClient): An instance of the AlgodClient class from the algosdk library. +account (Account): An instance of the Account class representing the account that wants to opt-in to the assets. +asset_ids (list[int]): A list of integers representing the asset IDs to opt-in to. +Returns: +dict[int, str]: A dictionary where the keys are the asset IDs and the values +are the transaction IDs for opting-in to each asset.

    +
    + +
    +
    +algokit_utils.opt_out(algod_client: algosdk.v2client.algod.AlgodClient, account: algokit_utils.models.Account, asset_ids: list[int]) dict[int, str]
    +

    Opt out from a list of Algorand Standard Assets (ASAs) by transferring them back to their creators. +The account also recovers the Minimum Balance Requirement for the asset (100,000 microAlgos) +The optOut function manages the opt-out process, permitting the account to discontinue holding a group of assets.

    +

    It’s essential to note that an account can only opt_out of an asset if its balance of that asset is zero.

    +

    Args: +algod_client (AlgodClient): An instance of the AlgodClient class from the algosdk library. +account (Account): An instance of the Account class that holds the private key and address for an account. +asset_ids (list[int]): A list of integers representing the asset IDs of the ASAs to opt out from. +Returns: +dict[int, str]: A dictionary where the keys are the asset IDs and the values are the transaction IDs of +the executed transactions.

    +
    + +
    +
    +algokit_utils.persist_sourcemaps(*, sources: list[algokit_utils._debugging.PersistSourceMapInput], project_root: pathlib.Path, client: algosdk.v2client.algod.AlgodClient, with_sources: bool = True) None
    +

    Persist the sourcemaps for the given sources as an AlgoKit AVM Debugger compliant artifacts. +Args: +sources (list[PersistSourceMapInput]): A list of PersistSourceMapInput objects. +project_root (Path): The root directory of the project. +client (AlgodClient): An AlgodClient object for interacting with the Algorand blockchain. +with_sources (bool): If True, it will dump teal source files along with sourcemaps. +Default is True, as needed by an AlgoKit AVM debugger.

    +
    +
    -algokit_utils.replace_template_variables(program: str, template_values: algokit_utils.deploy.TemplateValueMapping) str
    +algokit_utils.replace_template_variables(program: str, template_values: algokit_utils.deploy.TemplateValueMapping) str

    Replaces TMPL_* variables in program with template_values

    Note

    @@ -1569,6 +1722,30 @@

    Example +
    +algokit_utils.simulate_and_persist_response(atc: algosdk.atomic_transaction_composer.AtomicTransactionComposer, project_root: pathlib.Path, algod_client: algosdk.v2client.algod.AlgodClient, buffer_size_mb: float = 256) algosdk.atomic_transaction_composer.SimulateAtomicTransactionResponse
    +

    Simulates the atomic transactions using the provided AtomicTransactionComposer object and AlgodClient object, +and persists the simulation response to an AlgoKit AVM Debugger compliant JSON file.

    +
    +
    Parameters:
    +
      +
    • atc – An AtomicTransactionComposer object representing the atomic transactions to be +simulated and persisted.

    • +
    • project_root – A Path object representing the root directory of the project.

    • +
    • algod_client – An AlgodClient object representing the Algorand client.

    • +
    • buffer_size_mb – The size of the trace buffer in megabytes. Defaults to 256mb.

    • +
    +
    +
    Returns:
    +

    None

    +
    +
    +

    Returns: +SimulateAtomicTransactionResponse: The simulated response after persisting it +for AlgoKit AVM Debugger consumption.

    +

    +
    algokit_utils.transfer(client: algosdk.v2client.algod.AlgodClient, parameters: algokit_utils._transfer.TransferParameters) algosdk.transaction.PaymentTxn
    diff --git a/docs/html/capabilities/account.html b/docs/html/capabilities/account.html index 8abc9332..251d1761 100644 --- a/docs/html/capabilities/account.html +++ b/docs/html/capabilities/account.html @@ -52,6 +52,7 @@
  • App client
  • App deployment
  • Algo transfers
  • +
  • TestNet Dispenser Client
  • algokit_utils
  • diff --git a/docs/html/capabilities/app-client.html b/docs/html/capabilities/app-client.html index 96bdea83..8a5a0164 100644 --- a/docs/html/capabilities/app-client.html +++ b/docs/html/capabilities/app-client.html @@ -65,6 +65,7 @@
  • App deployment
  • Algo transfers
  • +
  • TestNet Dispenser Client
  • algokit_utils
  • diff --git a/docs/html/capabilities/client.html b/docs/html/capabilities/client.html index ae878900..335f2b5f 100644 --- a/docs/html/capabilities/client.html +++ b/docs/html/capabilities/client.html @@ -53,6 +53,7 @@
  • App client
  • App deployment
  • Algo transfers
  • +
  • TestNet Dispenser Client
  • algokit_utils
  • diff --git a/docs/html/capabilities/debugger.html b/docs/html/capabilities/debugger.html new file mode 100644 index 00000000..5df0f2cf --- /dev/null +++ b/docs/html/capabilities/debugger.html @@ -0,0 +1,137 @@ + + + + + + + Debugger — algokit-utils 1.0 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    Debugger

    +

    The AlgoKit Python Utilities package 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 [AVM Debugger extension](link to vscode extension).

    +
    +

    Configuration

    +

    The config.py file contains the UpdatableConfig class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes:

    +
      +
    • debug: Indicates whether debug mode is enabled.

    • +
    • project_root: The path to the project root directory. Can be ignored if you are using algokit_utils inside an algokit compliant project (containing .algokit.toml file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [AVM Debugger](links to extension). Alternatively you can also set the value via the ALGOKIT_PROJECT_ROOT environment variable.

    • +
    • trace_all: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via algokit_utils will store responses from simulate endpoint. These files are called traces, and can be used with [AVM Debugger](link to vscode extension) to debug TEAL source codes, transactions in the atomic group and etc.

    • +
    • trace_buffer_size_mb: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption.

    • +
    • max_search_depth: The maximum depth to search for a an algokit config file. By default it will traverse at most 10 folders searching for .algokit.toml file which will be used to assume algokit compliant project root path.

    • +
    +

    The configure method can be used to set these attributes.

    +

    To enable debug mode in your project you can configure it as follows:

    +
    from algokit_utils.config import config
    +
    +config.configure(debug=True)
    +
    +
    +
    +
    +

    Debugging Utilities

    +

    Debugging utilities can be used to simplify gathering artifacts to be used with [AVM Debugger](link to vscode extension) in non algokit compliant projects. The following methods are provided:

    +
      +
    • persist_sourcemaps: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts.

    • +
    • simulate_and_persist_response: This method simulates the atomic transactions using the provided AtomicTransactionComposer object and AlgodClient object, and persists the simulation response to an AVM Debugger compliant JSON file.

    • +
    +
    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2023, Algorand Foundation.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/html/capabilities/debugging.html b/docs/html/capabilities/debugging.html new file mode 100644 index 00000000..acc46666 --- /dev/null +++ b/docs/html/capabilities/debugging.html @@ -0,0 +1,151 @@ + + + + + + + Debugger — algokit-utils 1.0 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    Debugger

    +

    The AlgoKit Python Utilities package 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 [AVM Debugger extension](link to vscode extension).

    +
    +

    Configuration

    +

    The config.py file contains the UpdatableConfig class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes:

    +
      +
    • debug: Indicates whether debug mode is enabled.

    • +
    • project_root: The path to the project root directory. Can be ignored if you are using algokit_utils inside an algokit compliant project (containing .algokit.toml file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [AVM Debugger](links to extension). Alternatively you can also set the value via the ALGOKIT_PROJECT_ROOT environment variable.

    • +
    • trace_all: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via algokit_utils will store responses from simulate endpoint. These files are called traces, and can be used with [AVM Debugger](link to vscode extension) to debug TEAL source codes, transactions in the atomic group and etc.

    • +
    • trace_buffer_size_mb: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption.

    • +
    • max_search_depth: The maximum depth to search for a an algokit config file. By default it will traverse at most 10 folders searching for .algokit.toml file which will be used to assume algokit compliant project root path.

    • +
    +

    The configure method can be used to set these attributes.

    +

    To enable debug mode in your project you can configure it as follows:

    +
    from algokit_utils.config import config
    +
    +config.configure(debug=True)
    +
    +
    +
    +
    +

    Debugging Utilities

    +

    Debugging utilities can be used to simplify gathering artifacts to be used with AlgoKit AVM Debugger in non algokit compliant projects. The following methods are provided:

    +
      +
    • persist_sourcemaps: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. It takes a list of PersistSourceMapInput objects, a Path object representing the root directory of the project, an AlgodClient object for interacting with the Algorand blockchain, and a boolean indicating whether to dump teal source files along with sourcemaps.

    • +
    • simulate_and_persist_response: This method simulates the atomic transactions using the provided AtomicTransactionComposer object and AlgodClient object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an AtomicTransactionComposer object representing the atomic transactions to be simulated and persisted, a Path object representing the root directory of the project, an AlgodClient object representing the Algorand client, and a float representing the size of the trace buffer in megabytes.

    • +
    +
    +

    Trace filename format

    +

    The trace files are named in a specific format to provide useful information about the transactions they contain. The format is as follows:

    +
    `${timestamp}_lr${last_round}_${transaction_types}.trace.avm.json`;
    +
    +
    +

    Where:

    +
      +
    • timestamp: The time when the trace file was created, in ISO 8601 format, with colons and periods removed.

    • +
    • last_round: The last round when the simulation was performed.

    • +
    • transaction_types: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as ${count}#${type}, and different transaction types are separated by underscores.

    • +
    +

    For example, a trace file might be named 20220301T123456Z_lr1000_2#pay_1#axfer.trace.avm.json, indicating that the trace file was created at 2022-03-01T12:34:56Z, the last round was 1000, and the atomic group contained 2 payment transactions and 1 asset transfer transaction.

    +
    +
    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2023, Algorand Foundation.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/html/genindex.html b/docs/html/genindex.html index c9a17680..1a47ba0b 100644 --- a/docs/html/genindex.html +++ b/docs/html/genindex.html @@ -114,7 +114,11 @@

    A

  • account_to_fund (algokit_utils.EnsureBalanceParameters attribute)
  • accounts (algokit_utils.TransactionParameters attribute) + +
  • add_method_call() (algokit_utils.ApplicationClient method)
  • address (algokit_utils.Account attribute) @@ -159,7 +163,11 @@

    B

    @@ -275,11 +283,19 @@

    F

  • fee_micro_algos (algokit_utils.EnsureBalanceParameters attribute)
  • foreign_apps (algokit_utils.TransactionParameters attribute) + +
    • foreign_assets (algokit_utils.TransactionParameters attribute) + +
    • from_atr() (algokit_utils.TransactionResponse static method)
    • fund() (algokit_utils.TestNetDispenserApiClient method) @@ -353,7 +369,11 @@

      L

      @@ -419,15 +441,21 @@

      O

    • OnCompleteCallParametersDict (class in algokit_utils)
    • - - +
      @@ -435,12 +463,14 @@

      O

      P

        +
      • replace_template_variables() (in module algokit_utils) +
      • ReplaceApp (algokit_utils.OnSchemaBreak attribute)
          @@ -482,21 +516,31 @@

          S

          @@ -516,6 +560,8 @@

          T

        • transaction_id (algokit_utils.EnsureFundedResponse attribute)
        • TransactionParameters (class in algokit_utils) +
        • +
        • TransactionParametersDict (class in algokit_utils)
          • diff --git a/docs/html/index.html b/docs/html/index.html index ae93dfb3..ce389a02 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -182,6 +182,7 @@

            Types
          • ARC-0032 Application Spec client - 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)

          • App deployment - Idempotent (safely retryable) deployment of an app, including deploy-time immutability and permanence control and TEAL template substitution

          • Algo transfers - Ability to easily initiate algo transfers between accounts, including dispenser management and idempotent account funding

          • +
          • Debugger - 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 AVM Debugger extension.

          diff --git a/docs/html/objects.inv b/docs/html/objects.inv index d0ce3ac4424fadda4cc78f1871ae4bac8c304bf1..0e5c706d280fb5669dd9b939f1939e5cc973816d 100644 GIT binary patch delta 3273 zcmV;)3^wz!7^WJKeSb@Dq&gag_w_4EnzK#KobB0FC)JwPB*IBUAOmrjPc$6K>I^~e5dH~#ea?Z-7r(<3`K%5jRya{s5juu<`b#D5%6m0`qj0NRl*Eb|jX zd5L09X#R-Hg61U-Dt<_COcNYo#we?u5a*1%R2&C!%P@bVNq8TIen%fDt?&j`m{%;{ z%8h?UB!8ulMsZB59PAdBY6p}g43{N5=b>QaLlnR09e;&TuU=9Tcj5)31!nvUM!O{E z95X;&@#;DyIDhBYG=C*$s4Sew9!ktUFlgm4b>Q?J=a2?Paf6GLe%)b?ZV*RMm!>Fg zDSfXBI6Zj6NBoKz&SMNG`K!S3FD^=5*VrXBv9GEqXsE8-M2GnD(hSbX+ldJ(TWGOpjlCy1io6G%YPNS1P@IDDn@fJR` z;G$y_-lr;(u-7eczJ$(?q-i$8>Eq9WG9Hz*Vlj>~RD`oSV;-GT`hwEX<-c}HX}pb* z>_tW;&J)=w3u8sH%`z%<*)JF_5DS2&vSEAlkDKi-{S#&|dQ6;&xevU8P*dIj*pOq8F#3Jir@ z_kV!rjK`v&m!T03G0&}%1}6ue;+CTI4e=e36n`hDZc-b6#<*zO954M-URDf$Ln+E* z3|IWpJ4$;6a3!XaKJZHyAR>@e zz<(`0lNh?5yleW~vNs1eV=PtwO>z!Z9pXK0R1UfqjZ z5n4G&KUOCX*y8`pf5mS&L*GP~;yr|BJrWevn)nM?KE@7pw<4JMqv*Y$7(??v_k($m z3ohjXUF%jH{4%$?L9g&Z{sSytVAjlLJbz&JN?C>zsEnKmw}Z`~@P~WK-$cJ7tVx^A zVNEW@3drMu(X*&_f%5kWi|Ske{#|cNfop?DvUjK`+RTJdF8Mv?H>B>HmY5w20=h1& z)jxEDDu`J^y-Tx3Kr+I^TQLlpq=2(eO6_jI3)x>+8@r^tr!8uw#%QaWsWIE8c9K?`)KJoDlUfRRCQ!BiJFX|y>H$c^DC}Z@ z%I%fWEJBH9D^;yMhSiqB|r?;4q_x*lCs;_ zlOfp>hyg>BEBmVzKI69(!Ul|zWK}(oj8HDhWcyP#C_ey1W{(*hZYJKF^%*g~UtH^R z=h8{L5t-Kq!6|2Uj?~7*H+br)oh!9roiYIQ*v*l7aj6p?TxID>zi!DiKz~{m0X$M> zzYrTHVMc$)bj|z4@a&C;BcHi12+un6v*OmRE&K9KbRAfXi_x%nQ>z8q(JP=%#8`6% zz}x=da<|hRK_|To6NbYIq5BU|HuQ4Kj&imE*tZp(y0@L7_Si@Co+Z(5l%|+R=yI$U z07I{@BRYdKoY%QV&EPT1aeqd062mi0^i4!bw?-1+ip;f5B*AVFjkt-WIkA%0Nsyaq z0}yE~Ok9*jp^MX^&5ZAI$RLX4Dx2W|t2@|S)P=-w8*?;-k5TLDz7wGKJ zWC+mK#0zwGm@ourYvKkP^xpKiCxhOLKKJ14kT@(@BklxdI$aLQIQMbFHJng~q@CF~ z!>SLtL$eNDoKba0rJ-TRK2Er%qxO)va~~(%pe>J2i!(px4@uUkJE6@Z1VEy7>ON?j z6d1La6L!#Ug?)Dde}Ce*s+X8~9Q`KzO;lcI5?{h8Ld-y$EG!V~S}Mn%Jo>1Yz-8P8 zpgEM0tR;%fbUAx>*#QIuq!72j%Bw6ADPbroo7dm?m&vDCoo7- z*a=DzE(L^1>e?e2qkXs&sbrm@Mu9@Wm>N}kChhTPcc7W%TAInRYF`p5XAfaKIPDIj zl$}x4E4zbH4M3Bx8^!ca?ZhpRm1=r6rdcK~?CeybyHh7MbFx~j^V+{E=Y-U;=RI2S zf!wkqRDCv;G=Dg2;`;b`k40_WAyYpW)=}ugID7ToCZc-xX|QK6*H%pL2AoQZ^eI9` zds$xeG@eW0#ypy2jj|3z6X(mPPcTxn@`dXo%~Z|);5Caml$BPe<-@-93s=_(n}PYz&QXA7iArTA-;}>|6JAD zUm1o65~VY+CsGFO0Y&N@?3t7?en6Qz2YV(}NFY!obDgFS`Qx$Wf2L_;J`D^6fn61f_ zQGYtkYi`tf2ZEQ&ImEQC-Dx3z3-M0UuJr>e8-HtgZ+UIq?XBFM$LSB~#QhpHpo#I= zmA5<*<>*t0hsfA^F+=Lg%nf%7g|Atg(`Qk80BBC~j-AxcsrGj5Wf$DF&$9L> z7)mcusGoTaz;F>>Ku|my+uvTZ0l2j`KNZYl2c1fH1q0Mds8-v^vJmar7e_6xAzFUs z1;oxUyPUFnKn6UIDaV54)v8=t6T=%A>3`y~icJx47aB}jtfJBf=Y@tFIk_<^;`s)n zlwPYi6+wWZ@ubBnD#*ZS28UHl>e#~2T)oRGHdQEMXfn+aG&7eXZZSBQvG3v%iXEJA zDXg7|6{^|Pi?5~Gro|dNt!510at&-&({0v*&E4Et!?$EAztz0qTeN}AYP#Sp+keGn zHQOdF+}LR~;|49=&}Thg_!e*Ivz~9umQU@t%nUj4ykgdQ^-}~usb*FyC>2j1fMx3q zRzN8pR{#s8-qDj|{+qJ*b_udP9L1+{y8+zk;hE-I2vNVV54d_lC%+nt(|4Q)qmt@N zP{xf2p8LUuvNjwxtN)%+Q8f-Wbbp3*eLtv)unmj#J^=s7ty-HUPTktFJJL|m!dW5;Z@uX;V=uvlC&zecTW%Hg^00s8jF*iv@HvR0 zBCz>d-F8v5U!|Cor->lqD@_wwta?jQIhM^auczlxN56ltzQ3?R5p?_IH(&j+Lm8bx&x|-&ytX@h^c-53AL%|s5PkkF+6!$`L z-zn~gio%!StAdd{CPiw#t!W**uK(sP!S!%>71B-flieBTjq>=n-MjMg{HXuCyL_#^ zpo4GJ7w|uX?;pOz&@10R^RCE|yyPftQ?5_XkHOb=Vnn4tD!#6|4??8p9Zjkfw{U|` z7k<_vj(*L$v*=eMX-$}xCE&~H_0cbOB}OcM8~;$gC*6O^&mTky+f}9bYw&okKi~Zi Hy49fx-O^Ar delta 3027 zcmV;^3oP`e8nPIWeSb}JX82wHtqW{q4sM&a!K9YLt@@<=l7yuM5h0kUov@UGzEqM#am$H(V`+RJfq$b9oK@rkRzy~! zxRjgxM6`HikVZ+ussgMDYqbMTQ$flSp7X#3{ZOYLdM95o)T@__CY?AJj1wWhV6;nm zDu@8oRj+O`N`DG@!-`jWf~vxa?4cy$gMfApQwPc3NdalV`7PlY`?@C*-(rcO4h`pb zjJ;PJP7j{&iM$d)iiE&P{^TV2Db-omUF_1DI8;@gXt?g&bW?z%9qZOz5z^Nkl&EWV zGak~HAz-7(>KVZTm31w|G+`w{tdbEeSk7yc$VaPlxqrw}>&-5A^qMhfe4mtLh#DZGYBT@Nj*12YB-{5Wb10{B*p2KE~00IR15ff|Ty(>mISdsxc4&H5+J>2AmMo z@`HIG@B-W(?~c#c-|mj+`FQ_$r|J|vT;CsI?(uHPE3PtmElyRg`W3(fGf{s2;sgr0 z9{&K(8IMIl4?`myW1ib24NeX`#jQo_2Js!!jDMuZZc>|kCWJTFoFM&UQC5O{!x=6T z0)8r5)DKusA0o-nYgIr_p4%K>i5l_IL@-o;zr2K_Di|$J?Qrt~hB^L3moH{c3)B^r z7V2KHZma(XhLRHv@uEMzFharPCF;1WPA5`Ik|JKe3171Bswzne+=-c_5Ar+&KoqhI zxPN0Onn3rH_sw`)kLKWJjJ4{&X(6F{+=oBaaOd&q`2EL!VG#c;ZdlIi8Jg>+t{zlV zgjS9+jLGlIT6il#(yIbuT115g{sJzaC@^E75?zR38T6YnNF-d9-_TA-z9lff#)L+eS z1F*)LGXU9+b(V)z+YxNi%P?^`yb!uSfU2RFTXxiU%)q{_=+wO(47Hnu(SLiMqTe{n zh(!1tj0J#U*S8U!z!^^KTv2mlloupt1x?@?Ci*U-w3}Ira75s#3JruY4$l6 zbrJLytO!I_3l|p?DE8^JXfxwGZ%svso||=qJ#7b@i*6xt1WEy-&0IF2M&t{CGR7K# zvJD(IBF-a}U;#V*ZFuI`Fn>_Op+y*E{OUG11tLeT{+Ul0?lhPx3ad5=0-Z%=#Q<$h zfi~%9W?CNXA`a~Kob&o?z0Iu>Xj$tiZhQ6g?}XL)Hk8c<4PgX zI`t5=i<~fKuT9udhZX+AiP>Ji?HHYuhb#FcNhJxwGC{wod{bTKi6-aNUl8-&E(;ID zx^FDVr$iq_lx>VK(9F$9))PfHH9co|-cJJrWDxhjDykf*k_e2ru6e}qN$+9<;IgT^ zz{*k7wKZE%(3v)tTz^Hg5PJ^N0gSc7@#eAX@R*&4KdmVQemmDdZ41IYXdVKkQQd@d z6Nl$!JCGql9|lPaZ-O#}_Jc5KU4JBJWcqd@lk8@wQBXS=Q={t7WDVup4m6WoOEU=p z3?{a&hr~^6&lDbJ3^h0Q-4W^vn7W@nD~6rN^eCSpEoYGBSZaq}97+Qkv zLq;h>K_6FJsDC&R!$97PW*%D(1=1*cG1%hJp-2Y$R-S2EfDrFr=84aVSB!=*Q(j_# zt^T3tl5>nopGz-MSdtU~K%A9r431m|0seDUZ+~OT14xw4z@NyNAORGqbMR*}=2HM= z>Ky!;Oz9Uuk=%WnJ-tG}M){ehkNGqS1CW0wYe86wsejx~VNN$7DSgZ< z)VA@NwgaS@onfMn^ao-X$y)4%K7){KD-nHQLGeolwld@}m?51vw{z-~*dwIP+Qc_P zO|yYSKsy)%V14;ac|>ABo_)5G&eD*?z-&#XjP{tWpt(`+74#sNQ;ca{zZjcv3-wOg zu2lmoJAZrmV0mlb9jx3%vGidrNxy~)XyOc33YMqpJo;4PF)FrR%+R{Ja^p3jn9C;K zu~ES;*8MTT%HA2p5=04(vZV<+=7L4#d;*#&p&b3?-khSEzE=I4t7Fr0-K5DbqY4Y#*!U~R44 zPhbhy0cO%&!2q=qYSnhKEM(RU#WBlUh?etUYzEohO zvwzDfHbaV4XfSQDiprjn6&h~jw2je_$u%0K_FBbhNC69tr!7`dL8cRPIILnaXPAZN z>Rnc`nUc~%lUV|{++2n%w%}aOvCEdUx8Q_J$>8R!khk6|?z>lK)&-@SS*@TnWaNcq z>kU>w8B+MdLYdbz3nG6r@!n3ts!_iBRDUnHz{UT}G}l6?{zQDh^$j-p)mW0flOh_G zR$qd0F2w|{h!16bIDFPW0<)=E9DL{;D;r@@6JZ|~@0F17jBi$(B~IJy`gWwDqKCU_ z8a~Lp6ZG&lP1gr`cY-r-k0{@ubpp@*B0(O;WS$_3hGd;Pu^y#(wnHZb&j_Y`T>W>Spk@or!*kVl7=)wtbEZ z)ynF<>=QB0uiEaxs@H#|mE?S{U(co5Ts8=LfJgiX9pOMk0NuG+-DdrMU?%Q?-OeTrAONUyqc_o}R3N=aqa zoCuB^?Ta=r~dp= Vof^BURR20We$}7v{s(algokit_utils", "TestNet Dispenser Client", "Algo transfers", "AlgoKit Python Utilities"], "terms": {"abicallarg": 0, "abi": 0, "paramet": [0, 2], "us": [0, 1, 2, 3], "updat": 0, "delet": 0, "an": [0, 2, 3], "applic": [0, 3], "when": [0, 2], "call": [0, 2, 3], "deploi": [0, 3], "abicallargsdict": 0, "abicreatecallarg": 0, "creat": [0, 3], "abicreatecallargsdict": 0, "abitransactionrespons": 0, "respons": [0, 1], "account": [0, 2, 3], "hold": 0, "private_kei": 0, "address": [0, 1, 2], "algoclientconfig": 0, "connect": 0, "detail": [0, 1], "algosdk": 0, "v2client": 0, "algod": [0, 2, 3], "algodcli": 0, "index": [0, 3], "indexercli": 0, "appdeploymetadata": 0, "metadata": 0, "about": 0, "store": [0, 2], "transact": [0, 1, 2, 3], "note": [0, 2], "dure": [0, 2], "creation": [0, 3], "applookup": 0, "cach": 0, "appmetadata": 0, "specif": 0, "creator": [0, 3], "app": [0, 2, 3], "apprefer": 0, "inform": 0, "algorand": [0, 3], "applicationcli": 0, "A": [0, 3], "wrap": [0, 3], "arc": [0, 3], "0032": [0, 3], "spec": [0, 3], "provid": [0, 1, 2, 3], "high": [0, 3], "product": [0, 3], "method": [0, 1, 3], "applicationspecif": 0, "callconfig": 0, "describ": 0, "type": [0, 1], "can": [0, 1, 2, 3], "base": 0, "oncomplet": 0, "createcallparamet": 0, "addit": [0, 3], "includ": [0, 2, 3], "compose_cr": 0, "createcallparametersdict": 0, "createtransactionparamet": 0, "defaultargumentdict": 0, "defaultargu": 0, "i": [0, 1, 2, 3], "contain": [0, 1, 3], "ani": [0, 1, 3], "argument": [0, 1], "mai": 0, "resolv": [0, 3], "prior": [0, 2], "some": [0, 2], "target": 0, "deploycallarg": 0, "deploycallargsdict": 0, "deploycreatecallarg": 0, "deploycreatecallargsdict": 0, "deployrespons": 0, "action": 0, "taken": 0, "deploy": [0, 2, 3], "relat": 0, "ensurebalanceparamet": [0, 2], "ensur": [0, 3], "ha": [0, 2, 3], "minimum": [0, 3], "number": [0, 2, 3], "\u00b5algo": 0, "ensurefundedrespons": [0, 2], "methodhint": 0, "hint": [0, 3], "caller": 0, "how": [0, 1], "oncompletecallparamet": 0, "compose_cal": 0, "oncompletecallparametersdict": 0, "onschemabreak": 0, "take": [0, 1, 2], "": [0, 1, 2, 3], "schema": 0, "break": 0, "chang": 0, "onupd": 0, "been": [0, 3], "operationperform": 0, "program": 0, "compil": 0, "teal": [0, 3], "testnetdispenserapicli": [0, 1, 2], "client": [0, 2, 3], "interact": [0, 1], "algokit": [0, 1, 2], "testnet": [0, 2, 3], "dispens": [0, 3], "To": [0, 1, 2, 3], "get": [0, 2, 3], "start": 0, "new": 0, "access": [0, 2], "token": [0, 1, 2], "via": [0, 1, 2, 3], "login": 0, "ci": 0, "pass": [0, 1], "constructor": [0, 1], "auth_token": [0, 1], "altern": 0, "set": [0, 1, 2, 3], "environ": [0, 1, 2, 3], "variabl": [0, 1, 2, 3], "algokit_dispenser_access_token": [0, 1, 2], "auto": [0, 3], "load": 0, "If": [0, 1, 2, 3], "both": [0, 1], "ar": [0, 1, 2, 3], "preced": [0, 1], "transactionparamet": 0, "transactionrespons": 0, "non": 0, "transferassetparamet": [0, 2], "transfer": [0, 3], "asset": [0, 1, 3], "between": [0, 2, 3], "transferparamet": [0, 2], "create_kmd_wallet_account": 0, "wallet": 0, "specifi": [0, 2, 3], "name": 0, "ensure_fund": [0, 2], "fund": [0, 2, 3], "given": 0, "sourc": 0, "certain": 0, "amount": [0, 1, 2], "algo": [0, 1, 3], "free": 0, "spend": [0, 2], "lock": 0, "balanc": [0, 2], "requir": [0, 1, 2], "see": [0, 1, 2], "http": 0, "develop": [0, 3], "org": 0, "doc": [0, 1, 3], "execute_atc_with_logic_error": 0, "atomictransactioncompos": 0, "execut": 0, "atc": 0, "pars": 0, "error": [0, 3], "rais": [0, 1], "logicerror": 0, "possibl": [0, 2, 3], "get_account": 0, "return": [0, 1, 2], "privat": [0, 2], "kei": [0, 2], "identifi": [0, 3], "get_account_from_mnemon": 0, "convert": 0, "mnemon": [0, 2, 3], "25": 0, "word": 0, "passphras": 0, "get_algod_cli": 0, "from": [0, 1, 3], "config": 0, "get_app_id_from_tx_id": 0, "find": [0, 2, 3], "app_id": 0, "id": [0, 1, 2, 3], "get_creator_app": 0, "map": 0, "all": [0, 3], "have": [0, 2, 3], "get_default_localnet_config": 0, "configur": [0, 3], "point": 0, "default": [0, 2, 3], "localnet": [0, 2], "get_dispenser_account": [0, 2], "dispenser_mnenom": 0, "get_indexer_cli": 0, "get_kmd_client_from_algod_cli": 0, "kmd": [0, 2, 3], "kmdclient": 0, "suppli": 0, "get_kmd_wallet_account": 0, "match": 0, "predic": 0, "none": [0, 2], "found": 0, "get_localnet_default_account": 0, "instanc": [0, 2], "get_next_vers": 0, "calcul": 0, "next": 0, "version": 0, "current_vers": 0, "get_or_create_kmd_wallet_account": 0, "one": 0, "get_sender_from_sign": 0, "associ": 0, "signer": [0, 2, 3], "is_localnet": 0, "true": [0, 2], "genesi": 0, "devnet": 0, "v1": 0, "sandnet": 0, "is_mainnet": 0, "mainnet": [0, 2], "is_testnet": 0, "num_extra_program_pag": 0, "extra_pag": 0, "approv": 0, "clear": 0, "replace_template_vari": 0, "replac": 0, "tmpl_": 0, "template_valu": 0, "transfer_asset": [0, 2], "appspecstatedict": 0, "defin": [0, 3], "state": [0, 3], "entri": 0, "deletable_template_nam": 0, "templat": [0, 3], "control": [0, 3], "smart": [0, 3], "contract": [0, 3], "defaultargumenttyp": 0, "liter": 0, "valu": [0, 2], "methodconfigdict": 0, "dictionari": 0, "dict": 0, "oncompletionactionnam": 0, "repres": 0, "allow": [0, 2], "each": [0, 1], "complet": [0, 3], "note_prefix": 0, "0002": 0, "compliant": 0, "prefix": 0, "oncompleteactionnam": 0, "string": [0, 2], "templatevaluedict": 0, "str": 0, "int": 0, "byte": 0, "templatevaluemap": 0, "updatable_template_nam": 0, "abical": 0, "typeddict": 0, "initi": [0, 1, 2, 3], "self": 0, "help": [0, 3], "accur": 0, "signatur": 0, "model": 0, "gener": [0, 2, 3], "returntyp": 0, "decode_error": 0, "except": [0, 1], "occur": [0, 1], "attempt": [0, 2], "decod": 0, "raw_valu": 0, "make": [0, 1, 2, 3], "The": [0, 1, 2, 3], "raw": 0, "befor": 0, "return_valu": 0, "result": 0, "tx_info": 0, "thi": [0, 1, 2, 3], "base64": 0, "encod": 0, "properti": 0, "public_kei": 0, "public": 0, "atomic_transaction_compos": 0, "accounttransactionsign": [0, 2], "server": 0, "url": 0, "servic": [0, 2], "e": [0, 2, 3], "g": [0, 3], "localhost": 0, "4001": 0, "algonod": 0, "cloud": 0, "authent": 0, "serial": 0, "json": 0, "field": [0, 1, 2], "part": [0, 3], "reduc": 0, "multipl": 0, "discov": 0, "typealia": 0, "algod_cli": [0, 2], "app_spec": 0, "application_specif": 0, "pathlib": 0, "path": 0, "0": [0, 1, 2], "indexer_cli": 0, "existing_deploy": 0, "transactionsign": 0, "sender": [0, 1], "suggested_param": [0, 2], "suggestedparam": [0, 2], "app_nam": 0, "exist": 0, "instead": 0, "onli": 0, "sign": 0, "wa": [0, 2], "should": [0, 2], "NOT": 0, "add_method_cal": 0, "abi_method": 0, "abimethod": 0, "bool": 0, "abi_arg": 0, "abiargsdict": 0, "transactionparametersdict": 0, "on_complet": 0, "noopoc": 0, "local_schema": 0, "stateschema": 0, "global_schema": 0, "approval_program": 0, "clear_program": 0, "app_arg": 0, "list": 0, "call_config": 0, "au_spec": 0, "add": [0, 3], "call_abi_method": 0, "transaction_paramet": 0, "abi_kwarg": 0, "abiargtyp": 0, "submit": 0, "clear_stat": 0, "clearstat": 0, "close_out": 0, "closeout": 0, "compose_clear_st": 0, "compose_close_out": 0, "ac": 0, "compose_delet": 0, "deleteappl": 0, "compose_opt_in": 0, "optin": 0, "compose_upd": 0, "updateappl": 0, "allow_upd": 0, "allow_delet": 0, "on_upd": 0, "au_deploi": 0, "fail": 0, "on_schema_break": 0, "create_arg": 0, "update_arg": 0, "delete_arg": 0, "refer": [0, 1, 2], "idempot": [0, 2, 3], "against": [0, 2, 3], "time": [0, 3], "placehold": 0, "substitut": [0, 3], "understand": 0, "architectur": 0, "decis": 0, "behind": 0, "pleas": [0, 2], "github": 0, "com": 0, "algorandfound": 0, "cli": [0, 2], "blob": 0, "main": 0, "2023": 0, "01": 0, "12_smart": 0, "md": 0, "replaceapp": 0, "re": 0, "differ": [0, 2], "code": [0, 1, 3], "increment": 0, "tmpl_delet": 0, "condition": 0, "tmpl_updat": 0, "determin": [0, 2], "what": 0, "increas": 0, "beyond": 0, "current": [0, 2, 3], "alloc": 0, "relev": 0, "deploymenterror": 0, "export_source_map": 0, "export": 0, "later": 0, "import": [0, 1, 3], "import_source_map": 0, "get_global_st": 0, "fals": 0, "global": 0, "info": 0, "get_local_st": 0, "local": 0, "get_signer_send": 0, "tupl": 0, "Will": 0, "otherwis": [0, 2], "fall": 0, "back": [0, 1], "obtain": [0, 1], "source_map_json": 0, "opt_in": 0, "prepar": 0, "application_cli": 0, "copi": 0, "also": 0, "to_resolv": 0, "resolve_signer_send": 0, "valueerror": 0, "variant": 0, "pull": 0, "150": 0, "directori": 0, "write": [0, 3], "out": [0, 2], "artifact": 0, "disk": 0, "arg": 0, "option": [0, 2], "where": [0, 3], "written": [0, 3], "enum": 0, "intflag": 0, "3": 0, "handl": [0, 3], "normal": 0, "1": 0, "2": 0, "never": 0, "deploymentfailederror": 0, "account_to_fund": [0, 2], "receiv": [0, 1, 2], "fee_micro_algo": [0, 2], "flat": [0, 2], "fee": [0, 2], "you": [0, 1, 2, 3], "want": [0, 2, 3], "pai": [0, 2], "cover": [0, 2], "extra": [0, 2], "group": [0, 2], "funding_sourc": [0, 2], "dispenser_api": 0, "send": [0, 1, 2], "which": [0, 1, 2, 3], "max_fee_micro_algo": [0, 2], "maximum": [0, 2], "happi": [0, 2], "unbound": [0, 2], "could": [0, 2], "reject": [0, 2], "network": [0, 2, 3], "congest": [0, 2], "min_funding_increment_micro_algo": [0, 2], "issu": [0, 1, 2, 3], "avoid": [0, 2], "mani": [0, 2], "small": [0, 2], "often": [0, 2], "activ": [0, 2], "min_spending_balance_micro_algo": [0, 2], "avail": [0, 2, 3], "top": [0, 2, 3], "meet": [0, 2], "transaction_id": [0, 1], "were": 0, "logic_error_str": 0, "source_map": 0, "algosourcemap": 0, "messag": [0, 1], "pc": 0, "logic_error": 0, "trace": 0, "algokit_deploy": 0, "j": 0, "kwd": 0, "appendapp": 0, "old": 0, "singl": 0, "updateapp": 0, "No": 0, "noth": [0, 3], "date": 0, "origin": 0, "latest": 0, "fulli": 0, "binari": 0, "line": 0, "request_timeout": 0, "dispenser_request_timeout": 0, "request": [0, 1], "timeout": 0, "15": 0, "second": 0, "modifi": 0, "asset_id": [0, 1, 2], "dispenserfundrespons": 0, "get_limit": [0, 1], "dispenserlimitrespons": 0, "limit": [0, 3], "refund": [0, 3], "refund_txn_id": [0, 1], "regist": [0, 3], "box": 0, "collect": 0, "abc": 0, "sequenc": 0, "bytearrai": 0, "foreign_app": 0, "foreign": 0, "foreign_asset": 0, "leas": 0, "rekey_to": 0, "rekei": 0, "confirmed_round": 0, "round": 0, "confirm": 0, "dry": 0, "run": [0, 2], "static": 0, "from_atr": 0, "atomictransactionrespons": 0, "simulateatomictransactionrespons": 0, "transaction_index": 0, "either": 0, "more": [0, 2], "last": 0, "tx_id": [0, 1], "_transfer": 0, "transferparametersbas": 0, "clawback_from": 0, "perform": [0, 1], "clawback": 0, "oper": 0, "case": [0, 2, 3], "senderaccount": 0, "must": 0, "equal": 0, "asa": 0, "kmd_client": 0, "_ensure_fund": 0, "librari": [0, 3], "paymenttxn": 0, "need": [0, 1, 2, 3], "payment": [0, 1, 2], "indic": [0, 1], "wait_round": 0, "4": 0, "approval_source_map": 0, "sourcemap": 0, "callabl": 0, "abl": 0, "fund_with_algo": 0, "float": 0, "1000": [0, 1], "o": [0, 1], "f": 0, "_mnemon": 0, "secret": 0, "Be": 0, "care": 0, "commit": 0, "ideal": 0, "storag": 0, "rather": 0, "than": [0, 2], "file": [0, 3], "system": 0, "doesn": 0, "t": 0, "work": [0, 3], "seamlessli": 0, "without": [0, 3], "manual": 0, "reset": 0, "account_mnemon": 0, "follow": [0, 2, 3], "object": [0, 1], "automat": [0, 2], "network_cli": 0, "algod_serv": 0, "algod_port": 0, "algod_token": 0, "creator_account": 0, "indexer_serv": 0, "indexer_port": 0, "indexer_token": 0, "same": 0, "port": 0, "kmd_port": 0, "4002": 0, "semver": 0, "like": [0, 2, 3], "lower": 0, "intend": 0, "mostli": 0, "conveni": 0, "param": 0, "within": 0, "valid": 0, "input": 0, "output": 0, "beta1": 0, "4567": 0, "4568": 0, "alpha": 0, "cannot": 0, "assettransfertxn": [0, 2], "util": [1, 2], "api": [1, 2, 3], "It": 1, "author": 1, "done": 1, "two": [1, 2], "wai": 1, "directli": 1, "algokit_util": [1, 3], "your_auth_token": 1, "receiver_address": 1, "fundrespons": 1, "keep": 1, "mind": 1, "yourself": 1, "first": 1, "invok": [1, 2], "endpoint": 1, "txn_id": 1, "your": [1, 3], "txn": 1, "inspect": 1, "account_address": 1, "limitrespons": 1, "while": 1, "individu": 1, "higher": [2, 3], "order": [2, 3], "capabl": 2, "easili": [2, 3], "manag": [2, 3], "usag": 2, "exampl": 2, "check": 2, "autom": 2, "test": 2, "function": [2, 3], "facilit": [2, 3], "transfer_paramet": 2, "underli": [2, 3], "from_account": 2, "to_address": 2, "micro_algo": 2, "micro": 2, "abil": [2, 3], "dispos": 2, "incredibli": 2, "script": 2, "made": 2, "those": 2, "so": [2, 3], "use_dispenser_api": 2, "sure": 2, "document": 2, "smallest": 2, "divis": 2, "unit": 2, "programmat": 2, "sent": 2, "There": 2, "standard": 2, "other": 2, "dispenser_mnemon": 2, "doe": 2, "separ": 2, "abstract": 2, "dedic": 2, "releas": 3, "pypi": 3, "easier": 3, "build": 3, "solut": 3, "project": 3, "goal": 3, "intuit": 3, "quicker": 3, "safer": 3, "larg": 3, "sdk": 3, "level": 3, "interfac": 3, "sensibl": 3, "common": 3, "task": 3, "prefer": 3, "typescript": 3, "equival": 3, "design": 3, "compos": 3, "read": 3, "logic": 3, "diagnos": 3, "packag": 3, "modular": 3, "thin": 3, "wrapper": 3, "block": 3, "over": 3, "primit": 3, "expos": 3, "wherev": 3, "opt": 3, "approach": 3, "safeti": 3, "strong": 3, "support": 3, "effort": 3, "put": 3, "good": 3, "intellisens": 3, "built": 3, "highli": 3, "mechan": 3, "terser": 3, "pip": 3, "poetri": 3, "simpli": 3, "Then": 3, "variou": 3, "favourit": 3, "integr": 3, "extens": 3, "combin": 3, "tool": 3, "mypi": 3, "incorrect": 3, "incorrectli": 3, "multisig": 3, "inject": 3, "beaker": 3, "safe": 3, "retryabl": 3, "immut": 3, "perman": 3, "we": 3, "natur": 3, "evolv": 3, "experi": 3, "improv": 3, "futur": 3, "expand": 3}, "objects": {"": [[0, 0, 0, "-", "algokit_utils"]], "algokit_utils": [[0, 1, 1, "", "ABICallArgs"], [0, 1, 1, "", "ABICallArgsDict"], [0, 1, 1, "", "ABICreateCallArgs"], [0, 1, 1, "", "ABICreateCallArgsDict"], [0, 1, 1, "", "ABITransactionResponse"], [0, 1, 1, "", "Account"], [0, 1, 1, "", "AlgoClientConfig"], [0, 1, 1, "", "AppDeployMetaData"], [0, 1, 1, "", "AppLookup"], [0, 1, 1, "", "AppMetaData"], [0, 1, 1, "", "AppReference"], [0, 4, 1, "", "AppSpecStateDict"], [0, 1, 1, "", "ApplicationClient"], [0, 1, 1, "", "ApplicationSpecification"], [0, 1, 1, "", "CallConfig"], [0, 1, 1, "", "CreateCallParameters"], [0, 1, 1, "", "CreateCallParametersDict"], [0, 1, 1, "", "CreateTransactionParameters"], [0, 4, 1, "", "DELETABLE_TEMPLATE_NAME"], [0, 1, 1, "", "DefaultArgumentDict"], [0, 4, 1, "", "DefaultArgumentType"], [0, 1, 1, "", "DeployCallArgs"], [0, 1, 1, "", "DeployCallArgsDict"], [0, 1, 1, "", "DeployCreateCallArgs"], [0, 1, 1, "", "DeployCreateCallArgsDict"], [0, 1, 1, "", "DeployResponse"], [0, 6, 1, "", "DeploymentFailedError"], [0, 1, 1, "", "EnsureBalanceParameters"], [0, 1, 1, "", "EnsureFundedResponse"], [0, 6, 1, "", "LogicError"], [0, 4, 1, "", "MethodConfigDict"], [0, 1, 1, "", "MethodHints"], [0, 4, 1, "", "NOTE_PREFIX"], [0, 4, 1, "", "OnCompleteActionName"], [0, 1, 1, "", "OnCompleteCallParameters"], [0, 1, 1, "", "OnCompleteCallParametersDict"], [0, 1, 1, "", "OnSchemaBreak"], [0, 1, 1, "", "OnUpdate"], [0, 1, 1, "", "OperationPerformed"], [0, 1, 1, "", "Program"], [0, 4, 1, "", "TemplateValueDict"], [0, 4, 1, "", "TemplateValueMapping"], [0, 1, 1, "", "TestNetDispenserApiClient"], [0, 1, 1, "", "TransactionParameters"], [0, 1, 1, "", "TransactionResponse"], [0, 1, 1, "", "TransferAssetParameters"], [0, 1, 1, "", "TransferParameters"], [0, 4, 1, "", "UPDATABLE_TEMPLATE_NAME"], [0, 7, 1, "", "create_kmd_wallet_account"], [0, 7, 1, "", "ensure_funded"], [0, 7, 1, "", "execute_atc_with_logic_error"], [0, 7, 1, "", "get_account"], [0, 7, 1, "", "get_account_from_mnemonic"], [0, 7, 1, "", "get_algod_client"], [0, 7, 1, "", "get_app_id_from_tx_id"], [0, 7, 1, "", "get_creator_apps"], [0, 7, 1, "", "get_default_localnet_config"], [0, 7, 1, "", "get_dispenser_account"], [0, 7, 1, "", "get_indexer_client"], [0, 7, 1, "", "get_kmd_client_from_algod_client"], [0, 7, 1, "", "get_kmd_wallet_account"], [0, 7, 1, "", "get_localnet_default_account"], [0, 7, 1, "", "get_next_version"], [0, 7, 1, "", "get_or_create_kmd_wallet_account"], [0, 7, 1, "", "get_sender_from_signer"], [0, 7, 1, "", "is_localnet"], [0, 7, 1, "", "is_mainnet"], [0, 7, 1, "", "is_testnet"], [0, 7, 1, "", "num_extra_program_pages"], [0, 7, 1, "", "replace_template_variables"], [0, 7, 1, "", "transfer"], [0, 7, 1, "", "transfer_asset"]], "algokit_utils.ABITransactionResponse": [[0, 2, 1, "", "decode_error"], [0, 2, 1, "", "method"], [0, 2, 1, "", "raw_value"], [0, 2, 1, "", "return_value"], [0, 2, 1, "", "tx_info"]], "algokit_utils.Account": [[0, 2, 1, "", "address"], [0, 2, 1, "", "private_key"], [0, 3, 1, "", "public_key"], [0, 3, 1, "", "signer"]], "algokit_utils.AlgoClientConfig": [[0, 2, 1, "", "server"], [0, 2, 1, "", "token"]], "algokit_utils.ApplicationClient": [[0, 5, 1, "", "add_method_call"], [0, 5, 1, "", "call"], [0, 5, 1, "", "clear_state"], [0, 5, 1, "", "close_out"], [0, 5, 1, "", "compose_call"], [0, 5, 1, "", "compose_clear_state"], [0, 5, 1, "", "compose_close_out"], [0, 5, 1, "", "compose_create"], [0, 5, 1, "", "compose_delete"], [0, 5, 1, "", "compose_opt_in"], [0, 5, 1, "", "compose_update"], [0, 5, 1, "", "create"], [0, 5, 1, "", "delete"], [0, 5, 1, "", "deploy"], [0, 5, 1, "", "export_source_map"], [0, 5, 1, "", "get_global_state"], [0, 5, 1, "", "get_local_state"], [0, 5, 1, "", "get_signer_sender"], [0, 5, 1, "", "import_source_map"], [0, 5, 1, "", "opt_in"], [0, 5, 1, "", "prepare"], [0, 5, 1, "", "resolve"], [0, 5, 1, "", "resolve_signer_sender"], [0, 5, 1, "", "update"]], "algokit_utils.ApplicationSpecification": [[0, 5, 1, "", "export"]], "algokit_utils.CallConfig": [[0, 2, 1, "", "ALL"], [0, 2, 1, "", "CALL"], [0, 2, 1, "", "CREATE"], [0, 2, 1, "", "NEVER"]], "algokit_utils.EnsureBalanceParameters": [[0, 2, 1, "", "account_to_fund"], [0, 2, 1, "", "fee_micro_algos"], [0, 2, 1, "", "funding_source"], [0, 2, 1, "", "max_fee_micro_algos"], [0, 2, 1, "", "min_funding_increment_micro_algos"], [0, 2, 1, "", "min_spending_balance_micro_algos"], [0, 2, 1, "", "note"], [0, 2, 1, "", "suggested_params"]], "algokit_utils.EnsureFundedResponse": [[0, 2, 1, "", "transaction_id"]], "algokit_utils.OnSchemaBreak": [[0, 2, 1, "", "AppendApp"], [0, 2, 1, "", "Fail"], [0, 2, 1, "", "ReplaceApp"]], "algokit_utils.OnUpdate": [[0, 2, 1, "", "AppendApp"], [0, 2, 1, "", "Fail"], [0, 2, 1, "", "ReplaceApp"], [0, 2, 1, "", "UpdateApp"]], "algokit_utils.OperationPerformed": [[0, 2, 1, "", "Create"], [0, 2, 1, "", "Nothing"], [0, 2, 1, "", "Replace"], [0, 2, 1, "", "Update"]], "algokit_utils.TestNetDispenserApiClient": [[0, 5, 1, "", "fund"], [0, 5, 1, "", "get_limit"], [0, 5, 1, "", "refund"]], "algokit_utils.TransactionParameters": [[0, 2, 1, "", "accounts"], [0, 2, 1, "", "boxes"], [0, 2, 1, "", "foreign_apps"], [0, 2, 1, "", "foreign_assets"], [0, 2, 1, "", "lease"], [0, 2, 1, "", "note"], [0, 2, 1, "", "rekey_to"], [0, 2, 1, "", "sender"], [0, 2, 1, "", "signer"], [0, 2, 1, "", "suggested_params"]], "algokit_utils.TransactionResponse": [[0, 2, 1, "", "confirmed_round"], [0, 5, 1, "", "from_atr"], [0, 2, 1, "", "tx_id"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:property", "4": "py:data", "5": "py:method", "6": "py:exception", "7": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "property", "Python property"], "4": ["py", "data", "Python data"], "5": ["py", "method", "Python method"], "6": ["py", "exception", "Python exception"], "7": ["py", "function", "Python function"]}, "titleterms": {"algokit_util": 0, "packag": 0, "content": [0, 3], "class": 0, "function": 0, "data": 0, "api": 0, "convent": 0, "exampl": 0, "testnet": 1, "dispens": [1, 2], "client": 1, "creat": 1, "fund": 1, "an": 1, "account": 1, "regist": 1, "refund": 1, "get": 1, "current": 1, "limit": 1, "error": 1, "handl": 1, "algo": 2, "transfer": 2, "ensur": 2, "minimum": 2, "asset": 2, "algokit": 3, "python": 3, "util": 3, "core": 3, "principl": 3, "instal": 3, "usag": 3, "type": 3, "capabl": 3, "refer": 3, "document": 3, "roadmap": 3, "indic": 3, "tabl": 3}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 57}, "alltitles": {"AlgoKit Python Utilities": [[3, "algokit-python-utilities"]], "Contents": [[3, null]], "Core principles": [[3, "core-principles"]], "Installation": [[3, "installation"]], "Usage": [[3, "usage"]], "Types": [[3, "types"]], "Capabilities": [[3, "capabilities"]], "Reference documentation": [[3, "reference-documentation"]], "Roadmap": [[3, "roadmap"]], "Indices and tables": [[3, "indices-and-tables"]], "algokit_utils": [[0, "module-algokit_utils"]], "Package Contents": [[0, "package-contents"]], "Classes": [[0, "classes"]], "Functions": [[0, "functions"]], "Data": [[0, "data"]], "API": [[0, "api"]], "Convention": [[0, "convention"]], "Example": [[0, "example"]], "TestNet Dispenser Client": [[1, "testnet-dispenser-client"]], "Creating a Dispenser Client": [[1, "creating-a-dispenser-client"]], "Funding an Account": [[1, "funding-an-account"]], "Registering a Refund": [[1, "registering-a-refund"]], "Getting Current Limit": [[1, "getting-current-limit"]], "Error Handling": [[1, "error-handling"]], "Algo transfers": [[2, "algo-transfers"]], "Transferring Algos": [[2, "transferring-algos"]], "Ensuring minimum Algos": [[2, "ensuring-minimum-algos"]], "Transfering Assets": [[2, "transfering-assets"]], "Dispenser": [[2, "dispenser"]]}, "indexentries": {"abicallargs (class in algokit_utils)": [[0, "algokit_utils.ABICallArgs"]], "abicallargsdict (class in algokit_utils)": [[0, "algokit_utils.ABICallArgsDict"]], "abicreatecallargs (class in algokit_utils)": [[0, "algokit_utils.ABICreateCallArgs"]], "abicreatecallargsdict (class in algokit_utils)": [[0, "algokit_utils.ABICreateCallArgsDict"]], "abitransactionresponse (class in algokit_utils)": [[0, "algokit_utils.ABITransactionResponse"]], "all (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.ALL"]], "account (class in algokit_utils)": [[0, "algokit_utils.Account"]], "algoclientconfig (class in algokit_utils)": [[0, "algokit_utils.AlgoClientConfig"]], "appdeploymetadata (class in algokit_utils)": [[0, "algokit_utils.AppDeployMetaData"]], "applookup (class in algokit_utils)": [[0, "algokit_utils.AppLookup"]], "appmetadata (class in algokit_utils)": [[0, "algokit_utils.AppMetaData"]], "appreference (class in algokit_utils)": [[0, "algokit_utils.AppReference"]], "appspecstatedict (in module algokit_utils)": [[0, "algokit_utils.AppSpecStateDict"]], "appendapp (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.AppendApp"]], "appendapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.AppendApp"]], "applicationclient (class in algokit_utils)": [[0, "algokit_utils.ApplicationClient"]], "applicationspecification (class in algokit_utils)": [[0, "algokit_utils.ApplicationSpecification"]], "call (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.CALL"]], "create (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.CREATE"]], "callconfig (class in algokit_utils)": [[0, "algokit_utils.CallConfig"]], "create (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Create"]], "createcallparameters (class in algokit_utils)": [[0, "algokit_utils.CreateCallParameters"]], "createcallparametersdict (class in algokit_utils)": [[0, "algokit_utils.CreateCallParametersDict"]], "createtransactionparameters (class in algokit_utils)": [[0, "algokit_utils.CreateTransactionParameters"]], "deletable_template_name (in module algokit_utils)": [[0, "algokit_utils.DELETABLE_TEMPLATE_NAME"]], "defaultargumentdict (class in algokit_utils)": [[0, "algokit_utils.DefaultArgumentDict"]], "defaultargumenttype (in module algokit_utils)": [[0, "algokit_utils.DefaultArgumentType"]], "deploycallargs (class in algokit_utils)": [[0, "algokit_utils.DeployCallArgs"]], "deploycallargsdict (class in algokit_utils)": [[0, "algokit_utils.DeployCallArgsDict"]], "deploycreatecallargs (class in algokit_utils)": [[0, "algokit_utils.DeployCreateCallArgs"]], "deploycreatecallargsdict (class in algokit_utils)": [[0, "algokit_utils.DeployCreateCallArgsDict"]], "deployresponse (class in algokit_utils)": [[0, "algokit_utils.DeployResponse"]], "deploymentfailederror": [[0, "algokit_utils.DeploymentFailedError"]], "ensurebalanceparameters (class in algokit_utils)": [[0, "algokit_utils.EnsureBalanceParameters"]], "ensurefundedresponse (class in algokit_utils)": [[0, "algokit_utils.EnsureFundedResponse"]], "fail (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.Fail"]], "fail (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.Fail"]], "logicerror": [[0, "algokit_utils.LogicError"]], "methodconfigdict (in module algokit_utils)": [[0, "algokit_utils.MethodConfigDict"]], "methodhints (class in algokit_utils)": [[0, "algokit_utils.MethodHints"]], "never (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.NEVER"]], "note_prefix (in module algokit_utils)": [[0, "algokit_utils.NOTE_PREFIX"]], "nothing (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Nothing"]], "oncompleteactionname (in module algokit_utils)": [[0, "algokit_utils.OnCompleteActionName"]], "oncompletecallparameters (class in algokit_utils)": [[0, "algokit_utils.OnCompleteCallParameters"]], "oncompletecallparametersdict (class in algokit_utils)": [[0, "algokit_utils.OnCompleteCallParametersDict"]], "onschemabreak (class in algokit_utils)": [[0, "algokit_utils.OnSchemaBreak"]], "onupdate (class in algokit_utils)": [[0, "algokit_utils.OnUpdate"]], "operationperformed (class in algokit_utils)": [[0, "algokit_utils.OperationPerformed"]], "program (class in algokit_utils)": [[0, "algokit_utils.Program"]], "replace (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Replace"]], "replaceapp (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.ReplaceApp"]], "replaceapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.ReplaceApp"]], "templatevaluedict (in module algokit_utils)": [[0, "algokit_utils.TemplateValueDict"]], "templatevaluemapping (in module algokit_utils)": [[0, "algokit_utils.TemplateValueMapping"]], "testnetdispenserapiclient (class in algokit_utils)": [[0, "algokit_utils.TestNetDispenserApiClient"]], "transactionparameters (class in algokit_utils)": [[0, "algokit_utils.TransactionParameters"]], "transactionresponse (class in algokit_utils)": [[0, "algokit_utils.TransactionResponse"]], "transferassetparameters (class in algokit_utils)": [[0, "algokit_utils.TransferAssetParameters"]], "transferparameters (class in algokit_utils)": [[0, "algokit_utils.TransferParameters"]], "updatable_template_name (in module algokit_utils)": [[0, "algokit_utils.UPDATABLE_TEMPLATE_NAME"]], "update (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Update"]], "updateapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.UpdateApp"]], "account_to_fund (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.account_to_fund"]], "accounts (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.accounts"]], "add_method_call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.add_method_call"]], "address (algokit_utils.account attribute)": [[0, "algokit_utils.Account.address"]], "algokit_utils": [[0, "module-algokit_utils"]], "boxes (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.boxes"]], "call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.call"]], "clear_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.clear_state"]], "close_out() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.close_out"]], "compose_call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_call"]], "compose_clear_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_clear_state"]], "compose_close_out() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_close_out"]], "compose_create() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_create"]], "compose_delete() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_delete"]], "compose_opt_in() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_opt_in"]], "compose_update() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_update"]], "confirmed_round (algokit_utils.transactionresponse attribute)": [[0, "algokit_utils.TransactionResponse.confirmed_round"]], "create() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.create"]], "create_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.create_kmd_wallet_account"]], "decode_error (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.decode_error"]], "delete() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.delete"]], "deploy() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.deploy"]], "ensure_funded() (in module algokit_utils)": [[0, "algokit_utils.ensure_funded"]], "execute_atc_with_logic_error() (in module algokit_utils)": [[0, "algokit_utils.execute_atc_with_logic_error"]], "export() (algokit_utils.applicationspecification method)": [[0, "algokit_utils.ApplicationSpecification.export"]], "export_source_map() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.export_source_map"]], "fee_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.fee_micro_algos"]], "foreign_apps (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.foreign_apps"]], "foreign_assets (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.foreign_assets"]], "from_atr() (algokit_utils.transactionresponse static method)": [[0, "algokit_utils.TransactionResponse.from_atr"]], "fund() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.fund"]], "funding_source (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.funding_source"]], "get_account() (in module algokit_utils)": [[0, "algokit_utils.get_account"]], "get_account_from_mnemonic() (in module algokit_utils)": [[0, "algokit_utils.get_account_from_mnemonic"]], "get_algod_client() (in module algokit_utils)": [[0, "algokit_utils.get_algod_client"]], "get_app_id_from_tx_id() (in module algokit_utils)": [[0, "algokit_utils.get_app_id_from_tx_id"]], "get_creator_apps() (in module algokit_utils)": [[0, "algokit_utils.get_creator_apps"]], "get_default_localnet_config() (in module algokit_utils)": [[0, "algokit_utils.get_default_localnet_config"]], "get_dispenser_account() (in module algokit_utils)": [[0, "algokit_utils.get_dispenser_account"]], "get_global_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_global_state"]], "get_indexer_client() (in module algokit_utils)": [[0, "algokit_utils.get_indexer_client"]], "get_kmd_client_from_algod_client() (in module algokit_utils)": [[0, "algokit_utils.get_kmd_client_from_algod_client"]], "get_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.get_kmd_wallet_account"]], "get_limit() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.get_limit"]], "get_local_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_local_state"]], "get_localnet_default_account() (in module algokit_utils)": [[0, "algokit_utils.get_localnet_default_account"]], "get_next_version() (in module algokit_utils)": [[0, "algokit_utils.get_next_version"]], "get_or_create_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.get_or_create_kmd_wallet_account"]], "get_sender_from_signer() (in module algokit_utils)": [[0, "algokit_utils.get_sender_from_signer"]], "get_signer_sender() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_signer_sender"]], "import_source_map() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.import_source_map"]], "is_localnet() (in module algokit_utils)": [[0, "algokit_utils.is_localnet"]], "is_mainnet() (in module algokit_utils)": [[0, "algokit_utils.is_mainnet"]], "is_testnet() (in module algokit_utils)": [[0, "algokit_utils.is_testnet"]], "lease (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.lease"]], "max_fee_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.max_fee_micro_algos"]], "method (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.method"]], "min_funding_increment_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.min_funding_increment_micro_algos"]], "min_spending_balance_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.min_spending_balance_micro_algos"]], "module": [[0, "module-algokit_utils"]], "note (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.note"]], "note (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.note"]], "num_extra_program_pages() (in module algokit_utils)": [[0, "algokit_utils.num_extra_program_pages"]], "opt_in() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.opt_in"]], "prepare() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.prepare"]], "private_key (algokit_utils.account attribute)": [[0, "algokit_utils.Account.private_key"]], "public_key (algokit_utils.account property)": [[0, "algokit_utils.Account.public_key"]], "raw_value (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.raw_value"]], "refund() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.refund"]], "rekey_to (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.rekey_to"]], "replace_template_variables() (in module algokit_utils)": [[0, "algokit_utils.replace_template_variables"]], "resolve() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.resolve"]], "resolve_signer_sender() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.resolve_signer_sender"]], "return_value (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.return_value"]], "sender (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.sender"]], "server (algokit_utils.algoclientconfig attribute)": [[0, "algokit_utils.AlgoClientConfig.server"]], "signer (algokit_utils.account property)": [[0, "algokit_utils.Account.signer"]], "signer (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.signer"]], "suggested_params (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.suggested_params"]], "suggested_params (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.suggested_params"]], "token (algokit_utils.algoclientconfig attribute)": [[0, "algokit_utils.AlgoClientConfig.token"]], "transaction_id (algokit_utils.ensurefundedresponse attribute)": [[0, "algokit_utils.EnsureFundedResponse.transaction_id"]], "transfer() (in module algokit_utils)": [[0, "algokit_utils.transfer"]], "transfer_asset() (in module algokit_utils)": [[0, "algokit_utils.transfer_asset"]], "tx_id (algokit_utils.transactionresponse attribute)": [[0, "algokit_utils.TransactionResponse.tx_id"]], "tx_info (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.tx_info"]], "update() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.update"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["apidocs/algokit_utils/algokit_utils", "capabilities/account", "capabilities/app-client", "capabilities/app-deploy", "capabilities/client", "capabilities/debugging", "capabilities/dispenser-client", "capabilities/transfer", "index"], "filenames": ["apidocs/algokit_utils/algokit_utils.md", "capabilities/account.md", "capabilities/app-client.md", "capabilities/app-deploy.md", "capabilities/client.md", "capabilities/debugging.md", "capabilities/dispenser-client.md", "capabilities/transfer.md", "index.md"], "titles": ["algokit_utils", "Account management", "App client", "App deployment", "Client management", "Debugger", "TestNet Dispenser Client", "Algo transfers", "AlgoKit Python Utilities"], "terms": {"abicallarg": 0, "abi": 0, "paramet": [0, 7], "us": [0, 1, 2, 3, 4, 5, 6, 7, 8], "updat": [0, 2, 3, 5], "delet": [0, 2, 3], "an": [0, 1, 4, 5, 7, 8], "applic": [0, 5, 8], "when": [0, 1, 2, 3, 5, 7], "call": [0, 3, 5, 7, 8], "deploi": [0, 1, 2, 8], "abicallargsdict": 0, "abicreatecallarg": 0, "creat": [0, 1, 3, 4, 5, 8], "abicreatecallargsdict": 0, "abitransactionrespons": [0, 3], "respons": [0, 2, 5, 6], "account": [0, 2, 7, 8], "hold": [0, 3], "private_kei": [0, 1], "address": [0, 1, 2, 6, 7], "algoclientconfig": [0, 4], "connect": 0, "detail": [0, 2, 6], "algosdk": [0, 1, 2, 4], "v2client": [0, 4], "algod": [0, 3, 4, 7, 8], "algodcli": [0, 2, 4, 5], "index": [0, 2, 3, 4, 8], "indexercli": [0, 4], "appdeploymetadata": 0, "metadata": [0, 3], "about": [0, 5], "store": [0, 5, 7], "transact": [0, 1, 3, 5, 6, 7, 8], "note": [0, 2, 3, 7], "dure": [0, 2, 3, 7], "creation": [0, 3, 8], "applookup": [0, 3], "cach": 0, "appmetadata": [0, 3], "specif": [0, 2, 5], "creator": [0, 2, 8], "app": [0, 7, 8], "apprefer": 0, "inform": [0, 2, 5], "algorand": [0, 3, 5, 8], "applicationcli": [0, 2, 3], "A": [0, 2, 5, 8], "wrap": [0, 2, 8], "arc": [0, 2, 3, 8], "0032": [0, 2, 3, 8], "spec": [0, 2, 8], "provid": [0, 1, 2, 3, 4, 5, 6, 7, 8], "high": [0, 2, 8], "product": [0, 2, 8], "method": [0, 1, 3, 5, 6, 8], "applicationspecif": [0, 2], "callconfig": 0, "describ": [0, 3], "type": [0, 2, 5, 6], "can": [0, 1, 2, 3, 4, 5, 6, 7, 8], "base": [0, 1, 2, 3, 4], "oncomplet": 0, "createcallparamet": [0, 2], "addit": [0, 1, 2, 8], "includ": [0, 2, 3, 7, 8], "compose_cr": 0, "createcallparametersdict": 0, "createtransactionparamet": 0, "defaultargumentdict": 0, "defaultargu": 0, "i": [0, 1, 2, 3, 4, 5, 6, 7, 8], "contain": [0, 1, 2, 3, 5, 6, 8], "ani": [0, 2, 3, 4, 5, 6, 8], "argument": [0, 6], "mai": [0, 2], "resolv": [0, 1, 3, 4, 8], "prior": [0, 7], "some": [0, 1, 2, 3, 4, 7], "target": 0, "deploycallarg": 0, "deploycallargsdict": 0, "deploycreatecallarg": 0, "deploycreatecallargsdict": 0, "deployrespons": [0, 3], "action": [0, 2, 3], "taken": [0, 3], "deploy": [0, 2, 7, 8], "relat": 0, "ensurebalanceparamet": [0, 7], "ensur": [0, 8], "ha": [0, 2, 3, 5, 7, 8], "minimum": [0, 8], "number": [0, 2, 3, 4, 7, 8], "\u00b5algo": 0, "ensurefundedrespons": [0, 7], "methodhint": 0, "hint": [0, 8], "caller": 0, "how": [0, 6], "oncompletecallparamet": [0, 2], "compose_cal": [0, 2], "oncompletecallparametersdict": 0, "onschemabreak": 0, "take": [0, 2, 3, 4, 5, 6, 7], "": [0, 2, 3, 6, 7, 8], "schema": [0, 3], "break": [0, 3], "chang": [0, 3], "onupd": 0, "been": [0, 2, 3, 8], "operationperform": 0, "program": [0, 2], "compil": [0, 2], "teal": [0, 2, 3, 5, 8], "testnetdispenserapicli": [0, 6, 7], "client": [0, 5, 7, 8], "interact": [0, 5, 6], "algokit": [0, 1, 2, 3, 4, 5, 6, 7], "testnet": [0, 1, 3, 4, 7, 8], "dispens": [0, 1, 8], "To": [0, 2, 3, 4, 5, 6, 7, 8], "get": [0, 1, 2, 4, 7, 8], "start": 0, "new": [0, 1, 2, 3], "access": [0, 2, 7], "token": [0, 4, 6, 7], "via": [0, 2, 3, 5, 6, 7, 8], "login": 0, "ci": 0, "pass": [0, 2, 6], "constructor": [0, 6], "auth_token": [0, 6], "altern": [0, 2, 5], "set": [0, 2, 3, 5, 6, 7, 8], "environ": [0, 1, 3, 4, 5, 6, 7, 8], "variabl": [0, 1, 2, 4, 5, 6, 7, 8], "algokit_dispenser_access_token": [0, 6, 7], "auto": [0, 8], "load": [0, 1, 4], "If": [0, 1, 2, 3, 6, 7, 8], "both": [0, 2, 6], "ar": [0, 1, 2, 3, 4, 5, 6, 7, 8], "preced": [0, 6], "transactionparamet": 0, "transactionrespons": [0, 3], "non": [0, 3, 5], "transferassetparamet": [0, 7], "transfer": [0, 5, 8], "asset": [0, 2, 5, 6, 8], "between": [0, 7, 8], "transferparamet": [0, 7], "create_kmd_wallet_account": [0, 1], "wallet": [0, 1], "specifi": [0, 3, 4, 7, 8], "name": [0, 1, 2, 3, 5], "ensure_fund": [0, 7], "fund": [0, 1, 7, 8], "given": [0, 1, 2, 3, 4, 5], "sourc": [0, 2, 5], "certain": 0, "amount": [0, 2, 6, 7], "algo": [0, 1, 6, 8], "free": 0, "spend": [0, 7], "lock": 0, "balanc": [0, 7], "requir": [0, 2, 6, 7], "see": [0, 2, 3, 4, 6, 7], "http": [0, 4], "develop": [0, 2, 3, 5, 8], "org": 0, "doc": [0, 6, 8], "execute_atc_with_logic_error": 0, "atomictransactioncompos": [0, 2, 5], "execut": [0, 2, 3], "atc": [0, 2], "pars": [0, 2], "error": [0, 8], "rais": [0, 6], "logicerror": [0, 2], "possibl": [0, 2, 7, 8], "get_account": [0, 1], "return": [0, 1, 2, 4, 6, 7], "privat": [0, 1, 7], "kei": [0, 1, 2, 3, 7], "identifi": [0, 1, 2, 8], "get_account_from_mnemon": [0, 1], "convert": 0, "mnemon": [0, 1, 7, 8], "25": 0, "word": 0, "passphras": 0, "get_algod_cli": [0, 4], "from": [0, 1, 2, 3, 4, 5, 6, 8], "config": [0, 2, 4, 5], "get_app_id_from_tx_id": 0, "find": [0, 2, 7, 8], "app_id": [0, 2], "id": [0, 2, 3, 6, 7, 8], "get_creator_app": [0, 3], "map": [0, 2, 3], "all": [0, 2, 3, 5, 8], "have": [0, 1, 2, 3, 4, 7, 8], "get_default_localnet_config": [0, 4], "configur": [0, 3, 8], "point": 0, "default": [0, 1, 2, 4, 5, 7, 8], "localnet": [0, 1, 3, 4, 7], "get_dispenser_account": [0, 1, 7], "dispenser_mnenom": 0, "get_indexer_cli": [0, 4], "get_kmd_client_from_algod_cli": [0, 4], "kmd": [0, 1, 4, 7, 8], "kmdclient": [0, 4], "suppli": [0, 3], "get_kmd_wallet_account": [0, 1], "match": 0, "predic": 0, "none": [0, 2, 4, 7], "found": [0, 3], "get_localnet_default_account": [0, 1], "instanc": [0, 1, 2, 3, 4, 7], "get_next_vers": 0, "calcul": [0, 2], "next": 0, "version": [0, 3], "current_vers": 0, "get_or_create_kmd_wallet_account": [0, 1], "one": [0, 1, 2, 3, 4], "get_sender_from_sign": 0, "associ": [0, 1, 2], "signer": [0, 1, 2, 3, 7, 8], "is_localnet": 0, "true": [0, 2, 5, 7], "genesi": 0, "devnet": 0, "v1": 0, "sandnet": 0, "is_mainnet": 0, "mainnet": [0, 1, 3, 4, 7], "is_testnet": 0, "num_extra_program_pag": 0, "extra_pag": [0, 2], "approv": [0, 2], "clear": [0, 2], "replace_template_vari": 0, "replac": [0, 2, 3], "tmpl_": [0, 2, 3], "template_valu": [0, 2, 3], "transfer_asset": [0, 7], "appspecstatedict": 0, "defin": [0, 2, 3, 8], "state": [0, 3, 8], "entri": 0, "deletable_template_nam": 0, "templat": [0, 2, 8], "control": [0, 3, 8], "smart": [0, 2, 3, 5, 8], "contract": [0, 2, 3, 5, 8], "defaultargumenttyp": 0, "liter": 0, "valu": [0, 2, 5, 7], "methodconfigdict": 0, "dictionari": [0, 2], "dict": 0, "oncompletionactionnam": 0, "repres": [0, 1, 5], "allow": [0, 1, 2, 3, 4, 7], "each": [0, 5, 6], "complet": [0, 2, 8], "note_prefix": 0, "0002": 0, "compliant": [0, 5], "prefix": 0, "oncompleteactionnam": 0, "string": [0, 2, 3, 5, 7], "templatevaluedict": 0, "str": [0, 2], "int": 0, "byte": [0, 3], "templatevaluemap": 0, "updatable_template_nam": 0, "abical": 0, "typeddict": 0, "initi": [0, 6, 7, 8], "self": 0, "help": [0, 3, 8], "accur": 0, "signatur": [0, 2], "model": 0, "gener": [0, 2, 7, 8], "returntyp": 0, "decode_error": 0, "except": [0, 2, 6], "occur": [0, 2, 6], "attempt": [0, 2, 7], "decod": 0, "raw_valu": 0, "make": [0, 2, 6, 7, 8], "The": [0, 2, 3, 4, 5, 6, 7, 8], "raw": [0, 2], "befor": [0, 2], "return_valu": 0, "result": [0, 2, 3], "tx_info": 0, "thi": [0, 1, 2, 3, 4, 5, 6, 7, 8], "base64": 0, "encod": [0, 3], "properti": [0, 1], "public_kei": [0, 1], "public": 0, "atomic_transaction_compos": [0, 2], "accounttransactionsign": [0, 7], "server": [0, 4], "url": 0, "servic": [0, 1, 4, 7], "e": [0, 2, 3, 4, 7, 8], "g": [0, 2, 3, 4, 8], "localhost": 0, "4001": 0, "algonod": [0, 4], "cloud": 0, "authent": 0, "serial": 0, "json": [0, 5], "field": [0, 3, 6, 7], "part": [0, 8], "reduc": 0, "multipl": [0, 2, 3], "discov": 0, "typealia": 0, "algod_cli": [0, 2, 7], "app_spec": [0, 2, 3], "application_specif": 0, "pathlib": 0, "path": [0, 5], "0": [0, 2, 3, 6, 7], "indexer_cli": 0, "existing_deploy": 0, "transactionsign": [0, 2], "sender": [0, 1, 2, 3, 6], "suggested_param": [0, 2, 7], "suggestedparam": [0, 2, 7], "app_nam": [0, 2], "exist": [0, 1, 2, 3, 4], "instead": [0, 2, 3], "onli": [0, 1, 2, 3], "sign": [0, 1, 2], "wa": [0, 3, 5, 7], "should": [0, 2, 3, 7], "NOT": 0, "add_method_cal": 0, "abi_method": 0, "abimethod": 0, "bool": 0, "abi_arg": 0, "abiargsdict": 0, "transactionparametersdict": 0, "on_complet": [0, 2], "noopoc": 0, "local_schema": 0, "stateschema": 0, "global_schema": 0, "approval_program": 0, "clear_program": 0, "app_arg": 0, "list": [0, 2, 5], "call_config": 0, "au_spec": 0, "add": [0, 3, 8], "call_abi_method": [0, 2], "transaction_paramet": [0, 2], "abi_kwarg": 0, "abiargtyp": 0, "submit": 0, "clear_stat": [0, 2], "clearstat": 0, "close_out": [0, 2], "closeout": 0, "compose_clear_st": 0, "compose_close_out": 0, "ac": 0, "compose_delet": 0, "deleteappl": 0, "compose_opt_in": 0, "optin": 0, "compose_upd": 0, "updateappl": 0, "allow_upd": [0, 3], "allow_delet": [0, 3], "on_upd": [0, 3], "au_deploi": 0, "fail": [0, 2, 3], "on_schema_break": [0, 3], "create_arg": [0, 3], "update_arg": [0, 3], "delete_arg": [0, 3], "refer": [0, 2, 3, 6, 7], "idempot": [0, 1, 7, 8], "against": [0, 1, 3, 4, 7, 8], "time": [0, 1, 3, 5, 8], "placehold": 0, "substitut": [0, 8], "understand": [0, 2], "architectur": [0, 3], "decis": [0, 3], "behind": [0, 3], "pleas": [0, 7], "github": 0, "com": [0, 4], "algorandfound": 0, "cli": [0, 7], "blob": 0, "main": 0, "2023": 0, "01": 0, "12_smart": 0, "md": 0, "replaceapp": 0, "re": [0, 1, 2], "differ": [0, 3, 4, 5, 7], "code": [0, 1, 3, 5, 6, 8], "increment": [0, 3], "tmpl_delet": [0, 2, 3], "condition": 0, "tmpl_updat": [0, 2, 3], "determin": [0, 3, 7], "what": [0, 2, 3], "increas": 0, "beyond": 0, "current": [0, 2, 3, 7, 8], "alloc": [0, 2], "relev": 0, "deploymenterror": 0, "export_source_map": [0, 2], "export": [0, 2], "later": 0, "import": [0, 2, 5, 6, 8], "import_source_map": [0, 2], "get_global_st": [0, 2], "fals": [0, 2, 5], "global": [0, 2, 3], "info": 0, "get_local_st": [0, 2], "local": [0, 1, 2, 3], "get_signer_send": 0, "tupl": [0, 2], "Will": 0, "otherwis": [0, 2, 3, 7], "fall": 0, "back": [0, 6], "obtain": [0, 1, 2, 6], "source_map_json": 0, "opt_in": [0, 2], "prepar": 0, "application_cli": 0, "copi": 0, "also": [0, 2, 3, 5], "to_resolv": 0, "resolve_signer_send": 0, "valueerror": 0, "variant": [0, 2], "pull": 0, "150": 0, "directori": [0, 5], "write": [0, 3, 8], "out": [0, 2, 3, 4, 7], "artifact": [0, 5], "disk": 0, "arg": [0, 3], "option": [0, 2, 3, 4, 7], "where": [0, 2, 5, 8], "written": [0, 8], "enum": 0, "intflag": 0, "3": [0, 2], "handl": [0, 8], "normal": 0, "1": [0, 2, 3, 5], "2": [0, 2, 3, 5], "never": 0, "deploymentfailederror": 0, "account_to_fund": [0, 7], "receiv": [0, 6, 7], "fee_micro_algo": [0, 7], "flat": [0, 7], "fee": [0, 2, 7], "you": [0, 1, 2, 3, 4, 5, 6, 7, 8], "want": [0, 5, 7, 8], "pai": [0, 7], "cover": [0, 7], "extra": [0, 7], "group": [0, 5, 7], "funding_sourc": [0, 7], "dispenser_api": 0, "send": [0, 6, 7], "which": [0, 3, 5, 6, 7, 8], "max_fee_micro_algo": [0, 7], "maximum": [0, 5, 7], "happi": [0, 7], "unbound": [0, 7], "could": [0, 7], "reject": [0, 7], "network": [0, 2, 3, 7, 8], "congest": [0, 7], "min_funding_increment_micro_algo": [0, 7], "issu": [0, 2, 6, 7, 8], "avoid": [0, 7], "mani": [0, 7], "small": [0, 7], "often": [0, 2, 7], "activ": [0, 2, 7], "min_spending_balance_micro_algo": [0, 7], "avail": [0, 2, 7, 8], "top": [0, 3, 7, 8], "meet": [0, 7], "transaction_id": [0, 2, 6], "were": 0, "logic_error_str": 0, "source_map": [0, 2], "algosourcemap": 0, "messag": [0, 2, 6], "pc": [0, 2], "logic_error": [0, 2], "trace": [0, 8], "algokit_deploy": [0, 3], "j": [0, 3], "kwd": 0, "appendapp": 0, "old": 0, "singl": [0, 2, 3], "updateapp": 0, "No": 0, "noth": [0, 3, 8], "date": [0, 3], "origin": [0, 2, 3], "latest": 0, "fulli": 0, "binari": 0, "line": [0, 2], "request_timeout": 0, "dispenser_request_timeout": 0, "request": [0, 3, 6], "timeout": 0, "15": 0, "second": 0, "modifi": 0, "asset_id": [0, 6, 7], "dispenserfundrespons": 0, "get_limit": [0, 6], "dispenserlimitrespons": 0, "limit": [0, 8], "refund": [0, 8], "refund_txn_id": [0, 6], "regist": [0, 8], "box": [0, 2, 3], "collect": 0, "abc": 0, "sequenc": [0, 2], "bytearrai": 0, "foreign_app": [0, 2], "foreign": [0, 2], "foreign_asset": [0, 2], "leas": [0, 2], "rekey_to": 0, "rekei": 0, "confirmed_round": 0, "round": [0, 5], "confirm": 0, "dry": 0, "run": [0, 4, 7], "static": [0, 3], "from_atr": 0, "atomictransactionrespons": 0, "simulateatomictransactionrespons": 0, "transaction_index": 0, "either": [0, 1, 2, 3, 4], "more": [0, 2, 3, 7], "last": [0, 3, 5], "tx_id": [0, 6], "_transfer": 0, "transferparametersbas": 0, "clawback_from": 0, "perform": [0, 3, 5, 6], "clawback": 0, "oper": [0, 3, 5], "case": [0, 3, 7, 8], "senderaccount": 0, "must": [0, 2, 3], "equal": 0, "asa": 0, "kmd_client": 0, "_ensure_fund": 0, "librari": [0, 8], "paymenttxn": 0, "need": [0, 2, 3, 4, 5, 6, 7, 8], "payment": [0, 5, 6, 7], "indic": [0, 2, 3, 5, 6], "wait_round": 0, "4": [0, 2], "approval_source_map": [0, 2], "sourcemap": [0, 2, 5], "callabl": 0, "abl": [0, 2, 3], "fund_with_algo": 0, "float": [0, 5], "1000": [0, 5, 6], "o": [0, 6], "f": 0, "_mnemon": [0, 1], "secret": 0, "Be": 0, "care": 0, "commit": 0, "ideal": 0, "storag": [0, 3, 5], "rather": [0, 3], "than": [0, 3, 7], "file": [0, 5, 8], "system": 0, "doesn": [0, 3], "t": [0, 3], "work": [0, 1, 2, 3, 8], "seamlessli": 0, "without": [0, 4, 8], "manual": [0, 4], "reset": 0, "account_mnemon": 0, "follow": [0, 2, 3, 4, 5, 7, 8], "object": [0, 2, 3, 4, 5, 6], "automat": [0, 1, 2, 3, 7], "network_cli": 0, "algod_serv": [0, 4], "algod_port": [0, 4], "algod_token": [0, 4], "creator_account": 0, "indexer_serv": [0, 4], "indexer_port": [0, 4], "indexer_token": [0, 4], "same": [0, 1, 3, 4], "port": [0, 4], "kmd_port": [0, 4], "4002": [0, 4], "semver": 0, "like": [0, 2, 7, 8], "lower": 0, "intend": 0, "mostli": 0, "conveni": [0, 1], "param": [0, 2], "within": 0, "valid": [0, 3], "input": 0, "output": [0, 2, 3, 5], "beta1": 0, "4567": 0, "4568": 0, "alpha": 0, "cannot": 0, "assettransfertxn": [0, 7], "util": [1, 3, 4, 6, 7], "api": [6, 7, 8], "It": [0, 1, 3, 4, 5, 6], "author": 6, "done": [3, 6], "two": [2, 6, 7], "wai": [2, 4, 6], "directli": [2, 6], "algokit_util": [2, 4, 5, 6, 8], "your_auth_token": 6, "receiver_address": 6, "fundrespons": 6, "keep": 6, "mind": 6, "yourself": 6, "first": [2, 6], "invok": [6, 7], "endpoint": [5, 6], "txn_id": 6, "your": [5, 6, 8], "txn": 6, "inspect": 6, "account_address": 6, "limitrespons": 6, "while": [3, 6], "individu": 6, "higher": [3, 7, 8], "order": [3, 7, 8], "capabl": [1, 3, 4, 7], "easili": [7, 8], "manag": [0, 3, 5, 7, 8], "usag": [2, 3, 4, 7], "exampl": [2, 3, 4, 5, 7], "check": [2, 3, 4, 7], "autom": [2, 3, 4, 7], "test": [2, 3, 4, 5, 7, 8], "function": [1, 2, 3, 4, 7, 8], "facilit": [7, 8], "transfer_paramet": 7, "underli": [4, 7, 8], "from_account": 7, "to_address": 7, "micro_algo": 7, "micro": 7, "abil": [3, 7, 8], "dispos": 7, "incredibli": 7, "script": 7, "made": [2, 7], "those": 7, "so": [2, 4, 7, 8], "use_dispenser_api": 7, "sure": 7, "document": 7, "smallest": 7, "divis": 7, "unit": 7, "programmat": 7, "sent": 7, "There": [1, 2, 3, 4, 7], "standard": [0, 7], "other": [2, 3, 7], "dispenser_mnemon": [1, 7], "doe": [3, 7], "separ": [5, 7], "abstract": 7, "dedic": 7, "releas": 8, "pypi": 8, "easier": [2, 3, 8], "build": [3, 5, 8], "solut": 8, "project": [0, 5, 8], "goal": [3, 8], "intuit": 8, "quicker": 8, "safer": 8, "larg": 8, "sdk": 8, "level": 8, "interfac": [4, 8], "sensibl": 8, "common": 8, "task": 8, "prefer": [3, 4, 8], "typescript": [3, 8], "equival": 8, "design": 8, "compos": 8, "read": 8, "logic": [3, 4, 8], "diagnos": 8, "packag": [5, 8], "modular": [4, 8], "thin": 8, "wrapper": [2, 8], "block": 8, "over": [3, 8], "primit": 8, "expos": [1, 2, 8], "wherev": 8, "opt": [0, 2, 8], "approach": [2, 8], "safeti": 8, "strong": 8, "support": [2, 3, 8], "effort": 8, "put": 8, "good": 8, "intellisens": 8, "built": [3, 8], "highli": 8, "mechan": 8, "terser": 8, "pip": 8, "poetri": 8, "simpli": [5, 8], "Then": 8, "variou": [1, 2, 4, 8], "favourit": 8, "integr": 8, "extens": [5, 8], "combin": [2, 8], "tool": [5, 8], "mypi": 8, "incorrect": 8, "incorrectli": 8, "multisig": 8, "inject": [1, 8], "beaker": [2, 3, 8], "safe": [3, 8], "retryabl": [3, 8], "immut": [3, 8], "perman": [3, 8], "we": 8, "natur": [3, 8], "evolv": [3, 8], "experi": 8, "improv": 8, "futur": [2, 8], "expand": 8, "blockchain": [0, 5, 8], "place": 0, "its": 0, "100": 0, "000": 0, "microalgo": 0, "opt_out": 0, "them": 0, "recov": 0, "optout": 0, "process": [0, 3], "permit": 0, "discontinu": 0, "persist_sourcemap": [0, 5], "persist": [0, 5], "avm": [0, 5, 8], "debugg": [0, 8], "simulate_and_persist_respons": [0, 5], "simul": [0, 2, 5, 8], "atom": [0, 3, 5], "integ": 0, "essenti": 0, "zero": 0, "_debug_util": [], "persistsourcemapinput": [0, 5], "project_root": [0, 5], "root": [0, 5], "buffer_size_mb": 0, "256": [0, 5], "size": [0, 5], "buffer": [0, 5], "megabyt": [0, 5], "256mb": 0, "core": [1, 3, 4], "well": 1, "encapsul": 1, "convent": [1, 3], "OR": [1, 2], "ny": 1, "power": 1, "new_account": 1, "generate_account": 1, "reli": 1, "being": [1, 3], "These": [1, 2, 3, 5, 8], "retriev": [1, 3, 4], "data": [2, 3], "correspond": 2, "instanti": 2, "By": [2, 5], "uncondition": 2, "app_lookup": 2, "search": [2, 5], "under": [2, 3], "overridden": 2, "deriv": 2, "suggest": 2, "no_op": 2, "update_appl": 2, "remov": [2, 5], "delete_appl": 2, "close": 2, "everyth": 2, "select": 2, "explicitli": 2, "infer": 2, "bare": 2, "compat": 2, "interpret": 2, "abireturnsubroutin": 2, "method_spec": 2, "algosd": 2, "python": [2, 3, 5], "keyword": 2, "hello": 2, "syntax": 2, "world": 2, "overrid": 2, "app_index": 2, "box_nam": 2, "page": 2, "suffici": 2, "dataclass": 2, "commoncallparamet": 2, "exact": 2, "depend": [2, 3], "compose_": 2, "onc": [2, 4], "ad": 2, "For": [2, 5], "execute_atc": 2, "let": 2, "caus": 2, "throw": 2, "becaus": 2, "assert": 2, "lack": 2, "exhaust": 2, "opcod": 2, "budget": 2, "reason": 2, "look": 2, "someth": 2, "transactionpool": 2, "rememb": 2, "eval": 2, "error_messag": 2, "program_counter_valu": 2, "list_of_op_cod": 2, "much": 2, "happen": [2, 3], "thrown": 2, "line_no": 2, "insight": 2, "format": 2, "surround": 2, "extend": 2, "show": 2, "alreadi": [2, 3], "previous": [2, 3], "crucial": 2, "complex": 2, "enabl": [2, 5], "particularli": 3, "articul": 3, "record": 3, "implement": 3, "diverg": 3, "principl": [3, 4], "comprehens": 3, "explain": 3, "concept": 3, "lifecycl": 3, "transpil": 3, "verifi": 3, "maintain": 3, "stabil": 3, "qualiti": 3, "final": 3, "runtim": 3, "confid": 3, "correct": 3, "utilis": 3, "furthermor": 3, "characterist": 3, "per": 3, "framework": 3, "0004": 3, "mean": [3, 5], "languag": 3, "explicit": 3, "upgrad": 3, "vari": 3, "present": 3, "whether": [3, 5], "had": 3, "creatoraccount": 3, "seri": 3, "lookup": 3, "payload": 3, "boolean": [3, 5], "chronolog": 3, "trivial": 3, "recommend": 3, "durat": 3, "recalcul": 3, "most": [3, 5], "fresh": 3, "detect": 3, "concert": 3, "reliabl": 3, "popul": 3, "sinc": 3, "again": 3, "appli": 3, "straight": 3, "after": [0, 3], "do": 3, "abov": 3, "In": 3, "arrai": 3, "wil": 3, "hexadecim": 3, "shouldn": 3, "beaker_product": 3, "action_taken": 3, "up": 3, "create_respons": 3, "update_respons": 3, "delete_respons": 3, "class": [4, 5], "inlin": 4, "produc": 4, "myalgodnod": 4, "secret_token": 4, "get_algonode_config": 4, "get_purestake_config": 4, "purestak": 4, "configorport": 4, "assumpt": 4, "host": 4, "optim": [5, 8], "who": [5, 8], "link": 5, "vscode": 5, "py": 5, "updatableconfig": 5, "attribut": 5, "mode": 5, "ignor": 5, "insid": 5, "toml": 5, "folder": 5, "algokit_project_root": 5, "trace_al": 5, "etc": 5, "trace_buffer_size_mb": 5, "exceed": 5, "oldest": 5, "consumpt": [0, 5], "max_search_depth": 5, "depth": 5, "travers": 5, "10": 5, "assum": 5, "simplifi": 5, "gather": 5, "debug": 8, "with_sourc": 0, "dump": [0, 5], "along": [0, 5], "_debug": 0, "thei": 5, "timestamp": 5, "_lr": 5, "last_round": 5, "_": 5, "transaction_typ": 5, "iso": 5, "8601": 5, "colon": 5, "period": 5, "count": 5, "underscor": 5, "might": 5, "20220301t123456z_lr1000_2": 5, "pay_1": 5, "axfer": 5, "2022": 5, "03": 5, "01t12": 5, "34": 5, "56z": 5}, "objects": {"": [[0, 0, 0, "-", "algokit_utils"]], "algokit_utils": [[0, 1, 1, "", "ABICallArgs"], [0, 1, 1, "", "ABICallArgsDict"], [0, 1, 1, "", "ABICreateCallArgs"], [0, 1, 1, "", "ABICreateCallArgsDict"], [0, 1, 1, "", "ABITransactionResponse"], [0, 1, 1, "", "Account"], [0, 1, 1, "", "AlgoClientConfig"], [0, 1, 1, "", "AppDeployMetaData"], [0, 1, 1, "", "AppLookup"], [0, 1, 1, "", "AppMetaData"], [0, 1, 1, "", "AppReference"], [0, 4, 1, "", "AppSpecStateDict"], [0, 1, 1, "", "ApplicationClient"], [0, 1, 1, "", "ApplicationSpecification"], [0, 1, 1, "", "CallConfig"], [0, 1, 1, "", "CreateCallParameters"], [0, 1, 1, "", "CreateCallParametersDict"], [0, 1, 1, "", "CreateTransactionParameters"], [0, 4, 1, "", "DELETABLE_TEMPLATE_NAME"], [0, 1, 1, "", "DefaultArgumentDict"], [0, 4, 1, "", "DefaultArgumentType"], [0, 1, 1, "", "DeployCallArgs"], [0, 1, 1, "", "DeployCallArgsDict"], [0, 1, 1, "", "DeployCreateCallArgs"], [0, 1, 1, "", "DeployCreateCallArgsDict"], [0, 1, 1, "", "DeployResponse"], [0, 6, 1, "", "DeploymentFailedError"], [0, 1, 1, "", "EnsureBalanceParameters"], [0, 1, 1, "", "EnsureFundedResponse"], [0, 6, 1, "", "LogicError"], [0, 4, 1, "", "MethodConfigDict"], [0, 1, 1, "", "MethodHints"], [0, 4, 1, "", "NOTE_PREFIX"], [0, 4, 1, "", "OnCompleteActionName"], [0, 1, 1, "", "OnCompleteCallParameters"], [0, 1, 1, "", "OnCompleteCallParametersDict"], [0, 1, 1, "", "OnSchemaBreak"], [0, 1, 1, "", "OnUpdate"], [0, 1, 1, "", "OperationPerformed"], [0, 1, 1, "", "Program"], [0, 4, 1, "", "TemplateValueDict"], [0, 4, 1, "", "TemplateValueMapping"], [0, 1, 1, "", "TestNetDispenserApiClient"], [0, 1, 1, "", "TransactionParameters"], [0, 1, 1, "", "TransactionParametersDict"], [0, 1, 1, "", "TransactionResponse"], [0, 1, 1, "", "TransferAssetParameters"], [0, 1, 1, "", "TransferParameters"], [0, 4, 1, "", "UPDATABLE_TEMPLATE_NAME"], [0, 7, 1, "", "create_kmd_wallet_account"], [0, 7, 1, "", "ensure_funded"], [0, 7, 1, "", "execute_atc_with_logic_error"], [0, 7, 1, "", "get_account"], [0, 7, 1, "", "get_account_from_mnemonic"], [0, 7, 1, "", "get_algod_client"], [0, 7, 1, "", "get_app_id_from_tx_id"], [0, 7, 1, "", "get_creator_apps"], [0, 7, 1, "", "get_default_localnet_config"], [0, 7, 1, "", "get_dispenser_account"], [0, 7, 1, "", "get_indexer_client"], [0, 7, 1, "", "get_kmd_client_from_algod_client"], [0, 7, 1, "", "get_kmd_wallet_account"], [0, 7, 1, "", "get_localnet_default_account"], [0, 7, 1, "", "get_next_version"], [0, 7, 1, "", "get_or_create_kmd_wallet_account"], [0, 7, 1, "", "get_sender_from_signer"], [0, 7, 1, "", "is_localnet"], [0, 7, 1, "", "is_mainnet"], [0, 7, 1, "", "is_testnet"], [0, 7, 1, "", "num_extra_program_pages"], [0, 7, 1, "", "opt_in"], [0, 7, 1, "", "opt_out"], [0, 7, 1, "", "persist_sourcemaps"], [0, 7, 1, "", "replace_template_variables"], [0, 7, 1, "", "simulate_and_persist_response"], [0, 7, 1, "", "transfer"], [0, 7, 1, "", "transfer_asset"]], "algokit_utils.ABITransactionResponse": [[0, 2, 1, "", "decode_error"], [0, 2, 1, "", "method"], [0, 2, 1, "", "raw_value"], [0, 2, 1, "", "return_value"], [0, 2, 1, "", "tx_info"]], "algokit_utils.Account": [[0, 2, 1, "", "address"], [0, 2, 1, "", "private_key"], [0, 3, 1, "", "public_key"], [0, 3, 1, "", "signer"]], "algokit_utils.AlgoClientConfig": [[0, 2, 1, "", "server"], [0, 2, 1, "", "token"]], "algokit_utils.ApplicationClient": [[0, 5, 1, "", "add_method_call"], [0, 5, 1, "", "call"], [0, 5, 1, "", "clear_state"], [0, 5, 1, "", "close_out"], [0, 5, 1, "", "compose_call"], [0, 5, 1, "", "compose_clear_state"], [0, 5, 1, "", "compose_close_out"], [0, 5, 1, "", "compose_create"], [0, 5, 1, "", "compose_delete"], [0, 5, 1, "", "compose_opt_in"], [0, 5, 1, "", "compose_update"], [0, 5, 1, "", "create"], [0, 5, 1, "", "delete"], [0, 5, 1, "", "deploy"], [0, 5, 1, "", "export_source_map"], [0, 5, 1, "", "get_global_state"], [0, 5, 1, "", "get_local_state"], [0, 5, 1, "", "get_signer_sender"], [0, 5, 1, "", "import_source_map"], [0, 5, 1, "", "opt_in"], [0, 5, 1, "", "prepare"], [0, 5, 1, "", "resolve"], [0, 5, 1, "", "resolve_signer_sender"], [0, 5, 1, "", "update"]], "algokit_utils.ApplicationSpecification": [[0, 5, 1, "", "export"]], "algokit_utils.CallConfig": [[0, 2, 1, "", "ALL"], [0, 2, 1, "", "CALL"], [0, 2, 1, "", "CREATE"], [0, 2, 1, "", "NEVER"]], "algokit_utils.EnsureBalanceParameters": [[0, 2, 1, "", "account_to_fund"], [0, 2, 1, "", "fee_micro_algos"], [0, 2, 1, "", "funding_source"], [0, 2, 1, "", "max_fee_micro_algos"], [0, 2, 1, "", "min_funding_increment_micro_algos"], [0, 2, 1, "", "min_spending_balance_micro_algos"], [0, 2, 1, "", "note"], [0, 2, 1, "", "suggested_params"]], "algokit_utils.EnsureFundedResponse": [[0, 2, 1, "", "transaction_id"]], "algokit_utils.OnSchemaBreak": [[0, 2, 1, "", "AppendApp"], [0, 2, 1, "", "Fail"], [0, 2, 1, "", "ReplaceApp"]], "algokit_utils.OnUpdate": [[0, 2, 1, "", "AppendApp"], [0, 2, 1, "", "Fail"], [0, 2, 1, "", "ReplaceApp"], [0, 2, 1, "", "UpdateApp"]], "algokit_utils.OperationPerformed": [[0, 2, 1, "", "Create"], [0, 2, 1, "", "Nothing"], [0, 2, 1, "", "Replace"], [0, 2, 1, "", "Update"]], "algokit_utils.TestNetDispenserApiClient": [[0, 5, 1, "", "fund"], [0, 5, 1, "", "get_limit"], [0, 5, 1, "", "refund"]], "algokit_utils.TransactionParameters": [[0, 2, 1, "", "accounts"], [0, 2, 1, "", "boxes"], [0, 2, 1, "", "foreign_apps"], [0, 2, 1, "", "foreign_assets"], [0, 2, 1, "", "lease"], [0, 2, 1, "", "note"], [0, 2, 1, "", "rekey_to"], [0, 2, 1, "", "sender"], [0, 2, 1, "", "signer"], [0, 2, 1, "", "suggested_params"]], "algokit_utils.TransactionParametersDict": [[0, 2, 1, "", "accounts"], [0, 2, 1, "", "boxes"], [0, 2, 1, "", "foreign_apps"], [0, 2, 1, "", "foreign_assets"], [0, 2, 1, "", "lease"], [0, 2, 1, "", "note"], [0, 2, 1, "", "rekey_to"], [0, 2, 1, "", "sender"], [0, 2, 1, "", "signer"], [0, 2, 1, "", "suggested_params"]], "algokit_utils.TransactionResponse": [[0, 2, 1, "", "confirmed_round"], [0, 5, 1, "", "from_atr"], [0, 2, 1, "", "tx_id"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:property", "4": "py:data", "5": "py:method", "6": "py:exception", "7": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "property", "Python property"], "4": ["py", "data", "Python data"], "5": ["py", "method", "Python method"], "6": ["py", "exception", "Python exception"], "7": ["py", "function", "Python function"]}, "titleterms": {"algokit_util": 0, "packag": 0, "content": [0, 8], "class": 0, "function": 0, "data": 0, "api": 0, "convent": 0, "exampl": 0, "testnet": 6, "dispens": [6, 7], "client": [2, 4, 6], "creat": [2, 6], "fund": 6, "an": [2, 3, 6], "account": [1, 6], "regist": 6, "refund": 6, "get": 6, "current": 6, "limit": 6, "error": [2, 6], "handl": [2, 6], "algo": 7, "transfer": 7, "ensur": 7, "minimum": 7, "asset": 7, "algokit": 8, "python": 8, "util": [5, 8], "core": 8, "principl": 8, "instal": 8, "usag": 8, "type": 8, "capabl": 8, "refer": 8, "document": 8, "roadmap": 8, "indic": 8, "tabl": 8, "manag": [1, 4], "app": [2, 3], "design": [2, 3], "applic": [2, 3], "call": 2, "method": 2, "specifi": 2, "which": 2, "abi": 2, "argument": 2, "transact": 2, "paramet": [2, 3], "compos": 2, "read": 2, "state": 2, "logic": 2, "diagnos": 2, "debug": [2, 5], "mode": 2, "trace": [2, 5], "field": 2, "deploy": 3, "find": 3, "creator": 3, "deploi": 3, "input": 3, "idempot": 3, "compil": 3, "templat": 3, "substitut": 3, "return": 3, "valu": 3, "network": 4, "configur": [4, 5], "debugg": 5, "filenam": 5, "format": 5}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 57}, "alltitles": {"Account management": [[1, "account-management"]], "Account": [[1, "account"]], "App client": [[2, "app-client"]], "Design": [[2, "design"], [3, "design"]], "Creating an application client": [[2, "creating-an-application-client"]], "Calling methods on the app": [[2, "calling-methods-on-the-app"]], "Specifying which method": [[2, "specifying-which-method"]], "ABI arguments": [[2, "abi-arguments"]], "Transaction Parameters": [[2, "transaction-parameters"]], "Composing calls": [[2, "composing-calls"]], "Reading state": [[2, "reading-state"]], "Handling logic errors and diagnosing errors": [[2, "handling-logic-errors-and-diagnosing-errors"]], "Debug Mode and traces Field": [[2, "debug-mode-and-traces-field"]], "Client management": [[4, "client-management"]], "Network configuration": [[4, "network-configuration"]], "Clients": [[4, "clients"]], "App deployment": [[3, "app-deployment"]], "Finding apps by creator": [[3, "finding-apps-by-creator"]], "Deploying an application": [[3, "deploying-an-application"]], "Input parameters": [[3, "input-parameters"]], "Idempotency": [[3, "idempotency"]], "Compilation and template substitution": [[3, "compilation-and-template-substitution"]], "Return value": [[3, "return-value"]], "TestNet Dispenser Client": [[6, "testnet-dispenser-client"]], "Creating a Dispenser Client": [[6, "creating-a-dispenser-client"]], "Funding an Account": [[6, "funding-an-account"]], "Registering a Refund": [[6, "registering-a-refund"]], "Getting Current Limit": [[6, "getting-current-limit"]], "Error Handling": [[6, "error-handling"]], "Algo transfers": [[7, "algo-transfers"]], "Transferring Algos": [[7, "transferring-algos"]], "Ensuring minimum Algos": [[7, "ensuring-minimum-algos"]], "Transfering Assets": [[7, "transfering-assets"]], "Dispenser": [[7, "dispenser"]], "AlgoKit Python Utilities": [[8, "algokit-python-utilities"]], "Contents": [[8, null]], "Core principles": [[8, "core-principles"]], "Installation": [[8, "installation"]], "Usage": [[8, "usage"]], "Types": [[8, "types"]], "Capabilities": [[8, "capabilities"]], "Reference documentation": [[8, "reference-documentation"]], "Roadmap": [[8, "roadmap"]], "Indices and tables": [[8, "indices-and-tables"]], "algokit_utils": [[0, "module-algokit_utils"]], "Package Contents": [[0, "package-contents"]], "Classes": [[0, "classes"]], "Functions": [[0, "functions"]], "Data": [[0, "data"]], "API": [[0, "api"]], "Convention": [[0, "convention"]], "Example": [[0, "example"]], "Debugger": [[5, "debugger"]], "Configuration": [[5, "configuration"]], "Debugging Utilities": [[5, "debugging-utilities"]], "Trace filename format": [[5, "trace-filename-format"]]}, "indexentries": {"abicallargs (class in algokit_utils)": [[0, "algokit_utils.ABICallArgs"]], "abicallargsdict (class in algokit_utils)": [[0, "algokit_utils.ABICallArgsDict"]], "abicreatecallargs (class in algokit_utils)": [[0, "algokit_utils.ABICreateCallArgs"]], "abicreatecallargsdict (class in algokit_utils)": [[0, "algokit_utils.ABICreateCallArgsDict"]], "abitransactionresponse (class in algokit_utils)": [[0, "algokit_utils.ABITransactionResponse"]], "all (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.ALL"]], "account (class in algokit_utils)": [[0, "algokit_utils.Account"]], "algoclientconfig (class in algokit_utils)": [[0, "algokit_utils.AlgoClientConfig"]], "appdeploymetadata (class in algokit_utils)": [[0, "algokit_utils.AppDeployMetaData"]], "applookup (class in algokit_utils)": [[0, "algokit_utils.AppLookup"]], "appmetadata (class in algokit_utils)": [[0, "algokit_utils.AppMetaData"]], "appreference (class in algokit_utils)": [[0, "algokit_utils.AppReference"]], "appspecstatedict (in module algokit_utils)": [[0, "algokit_utils.AppSpecStateDict"]], "appendapp (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.AppendApp"]], "appendapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.AppendApp"]], "applicationclient (class in algokit_utils)": [[0, "algokit_utils.ApplicationClient"]], "applicationspecification (class in algokit_utils)": [[0, "algokit_utils.ApplicationSpecification"]], "call (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.CALL"]], "create (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.CREATE"]], "callconfig (class in algokit_utils)": [[0, "algokit_utils.CallConfig"]], "create (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Create"]], "createcallparameters (class in algokit_utils)": [[0, "algokit_utils.CreateCallParameters"]], "createcallparametersdict (class in algokit_utils)": [[0, "algokit_utils.CreateCallParametersDict"]], "createtransactionparameters (class in algokit_utils)": [[0, "algokit_utils.CreateTransactionParameters"]], "deletable_template_name (in module algokit_utils)": [[0, "algokit_utils.DELETABLE_TEMPLATE_NAME"]], "defaultargumentdict (class in algokit_utils)": [[0, "algokit_utils.DefaultArgumentDict"]], "defaultargumenttype (in module algokit_utils)": [[0, "algokit_utils.DefaultArgumentType"]], "deploycallargs (class in algokit_utils)": [[0, "algokit_utils.DeployCallArgs"]], "deploycallargsdict (class in algokit_utils)": [[0, "algokit_utils.DeployCallArgsDict"]], "deploycreatecallargs (class in algokit_utils)": [[0, "algokit_utils.DeployCreateCallArgs"]], "deploycreatecallargsdict (class in algokit_utils)": [[0, "algokit_utils.DeployCreateCallArgsDict"]], "deployresponse (class in algokit_utils)": [[0, "algokit_utils.DeployResponse"]], "deploymentfailederror": [[0, "algokit_utils.DeploymentFailedError"]], "ensurebalanceparameters (class in algokit_utils)": [[0, "algokit_utils.EnsureBalanceParameters"]], "ensurefundedresponse (class in algokit_utils)": [[0, "algokit_utils.EnsureFundedResponse"]], "fail (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.Fail"]], "fail (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.Fail"]], "logicerror": [[0, "algokit_utils.LogicError"]], "methodconfigdict (in module algokit_utils)": [[0, "algokit_utils.MethodConfigDict"]], "methodhints (class in algokit_utils)": [[0, "algokit_utils.MethodHints"]], "never (algokit_utils.callconfig attribute)": [[0, "algokit_utils.CallConfig.NEVER"]], "note_prefix (in module algokit_utils)": [[0, "algokit_utils.NOTE_PREFIX"]], "nothing (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Nothing"]], "oncompleteactionname (in module algokit_utils)": [[0, "algokit_utils.OnCompleteActionName"]], "oncompletecallparameters (class in algokit_utils)": [[0, "algokit_utils.OnCompleteCallParameters"]], "oncompletecallparametersdict (class in algokit_utils)": [[0, "algokit_utils.OnCompleteCallParametersDict"]], "onschemabreak (class in algokit_utils)": [[0, "algokit_utils.OnSchemaBreak"]], "onupdate (class in algokit_utils)": [[0, "algokit_utils.OnUpdate"]], "operationperformed (class in algokit_utils)": [[0, "algokit_utils.OperationPerformed"]], "program (class in algokit_utils)": [[0, "algokit_utils.Program"]], "replace (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Replace"]], "replaceapp (algokit_utils.onschemabreak attribute)": [[0, "algokit_utils.OnSchemaBreak.ReplaceApp"]], "replaceapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.ReplaceApp"]], "templatevaluedict (in module algokit_utils)": [[0, "algokit_utils.TemplateValueDict"]], "templatevaluemapping (in module algokit_utils)": [[0, "algokit_utils.TemplateValueMapping"]], "testnetdispenserapiclient (class in algokit_utils)": [[0, "algokit_utils.TestNetDispenserApiClient"]], "transactionparameters (class in algokit_utils)": [[0, "algokit_utils.TransactionParameters"]], "transactionparametersdict (class in algokit_utils)": [[0, "algokit_utils.TransactionParametersDict"]], "transactionresponse (class in algokit_utils)": [[0, "algokit_utils.TransactionResponse"]], "transferassetparameters (class in algokit_utils)": [[0, "algokit_utils.TransferAssetParameters"]], "transferparameters (class in algokit_utils)": [[0, "algokit_utils.TransferParameters"]], "updatable_template_name (in module algokit_utils)": [[0, "algokit_utils.UPDATABLE_TEMPLATE_NAME"]], "update (algokit_utils.operationperformed attribute)": [[0, "algokit_utils.OperationPerformed.Update"]], "updateapp (algokit_utils.onupdate attribute)": [[0, "algokit_utils.OnUpdate.UpdateApp"]], "account_to_fund (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.account_to_fund"]], "accounts (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.accounts"]], "accounts (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.accounts"]], "add_method_call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.add_method_call"]], "address (algokit_utils.account attribute)": [[0, "algokit_utils.Account.address"]], "algokit_utils": [[0, "module-algokit_utils"]], "boxes (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.boxes"]], "boxes (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.boxes"]], "call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.call"]], "clear_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.clear_state"]], "close_out() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.close_out"]], "compose_call() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_call"]], "compose_clear_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_clear_state"]], "compose_close_out() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_close_out"]], "compose_create() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_create"]], "compose_delete() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_delete"]], "compose_opt_in() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_opt_in"]], "compose_update() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.compose_update"]], "confirmed_round (algokit_utils.transactionresponse attribute)": [[0, "algokit_utils.TransactionResponse.confirmed_round"]], "create() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.create"]], "create_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.create_kmd_wallet_account"]], "decode_error (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.decode_error"]], "delete() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.delete"]], "deploy() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.deploy"]], "ensure_funded() (in module algokit_utils)": [[0, "algokit_utils.ensure_funded"]], "execute_atc_with_logic_error() (in module algokit_utils)": [[0, "algokit_utils.execute_atc_with_logic_error"]], "export() (algokit_utils.applicationspecification method)": [[0, "algokit_utils.ApplicationSpecification.export"]], "export_source_map() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.export_source_map"]], "fee_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.fee_micro_algos"]], "foreign_apps (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.foreign_apps"]], "foreign_apps (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.foreign_apps"]], "foreign_assets (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.foreign_assets"]], "foreign_assets (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.foreign_assets"]], "from_atr() (algokit_utils.transactionresponse static method)": [[0, "algokit_utils.TransactionResponse.from_atr"]], "fund() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.fund"]], "funding_source (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.funding_source"]], "get_account() (in module algokit_utils)": [[0, "algokit_utils.get_account"]], "get_account_from_mnemonic() (in module algokit_utils)": [[0, "algokit_utils.get_account_from_mnemonic"]], "get_algod_client() (in module algokit_utils)": [[0, "algokit_utils.get_algod_client"]], "get_app_id_from_tx_id() (in module algokit_utils)": [[0, "algokit_utils.get_app_id_from_tx_id"]], "get_creator_apps() (in module algokit_utils)": [[0, "algokit_utils.get_creator_apps"]], "get_default_localnet_config() (in module algokit_utils)": [[0, "algokit_utils.get_default_localnet_config"]], "get_dispenser_account() (in module algokit_utils)": [[0, "algokit_utils.get_dispenser_account"]], "get_global_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_global_state"]], "get_indexer_client() (in module algokit_utils)": [[0, "algokit_utils.get_indexer_client"]], "get_kmd_client_from_algod_client() (in module algokit_utils)": [[0, "algokit_utils.get_kmd_client_from_algod_client"]], "get_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.get_kmd_wallet_account"]], "get_limit() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.get_limit"]], "get_local_state() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_local_state"]], "get_localnet_default_account() (in module algokit_utils)": [[0, "algokit_utils.get_localnet_default_account"]], "get_next_version() (in module algokit_utils)": [[0, "algokit_utils.get_next_version"]], "get_or_create_kmd_wallet_account() (in module algokit_utils)": [[0, "algokit_utils.get_or_create_kmd_wallet_account"]], "get_sender_from_signer() (in module algokit_utils)": [[0, "algokit_utils.get_sender_from_signer"]], "get_signer_sender() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.get_signer_sender"]], "import_source_map() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.import_source_map"]], "is_localnet() (in module algokit_utils)": [[0, "algokit_utils.is_localnet"]], "is_mainnet() (in module algokit_utils)": [[0, "algokit_utils.is_mainnet"]], "is_testnet() (in module algokit_utils)": [[0, "algokit_utils.is_testnet"]], "lease (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.lease"]], "lease (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.lease"]], "max_fee_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.max_fee_micro_algos"]], "method (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.method"]], "min_funding_increment_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.min_funding_increment_micro_algos"]], "min_spending_balance_micro_algos (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.min_spending_balance_micro_algos"]], "module": [[0, "module-algokit_utils"]], "note (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.note"]], "note (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.note"]], "note (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.note"]], "num_extra_program_pages() (in module algokit_utils)": [[0, "algokit_utils.num_extra_program_pages"]], "opt_in() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.opt_in"]], "opt_in() (in module algokit_utils)": [[0, "algokit_utils.opt_in"]], "opt_out() (in module algokit_utils)": [[0, "algokit_utils.opt_out"]], "persist_sourcemaps() (in module algokit_utils)": [[0, "algokit_utils.persist_sourcemaps"]], "prepare() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.prepare"]], "private_key (algokit_utils.account attribute)": [[0, "algokit_utils.Account.private_key"]], "public_key (algokit_utils.account property)": [[0, "algokit_utils.Account.public_key"]], "raw_value (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.raw_value"]], "refund() (algokit_utils.testnetdispenserapiclient method)": [[0, "algokit_utils.TestNetDispenserApiClient.refund"]], "rekey_to (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.rekey_to"]], "rekey_to (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.rekey_to"]], "replace_template_variables() (in module algokit_utils)": [[0, "algokit_utils.replace_template_variables"]], "resolve() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.resolve"]], "resolve_signer_sender() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.resolve_signer_sender"]], "return_value (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.return_value"]], "sender (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.sender"]], "sender (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.sender"]], "server (algokit_utils.algoclientconfig attribute)": [[0, "algokit_utils.AlgoClientConfig.server"]], "signer (algokit_utils.account property)": [[0, "algokit_utils.Account.signer"]], "signer (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.signer"]], "signer (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.signer"]], "simulate_and_persist_response() (in module algokit_utils)": [[0, "algokit_utils.simulate_and_persist_response"]], "suggested_params (algokit_utils.ensurebalanceparameters attribute)": [[0, "algokit_utils.EnsureBalanceParameters.suggested_params"]], "suggested_params (algokit_utils.transactionparameters attribute)": [[0, "algokit_utils.TransactionParameters.suggested_params"]], "suggested_params (algokit_utils.transactionparametersdict attribute)": [[0, "algokit_utils.TransactionParametersDict.suggested_params"]], "token (algokit_utils.algoclientconfig attribute)": [[0, "algokit_utils.AlgoClientConfig.token"]], "transaction_id (algokit_utils.ensurefundedresponse attribute)": [[0, "algokit_utils.EnsureFundedResponse.transaction_id"]], "transfer() (in module algokit_utils)": [[0, "algokit_utils.transfer"]], "transfer_asset() (in module algokit_utils)": [[0, "algokit_utils.transfer_asset"]], "tx_id (algokit_utils.transactionresponse attribute)": [[0, "algokit_utils.TransactionResponse.tx_id"]], "tx_info (algokit_utils.abitransactionresponse attribute)": [[0, "algokit_utils.ABITransactionResponse.tx_info"]], "update() (algokit_utils.applicationclient method)": [[0, "algokit_utils.ApplicationClient.update"]]}}) \ No newline at end of file diff --git a/docs/source/capabilities/debugging.md b/docs/source/capabilities/debugging.md new file mode 100644 index 00000000..96ff7d22 --- /dev/null +++ b/docs/source/capabilities/debugging.md @@ -0,0 +1,46 @@ +# Debugger + +The AlgoKit Python Utilities package 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 [AlgoKit AVM Debugger extension](https://marketplace.visualstudio.com/items?itemName=algorandfoundation.algokit-avm-vscode-debugger). + +## Configuration + +The `config.py` file contains the `UpdatableConfig` class which manages and updates configuration settings for the AlgoKit project. The class has the following attributes: + +- `debug`: Indicates whether debug mode is enabled. +- `project_root`: The path to the project root directory. Can be ignored if you are using `algokit_utils` inside an `algokit` compliant project (containing `.algokit.toml` file). For non algokit compliant projects, simply provide the path to the folder where you want to store sourcemaps and traces to be used with [`AlgoKit AVM Debugger`](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). Alternatively you can also set the value via the `ALGOKIT_PROJECT_ROOT` environment variable. +- `trace_all`: Indicates whether to trace all operations. Defaults to false, this means that when debug mode is enabled, any (or all) application client calls performed via `algokit_utils` will store responses from `simulate` endpoint. These files are called traces, and can be used with `AlgoKit AVM Debugger` to debug TEAL source codes, transactions in the atomic group and etc. +- `trace_buffer_size_mb`: The size of the trace buffer in megabytes. By default uses 256 megabytes. When output folder containing debug trace files exceedes the size, oldest files are removed to optimize for storage consumption. +- `max_search_depth`: The maximum depth to search for a an `algokit` config file. By default it will traverse at most 10 folders searching for `.algokit.toml` file which will be used to assume algokit compliant project root path. + +The `configure` method can be used to set these attributes. + +To enable debug mode in your project you can configure it as follows: + +```py +from algokit_utils.config import config + +config.configure(debug=True) +``` + +## Debugging Utilities + +Debugging utilities can be used to simplify gathering artifacts to be used with [AlgoKit AVM Debugger](https://github.com/algorandfoundation/algokit-avm-vscode-debugger) in non algokit compliant projects. The following methods are provided: + +- `persist_sourcemaps`: This method persists the sourcemaps for the given sources as AVM Debugger compliant artifacts. It takes a list of `PersistSourceMapInput` objects, a `Path` object representing the root directory of the project, an `AlgodClient` object for interacting with the Algorand blockchain, and a boolean indicating whether to dump teal source files along with sourcemaps. +- `simulate_and_persist_response`: This method simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, and persists the simulation response to an AVM Debugger compliant JSON file. It takes an `AtomicTransactionComposer` object representing the atomic transactions to be simulated and persisted, a `Path` object representing the root directory of the project, an `AlgodClient` object representing the Algorand client, and a float representing the size of the trace buffer in megabytes. + +### Trace filename format + +The trace files are named in a specific format to provide useful information about the transactions they contain. The format is as follows: + +```ts +`${timestamp}_lr${last_round}_${transaction_types}.trace.avm.json`; +``` + +Where: + +- `timestamp`: The time when the trace file was created, in ISO 8601 format, with colons and periods removed. +- `last_round`: The last round when the simulation was performed. +- `transaction_types`: A string representing the types and counts of transactions in the atomic group. Each transaction type is represented as `${count}#${type}`, and different transaction types are separated by underscores. + +For example, a trace file might be named `20220301T123456Z_lr1000_2#pay_1#axfer.trace.avm.json`, indicating that the trace file was created at `2022-03-01T12:34:56Z`, the last round was `1000`, and the atomic group contained 2 payment transactions and 1 asset transfer transaction. diff --git a/docs/source/index.md b/docs/source/index.md index e71fa039..c260e516 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -79,6 +79,7 @@ The library helps you with the following capabilities: - [**ARC-0032 Application Spec client**](capabilities/app-client.md) - 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) - [**App deployment**](capabilities/app-deploy.md) - Idempotent (safely retryable) deployment of an app, including deploy-time immutability and permanence control and TEAL template substitution - [**Algo transfers**](capabilities/transfer.md) - Ability to easily initiate algo transfers between accounts, including dispenser management and idempotent account funding + - [**Debugger**](capabilities/debugger.md) - 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 [AVM Debugger extension](link). (reference-documentation)= diff --git a/poetry.lock b/poetry.lock index 72699ab9..501dc813 100644 --- a/poetry.lock +++ b/poetry.lock @@ -34,17 +34,22 @@ trio = ["trio (>=0.22)"] [[package]] name = "astroid" -version = "3.0.0" +version = "2.15.8" description = "An abstract syntax tree for Python with inference support." optional = false -python-versions = ">=3.8.0" +python-versions = ">=3.7.2" files = [ - {file = "astroid-3.0.0-py3-none-any.whl", hash = "sha256:f2510e7fdcd6cfda4ec50014726d4857abf79acfc010084ce8c26091913f1b25"}, - {file = "astroid-3.0.0.tar.gz", hash = "sha256:1defdbca052635dd29657ea674edfc45e4b5be9cd53630c5b084fcfed94344a8"}, + {file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"}, + {file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"}, ] [package.dependencies] +lazy-object-proxy = ">=1.4.0" typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} +wrapt = [ + {version = ">=1.11,<2", markers = "python_version < \"3.11\""}, + {version = ">=1.14,<2", markers = "python_version >= \"3.11\""}, +] [[package]] name = "babel" @@ -400,34 +405,34 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "41.0.4" +version = "41.0.7" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-41.0.4-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:80907d3faa55dc5434a16579952ac6da800935cd98d14dbd62f6f042c7f5e839"}, - {file = "cryptography-41.0.4-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:35c00f637cd0b9d5b6c6bd11b6c3359194a8eba9c46d4e875a3660e3b400005f"}, - {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cecfefa17042941f94ab54f769c8ce0fe14beff2694e9ac684176a2535bf9714"}, - {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e40211b4923ba5a6dc9769eab704bdb3fbb58d56c5b336d30996c24fcf12aadb"}, - {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:23a25c09dfd0d9f28da2352503b23e086f8e78096b9fd585d1d14eca01613e13"}, - {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2ed09183922d66c4ec5fdaa59b4d14e105c084dd0febd27452de8f6f74704143"}, - {file = "cryptography-41.0.4-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:5a0f09cefded00e648a127048119f77bc2b2ec61e736660b5789e638f43cc397"}, - {file = "cryptography-41.0.4-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:9eeb77214afae972a00dee47382d2591abe77bdae166bda672fb1e24702a3860"}, - {file = "cryptography-41.0.4-cp37-abi3-win32.whl", hash = "sha256:3b224890962a2d7b57cf5eeb16ccaafba6083f7b811829f00476309bce2fe0fd"}, - {file = "cryptography-41.0.4-cp37-abi3-win_amd64.whl", hash = "sha256:c880eba5175f4307129784eca96f4e70b88e57aa3f680aeba3bab0e980b0f37d"}, - {file = "cryptography-41.0.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67"}, - {file = "cryptography-41.0.4-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:86defa8d248c3fa029da68ce61fe735432b047e32179883bdb1e79ed9bb8195e"}, - {file = "cryptography-41.0.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:37480760ae08065437e6573d14be973112c9e6dcaf5f11d00147ee74f37a3829"}, - {file = "cryptography-41.0.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b5f4dfe950ff0479f1f00eda09c18798d4f49b98f4e2006d644b3301682ebdca"}, - {file = "cryptography-41.0.4-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7e53db173370dea832190870e975a1e09c86a879b613948f09eb49324218c14d"}, - {file = "cryptography-41.0.4-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5b72205a360f3b6176485a333256b9bcd48700fc755fef51c8e7e67c4b63e3ac"}, - {file = "cryptography-41.0.4-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:93530900d14c37a46ce3d6c9e6fd35dbe5f5601bf6b3a5c325c7bffc030344d9"}, - {file = "cryptography-41.0.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:efc8ad4e6fc4f1752ebfb58aefece8b4e3c4cae940b0994d43649bdfce8d0d4f"}, - {file = "cryptography-41.0.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c3391bd8e6de35f6f1140e50aaeb3e2b3d6a9012536ca23ab0d9c35ec18c8a91"}, - {file = "cryptography-41.0.4-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:0d9409894f495d465fe6fda92cb70e8323e9648af912d5b9141d616df40a87b8"}, - {file = "cryptography-41.0.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:8ac4f9ead4bbd0bc8ab2d318f97d85147167a488be0e08814a37eb2f439d5cf6"}, - {file = "cryptography-41.0.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:047c4603aeb4bbd8db2756e38f5b8bd7e94318c047cfe4efeb5d715e08b49311"}, - {file = "cryptography-41.0.4.tar.gz", hash = "sha256:7febc3094125fc126a7f6fb1f420d0da639f3f32cb15c8ff0dc3997c4549f51a"}, + {file = "cryptography-41.0.7-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:3c78451b78313fa81607fa1b3f1ae0a5ddd8014c38a02d9db0616133987b9cdf"}, + {file = "cryptography-41.0.7-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:928258ba5d6f8ae644e764d0f996d61a8777559f72dfeb2eea7e2fe0ad6e782d"}, + {file = "cryptography-41.0.7-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a1b41bc97f1ad230a41657d9155113c7521953869ae57ac39ac7f1bb471469a"}, + {file = "cryptography-41.0.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:841df4caa01008bad253bce2a6f7b47f86dc9f08df4b433c404def869f590a15"}, + {file = "cryptography-41.0.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5429ec739a29df2e29e15d082f1d9ad683701f0ec7709ca479b3ff2708dae65a"}, + {file = "cryptography-41.0.7-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:43f2552a2378b44869fe8827aa19e69512e3245a219104438692385b0ee119d1"}, + {file = "cryptography-41.0.7-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:af03b32695b24d85a75d40e1ba39ffe7db7ffcb099fe507b39fd41a565f1b157"}, + {file = "cryptography-41.0.7-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:49f0805fc0b2ac8d4882dd52f4a3b935b210935d500b6b805f321addc8177406"}, + {file = "cryptography-41.0.7-cp37-abi3-win32.whl", hash = "sha256:f983596065a18a2183e7f79ab3fd4c475205b839e02cbc0efbbf9666c4b3083d"}, + {file = "cryptography-41.0.7-cp37-abi3-win_amd64.whl", hash = "sha256:90452ba79b8788fa380dfb587cca692976ef4e757b194b093d845e8d99f612f2"}, + {file = "cryptography-41.0.7-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:079b85658ea2f59c4f43b70f8119a52414cdb7be34da5d019a77bf96d473b960"}, + {file = "cryptography-41.0.7-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:b640981bf64a3e978a56167594a0e97db71c89a479da8e175d8bb5be5178c003"}, + {file = "cryptography-41.0.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e3114da6d7f95d2dee7d3f4eec16dacff819740bbab931aff8648cb13c5ff5e7"}, + {file = "cryptography-41.0.7-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d5ec85080cce7b0513cfd233914eb8b7bbd0633f1d1703aa28d1dd5a72f678ec"}, + {file = "cryptography-41.0.7-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7a698cb1dac82c35fcf8fe3417a3aaba97de16a01ac914b89a0889d364d2f6be"}, + {file = "cryptography-41.0.7-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:37a138589b12069efb424220bf78eac59ca68b95696fc622b6ccc1c0a197204a"}, + {file = "cryptography-41.0.7-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:68a2dec79deebc5d26d617bfdf6e8aab065a4f34934b22d3b5010df3ba36612c"}, + {file = "cryptography-41.0.7-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:09616eeaef406f99046553b8a40fbf8b1e70795a91885ba4c96a70793de5504a"}, + {file = "cryptography-41.0.7-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:48a0476626da912a44cc078f9893f292f0b3e4c739caf289268168d8f4702a39"}, + {file = "cryptography-41.0.7-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c7f3201ec47d5207841402594f1d7950879ef890c0c495052fa62f58283fde1a"}, + {file = "cryptography-41.0.7-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c5ca78485a255e03c32b513f8c2bc39fedb7f5c5f8535545bdc223a03b24f248"}, + {file = "cryptography-41.0.7-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:d6c391c021ab1f7a82da5d8d0b3cee2f4b2c455ec86c8aebbc84837a631ff309"}, + {file = "cryptography-41.0.7.tar.gz", hash = "sha256:13f93ce9bea8016c253b34afc6bd6a75993e5c40672ed5405a9c832f0d4a00bc"}, ] [package.dependencies] @@ -847,6 +852,51 @@ completion = ["shtab"] docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +[[package]] +name = "lazy-object-proxy" +version = "1.9.0" +description = "A fast and thorough lazy object proxy." +optional = false +python-versions = ">=3.7" +files = [ + {file = "lazy-object-proxy-1.9.0.tar.gz", hash = "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-win32.whl", hash = "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455"}, + {file = "lazy_object_proxy-1.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-win32.whl", hash = "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586"}, + {file = "lazy_object_proxy-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win32.whl", hash = "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734"}, + {file = "lazy_object_proxy-1.9.0-cp37-cp37m-win_amd64.whl", hash = "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-win32.whl", hash = "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82"}, + {file = "lazy_object_proxy-1.9.0-cp38-cp38-win_amd64.whl", hash = "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-win32.whl", hash = "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821"}, + {file = "lazy_object_proxy-1.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f"}, +] + [[package]] name = "license-expression" version = "30.1.1" @@ -2454,4 +2504,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "542eb15ec27258c360c6b5224e4790d4ae922c3d1568bd9e16b77a856bce0711" +content-hash = "4f4eaa33d7cc9f47cfcf65138982caf63b23ea0aeb6a9c83992a05c27811363f" diff --git a/pyproject.toml b/pyproject.toml index e2b4eada..fcc6cdcb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,10 @@ types-deprecated = "^1.2.9.2" pytest-httpx = "^0.21.3" pytest-xdist = "^3.4.0" +# Used to prevent spinx-autodoc2 bug +# https://github.com/sphinx-extensions2/sphinx-autodoc2/issues/31 +astroid= "^2.15.8" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/src/algokit_utils/__init__.py b/src/algokit_utils/__init__.py index 2c57e632..a71df939 100644 --- a/src/algokit_utils/__init__.py +++ b/src/algokit_utils/__init__.py @@ -1,8 +1,5 @@ -from algokit_utils._ensure_funded import ( - EnsureBalanceParameters, - EnsureFundedResponse, - ensure_funded, -) +from algokit_utils._debugging import PersistSourceMapInput, persist_sourcemaps, simulate_and_persist_response +from algokit_utils._ensure_funded import EnsureBalanceParameters, EnsureFundedResponse, ensure_funded from algokit_utils._transfer import TransferAssetParameters, TransferParameters, transfer, transfer_asset from algokit_utils.account import ( create_kmd_wallet_account, @@ -15,7 +12,6 @@ ) from algokit_utils.application_client import ( ApplicationClient, - Program, execute_atc_with_logic_error, get_next_version, get_sender_from_signer, @@ -32,6 +28,7 @@ OnCompleteActionName, ) from algokit_utils.asset import opt_in, opt_out +from algokit_utils.common import Program from algokit_utils.deploy import ( DELETABLE_TEMPLATE_NAME, NOTE_PREFIX, @@ -181,4 +178,7 @@ "transfer_asset", "opt_in", "opt_out", + "persist_sourcemaps", + "PersistSourceMapInput", + "simulate_and_persist_response", ] diff --git a/src/algokit_utils/_debugging.py b/src/algokit_utils/_debugging.py new file mode 100644 index 00000000..8079447c --- /dev/null +++ b/src/algokit_utils/_debugging.py @@ -0,0 +1,280 @@ +import base64 +import json +import logging +import typing +from dataclasses import dataclass, field +from datetime import datetime, timezone +from pathlib import Path + +from algosdk.atomic_transaction_composer import ( + AtomicTransactionComposer, + EmptySigner, + SimulateAtomicTransactionResponse, +) +from algosdk.encoding import checksum +from algosdk.v2client.models import SimulateRequest, SimulateRequestTransactionGroup, SimulateTraceConfig + +from algokit_utils.common import Program + +if typing.TYPE_CHECKING: + from algosdk.v2client.algod import AlgodClient + +logger = logging.getLogger(__name__) + +ALGOKIT_DIR = ".algokit" +SOURCES_DIR = "sources" +SOURCES_FILE = "sources.avm.json" +TRACES_FILE_EXT = ".trace.avm.json" +DEBUG_TRACES_DIR = "debug_traces" +TEAL_FILE_EXT = ".teal" +TEAL_SOURCEMAP_EXT = ".teal.tok.map" + + +@dataclass +class AVMDebuggerSourceMapEntry: + location: str = field(metadata={"json": "sourcemap-location"}) + program_hash: str = field(metadata={"json": "hash"}) + + def __eq__(self, other: object) -> bool: + if isinstance(other, AVMDebuggerSourceMapEntry): + return self.location == other.location and self.program_hash == other.program_hash + return False + + def __str__(self) -> str: + return json.dumps({"sourcemap-location": self.location, "hash": self.program_hash}) + + +@dataclass +class AVMDebuggerSourceMap: + txn_group_sources: list[AVMDebuggerSourceMapEntry] = field(metadata={"json": "txn-group-sources"}) + + @classmethod + def from_dict(cls, data: dict) -> "AVMDebuggerSourceMap": + return cls( + txn_group_sources=[ + AVMDebuggerSourceMapEntry(location=item["sourcemap-location"], program_hash=item["hash"]) + for item in data.get("txn-group-sources", []) + ] + ) + + def to_dict(self) -> dict: + return {"txn-group-sources": [json.loads(str(item)) for item in self.txn_group_sources]} + + +@dataclass +class PersistSourceMapInput: + def __init__( + self, app_name: str, file_name: str, raw_teal: str | None = None, compiled_teal: Program | None = None + ): + self.compiled_teal = compiled_teal + self.app_name = app_name + self._raw_teal = raw_teal + self._file_name = self.strip_teal_extension(file_name) + + @classmethod + def from_raw_teal(cls, raw_teal: str, app_name: str, file_name: str) -> "PersistSourceMapInput": + return cls(app_name, file_name, raw_teal=raw_teal) + + @classmethod + def from_compiled_teal(cls, compiled_teal: Program, app_name: str, file_name: str) -> "PersistSourceMapInput": + return cls(app_name, file_name, compiled_teal=compiled_teal) + + @property + def raw_teal(self) -> str: + if self._raw_teal: + return self._raw_teal + elif self.compiled_teal: + return self.compiled_teal.teal + else: + raise ValueError("No teal content found") + + @property + def file_name(self) -> str: + return self._file_name + + @staticmethod + def strip_teal_extension(file_name: str) -> str: + if file_name.endswith(".teal"): + return file_name[:-5] + return file_name + + +def _load_or_create_sources(sources_path: Path) -> AVMDebuggerSourceMap: + if not sources_path.exists(): + return AVMDebuggerSourceMap(txn_group_sources=[]) + + with sources_path.open() as f: + return AVMDebuggerSourceMap.from_dict(json.load(f)) + + +def _upsert_debug_sourcemaps(sourcemaps: list[AVMDebuggerSourceMapEntry], project_root: Path) -> None: + """ + This function updates or inserts debug sourcemaps. If path in the sourcemap during iteration leads to non + existing file, removes it. Otherwise upserts. + + Args: + sourcemaps (list[AVMDebuggerSourceMapEntry]): A list of AVMDebuggerSourceMapEntry objects. + project_root (Path): The root directory of the project. + + Returns: + None + """ + + sources_path = project_root / ALGOKIT_DIR / SOURCES_DIR / SOURCES_FILE + sources = _load_or_create_sources(sources_path) + + for sourcemap in sourcemaps: + source_file_path = Path(sourcemap.location) + if not source_file_path.exists() and sourcemap in sources.txn_group_sources: + sources.txn_group_sources.remove(sourcemap) + elif source_file_path.exists(): + if sourcemap not in sources.txn_group_sources: + sources.txn_group_sources.append(sourcemap) + else: + index = sources.txn_group_sources.index(sourcemap) + sources.txn_group_sources[index] = sourcemap + + with sources_path.open("w") as f: + json.dump(sources.to_dict(), f) + + +def _write_to_file(path: Path, content: str) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(content) + + +def _build_avm_sourcemap( # noqa: PLR0913 + *, + app_name: str, + file_name: str, + output_path: Path, + client: "AlgodClient", + raw_teal: str | None = None, + compiled_teal: Program | None = None, + with_sources: bool = True, +) -> AVMDebuggerSourceMapEntry: + if not raw_teal and not compiled_teal: + raise ValueError("Either raw teal or compiled teal must be provided") + + result = compiled_teal if compiled_teal else Program(str(raw_teal), client=client) + program_hash = base64.b64encode( + checksum(result.raw_binary) # type: ignore[no-untyped-call] + ).decode() + source_map = result.source_map.__dict__ + source_map["sources"] = [f"{file_name}{TEAL_FILE_EXT}"] if with_sources else [] + + output_dir_path = output_path / ALGOKIT_DIR / SOURCES_DIR / app_name + source_map_output_path = output_dir_path / f"{file_name}{TEAL_SOURCEMAP_EXT}" + teal_output_path = output_dir_path / f"{file_name}{TEAL_FILE_EXT}" + _write_to_file(source_map_output_path, json.dumps(source_map)) + + if with_sources: + _write_to_file(teal_output_path, result.teal) + + return AVMDebuggerSourceMapEntry(str(source_map_output_path), program_hash) + + +def persist_sourcemaps( + *, sources: list[PersistSourceMapInput], project_root: Path, client: "AlgodClient", with_sources: bool = True +) -> None: + """ + Persist the sourcemaps for the given sources as an AlgoKit AVM Debugger compliant artifacts. + Args: + sources (list[PersistSourceMapInput]): A list of PersistSourceMapInput objects. + project_root (Path): The root directory of the project. + client (AlgodClient): An AlgodClient object for interacting with the Algorand blockchain. + with_sources (bool): If True, it will dump teal source files along with sourcemaps. + Default is True, as needed by an AlgoKit AVM debugger. + """ + + sourcemaps = [ + _build_avm_sourcemap( + raw_teal=source.raw_teal, + compiled_teal=source.compiled_teal, + app_name=source.app_name, + file_name=source.file_name, + output_path=project_root, + client=client, + with_sources=with_sources, + ) + for source in sources + ] + + _upsert_debug_sourcemaps(sourcemaps, project_root) + + +def simulate_response(atc: AtomicTransactionComposer, algod_client: "AlgodClient") -> SimulateAtomicTransactionResponse: + """ + Simulate and fetch response for the given AtomicTransactionComposer and AlgodClient. + + Args: + atc (AtomicTransactionComposer): An AtomicTransactionComposer object. + algod_client (AlgodClient): An AlgodClient object for interacting with the Algorand blockchain. + + Returns: + SimulateAtomicTransactionResponse: The simulated response. + """ + + unsigned_txn_groups = atc.build_group() + empty_signer = EmptySigner() + txn_list = [txn_group.txn for txn_group in unsigned_txn_groups] + fake_signed_transactions = empty_signer.sign_transactions(txn_list, []) + txn_group = [SimulateRequestTransactionGroup(txns=fake_signed_transactions)] + trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True) + + simulate_request = SimulateRequest( + txn_groups=txn_group, allow_more_logs=True, allow_empty_signatures=True, exec_trace_config=trace_config + ) + return atc.simulate(algod_client, simulate_request) + + +def simulate_and_persist_response( + atc: AtomicTransactionComposer, project_root: Path, algod_client: "AlgodClient", buffer_size_mb: float = 256 +) -> SimulateAtomicTransactionResponse: + """ + Simulates the atomic transactions using the provided `AtomicTransactionComposer` object and `AlgodClient` object, + and persists the simulation response to an AlgoKit AVM Debugger compliant JSON file. + + :param atc: An `AtomicTransactionComposer` object representing the atomic transactions to be + simulated and persisted. + :param project_root: A `Path` object representing the root directory of the project. + :param algod_client: An `AlgodClient` object representing the Algorand client. + :param buffer_size_mb: The size of the trace buffer in megabytes. Defaults to 256mb. + :return: None + + Returns: + SimulateAtomicTransactionResponse: The simulated response after persisting it + for AlgoKit AVM Debugger consumption. + """ + atc_to_simulate = atc.clone() + sp = algod_client.suggested_params() + + for txn_with_sign in atc_to_simulate.txn_list: + txn_with_sign.txn.first_valid_round = sp.first + txn_with_sign.txn.last_valid_round = sp.last + txn_with_sign.txn.genesis_hash = sp.gh + + response = simulate_response(atc_to_simulate, algod_client) + txn_results = response.simulate_response["txn-groups"] + + txn_types = [txn_result["txn-results"][0]["txn-result"]["txn"]["txn"]["type"] for txn_result in txn_results] + txn_types_count = {txn_type: txn_types.count(txn_type) for txn_type in set(txn_types)} + txn_types_str = "_".join([f"{count}#{txn_type}" for txn_type, count in txn_types_count.items()]) + + last_round = response.simulate_response["last-round"] + timestamp = datetime.now(tz=timezone.utc).strftime("%Y%m%d_%H%M%S") + output_file = project_root / DEBUG_TRACES_DIR / f"{timestamp}_lr{last_round}_{txn_types_str}{TRACES_FILE_EXT}" + + output_file.parent.mkdir(parents=True, exist_ok=True) + + # cleanup old files if buffer size is exceeded + total_size = sum(f.stat().st_size for f in output_file.parent.glob("*") if f.is_file()) + if total_size > buffer_size_mb * 1024 * 1024: + sorted_files = sorted(output_file.parent.glob("*"), key=lambda p: p.stat().st_mtime) + while total_size > buffer_size_mb * 1024 * 1024: + oldest_file = sorted_files.pop(0) + total_size -= oldest_file.stat().st_size + oldest_file.unlink() + + output_file.write_text(json.dumps(response.simulate_response, indent=2)) + return response diff --git a/src/algokit_utils/application_client.py b/src/algokit_utils/application_client.py index 743a4005..ceb00e75 100644 --- a/src/algokit_utils/application_client.py +++ b/src/algokit_utils/application_client.py @@ -18,7 +18,6 @@ AccountTransactionSigner, AtomicTransactionComposer, AtomicTransactionResponse, - EmptySigner, LogicSigTransactionSigner, MultisigTransactionSigner, SimulateAtomicTransactionResponse, @@ -28,10 +27,16 @@ from algosdk.constants import APP_PAGE_MAX_SIZE from algosdk.logic import get_application_address from algosdk.source_map import SourceMap -from algosdk.v2client.models import SimulateRequest, SimulateRequestTransactionGroup, SimulateTraceConfig import algokit_utils.application_specification as au_spec import algokit_utils.deploy as au_deploy +from algokit_utils._debugging import ( + PersistSourceMapInput, + persist_sourcemaps, + simulate_and_persist_response, + simulate_response, +) +from algokit_utils.common import Program from algokit_utils.config import config from algokit_utils.logic_error import LogicError, parse_logic_error from algokit_utils.models import ( @@ -61,7 +66,6 @@ __all__ = [ "ApplicationClient", - "Program", "execute_atc_with_logic_error", "get_next_version", "get_sender_from_signer", @@ -72,21 +76,6 @@ representing an ABI method name or signature""" -class Program: - """A compiled TEAL program""" - - def __init__(self, program: str, client: "AlgodClient"): - """ - Fully compile the program source to binary and generate a - source map for matching pc to line number - """ - self.teal = program - result: dict = client.compile(au_deploy.strip_comments(self.teal), source_map=True) - self.raw_binary = base64.b64decode(result["result"]) - self.binary_hash: str = result["hash"] - self.source_map = SourceMap(result["sourcemap"]) - - def num_extra_program_pages(approval: bytes, clear: bytes) -> int: """Calculate minimum number of extra_pages required for provided approval and clear programs""" @@ -346,6 +335,22 @@ def deploy( # noqa: PLR0913 self._approval_program, self._clear_program = substitute_template_and_compile( self.algod_client, self.app_spec, template_values ) + + if config.debug and config.project_root: + persist_sourcemaps( + sources=[ + PersistSourceMapInput( + compiled_teal=self._approval_program, app_name=self.app_name, file_name="approval.teal" + ), + PersistSourceMapInput( + compiled_teal=self._clear_program, app_name=self.app_name, file_name="clear.teal" + ), + ], + project_root=config.project_root, + client=self.algod_client, + with_sources=True, + ) + deployer = au_deploy.Deployer( app_client=self, creator=self._creator, @@ -630,6 +635,11 @@ def call( if method: hints = self._method_hints(method) if hints and hints.read_only: + if config.debug and config.project_root and config.trace_all: + simulate_and_persist_response( + atc, config.project_root, self.algod_client, config.trace_buffer_size_mb + ) + return self._simulate_readonly_call(method, atc) return self._execute_atc_tr(atc) @@ -865,26 +875,40 @@ def _check_is_compiled(self) -> tuple[Program, Program]: self._approval_program, self._clear_program = substitute_template_and_compile( self.algod_client, self.app_spec, self.template_values ) + + if config.debug and config.project_root: + persist_sourcemaps( + sources=[ + PersistSourceMapInput( + compiled_teal=self._approval_program, app_name=self.app_name, file_name="approval.teal" + ), + PersistSourceMapInput( + compiled_teal=self._clear_program, app_name=self.app_name, file_name="clear.teal" + ), + ], + project_root=config.project_root, + client=self.algod_client, + with_sources=True, + ) + return self._approval_program, self._clear_program def _simulate_readonly_call( self, method: Method, atc: AtomicTransactionComposer ) -> ABITransactionResponse | TransactionResponse: - simulate_response = _simulate_response(atc, self.algod_client) + response = simulate_response(atc, self.algod_client) traces = None if config.debug: - traces = _create_simulate_traces(simulate_response) - if simulate_response.failure_message: + traces = _create_simulate_traces(response) + if response.failure_message: raise _try_convert_to_logic_error( - simulate_response.failure_message, + response.failure_message, self.app_spec.approval_program, self._get_approval_source_map, traces, - ) or Exception( - f"Simulate failed for readonly method {method.get_signature()}: {simulate_response.failure_message}" - ) + ) or Exception(f"Simulate failed for readonly method {method.get_signature()}: {response.failure_message}") - return TransactionResponse.from_atr(simulate_response) + return TransactionResponse.from_atr(response) def _load_reference_and_check_app_id(self) -> None: self._load_app_reference() @@ -1192,7 +1216,9 @@ def substitute_template_and_compile( au_deploy.check_template_variables(app_spec.approval_program, template_values) approval = au_deploy.replace_template_variables(app_spec.approval_program, template_values) - return Program(approval, algod_client), Program(clear, algod_client) + approval_app, clear_app = Program(approval, algod_client), Program(clear, algod_client) + + return approval_app, clear_app def get_next_version(current_version: str) -> str: @@ -1263,10 +1289,22 @@ def execute_atc_with_logic_error( ``` """ try: + if config.debug and config.project_root and config.trace_all: + simulate_and_persist_response(atc, config.project_root, algod_client, config.trace_buffer_size_mb) + return atc.execute(algod_client, wait_rounds=wait_rounds) except Exception as ex: if config.debug: - simulate = _simulate_response(atc, algod_client) + simulate = None + if config.project_root and not config.trace_all: + # if trace_all is enabled, we already have the traces executed above + # hence we only need to simulate if trace_all is disabled and + # project_root is set + simulate = simulate_and_persist_response( + atc, config.project_root, algod_client, config.trace_buffer_size_mb + ) + else: + simulate = simulate_response(atc, algod_client) traces = _create_simulate_traces(simulate) else: traces = None @@ -1299,22 +1337,6 @@ def _create_simulate_traces(simulate: SimulateAtomicTransactionResponse) -> list return traces -def _simulate_response( - atc: AtomicTransactionComposer, algod_client: "AlgodClient" -) -> SimulateAtomicTransactionResponse: - unsigned_txn_groups = atc.build_group() - empty_signer = EmptySigner() - txn_list = [txn_group.txn for txn_group in unsigned_txn_groups] - fake_signed_transactions = empty_signer.sign_transactions(txn_list, []) - txn_group = [SimulateRequestTransactionGroup(txns=fake_signed_transactions)] - trace_config = SimulateTraceConfig(enable=True, stack_change=True, scratch_change=True) - - simulate_request = SimulateRequest( - txn_groups=txn_group, allow_more_logs=True, allow_empty_signatures=True, exec_trace_config=trace_config - ) - return atc.simulate(algod_client, simulate_request) - - def _convert_transaction_parameters( args: TransactionParameters | TransactionParametersDict | None, ) -> CreateCallParameters: diff --git a/src/algokit_utils/common.py b/src/algokit_utils/common.py new file mode 100644 index 00000000..8071c98f --- /dev/null +++ b/src/algokit_utils/common.py @@ -0,0 +1,28 @@ +""" +This module contains common classes and methods that are reused in more than one file. +""" + +import base64 +import typing + +from algosdk.source_map import SourceMap + +from algokit_utils import deploy + +if typing.TYPE_CHECKING: + from algosdk.v2client.algod import AlgodClient + + +class Program: + """A compiled TEAL program""" + + def __init__(self, program: str, client: "AlgodClient"): + """ + Fully compile the program source to binary and generate a + source map for matching pc to line number + """ + self.teal = program + result: dict = client.compile(deploy.strip_comments(self.teal), source_map=True) + self.raw_binary = base64.b64decode(result["result"]) + self.binary_hash: str = result["hash"] + self.source_map = SourceMap(result["sourcemap"]) diff --git a/src/algokit_utils/config.py b/src/algokit_utils/config.py index acd2635f..bd422056 100644 --- a/src/algokit_utils/config.py +++ b/src/algokit_utils/config.py @@ -1,25 +1,112 @@ +import logging +import os from collections.abc import Callable +from pathlib import Path + +logger = logging.getLogger(__name__) + +# Environment variable to override the project root +ALGOKIT_PROJECT_ROOT = os.getenv("ALGOKIT_PROJECT_ROOT") +ALGOKIT_CONFIG_FILENAME = ".algokit.toml" class UpdatableConfig: + """Class to manage and update configuration settings for the AlgoKit project. + + Attributes: + debug (bool): Indicates whether debug mode is enabled. + project_root (Path | None): The path to the project root directory. + trace_all (bool): Indicates whether to trace all operations. + trace_buffer_size_mb (int): The size of the trace buffer in megabytes. + max_search_depth (int): The maximum depth to search for a specific file. + """ + def __init__(self) -> None: self._debug: bool = False + self._project_root: Path | None = None + self._trace_all: bool = False + self._trace_buffer_size_mb: int | float = 256 # megabytes + self._max_search_depth: int = 10 + self._configure_project_root() + + def _configure_project_root(self) -> None: + """Configures the project root by searching for a specific file within a depth limit.""" + current_path = Path(__file__).resolve() + for _ in range(self._max_search_depth): + logger.info(f"Searching in: {current_path}") + if (current_path / ALGOKIT_CONFIG_FILENAME).exists(): + self._project_root = current_path + break + current_path = current_path.parent @property def debug(self) -> bool: + """Returns the debug status.""" return self._debug - def with_debug(self, lambda_func: Callable[[], None | str]) -> None: - original = self._debug + @property + def project_root(self) -> Path | None: + """Returns the project root path.""" + return self._project_root + + @property + def trace_all(self) -> bool: + """Indicates whether to store simulation traces for all operations.""" + return self._trace_all + + @property + def trace_buffer_size_mb(self) -> int | float: + """Returns the size of the trace buffer in megabytes.""" + return self._trace_buffer_size_mb + + def with_debug(self, func: Callable[[], str | None]) -> None: + """Executes a function with debug mode temporarily enabled.""" + original_debug = self._debug try: self._debug = True - lambda_func() + func() finally: - self._debug = original + self._debug = original_debug + + def configure( # noqa: PLR0913 + self, + *, + debug: bool, + project_root: Path | None = None, + trace_all: bool = False, + trace_buffer_size_mb: float = 256, + max_search_depth: int = 10, + ) -> None: + """ + Configures various settings for the application. + Please note, when `project_root` is not specified, by default config will attempt to find the `algokit.toml` by + scanning the parent directories according to the `max_search_depth` parameter. + Alternatively value can also be set via the `ALGOKIT_PROJECT_ROOT` environment variable. + If you are executing the config from an algokit compliant project, you can simply call + `config.configure(debug=True)`. + + Args: + debug (bool): Indicates whether debug mode is enabled. + project_root (Path | None, optional): The path to the project root directory. Defaults to None. + trace_all (bool, optional): Indicates whether to trace all operations. Defaults to False. Which implies that + only the operations that are failed will be traced by default. + trace_buffer_size_mb (float, optional): The size of the trace buffer in megabytes. Defaults to 512mb. + max_search_depth (int, optional): The maximum depth to search for a specific file. Defaults to 10. + + Returns: + None + """ + + self._debug = debug + + if project_root: + self._project_root = project_root.resolve(strict=True) + elif debug and ALGOKIT_PROJECT_ROOT: + self._project_root = Path(ALGOKIT_PROJECT_ROOT).resolve(strict=True) - def configure(self, *, debug: bool) -> None: - if debug is not None: - self._debug = debug + self._trace_all = trace_all + self._trace_buffer_size_mb = trace_buffer_size_mb + self._max_search_depth = max_search_depth config = UpdatableConfig() diff --git a/tests/test_app_client_call.py b/tests/test_app_client_call.py index 940a8560..390e159d 100644 --- a/tests/test_app_client_call.py +++ b/tests/test_app_client_call.py @@ -42,6 +42,7 @@ def client_fixture(algod_client: "AlgodClient", app_spec: ApplicationSpecificati def mock_config() -> Generator[Mock, None, None]: with patch("algokit_utils.application_client.config", new_callable=Mock) as mock_config: mock_config.debug = True + mock_config.project_root = None yield mock_config diff --git a/tests/test_debug_utils.approvals/test_build_teal_sourcemaps.approved.txt b/tests/test_debug_utils.approvals/test_build_teal_sourcemaps.approved.txt new file mode 100644 index 00000000..bdedcb69 --- /dev/null +++ b/tests/test_debug_utils.approvals/test_build_teal_sourcemaps.approved.txt @@ -0,0 +1 @@ +{"txn-group-sources": [{"sourcemap-location": "dummy", "hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug="}, {"sourcemap-location": "dummy", "hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug="}]} \ No newline at end of file diff --git a/tests/test_debug_utils.approvals/test_build_teal_sourcemaps_without_sources.approved.txt b/tests/test_debug_utils.approvals/test_build_teal_sourcemaps_without_sources.approved.txt new file mode 100644 index 00000000..bdedcb69 --- /dev/null +++ b/tests/test_debug_utils.approvals/test_build_teal_sourcemaps_without_sources.approved.txt @@ -0,0 +1 @@ +{"txn-group-sources": [{"sourcemap-location": "dummy", "hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug="}, {"sourcemap-location": "dummy", "hash": "EC1P8unO+zjVbdF8XZOs1rp+uaGNk7vXtZ/IYsN/sug="}]} \ No newline at end of file diff --git a/tests/test_debug_utils.py b/tests/test_debug_utils.py new file mode 100644 index 00000000..459bd126 --- /dev/null +++ b/tests/test_debug_utils.py @@ -0,0 +1,177 @@ +import json +from typing import TYPE_CHECKING +from unittest.mock import Mock + +import pytest +from algokit_utils._debugging import ( + AVMDebuggerSourceMap, + PersistSourceMapInput, + persist_sourcemaps, + simulate_and_persist_response, +) +from algokit_utils.account import get_account +from algokit_utils.application_client import ApplicationClient +from algokit_utils.application_specification import ApplicationSpecification +from algokit_utils.common import Program +from algokit_utils.models import Account +from algosdk.atomic_transaction_composer import ( + AccountTransactionSigner, + AtomicTransactionComposer, + TransactionWithSigner, +) +from algosdk.transaction import PaymentTxn + +from tests.conftest import check_output_stability, get_unique_name + +if TYPE_CHECKING: + from algosdk.v2client.algod import AlgodClient + + +@pytest.fixture() +def client_fixture(algod_client: "AlgodClient", app_spec: ApplicationSpecification) -> ApplicationClient: + creator_name = get_unique_name() + creator = get_account(algod_client, creator_name) + client = ApplicationClient(algod_client, app_spec, signer=creator) + create_response = client.create("create") + assert create_response.tx_id + return client + + +def test_build_teal_sourcemaps(algod_client: "AlgodClient", tmp_path_factory: pytest.TempPathFactory) -> None: + cwd = tmp_path_factory.mktemp("cwd") + + approval = """ +#pragma version 9 +int 1 +""" + clear = """ +#pragma version 9 +int 1 +""" + sources = [ + PersistSourceMapInput(raw_teal=approval, app_name="cool_app", file_name="approval.teal"), + PersistSourceMapInput(raw_teal=clear, app_name="cool_app", file_name="clear"), + ] + + persist_sourcemaps(sources=sources, project_root=cwd, client=algod_client) + + root_path = cwd / ".algokit" / "sources" + sourcemap_file_path = root_path / "sources.avm.json" + app_output_path = root_path / "cool_app" + + assert (sourcemap_file_path).exists() + assert (app_output_path / "approval.teal").exists() + assert (app_output_path / "approval.teal.tok.map").exists() + assert (app_output_path / "clear.teal").exists() + assert (app_output_path / "clear.teal.tok.map").exists() + + result = AVMDebuggerSourceMap.from_dict(json.loads(sourcemap_file_path.read_text())) + for item in result.txn_group_sources: + item.location = "dummy" + + check_output_stability(json.dumps(result.to_dict())) + + # check for updates in case of multiple runs + persist_sourcemaps(sources=sources, project_root=cwd, client=algod_client) + result = AVMDebuggerSourceMap.from_dict(json.loads(sourcemap_file_path.read_text())) + for item in result.txn_group_sources: + assert item.location != "dummy" + + +def test_build_teal_sourcemaps_without_sources( + algod_client: "AlgodClient", tmp_path_factory: pytest.TempPathFactory +) -> None: + cwd = tmp_path_factory.mktemp("cwd") + + approval = """ +#pragma version 9 +int 1 +""" + clear = """ +#pragma version 9 +int 1 +""" + compiled_approval = Program(approval, algod_client) + compiled_clear = Program(clear, algod_client) + sources = [ + PersistSourceMapInput(compiled_teal=compiled_approval, app_name="cool_app", file_name="approval.teal"), + PersistSourceMapInput(compiled_teal=compiled_clear, app_name="cool_app", file_name="clear"), + ] + + persist_sourcemaps(sources=sources, project_root=cwd, client=algod_client, with_sources=False) + + root_path = cwd / ".algokit" / "sources" + sourcemap_file_path = root_path / "sources.avm.json" + app_output_path = root_path / "cool_app" + + assert (sourcemap_file_path).exists() + assert not (app_output_path / "approval.teal").exists() + assert (app_output_path / "approval.teal.tok.map").exists() + assert json.loads((app_output_path / "approval.teal.tok.map").read_text())["sources"] == [] + assert not (app_output_path / "clear.teal").exists() + assert (app_output_path / "clear.teal.tok.map").exists() + assert json.loads((app_output_path / "clear.teal.tok.map").read_text())["sources"] == [] + + result = AVMDebuggerSourceMap.from_dict(json.loads(sourcemap_file_path.read_text())) + for item in result.txn_group_sources: + item.location = "dummy" + check_output_stability(json.dumps(result.to_dict())) + + +def test_simulate_and_persist_response_via_app_call( + tmp_path_factory: pytest.TempPathFactory, + client_fixture: ApplicationClient, + mocker: Mock, +) -> None: + mock_config = mocker.patch("algokit_utils.application_client.config") + mock_config.debug = True + mock_config.trace_all = True + mock_config.trace_buffer_size_mb = 256 + cwd = tmp_path_factory.mktemp("cwd") + mock_config.project_root = cwd + + client_fixture.call("hello", name="test") + + output_path = cwd / "debug_traces" + + content = list(output_path.iterdir()) + assert len(list(output_path.iterdir())) == 1 + trace_file_content = json.loads(content[0].read_text()) + simulated_txn = trace_file_content["txn-groups"][0]["txn-results"][0]["txn-result"]["txn"]["txn"] + assert simulated_txn["type"] == "appl" + assert simulated_txn["apid"] == client_fixture.app_id + + +def test_simulate_and_persist_response( + tmp_path_factory: pytest.TempPathFactory, client_fixture: ApplicationClient, mocker: Mock, funded_account: Account +) -> None: + mock_config = mocker.patch("algokit_utils.application_client.config") + mock_config.debug = True + mock_config.trace_all = True + cwd = tmp_path_factory.mktemp("cwd") + mock_config.project_root = cwd + + payment = PaymentTxn( + sender=funded_account.address, + receiver=client_fixture.app_address, + amt=1_000_000, + note=b"Payment", + sp=client_fixture.algod_client.suggested_params(), + ) # type: ignore[no-untyped-call] + txn_with_signer = TransactionWithSigner(payment, AccountTransactionSigner(funded_account.private_key)) + atc = AtomicTransactionComposer() + atc.add_transaction(txn_with_signer) + + simulate_and_persist_response(atc, cwd, client_fixture.algod_client) + + output_path = cwd / "debug_traces" + content = list(output_path.iterdir()) + assert len(list(output_path.iterdir())) == 1 + trace_file_content = json.loads(content[0].read_text()) + simulated_txn = trace_file_content["txn-groups"][0]["txn-results"][0]["txn-result"]["txn"]["txn"] + assert simulated_txn["type"] == "pay" + + trace_file_path = content[0] + while trace_file_path.exists(): + tmp_atc = atc.clone() + simulate_and_persist_response(tmp_atc, cwd, client_fixture.algod_client, buffer_size_mb=0.01) diff --git a/tests/test_deploy_scenarios.py b/tests/test_deploy_scenarios.py index 2c9af500..bdca873d 100644 --- a/tests/test_deploy_scenarios.py +++ b/tests/test_deploy_scenarios.py @@ -28,9 +28,13 @@ # This fixture is automatically applied to all application deployment tests. # If you need to run a test without debug mode, you can reference this mock within the test and disable it explicitly. @pytest.fixture(autouse=True) -def mock_config() -> Generator[Mock, None, None]: +def mock_config(tmp_path_factory: pytest.TempPathFactory) -> Generator[Mock, None, None]: with patch("algokit_utils.application_client.config", new_callable=Mock) as mock_config: mock_config.debug = True + cwd = tmp_path_factory.mktemp("cwd") + mock_config.project_root = cwd + mock_config.trace_all = True + mock_config.trace_buffer_size_mb = 256 yield mock_config