From 0cd0743179e53eec2d0c15011ea497f7796f78db Mon Sep 17 00:00:00 2001 From: "Rob Moore (MakerX)" Date: Thu, 19 Sep 2024 10:27:12 +0800 Subject: [PATCH] feat: app client deprecation (#311) * feat: Deprecated methods in transaction module BREAKING CHANGE: `ExecuteParams` has been moved from `types/composer` to `types/transaction` * feat: Added `AppClient` as an ARC-56 compatible non-typed application client * feat: Added `AppFactory` as an ARC-32/ARC-56 compatible mechanism to create and deploy apps and create app clients test: Added test coverage of AppClient and AppFactory BREAKING CHANGE: `persistSourceMaps` takes `appManager` rather than `client` now * docs: Added migration guide and app-client documentation feat: Added appClient.params.fundAppAccount and appClient.transactions.fundAppAccount fix: Allow extraProgramPages to be passed into create and deploy call as override * feat: Proper ARC-56 struct support feat: Added a number of methods and types to ARC-56 to make interacting with it easier * Linting and PR review * feat: ARC-56 Typed client support * feat: Added logging when sending app calls * fix: Fixing minor bugs * fixes * feat: Finalised typed app client construction methods * PR feedback * feat: AlgoAmount microAlgo/s property now returns a bigint BREAKING CHANGE: microAlgo/s property in AlgoAmount now returns a bigint --- .github/workflows/issue_closed.yml | 12 - .github/workflows/issue_commented.yml | 12 - .github/workflows/issue_labelled.yml | 12 - .../workflows/zendesk_github_add_comment.yml | 11 - .../workflows/zendesk_github_close_issue.yml | 11 - docs/README.md | 16 +- docs/capabilities/account.md | 52 +- docs/capabilities/algokit-composer.md | 41 +- docs/capabilities/algorand-client.md | 45 +- docs/capabilities/amount.md | 6 +- docs/capabilities/app-client.md | 447 +++--- docs/capabilities/app.md | 57 +- docs/capabilities/transaction.md | 89 +- docs/capabilities/transfer.md | 27 +- docs/capabilities/typed-app-clients.md | 2 +- docs/code/README.md | 4 + docs/code/classes/testing.TestLogger.md | 22 +- .../classes/types_account.MultisigAccount.md | 2 +- .../types_account_manager.AccountManager.md | 6 +- .../types_algorand_client.AlgorandClient.md | 94 +- ...reator.AlgorandClientTransactionCreator.md | 6 +- ..._sender.AlgorandClientTransactionSender.md | 132 +- docs/code/classes/types_amount.AlgoAmount.md | 32 +- .../classes/types_app_arc56.Arc56Method.md | 229 +++ .../classes/types_app_client.AppClient.md | 1256 +++++++++++++++++ .../types_app_client.ApplicationClient.md | 218 ++- .../classes/types_app_deployer.AppDeployer.md | 32 +- .../classes/types_app_factory.AppFactory.md | 638 +++++++++ .../classes/types_app_manager.AppManager.md | 61 +- .../types_asset_manager.AssetManager.md | 18 +- .../types_client_manager.ClientManager.md | 368 ++++- docs/code/classes/types_composer.default.md | 161 ++- .../types_debugging.AVMDebuggerSourceMap.md | 8 +- ...pes_debugging.AVMDebuggerSourceMapEntry.md | 10 +- .../types_debugging.PersistSourceMapInput.md | 20 +- ...penser_client.TestNetDispenserApiClient.md | 2 +- ...lient_interface.AlgorandClientInterface.md | 102 ++ .../types_app.AppCompilationResult.md | 2 +- docs/code/interfaces/types_app.AppState.md | 2 +- docs/code/interfaces/types_app.BoxName.md | 6 +- .../types_app.BoxValueRequestParams.md | 6 +- .../types_app.BoxValuesRequestParams.md | 6 +- .../types_app_arc56.Arc56Contract.md | 285 ++++ docs/code/interfaces/types_app_arc56.Event.md | 51 + .../code/interfaces/types_app_arc56.Method.md | 145 ++ .../interfaces/types_app_arc56.SourceInfo.md | 62 + .../interfaces/types_app_arc56.StorageKey.md | 64 + .../interfaces/types_app_arc56.StorageMap.md | 64 + .../types_app_arc56.StructFields.md | 11 + .../types_app_client.AppClientCallABIArgs.md | 2 +- ...ypes_app_client.AppClientCallCoreParams.md | 6 +- ...s_app_client.AppClientCompilationParams.md | 10 +- ...ient.AppClientDeployCallInterfaceParams.md | 10 +- ...es_app_client.AppClientDeployCoreParams.md | 14 +- .../types_app_client.AppClientDeployParams.md | 26 +- .../types_app_client.AppClientParams.md | 107 ++ .../types_app_client.AppSourceMaps.md | 4 +- .../types_app_client.FundAppAccountParams.md | 8 +- .../types_app_client.ResolveAppById.md | 6 +- .../types_app_client.ResolveAppByIdBase.md | 4 +- .../types_app_client.SourceMapExport.md | 8 +- .../types_app_deployer.AppDeployParams.md | 151 -- .../types_app_deployer.AppLookup.md | 4 +- .../types_app_deployer.AppMetadata.md | 12 +- .../types_app_factory.AppFactoryParams.md | 132 ++ .../types_app_manager.AppInformation.md | 22 +- .../types_app_manager.BoxReference.md | 4 +- ...types_app_manager.BoxValueRequestParams.md | 6 +- ...ypes_app_manager.BoxValuesRequestParams.md | 6 +- .../interfaces/types_app_spec.AppSources.md | 4 +- .../code/interfaces/types_app_spec.AppSpec.md | 12 +- .../interfaces/types_app_spec.CallConfig.md | 10 +- .../types_app_spec.DeclaredSchemaValueSpec.md | 8 +- docs/code/interfaces/types_app_spec.Hint.md | 8 +- .../types_app_spec.ReservedSchemaValueSpec.md | 6 +- docs/code/interfaces/types_app_spec.Schema.md | 4 +- .../interfaces/types_app_spec.SchemaSpec.md | 4 +- .../types_app_spec.StateSchemaSpec.md | 4 +- docs/code/interfaces/types_app_spec.Struct.md | 4 +- .../types_asset_manager.AssetInformation.md | 32 +- ...s_asset_manager.BulkAssetOptInOutResult.md | 4 +- .../types_client_manager.AlgoSdkClients.md | 6 +- .../types_client_manager.NetworkDetails.md | 77 - .../types_client_manager.TypedAppClient.md | 52 +- .../types_client_manager.TypedAppFactory.md | 39 + .../types_composer.BuiltTransactions.md | 6 +- .../types_composer.ExecuteParams.md | 51 - ...ypes_debugging.AVMDebuggerSourceMapDict.md | 2 +- ...types_debugging.PersistSourceMapsParams.md | 16 +- ...ugging.SimulateAndPersistResponseParams.md | 8 +- .../types_network_client.NetworkDetails.md | 77 + .../types_testing.LogSnapshotConfig.md | 2 +- ...saction.AtomicTransactionComposerToSend.md | 20 +- .../types_transaction.ExecuteParams.md | 51 + docs/code/modules/index.md | 272 ++-- .../types_algorand_client_interface.md | 9 + docs/code/modules/types_app.md | 29 +- docs/code/modules/types_app_arc56.md | 278 ++++ docs/code/modules/types_app_client.md | 101 +- docs/code/modules/types_app_deployer.md | 70 +- docs/code/modules/types_app_factory.md | 85 ++ .../types_app_factory_and_client_spec.md | 3 + docs/code/modules/types_app_manager.md | 2 +- docs/code/modules/types_app_spec.md | 40 +- docs/code/modules/types_client_manager.md | 57 +- docs/code/modules/types_composer.md | 86 +- docs/code/modules/types_network_client.md | 3 +- docs/code/modules/types_transaction.md | 3 +- docs/v7-migration.md | 123 ++ src/__snapshots__/app-deploy.spec.ts.snap | 3 +- src/amount.ts | 26 +- src/app-client.ts | 15 + src/app-deploy.spec.ts | 13 +- src/app-deploy.ts | 13 +- src/app.ts | 12 +- src/asset.ts | 3 - src/debugging/debugging.spec.ts | 9 +- src/debugging/debugging.ts | 11 +- src/index.ts | 10 +- src/indexer-lookup.spec.ts | 21 +- src/testing/test-logger.ts | 6 +- src/transaction/legacy-bridge.ts | 6 +- src/transaction/transaction.spec.ts | 629 +++------ src/transaction/transaction.ts | 64 +- src/transfer/transfer.ts | 4 +- .../app-factory-and-client.spec.ts.snap | 9 + src/types/account-manager.ts | 6 +- src/types/algorand-client-interface.ts | 29 + .../algorand-client-transaction-sender.ts | 38 +- src/types/algorand-client.spec.ts | 24 +- src/types/algorand-client.transfer.spec.ts | 10 +- src/types/algorand-client.ts | 5 +- src/types/amount.spec.ts | 10 +- src/types/amount.ts | 28 +- src/types/app-arc56.ts | 442 ++++++ src/types/app-client.spec.ts | 8 +- src/types/app-client.ts | 1140 ++++++++++++++- src/types/app-deployer.ts | 88 +- src/types/app-factory-and-client.spec.ts | 686 +++++++++ src/types/app-factory.ts | 516 +++++++ src/types/app-manager.ts | 16 +- src/types/app-spec.ts | 120 ++ src/types/app.ts | 9 +- src/types/asset-manager.ts | 4 +- src/types/client-manager.ts | 243 +++- src/types/composer.ts | 130 +- src/types/debugging.ts | 5 +- src/types/dispenser-client.ts | 4 +- src/types/network-client.ts | 14 + src/types/testing.ts | 6 +- src/types/transaction.ts | 16 +- src/util.ts | 18 +- 152 files changed, 9457 insertions(+), 2187 deletions(-) delete mode 100644 .github/workflows/issue_closed.yml delete mode 100644 .github/workflows/issue_commented.yml delete mode 100644 .github/workflows/issue_labelled.yml delete mode 100644 .github/workflows/zendesk_github_add_comment.yml delete mode 100644 .github/workflows/zendesk_github_close_issue.yml create mode 100644 docs/code/classes/types_app_arc56.Arc56Method.md create mode 100644 docs/code/classes/types_app_client.AppClient.md create mode 100644 docs/code/classes/types_app_factory.AppFactory.md create mode 100644 docs/code/interfaces/types_algorand_client_interface.AlgorandClientInterface.md create mode 100644 docs/code/interfaces/types_app_arc56.Arc56Contract.md create mode 100644 docs/code/interfaces/types_app_arc56.Event.md create mode 100644 docs/code/interfaces/types_app_arc56.Method.md create mode 100644 docs/code/interfaces/types_app_arc56.SourceInfo.md create mode 100644 docs/code/interfaces/types_app_arc56.StorageKey.md create mode 100644 docs/code/interfaces/types_app_arc56.StorageMap.md create mode 100644 docs/code/interfaces/types_app_arc56.StructFields.md create mode 100644 docs/code/interfaces/types_app_client.AppClientParams.md delete mode 100644 docs/code/interfaces/types_app_deployer.AppDeployParams.md create mode 100644 docs/code/interfaces/types_app_factory.AppFactoryParams.md delete mode 100644 docs/code/interfaces/types_client_manager.NetworkDetails.md create mode 100644 docs/code/interfaces/types_client_manager.TypedAppFactory.md delete mode 100644 docs/code/interfaces/types_composer.ExecuteParams.md create mode 100644 docs/code/interfaces/types_network_client.NetworkDetails.md create mode 100644 docs/code/interfaces/types_transaction.ExecuteParams.md create mode 100644 docs/code/modules/types_algorand_client_interface.md create mode 100644 docs/code/modules/types_app_arc56.md create mode 100644 docs/code/modules/types_app_factory.md create mode 100644 docs/code/modules/types_app_factory_and_client_spec.md create mode 100644 docs/v7-migration.md create mode 100644 src/types/__snapshots__/app-factory-and-client.spec.ts.snap create mode 100644 src/types/algorand-client-interface.ts create mode 100644 src/types/app-arc56.ts create mode 100644 src/types/app-factory-and-client.spec.ts create mode 100644 src/types/app-factory.ts diff --git a/.github/workflows/issue_closed.yml b/.github/workflows/issue_closed.yml deleted file mode 100644 index 80399eac..00000000 --- a/.github/workflows/issue_closed.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Solve zendesk ticket when the issue is closed -on: - issues: - types: [closed] -jobs: - issue_closed: - uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_closed.yml@main - with: - ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }} - ISSUE_LABEL: makerx - secrets: - ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }} diff --git a/.github/workflows/issue_commented.yml b/.github/workflows/issue_commented.yml deleted file mode 100644 index 17c7c292..00000000 --- a/.github/workflows/issue_commented.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Add comment to zendesk ticket on GitHub issue commented -on: - issue_comment: - types: [created] -jobs: - issue_closed: - uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_commented.yml@main - with: - ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }} - ISSUE_LABEL: makerx - secrets: - ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }} diff --git a/.github/workflows/issue_labelled.yml b/.github/workflows/issue_labelled.yml deleted file mode 100644 index 950ea3ea..00000000 --- a/.github/workflows/issue_labelled.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Create Zendesk ticket when an issue is labelled with makerx -on: - issues: - types: [labeled] -jobs: - issue_created: - uses: algorandfoundation/gh_zendesk_sync/.github/workflows/github_zendesk_issue_labelled.yml@main - with: - ZENDESK_TENANT_NAME: ${{ vars.ZENDESK_TENANT_NAME }} - ISSUE_LABEL: makerx - secrets: - ZENDESK_AUTH_TOKEN: ${{ secrets.ZENDESK_AUTH_TOKEN }} diff --git a/.github/workflows/zendesk_github_add_comment.yml b/.github/workflows/zendesk_github_add_comment.yml deleted file mode 100644 index 07f0c1b4..00000000 --- a/.github/workflows/zendesk_github_add_comment.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Add comment to GitHub issue on Zendesk ticket commented -on: - repository_dispatch: - types: - - zendesk_github_add_comment -permissions: - issues: write -jobs: - add-comment: - name: Add comment to issue - uses: algorandfoundation/gh_zendesk_sync/.github/workflows/zendesk_github_add_comment.yml@main diff --git a/.github/workflows/zendesk_github_close_issue.yml b/.github/workflows/zendesk_github_close_issue.yml deleted file mode 100644 index 42d33d73..00000000 --- a/.github/workflows/zendesk_github_close_issue.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Close GitHub issue on Zendesk ticket solved -on: - repository_dispatch: - types: - - zendesk_github_close_issue -permissions: - issues: write -jobs: - close_issue: - name: Close GitHub issue - uses: algorandfoundation/gh_zendesk_sync/.github/workflows/zendesk_github_close_issue.yml@main diff --git a/docs/README.md b/docs/README.md index 475f5772..962b520e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -36,7 +36,7 @@ To use this library simply include the following at the top of your file: import { AlgorandClient, Config } from '@algorandfoundation/algokit-utils' ``` -As well as `AlgorandClient` and `Config`, you can use intellisense to auto-complete the various types that you can import withing the {} in your favourite Integrated Development Environment (IDE), or you can refer to the [reference documentation](./code/modules/index.md). +As well as `AlgorandClient` and `Config`, you can use intellisense to auto-complete the various types that you can import within the `{}` in your favourite Integrated Development Environment (IDE), or you can refer to the [reference documentation](./code/modules/index.md). > [!WARNING] > Previous versions of AlgoKit Utils encouraged you to include an import that looks like this (note the subtle difference of the extra `* as algokit`): @@ -45,7 +45,9 @@ As well as `AlgorandClient` and `Config`, you can use intellisense to auto-compl > import * as algokit from '@algorandfoundation/algokit-utils' > ``` > -> This version will still work, but it exposes an older, function-based interface to the functionality that is in the process of being deprecated. The recommended way to use AlgoKit Utils is via the `AlgorandClient` class mentioned below, which is easier and more convenient to use. Some functionality won't yet be migrated to the new approach and this old approach will be needed, but the documentation pages will indicate when this is the case. +> This version will still work until the next major version bump, but it exposes an older, function-based interface to the functionality that is deprecated. The new way to use AlgoKit Utils is via the `AlgorandClient` class, which is easier, simpler and more convenient to use and has powerful new features. +> +> If you are migrating from the old functions to the new ones then you can follow the [migration guide](v7-migration.md). The main entrypoint to the bulk of the functionality is the `AlgorandClient` class, most of the time you can get started by typing `AlgorandClient.` and choosing one of the static initialisation methods to create an [Algorand client](./capabilities/algorand-client.md), e.g.: @@ -138,7 +140,7 @@ To turn on debug mode you can use the following: Config.configure({ debug: true }) ``` -To retrieve the current debug state you can use [`algokit.Config.debug`](./code/interfaces/types_config.Config.md). +To retrieve the current debug state you can use [`Config.debug`](./code/interfaces/types_config.Config.md). This will turn on things like automatic tracing, more verbose logging and [advanced debugging](./capabilities/debugging.md). It's likely this option will result in extra HTTP calls to algod so worth being careful when it's turned on. @@ -146,7 +148,7 @@ If you want to temporarily turn it on you can use the [`withDebug`](./code/class ```typescript Config.withDebug(() => { - // Do stuff with algokit.Config.debug set to true + // Do stuff with Config.debug set to true }) ``` @@ -159,11 +161,11 @@ The library helps you interact with and develop against the Algorand blockchain - [**Client management**](./capabilities/client.md) - Creation of (auto-retry) algod, indexer and kmd clients against various networks resolved from environment or specified configuration, and creation of other API clients (e.g. TestNet Dispenser API and app clients) - [**Account management**](./capabilities/account.md) - Creation, use, and management of accounts including mnemonic, rekeyed, multisig, transaction signer ([useWallet](https://github.com/TxnLab/use-wallet) for dApps and Atomic Transaction Composer compatible signers), idempotent KMD accounts and environment variable injected - [**Algo amount handling**](./capabilities/amount.md) - Reliable, explicit, and terse specification of microAlgo and Algo amounts and safe conversion between them - - [**Transaction management**](./capabilities/transaction.md) - Ability to construct and send single and atomically grouped transactions with consistent and highly configurable semantics, including configurable control of transaction notes, logging, fees, validity, signing, and sending behaviour + - [**Transaction management**](./capabilities/transaction.md) - Ability to construct, simulate and send transactions with consistent and highly configurable semantics, including configurable control of transaction notes, logging, fees, validity, signing, and sending behaviour - **Higher-order use cases** - [**Asset management**](./capabilities/asset.md) - Creation, transfer, destroying, opting in and out and managing Algorand Standard Assets - - [**Typed application clients**](./capabilities/typed-app-clients.md) - Type-safe application clients that are [generated](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) from ARC-0032 application spec files and allow you to intuitively and productively interact with a deployed app, which is the recommended way of interacting with apps and builds on top of the following capabilities: - - [**ARC-0032 Application Spec client**](./capabilities/app-client.md) - Builds on top of the App management and App deployment capabilities (below) to provide a high productivity application client that works with ARC-0032 application spec defined smart contracts + - [**Typed application clients**](./capabilities/typed-app-clients.md) - Type-safe application clients that are [generated](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients) from ARC-56 or ARC-32 application spec files and allow you to intuitively and productively interact with a deployed app, which is the recommended way of interacting with apps and builds on top of the following capabilities: + - [**ARC-56 / ARC-32 App client and App factory**](./capabilities/app-client.md) - Builds on top of the App management and App deployment capabilities (below) to provide a high productivity application client that works with ARC-56 and ARC-32 application spec defined smart contracts - [**App management**](./capabilities/app.md) - Creation, updating, deleting, calling (ABI and otherwise) smart contract apps and the metadata associated with them (including state and boxes) - [**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 (payments)**](./capabilities/transfer.md) - Ability to easily initiate Algo transfers between accounts, including dispenser management and idempotent account funding diff --git a/docs/capabilities/account.md b/docs/capabilities/account.md index 688051db..868fb4e3 100644 --- a/docs/capabilities/account.md +++ b/docs/capabilities/account.md @@ -18,28 +18,41 @@ const accountManager = new AccountManager(clientManager) The core internal type that holds information about a signer/sender pair for a transaction is [`TransactionSignerAccount`](../code/interfaces/types_account.TransactionSignerAccount.md), which represents an `algosdk.TransactionSigner` (`signer`) along with a sender address (`addr`) as the encoded string address. -Many methods in `AccountManager` expose a `TransactionSignerAccount`. +Many methods in `AccountManager` expose a `TransactionSignerAccount`. `TransactionSignerAccount` can be used with `AtomicTransactionComposer`, [`AlgoKitComposer`](./algokit-composer.md) and [useWallet](https://github.com/TxnLab/use-wallet). -### `SendTransactionFrom` +## Registering a signer -> [!NOTE] -> The [legacy functions](../README.md#usage) within AlgoKit Utils make use of a [`SendTransactionFrom`](../code/modules/types_transaction.md#sendtransactionfrom) union type that is slowly being phased out in favour of the simpler `TransactionSignerAccount`. This `SendTransactionFrom` type is still prevalent within the legacy functions though. +The `AccountManager` keeps track of which signer is associated with a given sender address. This is used by [`AlgorandClient`](./algorand-client.md) to automatically sign transactions by that sender. Any of the [methods](#accounts) within `AccountManager` that return an account will automatically register the signer with the sender. If however, you are creating a signer external to the `AccountManager`, for instance when using the use-wallet library in a dApp, then you need to register the signer with the `AccountManager` if you want it to be able to automatically sign transactions from that sender. -`SendTransactionFrom` is a union of the following types that each represent an account that can both sign a transaction and represent a sender address: +There are two methods that can be used for this, `setSignerFromAccount`, which takes any number of [account based objects](#underlying-account-classes) that combine signer and sender (`TransactionSignerAccount` | `algosdk.Account` | `algosdk.LogicSigAccount` | `SigningAccount` | `MultisigAccount`), or `setSigner` which takes the sender address and the `TransactionSigner`: -- `Account` - An in-built algosdk `Account` object -- [`SigningAccount`](../code/classes/types_account.SigningAccount.md) - An abstraction around `algosdk.Account` that supports rekeyed accounts -- `LogicSigAccount` - An in-built algosdk `algosdk.LogicSigAccount` object -- [`MultisigAccount`](../code/classes/types_account.MultisigAccount.md) - An abstraction around `algosdk.MultisigMetadata`, `algosdk.makeMultiSigAccountTransactionSigner`, `algosdk.multisigAddress`, `algosdk.signMultisigTransaction` and `algosdk.appendSignMultisigTransaction` that supports multisig accounts with one or more signers present -- [`TransactionSignerAccount`](../code/interfaces/types_account.TransactionSignerAccount.md) - An interface that provides a sender address alongside a transaction signer (e.g. for use with `AtomicTransactionComposer` or [useWallet](https://github.com/TxnLab/use-wallet)) +```typescript +algorand.account + .setSignerFromAccount(algosdk.generateAccount()) + .setSignerFromAccount(new algosdk.LogicSigAccount(program, args)) + .setSignerFromAccount(new SigningAccount(mnemonic, sender)) + .setSignerFromAccount(new MultisigAccount({ version: 1, threshold: 1, addrs: ['ADDRESS1...', 'ADDRESS2...'] }, [account1, account2])) + .setSignerFromAccount({ addr: 'SENDERADDRESS', signer: transactionSigner }) + .setSigner('SENDERADDRESS', transactionSigner) +``` -The use of in-built algosdk types like `Account`, `LogicSigAccount` and `TransactionSigner` is aligned to the [Modularity](../README.md#core-principles) principle. Allowing you to co-exist non AlgoKit Utils code with AlgoKit Utils functions. +## Default signer -AlgoKit Utils provides a few helper methods to take one of these `SendTransactionFrom` objects (that to reiterate uses the [legacy imports](../README.md#usage) to access): +If you want to have a default signer that is used to sign transactions without a registered signer (rather than throwing an exception) then you can [register a default signer](../code/classes/types_account_manager.AccountManager.md#setdefaultsigner): -- [`algokit.getSenderAddress`](../code/modules/index.md#getsenderaddress) - Returns the public address of the sender the account represents -- [`algokit.getSenderTransactionSigner`](../code/modules/index.md#getsendertransactionsigner) - Returns a `TransactionSigner` to represent the signer of the account' note: this is memoized so multiple calls to this for the same account will safely return the same `TransactionSigner` instance; this works nicely with `AtomicTransactionComposer` -- [`algokit.signTransaction`](../code/modules/index.md#signtransaction) - Signs a single `algosdk.Transaction` object with the given account +```typescript +algorand.account.setDefaultSigner(myDefaultSigner) +``` + +## Get a signer + +[`AlgorandClient`](./algorand-client.md) will automatically retrieve a signer when signing a transaction, but if you need to get a `TransactionSigner` externally to do something more custom then you can [retrieve the signer](../code/classes//types_account_manager.AccountManager.md#getsigner) for a given sender address: + +```typescript +const signer = algorand.account.getSigner('SENDER_ADDRESS') +``` + +If there is no signer registered for that sender address it will either return the default signer ([if registered](#default-signer)) or throw an exception. ## Accounts @@ -55,6 +68,15 @@ In order to get/register accounts for signing operations you can use the followi - [`algorand.account.fromKmd()`](../code/classes/types_account_manager.AccountManager.md#fromkmd) - Returns an account with private key loaded from the given KMD wallet (identified by name) - [`algorand.account.logicsig(program, args?)`](../code/classes/types_account_manager.AccountManager.md#logicsig) - Returns an account that represents a logic signature +### Underlying account classes + +While `TransactionSignerAccount` is the main class used to represent an account that can sign, there are underlying account classes that can underpin the signer within the transaction signer account. + +- `Account` - An in-built `algosdk.Account` object that has an address and private signing key, this can be created +- [`SigningAccount`](../code/classes/types_account.SigningAccount.md) - An abstraction around `algosdk.Account` that supports rekeyed accounts +- `LogicSigAccount` - An in-built algosdk `algosdk.LogicSigAccount` object +- [`MultisigAccount`](../code/classes/types_account.MultisigAccount.md) - An abstraction around `algosdk.MultisigMetadata`, `algosdk.makeMultiSigAccountTransactionSigner`, `algosdk.multisigAddress`, `algosdk.signMultisigTransaction` and `algosdk.appendSignMultisigTransaction` that supports multisig accounts with one or more signers present + ### Dispenser - [`algorand.account.dispenserFromEnvironment()`](../code/classes/types_account_manager.AccountManager.md#dispenserfromenvironment) - Returns an account (with private key loaded) that can act as a dispenser from environment variables, or against default LocalNet if no environment variables present diff --git a/docs/capabilities/algokit-composer.md b/docs/capabilities/algokit-composer.md index 7a63315d..8e164888 100644 --- a/docs/capabilities/algokit-composer.md +++ b/docs/capabilities/algokit-composer.md @@ -1,3 +1,42 @@ # AlgoKit composer -TODO +The `AlgoKitComposer` class allows you to easily compose one or more compliant Algorand transactions and execute and/or simulate them. + +It's the core of how the [`AlgorandClient`](./algorand-client.md) class composes and sends transactions. + +To get an instance of `AlgoKitComposer` you can either get it from an [app client](./app-client.md), from an [`AlgorandClient`](./algorand-client.md), or by new-ing up via the constructor. + +```typescript +const composerFromAlgorand = algorand.newGroup() +const composerFromAppClient = appClient.newGroup() +const composerFromConstructor = new AlgoKitComposer({ + algod, + /* Return the algosdk.TransactionSigner for this address*/ + getSigner: (address: string) => signer, +}) +const composerFromConstructorWithOptionalParams = new AlgoKitComposer({ + algod, + /* Return the algosdk.TransactionSigner for this address*/ + getSigner: (address: string) => signer, + getSuggestedParams: () => algod.getTransactionParams().do(), + defaultValidityWindow: 1000, + appManager: new AppManager(algod), +}) +``` + +## Constructing a transaction + +To construct a transaction you need to add it to the composer, passing in the relevant [params object](../code/modules/types_composer.md#type-aliases) for that transaction. Params are normal JavaScript objects and all of them extend the [common call parameters](./algorand-client.md#transaction-parameters). + +The [methods to construct a transaction](../code/classes/types_composer.default.md#methods) are all named `add{TransactionType}` and return an instance of the composer so they can be chained together fluently to construct a transaction group. + +For example: + +```typescript +const result = algorand.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (100).microAlgo() }).addAppCallMethodCall({ + sender: 'SENDER', + appId: 123n, + method: abiMethod, + args: [1, 2, 3], +}). +``` diff --git a/docs/capabilities/algorand-client.md b/docs/capabilities/algorand-client.md index f154143d..81f0157b 100644 --- a/docs/capabilities/algorand-client.md +++ b/docs/capabilities/algorand-client.md @@ -50,20 +50,43 @@ The `AlgorandClient` has a number of manager class instances that help you quick ## Creating and issuing transactions -`AlgorandClient` exposes a series of methods that allow you to create, execute, and compose groups of transactions: +`AlgorandClient` exposes a series of methods that allow you to create, execute, and compose groups of transactions (all via the [`AlgoKitComposer`](./algokit-composer.md)). -### Creating single transactions +### Creating transactions -You can compose a single transaction via `algorand.transactions...`, which gives you an instance of the [`AlgorandClientTransactionCreator`](../code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md) class. Intellisense will guide you on the different options. +You can compose a transaction via `algorand.transactions...`, which gives you an instance of the [`AlgorandClientTransactionCreator`](../code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md) class. Intellisense will guide you on the different options. The signature for the calls to send a single transaction usually look like: -`algorand.transactions.{method}(params: {ComposerTransactionTypeParams} & CommonTransactionParams): Transaction` +``` +algorand.transactions.{method}(params: {ComposerTransactionTypeParams} & CommonTransactionParams): Promise +``` - To get intellisense on the params, open an object parenthesis (`{`) and use your IDE's intellisense keyboard shortcut (e.g. ctrl+space). - `{ComposerTransactionTypeParams}` will be the parameters that are specific to that transaction type e.g. `PaymentParams`, [see the full list](../code/modules/types_composer.md#type-aliases) - [`CommonTransactionParams`](../code/modules/types_composer.md#commontransactionparams) are the [common transaction parameters](#transaction-parameters) that can be specified for every single transaction -- `Transaction` is an `algosdk.Transaction` object +- `Transaction` is an unsigned `algosdk.Transaction` object, ready to be signed and sent + +The return type for the ABI method call methods are slightly different: + +``` +algorand.transactions.app{callType}MethodCall(params: {ComposerTransactionTypeParams} & CommonTransactionParams): Promise +``` + +Where `BuiltTransactions` looks like this: + +```typescript +export interface BuiltTransactions { + /** The built transactions */ + transactions: algosdk.Transaction[] + /** Any `ABIMethod` objects associated with any of the transactions in a map keyed by transaction index. */ + methodCalls: Map + /** Any `TransactionSigner` objects associated with any of the transactions in a map keyed by transaction index. */ + signers: Map +} +``` + +This signifies the fact that an ABI method call can actually result in multiple transactions (which in turn may have different signers), that you need ABI metadata to be able to extract the return value from the transaction result. ### Sending a single transaction @@ -77,19 +100,19 @@ Further documentation is present in the related capabilities: The signature for the calls to send a single transaction usually look like: -`algorand.send.{method}(params: {ComposerTransactionTypeParams} & CommonTransactionParams & ExecuteParams): SingleSendTransactionResult` +`algorand.send.{method}(params: {ComposerTransactionTypeParams} & CommonAppCallParams & ExecuteParams): SingleSendTransactionResult` - To get intellisense on the params, open an object parenthesis (`{`) and use your IDE's intellisense keyboard shortcut (e.g. ctrl+space). - `{ComposerTransactionTypeParams}` will be the parameters that are specific to that transaction type e.g. `PaymentParams`, [see the full list](../code/modules/types_composer.md#type-aliases) -- [`CommonTransactionParams`](../code/modules/types_composer.md#commontransactionparams) are the [common transaction parameters](#transaction-parameters) that can be specified for every single transaction -- [`ExecuteParams`](../code/interfaces/types_composer.ExecuteParams.md) are the [parameters](#transaction-parameters) that control execution semantics when sending transactions to the network +- [`CommonAppCallParams`](../code/modules/types_composer.md#commonappcallparams) are the [common app call transaction parameters](./app.md#common-app-parameters) that can be specified for every single app transaction +- [`ExecuteParams`](../code/interfaces/types_transaction.ExecuteParams.md) are the [parameters](#transaction-parameters) that control execution semantics when sending transactions to the network - [`SendSingleTransactionResult`](../code/modules/types_algorand_client.md#sendsingletransactionresult) is all of the information that is relevant when [sending a single transaction to the network](./transaction.md#sending-a-transaction) Generally, the functions to immediately send a single transaction will emit log messages before and/or after sending the transaction. You can opt-out of this by sending `suppressLog: true`. ### Composing a group of transactions -You can compose a group of transactions for execution by using the `newGroup()` method on `AlgorandClient` and then use the various `.add{Type}()` methods to add a series of transactions. +You can compose a group of transactions for execution by using the `newGroup()` method on `AlgorandClient` and then use the various `.add{Type}()` methods on [`AlgoKitComposer`](./algokit-composer.md) to add a series of transactions. ```typescript const result = algorand @@ -121,10 +144,12 @@ There are two common base interfaces that get reused: - `validityWindow?: number` - How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. - `firstValidRound?: bigint` - Set the first round this transaction is valid. If left undefined, the value from algod will be used. We recommend you only set this when you intentionally want this to be some time in the future. - `lastValidRound?: bigint` - The last round this transaction is valid. It is recommended to use `validityWindow` instead. -- [`ExecuteParams`](../code/interfaces/types_composer.ExecuteParams.md) +- [`ExecuteParams`](../code/interfaces/types_transaction.ExecuteParams.md) - `maxRoundsToWaitForConfirmation?: number` - The number of rounds to wait for confirmation. By default until the latest lastValid has past. - `suppressLog?: boolean` - Whether to suppress log messages from transaction send, default: do not suppress. +Then on top of that the base type gets extended for the specific type of transaction you are issuing. These are all defined as part of [`AlgoKitComposer`](./algokit-composer.md). + ### Transaction configuration AlgorandClient caches network provided transaction values for you automatically to reduce network traffic. It has a set of default configurations that control this behaviour, but you have the ability to override and change the configuration of this behaviour: diff --git a/docs/capabilities/amount.md b/docs/capabilities/amount.md index fa9508ca..8001d0df 100644 --- a/docs/capabilities/amount.md +++ b/docs/capabilities/amount.md @@ -16,7 +16,7 @@ To import the AlgoAmount class you can access it via: import { AlgoAmount } from '@algorandfoundation/algokit-utils/types/amount' ``` -You may not need to import this type to use it though since there are also special methods that are exposed from `algokit.` and extend the `number` protoype per below. +You may not need to import this type to use it though since there are also special methods that are exposed from the root AlgoKit Utils export and also others that extend the `number` protoype per below. ### Creating an `AlgoAmount` @@ -25,12 +25,12 @@ There are a few ways to create an `AlgoAmount`: - Algo - Constructor: `new AlgoAmount({algo: 10})` - Static helper: `AlgoAmount.algo(10)` - - AlgoKit Helper: `algokit.algo(10)` + - AlgoKit Helper: `algo(10)` - Number coersion: `(10).algo()` (note: you have to wrap the number in brackets or have it in a variable or function return, a raw number value can't have a method called on it) - microAlgo - Constructor: `new AlgoAmount({microAlgos: 10_000})` - Static helper: `AlgoAmount.algo(10)` - - AlgoKit Helper: `algokit.microAlgo(10_000)` + - AlgoKit Helper: `microAlgo(10_000)` - Number coersion: `(10_000).microAlgo()` (note: you have to wrap the number in brackets or have it in a variable or function return, a raw number value can't have a method called on it) Note: per above, to use any of the versions that reference `AlgoAmount` type itself you need to import it: diff --git a/docs/capabilities/app-client.md b/docs/capabilities/app-client.md index 34086e42..fff67581 100644 --- a/docs/capabilities/app-client.md +++ b/docs/capabilities/app-client.md @@ -1,187 +1,330 @@ -# App client - -Application client that works with ARC-0032 application spec defined smart contracts (e.g. via Beaker). +# App client and App factory > [!NOTE] -> This page covers the untyped app client, but it's worth exploring the [typed client generation feature in AlgoKit](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/features/generate.md#1-typed-clients), which will give you a better developer experience with strong typing and intellisense specific to the app itself. +> This page covers the untyped app client, but we recommend using [typed clients](./typed-app-clients.md), which will give you a better developer experience with strong typing and intellisense specific to the app itself. -App client is a higher-order use case capability provided by AlgoKit Utils that builds on top of the core capabilities, particularly [App deployment](./app-deploy.md) and [App management](./app.md). It allows you to access a high productivity application client that works with ARC-0032 application spec defined smart contracts, which you can use to create, update, delete, deploy and call a smart contract and access state data for it. +App client and App factory are higher-order use case capabilities provided by AlgoKit Utils that builds on top of the core capabilities, particularly [App deployment](./app-deploy.md) and [App management](./app.md). They allow you to access high productivity application clients that work with [ARC-56](https://github.com/algorandfoundation/ARCs/pull/258) and [ARC-32](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0032.md) application spec defined smart contracts, which you can use to create, update, delete, deploy and call a smart contract and access state data for it. -To see some usage examples check out the [automated tests](../../src/types/app-client.spec.ts). +## `AppFactory` -## Design +The [`AppFactory`](../code/classes/types_app_factory.AppFactory.md) is a class that, for a given app spec, allows you to create and deploy one or more app instances and to create one or more app clients to interact with those (or other) app instances. -The design for the app client is based on a wrapper for parsing an [ARC-0032](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0032.md) application spec and wrapping the [App deployment](./app-deploy.md) functionality and corresponding [design](./app-deploy.md#design). +To get an instance of `AppFactory` you can use either [`AlgorandClient`](./algorand-client.md) via `algorand.client.getAppFactory` or instantiate it directly (passing in an app spec, an `AlgorandClient` instance and other optional parameters): -## Creating an application client +```typescript +// Minimal example +const factory = algorand.client.getAppFactory({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON */}', +}) +// Advanced example +const factory = algorand.client.getAppFactory({ + appSpec: parsedArc32OrArc56AppSpec, + defaultSender: 'SENDERADDRESS', + appName: 'OverriddenAppName', + version: '2.0.0', + updatable: true, + deletable: false, + deployTimeParams: { ONE: 1, TWO: 'value' }, +}) +``` -To create an application client you can do it via [`AlgorandClient`](./algorand-client.md) or directly. +## `AppClient` -### Via `AlgorandClient` +The [`AppClient`](../code/classes/types_app_client.AppClient.md) is a class that, for a given app spec, allows you to manage calls and state for a specific deployed instance of an app (with a known app ID). -This is the recommended way to create an application client. To create an application this way you can do: +To get an instance of `AppClient` you can use either [`AlgorandClient`](./algorand-client.md) via `algorand.client.getAppClient*` or instantiate it directly (passing in an app ID, app spec, `AlgorandClient` instance and other optional parameters): ```typescript -// Get by creator address and app name via indexer -const client = algorand.client.getAppClientByCreatorAndName({ - app: appSpec, - creatorAddress, +// Minimal examples +const appClient = algorand.client.getAppClientByCreatorAndName({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON */}', + // appId resolved by looking for app ID of named app by this creator + creatorAddress: 'CREATORADDRESS', }) - -// With optional params -const client = algorand.client.getAppClientByCreatorAndName({ - app: appSpec, - creatorAddress, - name: nameOverride, - deployTimeParams, - sender: defaultSender, +const appClient = algorand.client.getAppClientById({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON */}', + appId: 12345n, }) - -// Get by app ID -const client = algorand.client.getAppClientById({ - id: 12345, - app: appSpec, +const appClient = algorand.client.getAppClientByNetwork({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON */}', + // appId resolved by using ARC-56 spec to find app ID for current network }) -// With optional params -const client = algorand.client.getAppClientById({ - id: 12345, - app: appSpec, - name: nameOverride, - deployTimeParams, - sender: defaultSender, +// Advanced example +const appClient = algorand.client.getAppClientById({ + appSpec: parsedAppSpec_AppSpec_or_Arc56Contract, + appId: 12345n, + appName: 'OverriddenAppName', + defaultSender: 'SENDERADDRESS', + approvalSourceMap: approvalTealSourceMap, + clearSourceMap: clearTealSourceMap, }) ``` -### Directly +You can get the `appId` and `appAddress` at any time as properties on the `AppClient` along with `appName` and `appSpec`. + +## Dynamically creating clients for a given app spec -To create an application you can do: +As well as allowing you to control creation and deployment of apps, the `AppFactory` allows you to conveniently create multiple `AppClient` instances on-the-fly with information pre-populated. + +This is possible via two methods on the app factory: + +- [`factory.getAppClientById(params)`](../code/classes/types_app_factory.AppFactory.md#getappclientbyid) - Returns a new `AppClient` client for an app instance of the given ID. Automatically populates appName, defaultSender and source maps from the factory if not specified in the params. +- [`factory.getAppClientByCreatorAddressAndName(params)`](../code/classes/types_app_factory.AppFactory.md#getappclientbycreatoraddressandname) - Returns a new `AppClient` client, resolving the app by creator address and name using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). Automatically populates appName, defaultSender and source maps from the factory if not specified in the params. ```typescript -import { ApplicationClient } from '@algorandfoundation/algokit-utils/types/app-client' +const app1 = factory.getAppClientById({ appId: 12345n }) +const app2 = factory.getAppClientById({ appId: 12346n }) +const app3 = factory.getAppClientById({ appId: 12345n, defaultSender: 'SENDER2ADDRESS' }) +const app4 = factory.getAppClientByCreatorAddressAndName({ + creatorAddress: 'CREATORADDRESS', +}) +const app5 = factory.getAppClientByCreatorAddressAndName({ + creatorAddress: 'CREATORADDRESS', + appName: 'NonDefaultAppName', +}) +const app6 = factory.getAppClientByCreatorAddressAndName({ + creatorAddress: 'CREATORADDRESS', + appName: 'NonDefaultAppName', + ignoreCache: true, // Perform fresh indexer lookups + defaultSender: 'SENDER2ADDRESS', +}) +``` + +## Creating and deploying an app + +Once you have an [app factory](#appfactory) you can perform the following actions: + +- [`factory.create(params?)`](../code/classes/types_app_factory.AppFactory.md#create) - Signs and sends a transaction to create an app and returns the [result of that call](./app.md#creation) and an [`AppClient`](#appclient) instance for the created app +- [`factory.deploy(params)`](../code/classes/types_app_factory.AppFactory.md#deploy) - Uses the [creator address and app name pattern](./app-deploy.md#lookup-deployed-apps-by-name) to find if the app has already been deployed or not and either creates, updates or replaces that app based on the [deployment rules](./app-deploy.md#performing-a-deployment) (i.e. it's an idempotent deployment) and returns the [result of the deployment](./app-deploy.md#return-value) and an [`AppClient`](#appclient) instance for the created/updated/existing app + +### Create -const client = new ApplicationClient(appDetails, algod) +The create method is a wrapper over the `appCreate` (bare calls) and `appCreateMethodCall` (ABI method calls) [methods](./app.md#creation), with the following differences: + +- You don't need to specify the `approvalProgram`, `clearStateProgram`, or `schema` because these are all specified or calculated from the app spec (noting you can override the `schema`) +- `sender` is optional and if not specified then the `defaultSender` from the `AppFactory` constructor is used (if it was specified, otherwise an error is thrown) +- `deployTimeParams`, `updatable` and `deletable` can be passed in to control [deploy-time parameter replacements and deploy-time immutability and permanence control](./app-deploy.md#compilation-and-template-substitution); these values can also be passed into the `AppFactory` constructor instead and if so will be used if not defined in the params to the create call + +```typescript +// Use no-argument bare-call +const { result, app } = factory.create() +// Specify parameters for bare-call and override other parameters +const { result, app } = factory.create({ + args: [new Uint8Array(1, 2, 3, 4)], + staticFee: (3000).microAlgo(), + onComplete: algosdk.OnApplicationComplete.OptIn, + deployTimeParams: { + ONE: 1, + TWO: 'two', + }, + updatable: true, + deletable: false, + populateAppCallResources: true, +}) +// Specify parameters for ABI method call +const { result, app } = factory.create({ + method: 'create_application', + args: [1, 'something'], +}) ``` -The `appDetails` parameter is of type [`AppSpecAppDetails`](../code/modules/types_app_client.md#appspecappdetails), which contains some core properties and then one of two key mechanisms to specify the app to target. +If you want to construct a custom create call, use the underlying [`algorand.send.appCreate` / `algorand.transactions.appCreate` / `algorand.send.appCreateMethodCall` / `algorand.transactions.appCreateMethodCall` methods](./app.md#creation) then you can get params objects: -- Core parameters - Core parameters that can always be applied - - `app: AppSpec | string` - Either the parsed ARC-0032 `AppSpec`, or a raw JSON `string` which will get parsed as an `AppSpec` - - `sender?: SendTransactionFrom` - Optional [sender](./account.md#sendtransactionfrom) to send/sign all transactions with (if left out then individual methods must have a sender passed to them) - - `params?: SuggestedParams` - Optional [sending parameters](./transaction.md#transaction-params) if you want to avoid an extra call to algod -- App target - How to resolve an existing app (if one exists), which can either be: - 1. [`ResolveAppById`](../code/interfaces/types_app_client.ResolveAppById.md) - When you want to resolve an existing app by app ID, which consists of the following parameters: - - `id: number` - The app ID, which should be set as `0` if you have yet to deploy the contract - - `name? string` - The optional name to mark the contract with if you are deploying it, otherwise `contract.name` is used from the app spec - 2. [`ResolveAppByCreatorAndName`](../code/modules/types_app_client.md#resolveappbycreatorandname) - When you want to resolve an existing app by name for a given creator account, which consists of the following parameters: - - `creatorAddress: string` - The address of the creator account of the app for which to search for the deployed app under - - `name?: string` - An overridden name to identify the contract with, otherwise `contract.name` is used from the app spec - - And either: - 1. `indexer: Indexer` - An indexer instance so the existing app deployments can be queried - 2. `existingDeployments: AppLookup` - The result of an existing indexer lookup to generate an [app lookup](./app-deploy.md#getcreatorappsbyname), which avoids extra indexer calls from being made +- `factory.params.create(params)` - ABI method create call for deploy method or an underlying [`appCreateMethodCall` call](./app.md#creation) +- `factory.params.bare.create(params)` - Bare create call for deploy method or an underlying [`appCreate` call](./app.md#creation) -## Creating, updating, deploying and deleting the app +### Deploy -Once you have an application client you can perform the following actions related to creating and managing the lifecycle of an app: +The deploy method is a wrapper over the [`AppDeployer`'s `deploy` method](./app-deploy.md#performing-a-deployment), with the following differences: -- `compile(compilationParams?)` - Allows you to compile the application (approval and clear program)), including [deploy-time parameter replacements and deploy-time immutability and permanence control](./app-deploy.md#compilation-and-template-substitution); it returns the compiled AVM code and source maps -- `deploy(deploymentParams?)` - Allows you to perform an idempotent (safely retryable) deployment of the smart contract app per the design of [`deployApp`](app-deploy.md#deployapp) -- `create(createParams?)` - Allows you to perform a creation of the smart contract app -- `update(updateParams?)` - Allows you to perform an update of the (existing) smart contract app -- `delete(deleteParams?)` - Allows you to delete the (existing) smart contract app +- You don't need to specify the `approvalProgram`, `clearStateProgram`, or `schema` in the `createParams` because these are all specified or calculated from the app spec (noting you can override the `schema`) +- `sender` is optional for `createParams`, `updateParams` and `deleteParams` and if not specified then the `defaultSender` from the `AppFactory` constructor is used (if it was specified, otherwise an error is thrown) +- You don't need to pass in `metadata` to the deploy params - it's calculated from: + - `updatable` and `deletable`, which you can optionally pass in directly to the method params + - `version` and `name`, which are optionally passed into the `AppFactory` constructor +- `deployTimeParams`, `updatable` and `deletable` can all be passed into the `AppFactory` and if so will be used if not defined in the params to the deploy call for the [deploy-time parameter replacements and deploy-time immutability and permanence control](./app-deploy.md#compilation-and-template-substitution) +- `createParams`, `updateParams` and `deleteParams` are optional, if they aren't specified then default values are used for everything and a no-argument bare call will be made for any create/update/delete calls +- If you want to call an ABI method for create/update/delete calls then you can pass in a string for `method` (as opposed to an `ABIMethod` object), which can either be the method name, or if you need to disambiguate between multiple methods of the same name it can be the ABI signature (see example below) -The input payload for `create` and `update` are the same and are a union of [`AppClientCallParams`](#appclientcallparams) and [`AppClientCompilationParams`](#appclientcompilationparams). The input payload for `delete` is [`AppClientCallParams`](#appclientcallparams). The input payload for `deploy` is [`AppClientDeployParams`](#appclientdeployparams). +```typescript +// Use no-argument bare-calls to deploy with default behaviour +// for when update or schema break detected (fail the deployment) +const { result, app } = factory.deploy({}) +// Specify parameters for bare-calls and override the schema break behaviour +const { result, app } = factory.deploy({ + createParams: { + args: [new Uint8Array(1, 2, 3, 4)], + staticFee: (3000).microAlgo(), + onComplete: algosdk.OnApplicationComplete.OptIn: + }, + updateParams: { + args: [new Uint8Array(1, 2, 3)], + }, + deleteParams: { + args: [new Uint8Array(1, 2)], + }, + deployTimeParams: { + ONE: 1, + TWO: 'two', + }, + onUpdate: 'update', + onSchemaBreak: 'replace', + updatable: true, + deletable: true, +}) +// Specify parameters for ABI method calls +const { result, app } = factory.deploy({ + createParams: { + method: "create_application", + args: [1, "something"], + }, + updateParams: { + method: "update", + }, + deleteParams: { + method: "delete_app(uint64,uint64,uint64)uint64", + args: [1, 2, 3] + } +}) +``` -The return payload for these methods directly matches the equivalent underlying [App management](./app.md) / [App deployment](./app-deploy.md) methods (since these methods are wrappers): +If you want to construct a custom deploy call, use the underlying [`algorand.appDeployer.deploy` method](./app-deploy.md#performing-a-deployment) then you can get params objects for the `createParams`, `updateParams` and `deleteParams`: -- `create` -> [`createApp`](./app.md#createapp) -- `update` -> [`updateApp`](./app.md#updateapp) -- `delete` -> [`deleteApp`](./app.md#deleteapp) -- `deploy` -> [`deployApp`](./app-deploy.md#deployapp) +- `factory.params.create(params)` - ABI method create call for deploy method or an underlying [`appCreateMethodCall` call](./app.md#creation) +- `factory.params.deployUpdate(params)` - ABI method update call for deploy method +- `factory.params.deployDelete(params)` - ABI method delete call for deploy method +- `factory.params.bare.create(params)` - Bare create call for deploy method or an underlying [`appCreate` call](./app.md#creation) +- `factory.params.bare.deployUpdate(params)` - Bare update call for deploy method +- `factory.params.bare.deployDelete(params)` - Bare delete call for deploy method -## Calling the app +## Updating and deleting an app -To make a call to a smart contract you can use the following methods (which determine the [on complete action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) that the call will use): +Deploy method aside, the ability to make update and delete calls happens after there is an instance of an app so are done via `AppClient`. The semantics of this are no different than [other calls](#calling-the-app), with the caveat that the update call is a bit different to the others since the code will be compiled when constructing the update params (making it an async method) and the update calls thus optionally takes compilation parameters (`deployTimeParams`, `updatable` and `deletable`) for [deploy-time parameter replacements and deploy-time immutability and permanence control](./app-deploy.md#compilation-and-template-substitution). -- `call(call?)` - A normal (`noop` on completion action) call -- `optIn(call?)` - An opt-in call -- `closeOut(call?)` - A close-out call -- `clearState(call?)` - A clear state call (note: calls the clear program) -- `callOfType(call, callType)` - Make a call with a specified call type +## Calling the app -These calls will only work if the Application Client knows the ID of the app, which will occur if: +You can construct a params object, transaction(s) and sign and send a transaction to call the app that a given `AppClient` instance is pointing to. -- The app ID is passed into the constructor; -- You have passed `creatorAccount` and the smart contract name to the constructor and the contract already exists; or -- You have called `create` or `deploy` using that Application Client. +This is done via the following properties: -The input payload for all of these calls is the same as `delete`; [`AppClientCallParams`](#appclientcallparams). +- `appClient.params.{onComplete}(params)` - Params for an ABI method call +- `appClient.params.bare.{onComplete}(params)` - Params for a bare call +- `appClient.transactions.{onComplete}(params)` - Transaction(s) for an ABI method call +- `appClient.transactions.bare.{onComplete}(params)` - Transaction for a bare call +- `appClient.send.{onComplete}(params)` - Sign and send an ABI method call +- `appClient.send.bare.{onComplete}(params)` - Sign and send a bare call -The return payload for all of these is the same as [`callApp`](./app.md#calling). +To make one of these calls `{onComplete}` needs to be swapped with the [on complete action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) that should be made: -## Getting a reference to the app +- `update` - An update call +- `optIn` - An opt-in call +- `delete` - A delete application call +- `clearState` - A clear state call (note: calls the clear program and only applies to bare calls) +- `closeOut` - A close-out call +- `call` - A no-op call (or other call if `onComplete` is specified to anything other than update) -To get reference information for the app from outside the Application Client you can call `getAppReference()`. If you passed the `creatorAddress` and app name to the constructor then this method will return the full [`AppMetadata`](../code/interfaces/types_app.AppMetadata.md) per [`getCreatorAppsByName`](./app-deploy.md#getcreatorappsbyname). If you just passed in the app ID or used `create` rather than `deploy` then you will just receive an [`AppReference`](../code/interfaces/types_app.AppReference.md) (which is also a sub-type of the `AppMetadata`): +The input payload for all of these calls is the same as the [underlying app methods](./app.md#calling-apps) with the caveat that the `appId` is not passed in (since the `AppClient` already knows the app ID), `sender` is optional (it uses `defaultSender` from the `AppClient` constructor if it was specified) and `method` (for ABI method calls) is a string rather than an `ABIMethod` object (which can either be the method name, or if you need to disambiguate between multiple methods of the same name it can be the ABI signature). -- `appId: number` - The id of the app -- `appAddress: string` - The Algorand address of the account associated with the app +The return payload for all of these is the same as the [underlying methods](./app.md#calling-apps). -## Funding the app account +```typescript +const call1 = await app.send.update({ + method: 'update_abi', + args: ['string_io'], + deployTimeParams, +}) +const call2 = await app.send.delete({ + method: 'delete_abi', + args: ['string_io'], +}) +const call3 = await app.send.optIn({ method: 'opt_in' }) +const call4 = await app.send.bare.clearState() + +const transaction = await app.transactions.bare.closeOut({ + args: [new Uint8Array(1, 2, 3)], +}) -Often there is a need to fund an app account to cover minimum balance requirements for boxes and other scenarios. There is a helper method that will do this for you `fundAppAccount(fundParams)`. +const params = app.params.optIn({ method: 'optin' }) +``` -The input parameters can either be: +## Funding the app account -- An [`AlgoAmount`](./amount.md) value (note: requires `sender` to be passed into the constructor) -- A [`FundAppAccountParams`](../code/interfaces/types_app_client.FundAppAccountParams.md), which has the following properties: - - `amount: AlgoAmount` - The amount to fund - - `sender?: SendTransactionFrom` - The [sender/signer](./account.md#sendtransactionfrom) to use; if unspecified then the sender that was passed into the constructor of the Application Client is used - - `note?: TransactionNote` - The [transaction note](./transaction.md#transaction-notes) to use when issuing the transaction - - `sendParams?: SendTransactionParams` - The [transaction sending configuration](./transaction.md#sendtransactionparams) +Often there is a need to fund an app account to cover minimum balance requirements for boxes and other scenarios. There is an app client method that will do this for you `fundAppAccount(params)`. -This call will only work if the Application Client knows the ID of the app, which will occur if: +The input parameters are: -- The app ID is passed into the constructor; -- You have passed `creatorAccount` and the smart contract name to the constructor and the contract already exists; or -- You have called `create` or `deploy` using that Application Client. +- A [`FundAppParams`](../code/modules/types_app_client.md#fundappparams), which has the same properties as a [payment transaction](./transfer.md#payment) except `receiver` is not required and `sender` is optional (if not specified then it will be set to the app client's default sender if configured). -Note: If you are passing the funding payment in as an ABI argument so it can be validated by the ABI method then you'll want to issue the `skipSending` configuration. That might look something like this as an example: +Note: If you are passing the funding payment in as an ABI argument so it can be validated by the ABI method then you'll want to get the funding call as a transaction, e.g.: ```typescript -const result = await appClient.call({ +const result = await app.send.call({ method: 'bootstrap', - methodArgs: { - args: [ - appClient.fundAppAccount({ - amount: algokit.microAlgo(200_000), - sendParams: { skipSending: true }, - }), - ], - boxes: ['Box1'], - }, + args: [ + app.transactions.fundAppAccount({ + amount: microAlgo(200_000), + }), + ], + boxReferences: ['Box1'], }) ``` +You can also get the funding call as a params object via `app.params.fundAppAccount(params)`. + ## Reading state -> [!NOTE] -> These methods require the [legacy AlgoKit Utils import method to access them](../README.md#usage). +`AppClient` has a number of mechanisms to read state (global, local and box storage) from the app instance. + +### App spec methods + +The ARC-56 app spec can specify detailed information about the encoding format of state values and as such allows for a more advanced ability to automatically read state values and decode them as their high-level language types rather than the limited `bigint` / `bytes` / `string` ability that the [generic methods](#generic-methods) give you. + +You can access this functionality via: + +- `app.state.global.{method}()` - Global state +- `app.state.local(address).{method}()` - Local state +- `app.state.box.{method}()` - Box storage + +Where `{method}` is one of: + +- `getAll()` - Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value. +- `getValue(name)` - Returns a single state value for the current app with the value a decoded ABI value. +- `getMapValue(mapName, key)` - Returns a single value from the given map for the current app with the value a decoded ABI value. Key can either be a `Uint8Array` with the binary value of the key value on-chain (without the map prefix) or the high level (decoded) value that will be encoded to bytes for the app spec specified `keyType` +- `getMap(mapName)` - Returns all map values for the given map in a key=>value record. It's recommended that this is only done when you have a unique `prefix` for the map otherwise there's a high risk that incorrect values will be included in the map. + +```typescript +const values = app.state.global.getAll() +const value = app.state.local('ADDRESS').getValue('value1') +const mapValue = app.state.box.getMapValue('map1', 'mapKey') +const map = app.state.global.getMap('myMap') +``` + +### Generic methods There are various methods defined that let you read state from the smart contract app: -- `getGlobalState()` - Gets the current global state using [`algokit.getAppGlobalState](./app.md#global-state) -- `getLocalState(account: string | SendTransactionFrom)` - Gets the current local state for the given account address using [`algokit.getAppLocalState](./app.md#local-state). -- `getBoxNames()` - Gets the current box names using [`algokit.getAppBoxNames`](./app.md#boxes) -- `getBoxValue(name)` - Gets the current value of the given box using [`algokit.getAppBoxValue](./app.md#boxes) -- `getBoxValueFromABIType(name)` - Gets the current value of the given box from an ABI type using [`algokit.getAppBoxValueFromABIType](./app.md#boxes) -- `getBoxValues(filter)` - Gets the current values of the boxes using [`algokit.getAppBoxValues](./app.md#boxes) -- `getBoxValuesFromABIType(type, filter)` - Gets the current values of the boxes from an ABI type using [`algokit.getAppBoxValuesFromABIType](./app.md#boxes) +- `getGlobalState()` - Gets the current global state using [`algorand.app.getGlobalState`](./app.md#global-state) +- `getLocalState(address: string)` - Gets the current local state for the given account address using [`algorand.app.getLocalState`](./app.md#local-state). +- `getBoxNames()` - Gets the current box names using [`algorand.app.getBoxNames`](./app.md#boxes) +- `getBoxValue(name)` - Gets the current value of the given box using [`algorand.app.getBoxValue`](./app.md#boxes) +- `getBoxValueFromABIType(name)` - Gets the current value of the given box from an ABI type using [`algorand.app.getBoxValueFromABIType`](./app.md#boxes) +- `getBoxValues(filter)` - Gets the current values of the boxes using [`algorand.app.getBoxValues`](./app.md#boxes) +- `getBoxValuesFromABIType(type, filter)` - Gets the current values of the boxes from an ABI type using [`algorand.app.getBoxValuesFromABIType`](./app.md#boxes) -These calls will only work if the Application Client knows the ID of the app, which will occur if: +```typescript +const globalState = await app.getGlobalState() +const localState = await app.getLocalState('ACCOUNTADDRESS') -- The app ID is passed into the constructor; -- You have passed `creatorAccount` and the smart contract name to the constructor and the contract already exists; or -- You have called `create` or `deploy` using that Application Client. +const boxName: BoxReference = 'my-box' +const boxName2: BoxReference = 'my-box2' + +const boxNames = app.getBoxNames() +const boxValue = app.getBoxValue(boxName) +const boxValues = app.getBoxValues([boxName, boxName2]) +const boxABIValue = app.getBoxValueFromABIType(boxName, algosdk.ABIStringType) +const boxABIValues = app.getBoxValuesFromABIType([boxName, boxName2], algosdk.ABIStringType) +``` ## Handling logic errors and diagnosing errors @@ -189,9 +332,9 @@ Often when calling a smart contract during development you will get logic errors When this occurs, you will generally get an error that looks something like: `TransactionPool.Remember: transaction {TRANSACTION_ID}: logic eval error: {ERROR_MESSAGE}. Details: pc={PROGRAM_COUNTER_VALUE}, opcodes={LIST_OF_OP_CODES}`. -The information in that error message can be parsed and when combined with the [source map from compilation](./app-deploy.md#compilation-and-template-substitution) you can expose debugging information that makes it much easier to understand what's happening. +The information in that error message can be parsed and when combined with the [source map from compilation](./app-deploy.md#compilation-and-template-substitution) you can expose debugging information that makes it much easier to understand what's happening. The ARC-56 app spec, if provided, can also specify human-readable error messages against certain program counter values and further augment the error message. -The Application Client automatically provides this functionality for all smart contract calls. It also exposes a function that can be used for any custom calls you manually construct and need to add into your own try/catch `exposeLogicError(e: Error, isClear?: boolean)`. +The app client and app factory automatically provide this functionality for all smart contract calls. They also expose a function that can be used for any custom calls you manually construct and need to add into your own try/catch `exposeLogicError(e: Error, isClear?: boolean)`. When an error is thrown then the resulting error that is re-thrown will be a [`LogicError` object](../code/classes/types_logic_error.LogicError.md), which has the following fields: @@ -206,64 +349,18 @@ When an error is thrown then the resulting error that is re-thrown will be a [`L - `program: string[]` - The TEAL program split by line - `teal_line: number` - The line number in the TEAL program that triggered the error -Note: This information will only show if the Application Client has a source map. This will occur if: +Note: This information will only show if the app client / app factory has a source map. This will occur if: - You have called `create`, `update` or `deploy` -- You have called `importSourceMaps(sourceMaps)` and provided the source maps (which you can get by calling `exportSourceMaps()` after calling `create`, `update` or `deploy` and it returns a serialisable value) +- You have called `importSourceMaps(sourceMaps)` and provided the source maps (which you can get by calling `exportSourceMaps()` after variously calling `create`, `update`, or `deploy` and it returns a serialisable value) +- You had source maps present in an app factory and then used it to [create an app client](#dynamically-creating-clients-for-a-given-app-spec) (they are automatically passed through) If you want to go a step further and automatically issue a [simulated transaction](https://algorand.github.io/js-algorand-sdk/classes/modelsv2.SimulateTransactionResult.html) and get trace information when there is an error when an ABI method is called you can turn on debug mode: ```typescript -algokit.Config.configure({ debug: true }) +Config.configure({ debug: true }) ``` If you do that then the exception will have the `traces` property within the underlying exception will have key information from the simulation within it and this will get populated into the `led.traces` property of the thrown error. -## `AppClientCallParams` - -All methods that call the smart contract apart from `deploy` make use of [this type](../code/modules/types_app_client.md#appclientcallparams). It consists of the following core properties, all of which are optional: - -- `sender?: SendTransactionFrom` - The [sender/signer](./account.md#sendtransactionfrom) to use; if unspecified then the sender that was passed into the constructor of the Application Client is used -- `note?: TransactionNote` - The [transaction note](./transaction.md#transaction-notes) to use when issuing the transaction -- `sendParams?: SendTransactionParams` - The [transaction sending configuration](./transaction.md#sendtransactionparams) - -In addition to these parameters, it may specify [call arguments](#appclientcallargs) parameters (`AppClientCallArgs`). - -## `AppClientCallArgs` - -Whenever an app call is specified, including within `deploy` [this type](../code/modules/types_app_client.md#appclientcallargs) specifies the arguments. There are two forms you can use: - -- **Raw call** - Directly specifies the [values](./app.md#rawappcallargs) that will be populated onto an `algosdk.Transaction` -- **ABI call** - Specifies a [ARC-0004 ABI call](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/ABI/) along with relevant values (like boxes) that will be directly populated onto an `algosdk.Transaction`. Consists of the [ABI app call args type](./app.md#abiappcallargs) with the `method` parameter replaced with a string (since the Application Client only needs it as a string): - - `method: string` - The name of the method (e.g. `hello`) or the ABI signature of the method (e.g. `hello(string)string`) for when you have multiple methods with the same name and need to differentiate between them - - `methodArgs?: ABIAppCallArg[]` - An array of arguments to pass into the ABI method - - `boxes: (BoxReference | BoxIdentifier | algosdk.BoxReference)[]` - Any [boxes](./app.md#referencing-boxes) to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays) - - `lease: string | Uint8Array`: A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) to assign to the transaction to enforce a mutually exclusive transaction (useful to prevent double-posting and other scenarios) - -If you want to get call args for manually populating into an `algosdk.Transaction` you can use the `getCallArgs` method on Application Client. - -Also, if you want to manually construct an ABI call (e.g. to use with AtomicTransactionComposer directly) then you can use `getABIMethod` and/or `getABIMethodParams` - -## `AppClientCompilationParams` - -When calling `create` or `update` there are extra parameter that need to be passed to facilitate the compilation of the code in addition to the other parameters in [`AppClientCallParams`](#appclientcallparams): - -- `deployTimeParams?: TealTemplateParams` - Any [deploy-time parameters](./app-deploy.md#compilation-and-template-substitution) to replace in the TEAL code -- `updatable?: boolean` - Whether or not the contract should have [deploy-time immutability control](./app-deploy.md#compilation-and-template-substitution) set, undefined = ignore -- `deletable?: boolean` - Whether or not the contract should have [deploy-time permanence control](./app-deploy.md#compilation-and-template-substitution) set, undefined = ignore - -## `AppClientDeployParams` - -When calling `deploy` the [`AppClientDeployParams`](../code/interfaces/types_app_client.AppClientDeployParams.md) type defines the input parameters, all of which are optional. This type closely models the semantics of [`deployApp`](./app-deploy.md#deployapp). - -- `version?: string` - The version of the contract, uses "1.0" by default -- `sender?: SendTransactionFrom` - The [sender/signer](./account.md#sendtransactionfrom) to use; if unspecified then the sender that was passed into the constructor of the Application Client is used -- `sendParams?: SendTransactionParams` - The [transaction sending configuration](./transaction.md#sendtransactionparams) -- `deployTimeParams?: TealTemplateParams` - Any [deploy-time parameters](./app-deploy.md#compilation-and-template-substitution) to replace in the TEAL code -- `allowUpdate?: boolean` - Whether or not to allow updates in the contract using the [deploy-time updatability](./app-deploy.md#compilation-and-template-substitution) control if present in your contract; if this is not specified then it will automatically be determined based on the AppSpec definition (if there is an update method) -- `allowDelete?: boolean` - Whether or not to allow deletes in the contract using the [deploy-time deletability](./app-deploy.md#compilation-and-template-substitution) control if present in your contract; if this is not specified then it will automatically be determined based on the AppSpec definition (if there is a delete method) -- `onSchemaBreak?: 'replace' | 'fail' | OnSchemaBreak` determines what should happen if a breaking change to the schema is detected (e.g. if you need more global or local state that was previously requested when the contract was originally created) -- `onUpdate?: 'update' | 'replace' | 'fail' | OnUpdate` determines what should happen if an update to the smart contract is detected (e.g. the TEAL code has changed since last deployment) -- `createArgs?: AppClientCallArgs` - The args to use if a create is needed -- `updateArgs?: AppClientCallArgs` - The args to use if an update is needed -- `deleteArgs?: AppClientCallArgs` - The args to use if a delete is needed +When this debug flag is set, it will also emit debugging symbols to allow break-point debugging of the calls if the [project root is also configured](./debugging.md). diff --git a/docs/capabilities/app.md b/docs/capabilities/app.md index 5f4d714c..477593d5 100644 --- a/docs/capabilities/app.md +++ b/docs/capabilities/app.md @@ -18,7 +18,7 @@ const appManager = new AppManager(algod) ### App Clients -The recommended way of interacting with apps is via [Typed app clients](./typed-app-clients.md). The methods shown on this page are the underlying mechanisms that app clients use and are for advanced use cases when you want more control. +The recommended way of interacting with apps is via [Typed app clients](./typed-app-clients.md) or if you can't use a typed app client then an [untyped app client](./app-client.md). The methods shown on this page are the underlying mechanisms that app clients use and are for advanced use cases when you want more control. ### Calling an app @@ -71,7 +71,7 @@ The base type for specifying an app creation transaction is [`AppCreateParams`]( - `localByteSlices: number` - The number of byte slices saved in local state. - `extraProgramPages?: number` - Number of extra pages required for the programs. This is immutable once the app is created. -If you pass in `approvalProgram` or `clearStateProgram` as a string then it will automatically be compiled using Algod and the compilation result will be available via [`appManager.getCompilationResult`](../code/classes/types_app_manager.AppManager.md#getcompilationresult) (including the source map). To skip this behaviour you can pass in the compiled TEAL as `Uint8Array`. +If you pass in `approvalProgram` or `clearStateProgram` as a string then it will automatically be compiled using Algod and the compilation result will be available via [`algorand.app.getCompilationResult`](../code/classes/types_app_manager.AppManager.md#getcompilationresult) (including the source map). To skip this behaviour you can pass in the compiled TEAL as `Uint8Array`. ```typescript // Basic raw example @@ -142,7 +142,7 @@ The base type for specifying an app update transaction is [`AppUpdateParams`](.. - `approvalProgram: Uint8Array | string` - The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). - `clearStateProgram: Uint8Array | string` - The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). -If you pass in `approvalProgram` or `clearStateProgram` as a string then it will automatically be compiled using Algod and the compilation result will be available via [`appManager.getCompilationResult`](../code/classes/types_app_manager.AppManager.md#getcompilationresult) (including the source map). To skip this behaviour you can pass in the compiled TEAL as `Uint8Array`. +If you pass in `approvalProgram` or `clearStateProgram` as a string then it will automatically be compiled using Algod and the compilation result will be available via [`algorand.app.getCompilationResult`](../code/classes/types_app_manager.AppManager.md#getcompilationresult) (including the source map). To skip this behaviour you can pass in the compiled TEAL as `Uint8Array`. ```typescript // Basic raw example @@ -304,7 +304,15 @@ await algorand.send.appCallMethodCall({ ### Global state -To access and parse global state you can use the following static method from [`AppManager`](#appmanager): +To access local state you can use the following method from an [`AppManager`](#appmanager) instance: + +- [`algorand.app.getLocalState(appId, address)`](../code/classes/types_app_manager.AppManager.md#getlocalstate) - Returns the current local state for the given app ID and account address decoded into an object keyed by the UTF-8 representation of the state key with various parsed versions of the value (base64, UTF-8 and raw binary) + +```typescript +const globalState = await algorand.app.getGlobalState(12345n) +``` + +Global state is parsed from the underlying algod response via the following static method from [`AppManager`](#appmanager): - [`AppManager.decodeAppState(state)`](../code/classes/types_app_manager.AppManager.md#decodeappstate) - Takes the raw response from the algod API for global state and returns a friendly generic object keyed by the UTF-8 value of the key @@ -323,51 +331,44 @@ if (typeof appState['value1'].value === 'string') { } ``` -The easiest way to access a decoded global state is via the `getById` method in an [`AppManager`](#appmanager) instance: - -```typescript -const appData = await appManager.getById(12345n) -const appState = appData.globalState -``` - ### Local state To access local state you can use the following method from an [`AppManager`](#appmanager) instance: -- [`appManager.getLocalState(appId, address)`](../code/classes/types_app_manager.AppManager.md#getlocalstate) - Returns the current local state for the given app ID and account address decoded into an object keyed by the UTF-8 representation of the state key with various parsed versions of the value (base64, UTF-8 and raw binary) +- [`algorand.app.getLocalState(appId, address)`](../code/classes/types_app_manager.AppManager.md#getlocalstate) - Returns the current local state for the given app ID and account address decoded into an object keyed by the UTF-8 representation of the state key with various parsed versions of the value (base64, UTF-8 and raw binary) ```typescript -const localState = await appManager.getLocalState(12345n, 'ACCOUNTADDRESS') +const localState = await algorand.app.getLocalState(12345n, 'ACCOUNTADDRESS') ``` ### Boxes To access and parse box values and names for an app you can use the following methods from an [`AppManager`](#appmanager) instance: -- [`appManager.getBoxNames(appId: bigint)`](../code/modules/index.md#getboxnames) - Returns the current [box names](#boxname) for the given app ID -- [`appManager.getBoxValue(appId: bigint, boxName: BoxIdentifier)`](../code/modules/index.md#getboxvalue) - Returns the binary value of the given box name for the given app ID -- [`appManager.getBoxValues(appId: bigint, boxNames: BoxIdentifier[])`](../code/modules/index.md#getboxvalues) - Returns the binary values of the given box names for the given app ID -- [`appManager.getBoxValueFromABIType(request: {appId: bigint, boxName: BoxIdentifier, type: algosdk.ABIType}})`](../code/modules/index.md#getboxvaluefromabitype) - Returns the parsed ABI value of the given box name for the given app ID for the provided ABI type -- [`appManager.getBoxValuesFromABIType(request: {appId: bigint, boxNames: BoxIdentifier[], type: algosdk.ABIType})`](../code/modules/index.md#getboxvaluesfromabitype) - Returns the parsed ABI values of the given box names for the given app ID for the provided ABI type +- [`algorand.app.getBoxNames(appId: bigint)`](../code/modules/index.md#getboxnames) - Returns the current [box names](#boxname) for the given app ID +- [`algorand.app.getBoxValue(appId: bigint, boxName: BoxIdentifier)`](../code/modules/index.md#getboxvalue) - Returns the binary value of the given box name for the given app ID +- [`algorand.app.getBoxValues(appId: bigint, boxNames: BoxIdentifier[])`](../code/modules/index.md#getboxvalues) - Returns the binary values of the given box names for the given app ID +- [`algorand.app.getBoxValueFromABIType(request: {appId: bigint, boxName: BoxIdentifier, type: algosdk.ABIType}})`](../code/modules/index.md#getboxvaluefromabitype) - Returns the parsed ABI value of the given box name for the given app ID for the provided ABI type +- [`algorand.app.getBoxValuesFromABIType(request: {appId: bigint, boxNames: BoxIdentifier[], type: algosdk.ABIType})`](../code/modules/index.md#getboxvaluesfromabitype) - Returns the parsed ABI values of the given box names for the given app ID for the provided ABI type - [`AppManager.getBoxReference(boxId)`](../code/modules/index.md#getboxreference) - Returns a `algosdk.BoxReference` representation of the given [box identifier / reference](#box-references), which is useful when constructing a raw `algosdk.Transaction` ```typescript const appId = 12345n const boxName: BoxReference = 'my-box' -const boxName2: BoxReference = 'my-box' +const boxName2: BoxReference = 'my-box2' -const boxNames = appManager.getBoxNames(appId) -const boxValue = appManager.getBoxValue(appId, boxName) -const boxValues = appManager.getBoxValues(appId, [boxName, boxName2]) -const boxABIValue = appManager.getBoxValueFromABIType(appId, boxName, algosdk.ABIStringType) -const boxABIValues = appManager.getBoxValuesFromABIType(appId, [boxName, boxName2], algosdk.ABIStringType) +const boxNames = algorand.app.getBoxNames(appId) +const boxValue = algorand.app.getBoxValue(appId, boxName) +const boxValues = algorand.app.getBoxValues(appId, [boxName, boxName2]) +const boxABIValue = algorand.app.getBoxValueFromABIType(appId, boxName, algosdk.ABIStringType) +const boxABIValues = algorand.app.getBoxValuesFromABIType(appId, [boxName, boxName2], algosdk.ABIStringType) ``` ## Getting app information To get reference information and metadata about an existing app you can use the following methods: -- [`appManager.getById(appId)`](../code/classes/types_app_manager.AppManager.md#getbyid) - Returns current app information by app ID from an [`AppManager`](#appmanager) instance +- [`algorand.app.getById(appId)`](../code/classes/types_app_manager.AppManager.md#getbyid) - Returns current app information by app ID from an [`AppManager`](#appmanager) instance - [`indexer.lookupAccountCreatedApplicationByAddress(indexer, address, getAll?, paginationLimit?)`](../code/modules/index.indexer.md#lookupaccountcreatedapplicationbyaddress) - Returns all apps created by a given account from [indexer](./indexer.md) ## Common app parameters @@ -431,11 +432,11 @@ export interface BoxReference { The [`AppManager`](#appmanager) class allows you to compile TEAL code with caching semantics that allows you to avoid duplicate compilation and keep track of source maps from compiled code. -If you call `appManager.compileTeal(tealCode)` then the compilation result will be stored and retrievable from `appManager.getCompilationResult(tealCode)`. +If you call `algorand.app.compileTeal(tealCode)` then the compilation result will be stored and retrievable from `algorand.app.getCompilationResult(tealCode)`. ```typescript const tealCode = 'return 1' -const compilationResult = await appManager.compileTeal(tealCode) +const compilationResult = await algorand.app.compileTeal(tealCode) // ... -const previousCompilationResult = appManager.getCompilationResult(tealCode) +const previousCompilationResult = algorand.app.getCompilationResult(tealCode) ``` diff --git a/docs/capabilities/transaction.md b/docs/capabilities/transaction.md index eb9b43bb..117a3238 100644 --- a/docs/capabilities/transaction.md +++ b/docs/capabilities/transaction.md @@ -1,98 +1,23 @@ # Transaction management -Transaction management is one of the core capabilities provided by AlgoKit Utils. It allows you to send single, grouped or Atomic Transaction Composer transactions with consistent and highly configurable semantics, including configurable control of transaction notes (including ARC-0002), logging, fees, multiple sender account types, and sending behaviour. +Transaction management is one of the core capabilities provided by AlgoKit Utils. It allows you to construct, simulate and send single, or grouped transactions with consistent and highly configurable semantics, including configurable control of transaction notes, logging, fees, multiple sender account types, and sending behaviour. -> [!NOTE] -> The methods on this page require the [legacy AlgoKit Utils import method to access them](../README.md#usage). +## `ConfirmedTransactionResult` -## `SendTransactionParams` - -Any AlgoKit Utils function that needs to sign/send a transaction will generally take all or part of [`SendTransactionParams`](../code/interfaces/types_transaction.SendTransactionParams.md) interface, which represents a standard set of configurations that can be applied to a given transaction or transactions that are to be sent to an Algorand network. - -The following parameters are able to be provided, with all of them being optional: - -- **skipSending: boolean** - Whether to skip signing and sending the transaction to the chain (default: transaction signed and sent to chain, unless `atc` is specified) and instead just return the raw transaction, e.g. so you can add it to a group of transactions -- **skipWaiting: boolean** - Whether to skip waiting for the submitted transaction (only relevant if `skipSending` is `false` or unset) and turn this transaction send into an async operation -- **atc: AtomicTransactionComposer** - An optional `AtomicTransactionComposer` to add the transaction to, if specified then `skipSending: undefined` has the same effect as `skipSending: true` -- **suppressLog: boolean** - Whether to suppress log messages from transaction send, default: do not suppress -- **fee: AlgoAmount** - The flat fee you want to pay, useful for covering extra fees in a transaction group or app call -- **maxFee: AlgoAmount** - 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 -- **maxRoundsToWaitForConfirmation: number** - The maximum number of rounds to wait for confirmation, only applies if `skipWaiting` is `undefined` or `false`, default: wait up to 5 rounds - -## `SendTransactionResult` - -All AlgoKit Utils functions that prepare and/or send a transaction will generally return a [`SendTransactionResult` interface](../code/interfaces/types_transaction.SendTransactionResult.md) or some superset of that. This provides a consistent mechanism to interpret the results of a transaction send. +All AlgoKit Utils functions that send a transaction will generally return a variant of the [`ConfirmedTransactionResult` interface](../code/interfaces/types_transaction.ConfirmedTransactionResult.md) or some superset of that. This provides a consistent mechanism to interpret the results of a transaction send. It consists of two properties: - `transaction`: An `algosdk.Transaction` object that is either ready to send or represents the transaction that was sent -- `confirmation` (optional): An `algosdk.modelsv2.PendingTransactionResponse` object, which is a type-safe wrapper of the return from the algod pending transaction API noting that it will only be returned if the transaction was able to be confirmed (so won't represent a "pending" transaction) - -A useful pattern to use to access these properties is destructuring, e.g.: +- `confirmation`: An `algosdk.modelsv2.PendingTransactionResponse` object, which is a type-safe wrapper of the return from the algod pending transaction API noting that it will only be returned if the transaction was able to be confirmed (so won't represent a "pending" transaction) -```typescript -const { transaction, confirmation } = await algokit.sendTransaction(...) -``` +There are various variations of the `ConfirmedTransactionResult` that are exposed by various functions within AlgoKit Utils, including: -There are various variations of the `SendTransactionResult` that are exposed by various functions within AlgoKit Utils, including: - -- [`ConfirmedTransactionResult`](../code/interfaces/types_transaction.ConfirmedTransactionResult.md) - Where it's guaranteed that a confirmation will be returned (i.e. `skipSending` is not made available) - [`ConfirmedTransactionResults`](../code/interfaces/types_transaction.ConfirmedTransactionResults.md) - Where it's both guaranteed that a confirmation will be returned, there is a primary driving transaction, but multiple transactions may be sent (e.g. when making an ABI app call which has dependant transactions) - [`SendTransactionResults`](../code/interfaces/types_transaction.SendTransactionResults.md) - Where multiple transactions are being sent (`transactions` and `confirmations` are arrays that replace the singular `transaction` and `confirmation`) - [`SendAtomicTransactionComposerResults`](../code/interfaces/types_transaction.SendAtomicTransactionComposerResults.md) - The result from sending the transactions within an `AtomicTransactionComposer`, it extends `SendTransactionResults` and adds a few other useful properties - [`AppCallTransactionResult`](../code/interfaces/types_app.AppCallTransactionResult.md) - Result from calling a single app call (which potentially may result in multiple other transaction calls if it was an ABI method with dependant transactions) -## Sending a transaction - -AlgoKit Utils provides three core helper methods that allow you to use the `SendTransactionParams` configuration when sending transactions. It also has many other methods that delegate to these underlying core methods such as `algokit.transferAlgos(...)`, etc.. - -- [`sendTransaction`](../code/modules/index.md#sendtransaction) - Signs and sends (if instructed to) a single transaction using the `SendTransactionParams` configuration -- [`sendGroupOfTransactions`](../code/modules/index.md#sendgroupoftransactions) - Takes an array of transactions to sign with associated `SendTransactionFrom` accounts and signs and sends (if instructed to) them as an atomic transaction group using the `SendTransactionParams` configuration -- [`sendAtomicTransactionComposer`](../code/modules/index.md#sendatomictransactioncomposer) - Signs and sends (if instructed to) the transactions and/or method calls loaded into an `AtomicTransactionComposer` object using the `SendTransactionParams` configuration - -All of these methods take `algosdk.Transaction` and/or `algosdk.AtomicTransactionComposer` objects so you can use them with transaction generation mechanisms outside of AlgoKit Utils per the [modularity principle](../README.md#core-principles). - -## Helpers - -The functionality provided by the transaction capability includes a set of lower level helpers that might be useful in their own right per the [modularity principle](../README.md#core-principles). - -### Signing - -If you want to sign a transaction there are the [`algokit.signTransaction(transaction, signer)`](../code/modules/index.md#signtransaction) method and [`algokit.getSenderTransactionSigner(sender)`](../code/modules/index.md#getsendertransactionsigner) methods that both work with `SendTransactionFrom` as described in the [Account capability](./account.md). - -There are also some methods that take a [`TransactionToSign`](../code/interfaces/types_transaction.TransactionToSign.md), which is the AlgoKit Utils equivalent of `algosdk.TransactionWithSigner`, but has a `SendTransactionFrom` as the signer. - -### Waiting - -There is a [`algokit.waitForConfirmation(transactionId, maxRoundsToWait, algod)`](../code/modules/index.md#waitforconfirmation) method which helps you wait until a given `algosdk.Transaction` has been confirmed by the network. - -### Fees - -If you want to control the fees of a transaction before sending then you can use: - -- [`algokit.capTransactionFee(transaction, maxAcceptableFee)`](../code/modules/index.md#captransactionfee) - Limit the acceptable maximum fee of a `algosdk.Transaction` or `algosdk.SuggestedParams` to a defined amount of Algo. -- [`algokit.controlFees(transaction, feeControl)`](../code/modules/index.md#controlfees) - Allows you to control fees on a `algosdk.Transaction` or `algosdk.SuggestedParams` object either applying a flat fee or a max fee - -### Transaction notes - -If you want to create an encoded transaction note for adding to a transaction you can use the [`algokit.encodeTransactionNote(note)`](../code/modules/index.md#encodetransactionnote) function. This takes a `TransactionNote` type, which is a union of: - -- `null` or `undefined` if there is no note -- `Uint8Array` which is passed straight through -- Data that is turned into JSON, any one of: - - `string` - - `number` - - `any[]` - - `Record` -- A `Arc2TransactionNote` object, which creates an [ARC-0002 compliant transaction note](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0002.md) and has the following properties: - - `dAppName` - The name of the app that is generating the note - - `format`: - - `m` - Message Pack format - - `b` - Byte string - - `u` - UTF-8 string - - `j` - JSON data - - `data` either a string or an object that is encoded to JSON (if `format` is `j`) - -### Transaction params +## Further reading -If you want to specify transaction params to add to a transaction you can use the [`algokit.getTransactionParams(params, algod)`](../code/modules/index.md#gettransactionparams) method. This let's you pass in an existing params object if one exists or if that's `undefined` then it will retrieve a new params object from the Algod client. +To understand how to create, simulate and send transactions consult the [`AlgorandClient`](./algorand-client.md) and [`AlgorandClient`](./algokit-composer.md) documentation. diff --git a/docs/capabilities/transfer.md b/docs/capabilities/transfer.md index 74c6707b..7145600a 100644 --- a/docs/capabilities/transfer.md +++ b/docs/capabilities/transfer.md @@ -81,10 +81,10 @@ The general structure of these calls is similar, they all take: // From account // Basic example -await algorand.account.ensureFunded('ACCOUNTADDRESS', 'DISPENSERADDRESS', algokit.algo(1)) +await algorand.account.ensureFunded('ACCOUNTADDRESS', 'DISPENSERADDRESS', (1).algo()) // With configuration -await algorand.account.ensureFunded('ACCOUNTADDRESS', 'DISPENSERADDRESS', algokit.algo(1), { - minFundingIncrement: algokit.algo(2), +await algorand.account.ensureFunded('ACCOUNTADDRESS', 'DISPENSERADDRESS', (1).algo(), { + minFundingIncrement: (2).algo(), fee: (1000).microAlgo(), suppressLog: true, }) @@ -92,10 +92,10 @@ await algorand.account.ensureFunded('ACCOUNTADDRESS', 'DISPENSERADDRESS', algoki // From environment // Basic example -await algorand.account.ensureFundedFromEnvironment('ACCOUNTADDRESS', algokit.algo(1)) +await algorand.account.ensureFundedFromEnvironment('ACCOUNTADDRESS', (1).algo()) // With configuration -await algorand.account.ensureFundedFromEnvironment('ACCOUNTADDRESS', algokit.algo(1), { - minFundingIncrement: algokit.algo(2), +await algorand.account.ensureFundedFromEnvironment('ACCOUNTADDRESS', (1).algo(), { + minFundingIncrement: (2).algo(), fee: (1000).microAlgo(), suppressLog: true, }) @@ -103,18 +103,11 @@ await algorand.account.ensureFundedFromEnvironment('ACCOUNTADDRESS', algokit.alg // TestNet Dispenser API // Basic example -await algorand.account.ensureFundedUsingDispenserAPI( - 'ACCOUNTADDRESS', - algorand.client.getTestNetDispenserFromEnvironment(), - algokit.algo(1), -) +await algorand.account.ensureFundedUsingDispenserAPI('ACCOUNTADDRESS', algorand.client.getTestNetDispenserFromEnvironment(), (1).algo()) // With configuration -await algorand.account.ensureFundedUsingDispenserAPI( - 'ACCOUNTADDRESS', - algorand.client.getTestNetDispenserFromEnvironment(), - algokit.algo(1), - { minFundingIncrement: algokit.algo(2) }, -) +await algorand.account.ensureFundedUsingDispenserAPI('ACCOUNTADDRESS', algorand.client.getTestNetDispenserFromEnvironment(), (1).algo(), { + minFundingIncrement: (2).algo(), +}) ``` All 3 variants return an [`EnsureFundedReturnType`](../code/modules/types_account_manager.md#) (and the first two also return a [single transaction result](./algorand-client.md#sending-a-single-transaction)) if a funding transaction was needed, or `undefined` if no transaction was required: diff --git a/docs/capabilities/typed-app-clients.md b/docs/capabilities/typed-app-clients.md index a2c8b73e..7e899274 100644 --- a/docs/capabilities/typed-app-clients.md +++ b/docs/capabilities/typed-app-clients.md @@ -39,7 +39,7 @@ const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractCl }) const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, { creatorAddress: 'CREATORADDRESS', - // Override the name (by default uses the name in the ARC-32 app spec) + // Override the name (by default uses the name in the ARC-32 / ARC-56 app spec) name: 'contract-name', }) diff --git a/docs/code/README.md b/docs/code/README.md index 05cc26d5..be26fa16 100644 --- a/docs/code/README.md +++ b/docs/code/README.md @@ -13,6 +13,7 @@ - [types/account-manager.spec](modules/types_account_manager_spec.md) - [types/algo-http-client-with-retry](modules/types_algo_http_client_with_retry.md) - [types/algorand-client](modules/types_algorand_client.md) +- [types/algorand-client-interface](modules/types_algorand_client_interface.md) - [types/algorand-client-transaction-creator](modules/types_algorand_client_transaction_creator.md) - [types/algorand-client-transaction-sender](modules/types_algorand_client_transaction_sender.md) - [types/algorand-client.asset.spec](modules/types_algorand_client_asset_spec.md) @@ -21,9 +22,12 @@ - [types/amount](modules/types_amount.md) - [types/amount.spec](modules/types_amount_spec.md) - [types/app](modules/types_app.md) +- [types/app-arc56](modules/types_app_arc56.md) - [types/app-client](modules/types_app_client.md) - [types/app-client.spec](modules/types_app_client_spec.md) - [types/app-deployer](modules/types_app_deployer.md) +- [types/app-factory](modules/types_app_factory.md) +- [types/app-factory-and-client.spec](modules/types_app_factory_and_client_spec.md) - [types/app-manager](modules/types_app_manager.md) - [types/app-spec](modules/types_app_spec.md) - [types/asset](modules/types_asset.md) diff --git a/docs/code/classes/testing.TestLogger.md b/docs/code/classes/testing.TestLogger.md index b28f0360..f6433372 100644 --- a/docs/code/classes/testing.TestLogger.md +++ b/docs/code/classes/testing.TestLogger.md @@ -56,7 +56,7 @@ Create a new test logger that wraps the given logger if provided. #### Defined in -[src/testing/test-logger.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L16) +[src/testing/test-logger.ts:15](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L15) ## Properties @@ -66,7 +66,7 @@ Create a new test logger that wraps the given logger if provided. #### Defined in -[src/testing/test-logger.ts:10](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L10) +[src/testing/test-logger.ts:9](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L9) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[src/testing/test-logger.ts:9](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L9) +[src/testing/test-logger.ts:8](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L8) ## Accessors @@ -92,7 +92,7 @@ Returns all logs captured thus far. #### Defined in -[src/testing/test-logger.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L22) +[src/testing/test-logger.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L21) ## Methods @@ -108,7 +108,7 @@ Clears all logs captured so far. #### Defined in -[src/testing/test-logger.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L27) +[src/testing/test-logger.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L26) ___ @@ -133,7 +133,7 @@ Logger.debug #### Defined in -[src/testing/test-logger.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L77) +[src/testing/test-logger.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L79) ___ @@ -158,7 +158,7 @@ Logger.error #### Defined in -[src/testing/test-logger.ts:61](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L61) +[src/testing/test-logger.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L63) ___ @@ -194,7 +194,7 @@ expect(logger.getLogSnapshot()).toMatchSnapshot() #### Defined in -[src/testing/test-logger.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L47) +[src/testing/test-logger.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L46) ___ @@ -219,7 +219,7 @@ Logger.info #### Defined in -[src/testing/test-logger.ts:69](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L69) +[src/testing/test-logger.ts:71](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L71) ___ @@ -244,7 +244,7 @@ Logger.verbose #### Defined in -[src/testing/test-logger.ts:73](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L73) +[src/testing/test-logger.ts:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L75) ___ @@ -269,4 +269,4 @@ Logger.warn #### Defined in -[src/testing/test-logger.ts:65](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L65) +[src/testing/test-logger.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/testing/test-logger.ts#L67) diff --git a/docs/code/classes/types_account.MultisigAccount.md b/docs/code/classes/types_account.MultisigAccount.md index 3915e8ab..d5e0fd01 100644 --- a/docs/code/classes/types_account.MultisigAccount.md +++ b/docs/code/classes/types_account.MultisigAccount.md @@ -165,7 +165,7 @@ Sign the given transaction | Name | Type | Description | | :------ | :------ | :------ | -| `transaction` | `Transaction` \| `Uint8Array` | Either a transaction object or a raw, partially signed transaction | +| `transaction` | `Uint8Array` \| `Transaction` | Either a transaction object or a raw, partially signed transaction | #### Returns diff --git a/docs/code/classes/types_account_manager.AccountManager.md b/docs/code/classes/types_account_manager.AccountManager.md index 95e1574f..9c1c918d 100644 --- a/docs/code/classes/types_account_manager.AccountManager.md +++ b/docs/code/classes/types_account_manager.AccountManager.md @@ -227,7 +227,7 @@ https://developer.algorand.org/docs/get-details/accounts/#minimum-balance | `accountToFund` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to fund | | `dispenserAccount` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to use as a dispenser funding source | | `minSpendingBalance` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement) | -| `options?` | \{ `minFundingIncrement?`: [`AlgoAmount`](types_amount.AlgoAmount.md) } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) & `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> | Optional parameters to control the funding increment, transaction or execution of the transaction | +| `options?` | \{ `minFundingIncrement?`: [`AlgoAmount`](types_amount.AlgoAmount.md) } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> | Optional parameters to control the funding increment, transaction or execution of the transaction | #### Returns @@ -276,7 +276,7 @@ https://developer.algorand.org/docs/get-details/accounts/#minimum-balance | :------ | :------ | :------ | | `accountToFund` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to fund | | `minSpendingBalance` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement) | -| `options?` | \{ `minFundingIncrement?`: [`AlgoAmount`](types_amount.AlgoAmount.md) } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) & `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> | Optional parameters to control the funding increment, transaction or execution of the transaction | +| `options?` | \{ `minFundingIncrement?`: [`AlgoAmount`](types_amount.AlgoAmount.md) } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> | Optional parameters to control the funding increment, transaction or execution of the transaction | #### Returns @@ -683,7 +683,7 @@ Rekey an account to a new address. | :------ | :------ | :------ | | `account` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to rekey | | `rekeyTo` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account address or signing account of the account that will be used to authorise transactions for the rekeyed account going forward. If a signing account is provided that will now be tracked as the signer for `account` in this `AccountManager` | -| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | Any parameters to control the transaction or execution of the transaction | +| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | Any parameters to control the transaction or execution of the transaction | #### Returns diff --git a/docs/code/classes/types_algorand_client.AlgorandClient.md b/docs/code/classes/types_algorand_client.AlgorandClient.md index a90009e1..e604bc56 100644 --- a/docs/code/classes/types_algorand_client.AlgorandClient.md +++ b/docs/code/classes/types_algorand_client.AlgorandClient.md @@ -6,6 +6,10 @@ A client that brokers easy access to Algorand functionality. +## Implements + +- [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) + ## Table of contents ### Constructors @@ -71,7 +75,7 @@ A client that brokers easy access to Algorand functionality. #### Defined in -[src/types/algorand-client.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L33) +[src/types/algorand-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L34) ## Properties @@ -81,7 +85,7 @@ A client that brokers easy access to Algorand functionality. #### Defined in -[src/types/algorand-client.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L20) +[src/types/algorand-client.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L21) ___ @@ -91,7 +95,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L22) +[src/types/algorand-client.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L23) ___ @@ -101,7 +105,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L21) +[src/types/algorand-client.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L22) ___ @@ -111,7 +115,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L23) +[src/types/algorand-client.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L24) ___ @@ -121,7 +125,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L27) +[src/types/algorand-client.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L28) ___ @@ -131,7 +135,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L28) +[src/types/algorand-client.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L29) ___ @@ -141,7 +145,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L29) +[src/types/algorand-client.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L30) ___ @@ -151,7 +155,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:19](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L19) +[src/types/algorand-client.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L20) ___ @@ -161,7 +165,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:31](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L31) +[src/types/algorand-client.ts:32](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L32) ___ @@ -171,7 +175,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L25) +[src/types/algorand-client.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L26) ___ @@ -181,7 +185,7 @@ ___ #### Defined in -[src/types/algorand-client.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L24) +[src/types/algorand-client.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L25) ## Accessors @@ -197,7 +201,7 @@ Get or create accounts that can sign transactions. #### Defined in -[src/types/algorand-client.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L140) +[src/types/algorand-client.ts:141](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L141) ___ @@ -211,9 +215,13 @@ Methods for interacting with apps. [`AppManager`](types_app_manager.AppManager.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[app](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#app) + #### Defined in -[src/types/algorand-client.ts:150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L150) +[src/types/algorand-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L151) ___ @@ -227,9 +235,13 @@ Methods for deploying apps and managing app deployment metadata. [`AppDeployer`](types_app_deployer.AppDeployer.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[appDeployer](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#appdeployer) + #### Defined in -[src/types/algorand-client.ts:155](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L155) +[src/types/algorand-client.ts:156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L156) ___ @@ -245,7 +257,7 @@ Methods for interacting with assets. #### Defined in -[src/types/algorand-client.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L145) +[src/types/algorand-client.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L146) ___ @@ -259,9 +271,13 @@ Get clients, including algosdk clients and app clients. [`ClientManager`](types_client_manager.ClientManager.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[client](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#client) + #### Defined in -[src/types/algorand-client.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L135) +[src/types/algorand-client.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L136) ___ @@ -275,9 +291,13 @@ Methods for sending a single transaction. [`AlgorandClientTransactionSender`](types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[send](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#send) + #### Defined in -[src/types/algorand-client.ts:173](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L173) +[src/types/algorand-client.ts:174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L174) ___ @@ -291,9 +311,13 @@ Methods for building transactions [`AlgorandClientTransactionCreator`](types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[transactions](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#transactions) + #### Defined in -[src/types/algorand-client.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L180) +[src/types/algorand-client.ts:181](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L181) ## Methods @@ -309,7 +333,7 @@ Get suggested params for a transaction (either cached or from algod if the cache #### Defined in -[src/types/algorand-client.ts:119](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L119) +[src/types/algorand-client.ts:120](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L120) ___ @@ -323,9 +347,13 @@ Start a new `AlgoKitComposer` transaction group [`default`](types_composer.default.md) +#### Implementation of + +[AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md).[newGroup](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md#newgroup) + #### Defined in -[src/types/algorand-client.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L160) +[src/types/algorand-client.ts:161](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L161) ___ @@ -349,7 +377,7 @@ The `AlgorandClient` so method calls can be chained #### Defined in -[src/types/algorand-client.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L58) +[src/types/algorand-client.ts:59](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L59) ___ @@ -373,7 +401,7 @@ The `AlgorandClient` so method calls can be chained #### Defined in -[src/types/algorand-client.ts:48](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L48) +[src/types/algorand-client.ts:49](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L49) ___ @@ -398,7 +426,7 @@ The `AlgorandClient` so method calls can be chained #### Defined in -[src/types/algorand-client.ts:91](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L91) +[src/types/algorand-client.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L92) ___ @@ -433,7 +461,7 @@ const accountManager = AlgorandClient.mainnet() #### Defined in -[src/types/algorand-client.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L78) +[src/types/algorand-client.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L79) ___ @@ -458,7 +486,7 @@ The `AlgorandClient` so method calls can be chained #### Defined in -[src/types/algorand-client.ts:102](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L102) +[src/types/algorand-client.ts:103](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L103) ___ @@ -482,7 +510,7 @@ The `AlgorandClient` so method calls can be chained #### Defined in -[src/types/algorand-client.ts:113](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L113) +[src/types/algorand-client.ts:114](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L114) ___ @@ -500,7 +528,7 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:190](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L190) +[src/types/algorand-client.ts:191](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L191) ___ @@ -524,7 +552,7 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:227](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L227) +[src/types/algorand-client.ts:228](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L228) ___ @@ -548,7 +576,7 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L257) +[src/types/algorand-client.ts:258](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L258) ___ @@ -579,7 +607,7 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:248](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L248) +[src/types/algorand-client.ts:249](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L249) ___ @@ -597,7 +625,7 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:214](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L214) +[src/types/algorand-client.ts:215](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L215) ___ @@ -615,4 +643,4 @@ The `AlgorandClient` #### Defined in -[src/types/algorand-client.ts:202](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L202) +[src/types/algorand-client.ts:203](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L203) diff --git a/docs/code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md b/docs/code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md index f6c913de..b7574cc3 100644 --- a/docs/code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md +++ b/docs/code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md @@ -291,13 +291,13 @@ await algorand.transactions.appCreate({ | `params.boxReferences?` | ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] | Any boxes to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). Either the name identifier (which will be set against app ID of `0` i.e. the current app), or a box identifier with the name identifier and app ID. | | `params.clearStateProgram` | `string` \| `Uint8Array` | The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). | | `params.extraFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. | -| `params.extraProgramPages?` | `number` | Number of extra pages required for the programs. This is immutable once the app is created. | +| `params.extraProgramPages?` | `number` | Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created. | | `params.firstValidRound?` | `bigint` | Set the first round this transaction is valid. If left undefined, the value from algod will be used. We recommend you only set this when you intentionally want this to be some time in the future. | | `params.lastValidRound?` | `bigint` | The last round this transaction is valid. It is recommended to use `validityWindow` instead. | | `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). | | `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. | | `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. | -| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. | +| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. | | `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). | | `params.schema?` | `Object` | The state schema for the app. This is immutable once the app is created. | | `params.schema.globalByteSlices` | `number` | The number of byte slices saved in global state. | @@ -614,7 +614,7 @@ await algorand.transactions.appUpdate({ | `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). | | `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. | | `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. | -| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. | +| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. | | `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). | | `params.sender` | `string` | The address of the account sending the transaction. | | `params.signer?` | `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The function used to sign transaction(s); if not specified then an attempt will be made to find a registered signer for the given `sender` or use a default signer (if configured). | diff --git a/docs/code/classes/types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md b/docs/code/classes/types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md index c4055fbd..532c20f2 100644 --- a/docs/code/classes/types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md +++ b/docs/code/classes/types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md @@ -65,7 +65,7 @@ Creates a new `AlgorandClientSender` #### Defined in -[src/types/algorand-client-transaction-sender.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L33) +[src/types/algorand-client-transaction-sender.ts:37](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L37) ## Properties @@ -75,7 +75,7 @@ Creates a new `AlgorandClientSender` #### Defined in -[src/types/algorand-client-transaction-sender.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L26) +[src/types/algorand-client-transaction-sender.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L30) ___ @@ -85,7 +85,7 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L25) +[src/types/algorand-client-transaction-sender.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L29) ___ @@ -103,13 +103,13 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L24) +[src/types/algorand-client-transaction-sender.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L28) ___ ### appCall -• **appCall**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appCall**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Call a smart contract. @@ -159,7 +159,7 @@ await algorand.send.appCall({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app call transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app call transaction | ##### Returns @@ -167,13 +167,13 @@ await algorand.send.appCall({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:697](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L697) +[src/types/algorand-client-transaction-sender.ts:707](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L707) ___ ### appCallMethodCall -• **appCallMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appCallMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Call a smart contract via an ABI method. @@ -235,7 +235,7 @@ await algorand.send.appCallMethodCall({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `ClearStateOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app call transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app call transaction | ##### Returns @@ -243,13 +243,13 @@ await algorand.send.appCallMethodCall({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:924](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L924) +[src/types/algorand-client-transaction-sender.ts:943](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L943) ___ ### appCreate -• **appCreate**: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appCreate**: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Create a smart contract. @@ -309,7 +309,7 @@ await algorand.send.appCreate({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app creation transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app creation transaction | ##### Returns @@ -317,13 +317,13 @@ await algorand.send.appCreate({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:569](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L569) +[src/types/algorand-client-transaction-sender.ts:573](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L573) ___ ### appCreateMethodCall -• **appCreateMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appCreateMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Create a smart contract via an ABI method. @@ -395,7 +395,7 @@ await algorand.send.appCreate({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app creation transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app creation transaction | ##### Returns @@ -403,13 +403,13 @@ await algorand.send.appCreate({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:760](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L760) +[src/types/algorand-client-transaction-sender.ts:773](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L773) ___ ### appDelete -• **appDelete**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appDelete**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Delete a smart contract. @@ -459,7 +459,7 @@ await algorand.send.appDelete({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app deletion transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `onComplete?`: `OnApplicationComplete` } & \{ `onComplete?`: `DeleteApplicationOC` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app deletion transaction | ##### Returns @@ -467,13 +467,13 @@ await algorand.send.appDelete({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:656](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L656) +[src/types/algorand-client-transaction-sender.ts:663](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L663) ___ ### appDeleteMethodCall -• **appDeleteMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appDeleteMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Delete a smart contract via an ABI method. @@ -535,7 +535,7 @@ await algorand.send.appDeleteMethodCall({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app deletion transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app deletion transaction | ##### Returns @@ -543,13 +543,13 @@ await algorand.send.appDeleteMethodCall({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:871](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L871) +[src/types/algorand-client-transaction-sender.ts:887](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L887) ___ ### appUpdate -• **appUpdate**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appUpdate**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Update a smart contract. @@ -601,7 +601,7 @@ await algorand.send.appUpdate({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app update transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app update transaction | ##### Returns @@ -609,13 +609,13 @@ await algorand.send.appUpdate({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:615](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L615) +[src/types/algorand-client-transaction-sender.ts:619](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L619) ___ ### appUpdateMethodCall -• **appUpdateMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **appUpdateMethodCall**: (`params`: \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Update a smart contract via an ABI method. @@ -679,7 +679,7 @@ await algorand.send.appUpdateMethodCall({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the app update transaction | +| `params` | \{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: `ABIMethod` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the app update transaction | ##### Returns @@ -687,13 +687,13 @@ await algorand.send.appUpdateMethodCall({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:818](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L818) +[src/types/algorand-client-transaction-sender.ts:831](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L831) ___ ### assetConfig -• **assetConfig**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` ; `clawback?`: `string` ; `freeze?`: `string` ; `manager`: `undefined` \| `string` ; `reserve?`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **assetConfig**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` ; `clawback?`: `string` ; `freeze?`: `string` ; `manager`: `undefined` \| `string` ; `reserve?`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Configure an existing Algorand Standard Asset. @@ -744,7 +744,7 @@ await algorand.send.assetConfig({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` ; `clawback?`: `string` ; `freeze?`: `string` ; `manager`: `undefined` \| `string` ; `reserve?`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset config transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` ; `clawback?`: `string` ; `freeze?`: `string` ; `manager`: `undefined` \| `string` ; `reserve?`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset config transaction | ##### Returns @@ -752,13 +752,13 @@ await algorand.send.assetConfig({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:280](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L280) +[src/types/algorand-client-transaction-sender.ts:284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L284) ___ ### assetDestroy -• **assetDestroy**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **assetDestroy**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Destroys an Algorand Standard Asset. @@ -805,7 +805,7 @@ await algorand.send.assetDestroy({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset destroy transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset destroy transaction | ##### Returns @@ -813,13 +813,13 @@ await algorand.send.assetDestroy({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L360) +[src/types/algorand-client-transaction-sender.ts:364](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L364) ___ ### assetFreeze -• **assetFreeze**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `account`: `string` ; `assetId`: `bigint` ; `frozen`: `boolean` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **assetFreeze**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `account`: `string` ; `assetId`: `bigint` ; `frozen`: `boolean` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Freeze or unfreeze an Algorand Standard Asset for an account. @@ -864,7 +864,7 @@ await algorand.send.assetFreeze({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `account`: `string` ; `assetId`: `bigint` ; `frozen`: `boolean` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset freeze transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `account`: `string` ; `assetId`: `bigint` ; `frozen`: `boolean` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset freeze transaction | ##### Returns @@ -872,13 +872,13 @@ await algorand.send.assetFreeze({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:319](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L319) +[src/types/algorand-client-transaction-sender.ts:323](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L323) ___ ### assetOptIn -• **assetOptIn**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **assetOptIn**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Opt an account into an Algorand Standard Asset. @@ -921,7 +921,7 @@ await algorand.send.assetOptIn({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset opt-in transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetId`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset opt-in transaction | ##### Returns @@ -929,13 +929,13 @@ await algorand.send.assetOptIn({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:440](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L440) +[src/types/algorand-client-transaction-sender.ts:444](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L444) ___ ### assetTransfer -• **assetTransfer**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: `bigint` ; `assetId`: `bigint` ; `clawbackTarget?`: `string` ; `closeAssetTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **assetTransfer**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: `bigint` ; `assetId`: `bigint` ; `clawbackTarget?`: `string` ; `closeAssetTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Transfer an Algorand Standard Asset. @@ -983,7 +983,7 @@ await algorand.send.assetTransfer({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: `bigint` ; `assetId`: `bigint` ; `clawbackTarget?`: `string` ; `closeAssetTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset transfer transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: `bigint` ; `assetId`: `bigint` ; `clawbackTarget?`: `string` ; `closeAssetTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset transfer transaction | ##### Returns @@ -991,13 +991,13 @@ await algorand.send.assetTransfer({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:402](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L402) +[src/types/algorand-client-transaction-sender.ts:406](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L406) ___ ### onlineKeyRegistration -• **onlineKeyRegistration**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `selectionKey`: `Uint8Array` ; `stateProofKey?`: `Uint8Array` ; `voteFirst`: `bigint` ; `voteKey`: `Uint8Array` ; `voteKeyDilution`: `bigint` ; `voteLast`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **onlineKeyRegistration**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `selectionKey`: `Uint8Array` ; `stateProofKey?`: `Uint8Array` ; `voteFirst`: `bigint` ; `voteKey`: `Uint8Array` ; `voteKeyDilution`: `bigint` ; `voteLast`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Register an online key. @@ -1009,7 +1009,7 @@ Register an online key. | Name | Type | | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `selectionKey`: `Uint8Array` ; `stateProofKey?`: `Uint8Array` ; `voteFirst`: `bigint` ; `voteKey`: `Uint8Array` ; `voteKeyDilution`: `bigint` ; `voteLast`: `bigint` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `selectionKey`: `Uint8Array` ; `stateProofKey?`: `Uint8Array` ; `voteFirst`: `bigint` ; `voteKey`: `Uint8Array` ; `voteKeyDilution`: `bigint` ; `voteLast`: `bigint` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | ##### Returns @@ -1017,13 +1017,13 @@ Register an online key. #### Defined in -[src/types/algorand-client-transaction-sender.ts:927](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L927) +[src/types/algorand-client-transaction-sender.ts:949](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L949) ___ ### payment -• **payment**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +• **payment**: (`params`: [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> Send a payment transaction to transfer Algo between accounts. @@ -1074,7 +1074,7 @@ const result = await algorand.send.payment({ | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the payment transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `receiver`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the payment transaction | ##### Returns @@ -1082,13 +1082,13 @@ const result = await algorand.send.payment({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L180) +[src/types/algorand-client-transaction-sender.ts:184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L184) ## Methods ### \_send -▸ **_send**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +▸ **_send**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> #### Type parameters @@ -1115,7 +1115,7 @@ const result = await algorand.send.payment({ | Name | Type | | :------ | :------ | -| `params` | `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | +| `params` | `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | ##### Returns @@ -1123,13 +1123,13 @@ const result = await algorand.send.payment({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L43) +[src/types/algorand-client-transaction-sender.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L47) ___ ### \_sendAppCall -▸ **_sendAppCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +▸ **_sendAppCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> #### Type parameters @@ -1156,7 +1156,7 @@ ___ | Name | Type | | :------ | :------ | -| `params` | `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | +| `params` | `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | ##### Returns @@ -1164,13 +1164,13 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L78) +[src/types/algorand-client-transaction-sender.ts:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L82) ___ ### \_sendAppCreateCall -▸ **_sendAppCreateCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +▸ **_sendAppCreateCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> #### Type parameters @@ -1197,7 +1197,7 @@ ___ | Name | Type | | :------ | :------ | -| `params` | `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | +| `params` | `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | ##### Returns @@ -1205,13 +1205,13 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:121](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L121) +[src/types/algorand-client-transaction-sender.ts:125](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L125) ___ ### \_sendAppUpdateCall -▸ **_sendAppUpdateCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> +▸ **_sendAppUpdateCall**\<`T`\>(`c`, `log?`): (`params`: `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> #### Type parameters @@ -1238,7 +1238,7 @@ ___ | Name | Type | | :------ | :------ | -| `params` | `T` & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | +| `params` | `T` & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | ##### Returns @@ -1246,7 +1246,7 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:102](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L102) +[src/types/algorand-client-transaction-sender.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L106) ___ @@ -1263,7 +1263,7 @@ opted in to the asset and will hold all units after creation. | Name | Type | Description | | :------ | :------ | :------ | -| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetName?`: `string` ; `clawback?`: `string` ; `decimals?`: `number` ; `defaultFrozen?`: `boolean` ; `freeze?`: `string` ; `manager?`: `string` ; `metadataHash?`: `string` \| `Uint8Array` ; `reserve?`: `string` ; `total`: `bigint` ; `unitName?`: `string` ; `url?`: `string` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset creation transaction | +| `params` | [`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams) & \{ `assetName?`: `string` ; `clawback?`: `string` ; `decimals?`: `number` ; `defaultFrozen?`: `boolean` ; `freeze?`: `string` ; `manager?`: `string` ; `metadataHash?`: `string` \| `Uint8Array` ; `reserve?`: `string` ; `total`: `bigint` ; `unitName?`: `string` ; `url?`: `string` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset creation transaction | #### Returns @@ -1314,7 +1314,7 @@ await algorand.send.assetCreate({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:231](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L231) +[src/types/algorand-client-transaction-sender.ts:235](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L235) ___ @@ -1332,7 +1332,7 @@ is set to `false` (but then the account will lose the assets). | Name | Type | Description | | :------ | :------ | :------ | -| `params` | `Omit`\<[`AssetOptOutParams`](../modules/types_composer.md#assetoptoutparams), ``"creator"``\> & \{ `creator?`: `string` ; `ensureZeroBalance`: `boolean` } & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters for the asset opt-out transaction | +| `params` | `Omit`\<[`AssetOptOutParams`](../modules/types_composer.md#assetoptoutparams), ``"creator"``\> & \{ `creator?`: `string` ; `ensureZeroBalance`: `boolean` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters for the asset opt-out transaction | #### Returns @@ -1381,7 +1381,7 @@ await algorand.send.assetOptOut({ #### Defined in -[src/types/algorand-client-transaction-sender.ts:487](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L487) +[src/types/algorand-client-transaction-sender.ts:491](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L491) ___ @@ -1395,4 +1395,4 @@ ___ #### Defined in -[src/types/algorand-client-transaction-sender.ts:39](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L39) +[src/types/algorand-client-transaction-sender.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-sender.ts#L43) diff --git a/docs/code/classes/types_amount.AlgoAmount.md b/docs/code/classes/types_amount.AlgoAmount.md index 4b19a435..b94aa080 100644 --- a/docs/code/classes/types_amount.AlgoAmount.md +++ b/docs/code/classes/types_amount.AlgoAmount.md @@ -42,7 +42,7 @@ Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbe | Name | Type | | :------ | :------ | -| `amount` | \{ `algos`: `number` } \| \{ `algo`: `number` } \| \{ `microAlgos`: `number` } \| \{ `microAlgo`: `number` } | +| `amount` | \{ `algos`: `number` \| `bigint` } \| \{ `algo`: `number` \| `bigint` } \| \{ `microAlgos`: `number` \| `bigint` } \| \{ `microAlgo`: `number` \| `bigint` } | #### Returns @@ -56,7 +56,7 @@ Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbe ### amountInMicroAlgo -• `Private` **amountInMicroAlgo**: `number` +• `Private` **amountInMicroAlgo**: `bigint` #### Defined in @@ -98,13 +98,13 @@ ___ ### microAlgo -• `get` **microAlgo**(): `number` +• `get` **microAlgo**(): `bigint` Return the amount as a number in µAlgo #### Returns -`number` +`bigint` #### Defined in @@ -114,13 +114,13 @@ ___ ### microAlgos -• `get` **microAlgos**(): `number` +• `get` **microAlgos**(): `bigint` Return the amount as a number in µAlgo #### Returns -`number` +`bigint` #### Defined in @@ -138,7 +138,7 @@ Return the amount as a number in µAlgo #### Defined in -[src/types/amount.ts:38](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L38) +[src/types/amount.ts:40](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L40) ___ @@ -156,7 +156,7 @@ the algos or microAlgos properties #### Defined in -[src/types/amount.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L46) +[src/types/amount.ts:48](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L48) ___ @@ -170,7 +170,7 @@ Create a `AlgoAmount` object representing the given number of Algo | Name | Type | | :------ | :------ | -| `amount` | `number` | +| `amount` | `number` \| `bigint` | #### Returns @@ -178,7 +178,7 @@ Create a `AlgoAmount` object representing the given number of Algo #### Defined in -[src/types/amount.ts:56](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L56) +[src/types/amount.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L58) ___ @@ -192,7 +192,7 @@ Create a `AlgoAmount` object representing the given number of Algo | Name | Type | | :------ | :------ | -| `amount` | `number` | +| `amount` | `number` \| `bigint` | #### Returns @@ -200,7 +200,7 @@ Create a `AlgoAmount` object representing the given number of Algo #### Defined in -[src/types/amount.ts:51](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L51) +[src/types/amount.ts:53](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L53) ___ @@ -214,7 +214,7 @@ Create a `AlgoAmount` object representing the given number of µAlgo | Name | Type | | :------ | :------ | -| `amount` | `number` | +| `amount` | `number` \| `bigint` | #### Returns @@ -222,7 +222,7 @@ Create a `AlgoAmount` object representing the given number of µAlgo #### Defined in -[src/types/amount.ts:66](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L66) +[src/types/amount.ts:68](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L68) ___ @@ -236,7 +236,7 @@ Create a `AlgoAmount` object representing the given number of µAlgo | Name | Type | | :------ | :------ | -| `amount` | `number` | +| `amount` | `number` \| `bigint` | #### Returns @@ -244,4 +244,4 @@ Create a `AlgoAmount` object representing the given number of µAlgo #### Defined in -[src/types/amount.ts:61](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L61) +[src/types/amount.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/amount.ts#L63) diff --git a/docs/code/classes/types_app_arc56.Arc56Method.md b/docs/code/classes/types_app_arc56.Arc56Method.md new file mode 100644 index 00000000..a900384c --- /dev/null +++ b/docs/code/classes/types_app_arc56.Arc56Method.md @@ -0,0 +1,229 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / Arc56Method + +# Class: Arc56Method + +[types/app-arc56](../modules/types_app_arc56.md).Arc56Method + +Wrapper around `algosdk.ABIMethod` that represents an ARC-56 ABI method. + +## Hierarchy + +- `ABIMethod` + + ↳ **`Arc56Method`** + +## Table of contents + +### Constructors + +- [constructor](types_app_arc56.Arc56Method.md#constructor) + +### Properties + +- [args](types_app_arc56.Arc56Method.md#args) +- [description](types_app_arc56.Arc56Method.md#description) +- [method](types_app_arc56.Arc56Method.md#method) +- [name](types_app_arc56.Arc56Method.md#name) +- [returns](types_app_arc56.Arc56Method.md#returns) + +### Methods + +- [getSelector](types_app_arc56.Arc56Method.md#getselector) +- [getSignature](types_app_arc56.Arc56Method.md#getsignature) +- [toJSON](types_app_arc56.Arc56Method.md#tojson) +- [txnCount](types_app_arc56.Arc56Method.md#txncount) +- [fromSignature](types_app_arc56.Arc56Method.md#fromsignature) + +## Constructors + +### constructor + +• **new Arc56Method**(`method`): [`Arc56Method`](types_app_arc56.Arc56Method.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `method` | [`Method`](../interfaces/types_app_arc56.Method.md) | + +#### Returns + +[`Arc56Method`](types_app_arc56.Arc56Method.md) + +#### Overrides + +algosdk.ABIMethod.constructor + +#### Defined in + +[src/types/app-arc56.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L22) + +## Properties + +### args + +• `Readonly` **args**: \{ `defaultValue?`: `string` ; `desc?`: `string` ; `name?`: `string` ; `struct?`: `string` ; `type`: `ABIArgumentType` }[] + +#### Overrides + +algosdk.ABIMethod.args + +#### Defined in + +[src/types/app-arc56.ts:9](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L9) + +___ + +### description + +• `Optional` `Readonly` **description**: `string` + +#### Inherited from + +algosdk.ABIMethod.description + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:23 + +___ + +### method + +• **method**: [`Method`](../interfaces/types_app_arc56.Method.md) + +#### Defined in + +[src/types/app-arc56.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L22) + +___ + +### name + +• `Readonly` **name**: `string` + +#### Inherited from + +algosdk.ABIMethod.name + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:22 + +___ + +### returns + +• `Readonly` **returns**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `desc?` | `string` | Optional, user-friendly description for the return value | +| `struct?` | `string` | If the type is a struct, the name of the struct | +| `type` | `ABIReturnType` | - | + +#### Overrides + +algosdk.ABIMethod.returns + +#### Defined in + +[src/types/app-arc56.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L16) + +## Methods + +### getSelector + +▸ **getSelector**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Inherited from + +algosdk.ABIMethod.getSelector + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:35 + +___ + +### getSignature + +▸ **getSignature**(): `string` + +#### Returns + +`string` + +#### Inherited from + +algosdk.ABIMethod.getSignature + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:34 + +___ + +### toJSON + +▸ **toJSON**(): [`Method`](../interfaces/types_app_arc56.Method.md) + +#### Returns + +[`Method`](../interfaces/types_app_arc56.Method.md) + +#### Overrides + +algosdk.ABIMethod.toJSON + +#### Defined in + +[src/types/app-arc56.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L34) + +___ + +### txnCount + +▸ **txnCount**(): `number` + +#### Returns + +`number` + +#### Inherited from + +algosdk.ABIMethod.txnCount + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:36 + +___ + +### fromSignature + +▸ **fromSignature**(`signature`): `ABIMethod` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `signature` | `string` | + +#### Returns + +`ABIMethod` + +#### Inherited from + +algosdk.ABIMethod.fromSignature + +#### Defined in + +node_modules/algosdk/dist/types/abi/method.d.ts:38 diff --git a/docs/code/classes/types_app_client.AppClient.md b/docs/code/classes/types_app_client.AppClient.md new file mode 100644 index 00000000..6a874ae0 --- /dev/null +++ b/docs/code/classes/types_app_client.AppClient.md @@ -0,0 +1,1256 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-client](../modules/types_app_client.md) / AppClient + +# Class: AppClient + +[types/app-client](../modules/types_app_client.md).AppClient + +ARC-56/ARC-32 application client that allows you to manage calls and +state for a specific deployed instance of an app (with a known app ID). + +## Table of contents + +### Constructors + +- [constructor](types_app_client.AppClient.md#constructor) + +### Properties + +- [\_algorand](types_app_client.AppClient.md#_algorand) +- [\_appAddress](types_app_client.AppClient.md#_appaddress) +- [\_appId](types_app_client.AppClient.md#_appid) +- [\_appName](types_app_client.AppClient.md#_appname) +- [\_appSpec](types_app_client.AppClient.md#_appspec) +- [\_approvalSourceMap](types_app_client.AppClient.md#_approvalsourcemap) +- [\_boxStateMethods](types_app_client.AppClient.md#_boxstatemethods) +- [\_clearSourceMap](types_app_client.AppClient.md#_clearsourcemap) +- [\_defaultSender](types_app_client.AppClient.md#_defaultsender) +- [\_globalStateMethods](types_app_client.AppClient.md#_globalstatemethods) +- [\_localStateMethods](types_app_client.AppClient.md#_localstatemethods) +- [\_paramsMethods](types_app_client.AppClient.md#_paramsmethods) +- [\_sendMethods](types_app_client.AppClient.md#_sendmethods) +- [\_transactionsMethods](types_app_client.AppClient.md#_transactionsmethods) + +### Accessors + +- [appAddress](types_app_client.AppClient.md#appaddress) +- [appId](types_app_client.AppClient.md#appid) +- [appName](types_app_client.AppClient.md#appname) +- [appSpec](types_app_client.AppClient.md#appspec) +- [params](types_app_client.AppClient.md#params) +- [send](types_app_client.AppClient.md#send) +- [state](types_app_client.AppClient.md#state) +- [transactions](types_app_client.AppClient.md#transactions) + +### Methods + +- [compile](types_app_client.AppClient.md#compile) +- [exportSourceMaps](types_app_client.AppClient.md#exportsourcemaps) +- [exposeLogicError](types_app_client.AppClient.md#exposelogicerror) +- [fundAppAccount](types_app_client.AppClient.md#fundappaccount) +- [getABIMethod](types_app_client.AppClient.md#getabimethod) +- [getABIParams](types_app_client.AppClient.md#getabiparams) +- [getBareParams](types_app_client.AppClient.md#getbareparams) +- [getBareParamsMethods](types_app_client.AppClient.md#getbareparamsmethods) +- [getBareSendMethods](types_app_client.AppClient.md#getbaresendmethods) +- [getBareTransactionsMethods](types_app_client.AppClient.md#getbaretransactionsmethods) +- [getBoxMethods](types_app_client.AppClient.md#getboxmethods) +- [getBoxNames](types_app_client.AppClient.md#getboxnames) +- [getBoxValue](types_app_client.AppClient.md#getboxvalue) +- [getBoxValueFromABIType](types_app_client.AppClient.md#getboxvaluefromabitype) +- [getBoxValues](types_app_client.AppClient.md#getboxvalues) +- [getBoxValuesFromABIType](types_app_client.AppClient.md#getboxvaluesfromabitype) +- [getGlobalState](types_app_client.AppClient.md#getglobalstate) +- [getLocalState](types_app_client.AppClient.md#getlocalstate) +- [getMethodCallParamsMethods](types_app_client.AppClient.md#getmethodcallparamsmethods) +- [getMethodCallSendMethods](types_app_client.AppClient.md#getmethodcallsendmethods) +- [getMethodCallTransactionsMethods](types_app_client.AppClient.md#getmethodcalltransactionsmethods) +- [getSender](types_app_client.AppClient.md#getsender) +- [getStateMethods](types_app_client.AppClient.md#getstatemethods) +- [handleCallErrors](types_app_client.AppClient.md#handlecallerrors) +- [importSourceMaps](types_app_client.AppClient.md#importsourcemaps) +- [newGroup](types_app_client.AppClient.md#newgroup) +- [parseMethodCallReturn](types_app_client.AppClient.md#parsemethodcallreturn) +- [compile](types_app_client.AppClient.md#compile-1) +- [exposeLogicError](types_app_client.AppClient.md#exposelogicerror-1) +- [fromCreatorAndName](types_app_client.AppClient.md#fromcreatorandname) +- [fromNetwork](types_app_client.AppClient.md#fromnetwork) +- [getABIArgsWithDefaultValues](types_app_client.AppClient.md#getabiargswithdefaultvalues) +- [normaliseAppSpec](types_app_client.AppClient.md#normaliseappspec) + +## Constructors + +### constructor + +• **new AppClient**(`params`): [`AppClient`](types_app_client.AppClient.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`AppClientParams`](../interfaces/types_app_client.AppClientParams.md) | + +#### Returns + +[`AppClient`](types_app_client.AppClient.md) + +#### Defined in + +[src/types/app-client.ts:418](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L418) + +## Properties + +### \_algorand + +• `Private` **\_algorand**: [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) + +#### Defined in + +[src/types/app-client.ts:398](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L398) + +___ + +### \_appAddress + +• `Private` **\_appAddress**: `string` + +#### Defined in + +[src/types/app-client.ts:395](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L395) + +___ + +### \_appId + +• `Private` **\_appId**: `bigint` + +#### Defined in + +[src/types/app-client.ts:394](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L394) + +___ + +### \_appName + +• `Private` **\_appName**: `string` + +#### Defined in + +[src/types/app-client.ts:396](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L396) + +___ + +### \_appSpec + +• `Private` **\_appSpec**: [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +#### Defined in + +[src/types/app-client.ts:397](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L397) + +___ + +### \_approvalSourceMap + +• `Private` **\_approvalSourceMap**: `undefined` \| `SourceMap` + +#### Defined in + +[src/types/app-client.ts:401](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L401) + +___ + +### \_boxStateMethods + +• `Private` **\_boxStateMethods**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `getMapValue` | (`mapName`: `string`, `key`: `any`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `getValue` | (`name`: `string`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | + +#### Defined in + +[src/types/app-client.ts:406](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L406) + +___ + +### \_clearSourceMap + +• `Private` **\_clearSourceMap**: `undefined` \| `SourceMap` + +#### Defined in + +[src/types/app-client.ts:402](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L402) + +___ + +### \_defaultSender + +• `Private` `Optional` **\_defaultSender**: `string` + +#### Defined in + +[src/types/app-client.ts:399](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L399) + +___ + +### \_globalStateMethods + +• `Private` **\_globalStateMethods**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `getMapValue` | (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `getValue` | (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | + +#### Defined in + +[src/types/app-client.ts:405](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L405) + +___ + +### \_localStateMethods + +• `Private` **\_localStateMethods**: (`address`: `string`) => \{ `getAll`: () => `Promise`\<`Record`\<`string`, `any`\>\> ; `getMap`: (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> ; `getMapValue`: (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> ; `getValue`: (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> } + +#### Type declaration + +▸ (`address`): `Object` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `string` | + +##### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `getMapValue` | (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `getValue` | (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | + +#### Defined in + +[src/types/app-client.ts:404](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L404) + +___ + +### \_paramsMethods + +• `Private` **\_paramsMethods**: \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteMethodCall`](../modules/types_composer.md#appdeletemethodcall) ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `receiver`: `string` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `appId`: `bigint` ; `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteParams`](../modules/types_composer.md#appdeleteparams) ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> } } + +#### Defined in + +[src/types/app-client.ts:408](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L408) + +___ + +### \_sendMethods + +• `Private` **\_sendMethods**: \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } } + +#### Defined in + +[src/types/app-client.ts:414](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L414) + +___ + +### \_transactionsMethods + +• `Private` **\_transactionsMethods**: \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<`Transaction`\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<`Transaction`\> } } + +#### Defined in + +[src/types/app-client.ts:411](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L411) + +## Accessors + +### appAddress + +• `get` **appAddress**(): `string` + +The app address of the app instance this client is linked to. + +#### Returns + +`string` + +#### Defined in + +[src/types/app-client.ts:518](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L518) + +___ + +### appId + +• `get` **appId**(): `bigint` + +The ID of the app instance this client is linked to. + +#### Returns + +`bigint` + +#### Defined in + +[src/types/app-client.ts:513](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L513) + +___ + +### appName + +• `get` **appName**(): `string` + +The name of the app (from the ARC-32 / ARC-56 app spec). + +#### Returns + +`string` + +#### Defined in + +[src/types/app-client.ts:523](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L523) + +___ + +### appSpec + +• `get` **appSpec**(): [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +The ARC-56 app spec being used + +#### Returns + +[`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +#### Defined in + +[src/types/app-client.ts:528](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L528) + +___ + +### params + +• `get` **params**(): \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteMethodCall`](../modules/types_composer.md#appdeletemethodcall) ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `receiver`: `string` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `appId`: `bigint` ; `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteParams`](../modules/types_composer.md#appdeleteparams) ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> } } + +Get parameters to define transactions to the current app + +#### Returns + +\{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteMethodCall`](../modules/types_composer.md#appdeletemethodcall) ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `receiver`: `string` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `appId`: `bigint` ; `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteParams`](../modules/types_composer.md#appdeleteparams) ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> } } + +#### Defined in + +[src/types/app-client.ts:533](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L533) + +___ + +### send + +• `get` **send**(): \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } } + +Send calls to the current app + +#### Returns + +\{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> } } + +#### Defined in + +[src/types/app-client.ts:543](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L543) + +___ + +### state + +• `get` **state**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `box` | \{ `getAll`: () => `Promise`\<`Record`\<`string`, `any`\>\> ; `getMap`: (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> ; `getMapValue`: (`mapName`: `string`, `key`: `any`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> ; `getValue`: (`name`: `string`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> } | Methods to access box storage for the current app | +| `box.getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `box.getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `box.getMapValue` | (`mapName`: `string`, `key`: `any`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `box.getValue` | (`name`: `string`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `global` | \{ `getAll`: () => `Promise`\<`Record`\<`string`, `any`\>\> ; `getMap`: (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> ; `getMapValue`: (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> ; `getValue`: (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> } | Methods to access global state for the current app | +| `global.getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `global.getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `global.getMapValue` | (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `global.getValue` | (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `local` | (`address`: `string`) => \{ `getAll`: () => `Promise`\<`Record`\<`string`, `any`\>\> ; `getMap`: (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> ; `getMapValue`: (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> ; `getValue`: (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> } | - | + +#### Defined in + +[src/types/app-client.ts:547](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L547) + +___ + +### transactions + +• `get` **transactions**(): \{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<`Transaction`\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<`Transaction`\> } } + +Get transactions for the current app + +#### Returns + +\{ `call`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `closeOut`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `delete`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `fundAppAccount`: (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> ; `update`: (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> } & \{ `bare`: \{ `call`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<`Transaction`\> ; `clearState`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `closeOut`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `delete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `optIn`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> ; `update`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<`Transaction`\> } } + +#### Defined in + +[src/types/app-client.ts:538](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L538) + +## Methods + +### compile + +▸ **compile**(`compilation?`): `Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +Compiles the approval and clear state programs (if TEAL templates provided), +performing any provided deploy-time parameter replacement and stores +the source maps. + +If no TEAL templates provided it will use any byte code provided in the app spec. + +Will store any generated source maps for later use in debugging. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `compilation?` | [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) | + +#### Returns + +`Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +#### Defined in + +[src/types/app-client.ts:1123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1123) + +___ + +### exportSourceMaps + +▸ **exportSourceMaps**(): [`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) + +Export the current source maps for the app. + +#### Returns + +[`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) + +The source maps + +#### Defined in + +[src/types/app-client.ts:673](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L673) + +___ + +### exposeLogicError + +▸ **exposeLogicError**(`e`, `isClearStateProgram?`): `Error` + +Takes an error that may include a logic error from a call to the current app and re-exposes the +error to include source code information via the source map and ARC-56 spec. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `e` | `Error` | The error to parse | +| `isClearStateProgram?` | `boolean` | Whether or not the code was running the clear state program (defaults to approval program) | + +#### Returns + +`Error` + +The new error, or if there was no logic error or source map then the wrapped error with source details + +#### Defined in + +[src/types/app-client.ts:661](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L661) + +___ + +### fundAppAccount + +▸ **fundAppAccount**(`params`): `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> + +Funds Algo into the app account for this app. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters for the funding transaction | +| `params.amount` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Amount to send | +| `params.closeRemainderTo?` | `string` | If given, close the sender account and send the remaining balance to this address *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly. | +| `params.extraFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. | +| `params.firstValidRound?` | `bigint` | Set the first round this transaction is valid. If left undefined, the value from algod will be used. We recommend you only set this when you intentionally want this to be some time in the future. | +| `params.lastValidRound?` | `bigint` | The last round this transaction is valid. It is recommended to use `validityWindow` instead. | +| `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). | +| `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. | +| `params.maxRoundsToWaitForConfirmation?` | `number` | The number of rounds to wait for confirmation. By default until the latest lastValid has past. | +| `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. | +| `params.populateAppCallResources?` | `boolean` | Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. | +| `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). | +| `params.sender?` | `string` | The optional sender to send the transaction from, will use the application client's default sender by default if specified | +| `params.signer?` | `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The function used to sign transaction(s); if not specified then an attempt will be made to find a registered signer for the given `sender` or use a default signer (if configured). | +| `params.staticFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. | +| `params.suppressLog?` | `boolean` | Whether to suppress log messages from transaction send, default: do not suppress. | +| `params.validityWindow?` | `number` | How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. | + +#### Returns + +`Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> + +The result of the funding + +#### Defined in + +[src/types/app-client.ts:570](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L570) + +___ + +### getABIMethod + +▸ **getABIMethod**(`methodNameOrSignature`): [`Arc56Method`](types_app_arc56.Arc56Method.md) + +Returns the ABI Method for the given method name string for the app represented by this application client instance + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `methodNameOrSignature` | `string` | The method name or method signature to call if an ABI call is being emitted. e.g. `my_method` or `my_method(unit64,string)bytes` | + +#### Returns + +[`Arc56Method`](types_app_arc56.Arc56Method.md) + +A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`] + +#### Defined in + +[src/types/app-client.ts:701](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L701) + +___ + +### getABIParams + +▸ **getABIParams**\<`TParams`, `TOnComplete`\>(`params`, `onComplete`): `TParams` & \{ `appId`: `bigint` ; `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TParams` | extends `Object` | +| `TOnComplete` | extends `OnApplicationComplete` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `TParams` | +| `onComplete` | `TOnComplete` | + +#### Returns + +`TParams` & \{ `appId`: `bigint` ; `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Defined in + +[src/types/app-client.ts:1157](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1157) + +___ + +### getBareParams + +▸ **getBareParams**\<`TParams`, `TOnComplete`\>(`params`, `onComplete`): `TParams` & \{ `appId`: `bigint` ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TParams` | extends `undefined` \| \{ `sender?`: `string` } | +| `TOnComplete` | extends `OnApplicationComplete` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `TParams` | +| `onComplete` | `TOnComplete` | + +#### Returns + +`TParams` & \{ `appId`: `bigint` ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Defined in + +[src/types/app-client.ts:1145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1145) + +___ + +### getBareParamsMethods + +▸ **getBareParamsMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallParams`](../modules/types_composer.md#appcallparams) | - | +| `clearState` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) | - | +| `closeOut` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) | - | +| `delete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteParams`](../modules/types_composer.md#appdeleteparams) | - | +| `optIn` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallParams`](../modules/types_composer.md#appcallparams) | - | +| `update` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> | - | + +#### Defined in + +[src/types/app-client.ts:857](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L857) + +___ + +### getBareSendMethods + +▸ **getBareSendMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `clearState` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `closeOut` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `delete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `optIn` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `update` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | + +#### Defined in + +[src/types/app-client.ts:921](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L921) + +___ + +### getBareTransactionsMethods + +▸ **getBareTransactionsMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<`Transaction`\> | - | +| `clearState` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> | - | +| `closeOut` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> | - | +| `delete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> | - | +| `optIn` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> | - | +| `update` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<`Transaction`\> | - | + +#### Defined in + +[src/types/app-client.ts:892](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L892) + +___ + +### getBoxMethods + +▸ **getBoxMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `getMapValue` | (`mapName`: `string`, `key`: `any`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `getValue` | (`name`: `string`) => `Promise`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | + +#### Defined in + +[src/types/app-client.ts:1182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1182) + +___ + +### getBoxNames + +▸ **getBoxNames**(): `Promise`\<[`BoxName`](../interfaces/types_app.BoxName.md)[]\> + +Returns the names of all current boxes for the current app. + +#### Returns + +`Promise`\<[`BoxName`](../interfaces/types_app.BoxName.md)[]\> + +The names of the boxes + +#### Defined in + +[src/types/app-client.ts:595](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L595) + +___ + +### getBoxValue + +▸ **getBoxValue**(`name`): `Promise`\<`Uint8Array`\> + +Returns the value of the given box for the current app. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) | The identifier of the box to return | + +#### Returns + +`Promise`\<`Uint8Array`\> + +The current box value as a byte array + +#### Defined in + +[src/types/app-client.ts:604](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L604) + +___ + +### getBoxValueFromABIType + +▸ **getBoxValueFromABIType**(`name`, `type`): `Promise`\<`ABIValue`\> + +Returns the value of the given box for the current app. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `name` | [`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) | The identifier of the box to return | +| `type` | `ABIType` | | + +#### Returns + +`Promise`\<`ABIValue`\> + +The current box value as a byte array + +#### Defined in + +[src/types/app-client.ts:614](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L614) + +___ + +### getBoxValues + +▸ **getBoxValues**(`filter?`): `Promise`\<\{ `name`: [`BoxName`](../interfaces/types_app.BoxName.md) ; `value`: `Uint8Array` }[]\> + +Returns the values of all current boxes for the current app. +Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `filter?` | (`name`: [`BoxName`](../interfaces/types_app.BoxName.md)) => `boolean` | Optional filter to filter which boxes' values are returned | + +#### Returns + +`Promise`\<\{ `name`: [`BoxName`](../interfaces/types_app.BoxName.md) ; `value`: `Uint8Array` }[]\> + +The (name, value) pair of the boxes with values as raw byte arrays + +#### Defined in + +[src/types/app-client.ts:628](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L628) + +___ + +### getBoxValuesFromABIType + +▸ **getBoxValuesFromABIType**(`type`, `filter?`): `Promise`\<\{ `name`: [`BoxName`](../interfaces/types_app.BoxName.md) ; `value`: `ABIValue` }[]\> + +Returns the values of all current boxes for the current app decoded using an ABI Type. +Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `type` | `ABIType` | The ABI type to decode the values with | +| `filter?` | (`name`: [`BoxName`](../interfaces/types_app.BoxName.md)) => `boolean` | Optional filter to filter which boxes' values are returned | + +#### Returns + +`Promise`\<\{ `name`: [`BoxName`](../interfaces/types_app.BoxName.md) ; `value`: `ABIValue` }[]\> + +The (name, value) pair of the boxes with values as the ABI Value + +#### Defined in + +[src/types/app-client.ts:644](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L644) + +___ + +### getGlobalState + +▸ **getGlobalState**(): `Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +Returns raw global state for the current app. + +#### Returns + +`Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +The global state + +#### Defined in + +[src/types/app-client.ts:578](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L578) + +___ + +### getLocalState + +▸ **getLocalState**(`address`): `Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +Returns raw local state for the given account address. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `string` | The address of the account to get the local state for | + +#### Returns + +`Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +The local state + +#### Defined in + +[src/types/app-client.ts:587](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L587) + +___ + +### getMethodCallParamsMethods + +▸ **getMethodCallParamsMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) | - | +| `closeOut` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) | - | +| `delete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppDeleteMethodCall`](../modules/types_composer.md#appdeletemethodcall) | - | +| `fundAppAccount` | (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `receiver`: `string` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } | - | +| `optIn` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => [`AppCallMethodCall`](../modules/types_composer.md#appcallmethodcall) | - | +| `update` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: OnApplicationComplete \| undefined ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `appId`: `bigint` ; `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` }\> | - | + +#### Defined in + +[src/types/app-client.ts:950](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L950) + +___ + +### getMethodCallSendMethods + +▸ **getMethodCallSendMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `closeOut` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `delete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `fundAppAccount` | (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `optIn` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | +| `update` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md)) => `Promise`\<\{ `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] }\> | - | + +#### Defined in + +[src/types/app-client.ts:989](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L989) + +___ + +### getMethodCallTransactionsMethods + +▸ **getMethodCallTransactionsMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`CallOnComplete`](../modules/types_app_client.md#calloncomplete)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> | - | +| `closeOut` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> | - | +| `delete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> | - | +| `fundAppAccount` | (`params`: \{ `amount`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `closeRemainderTo?`: `string` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `maxRoundsToWaitForConfirmation?`: `number` ; `note?`: `string` \| `Uint8Array` ; `populateAppCallResources?`: `boolean` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `suppressLog?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<`Transaction`\> | - | +| `optIn` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> | - | +| `update` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md)) => `Promise`\<\{ `methodCalls`: `Map`\<`number`, `ABIMethod`\> ; `signers`: `Map`\<`number`, `TransactionSigner`\> ; `transactions`: `Transaction`[] }\> | - | + +#### Defined in + +[src/types/app-client.ts:1075](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1075) + +___ + +### getSender + +▸ **getSender**(`sender`): `string` + +Returns the sender for a call, using the `defaultSender` +if none provided and throws an error if neither provided + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sender` | `undefined` \| `string` | + +#### Returns + +`string` + +#### Defined in + +[src/types/app-client.ts:1138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1138) + +___ + +### getStateMethods + +▸ **getStateMethods**(`stateGetter`, `keyGetter`, `mapGetter`): `Object` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stateGetter` | () => `Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> | +| `keyGetter` | () => \{ `[name: string]`: [`StorageKey`](../interfaces/types_app_arc56.StorageKey.md); } | +| `mapGetter` | () => \{ `[name: string]`: [`StorageMap`](../interfaces/types_app_arc56.StorageMap.md); } | + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `getAll` | () => `Promise`\<`Record`\<`string`, `any`\>\> | - | +| `getMap` | (`mapName`: `string`) => `Promise`\<`Map`\<`ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct), `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\>\> | - | +| `getMapValue` | (`mapName`: `string`, `key`: `any`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | +| `getValue` | (`name`: `string`, `appState?`: [`AppState`](../interfaces/types_app.AppState.md)) => `Promise`\<`undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct)\> | - | + +#### Defined in + +[src/types/app-client.ts:1254](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1254) + +___ + +### handleCallErrors + +▸ **handleCallErrors**\<`TResult`\>(`call`): `Promise`\<`TResult`\> + +Make the given call and catch any errors, augmenting with debugging information before re-throwing. + +#### Type parameters + +| Name | +| :------ | +| `TResult` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `call` | () => `Promise`\<`TResult`\> | + +#### Returns + +`Promise`\<`TResult`\> + +#### Defined in + +[src/types/app-client.ts:1174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1174) + +___ + +### importSourceMaps + +▸ **importSourceMaps**(`sourceMaps`): `void` + +Import source maps for the app. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `sourceMaps` | [`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) | The source maps to import | + +#### Returns + +`void` + +#### Defined in + +[src/types/app-client.ts:690](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L690) + +___ + +### newGroup + +▸ **newGroup**(): [`default`](types_composer.default.md) + +Start a new `AlgoKitComposer` transaction group + +#### Returns + +[`default`](types_composer.default.md) + +#### Defined in + +[src/types/app-client.ts:451](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L451) + +___ + +### parseMethodCallReturn + +▸ **parseMethodCallReturn**\<`TReturn`, `TResult`\>(`result`, `method`): `Promise`\<[`Expand`](../modules/types_expand.md#expand)\<`Omit`\<`TResult`, ``"return"``\> & [`AppReturn`](../modules/types_app.md#appreturn)\<`TReturn`\>\>\> + +Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type +on the ARC-56 method. + +If the return type is a struct then the struct will be returned. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TReturn` | extends `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) | +| `TResult` | extends `Object` = \{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `result` | `TResult` \| `Promise`\<`TResult`\> | The SendAppTransactionResult to be mapped | +| `method` | [`Arc56Method`](types_app_arc56.Arc56Method.md) | The method that was called | + +#### Returns + +`Promise`\<[`Expand`](../modules/types_expand.md#expand)\<`Omit`\<`TResult`, ``"return"``\> & [`AppReturn`](../modules/types_app.md#appreturn)\<`TReturn`\>\>\> + +The smart contract response with an updated return value + +#### Defined in + +[src/types/app-client.ts:715](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L715) + +___ + +### compile + +▸ **compile**(`appSpec`, `appManager`, `compilation?`): `Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +Compiles the approval and clear state programs (if TEAL templates provided), +performing any provided deploy-time parameter replacement and returns +the compiled code and any compilation results (including source maps). + +If no TEAL templates provided it will use any byte code provided in the app spec. + +Will store any generated source maps for later use in debugging. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `appSpec` | [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) | The app spec for the app | +| `appManager` | [`AppManager`](types_app_manager.AppManager.md) | - | +| `compilation?` | [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) | Any compilation parameters to use | + +#### Returns + +`Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +#### Defined in + +[src/types/app-client.ts:783](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L783) + +___ + +### exposeLogicError + +▸ **exposeLogicError**(`e`, `appSpec`, `details`): `Error` + +Takes an error that may include a logic error from a call to the current app and re-exposes the +error to include source code information via the source map and ARC-56 spec. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `e` | `Error` | The error to parse | +| `appSpec` | [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) | The app spec for the app | +| `details` | `Object` | Additional information to inform the error | +| `details.approvalSourceMap?` | `SourceMap` | Approval program source map | +| `details.clearSourceMap?` | `SourceMap` | Clear state program source map | +| `details.isClearStateProgram?` | `boolean` | Whether or not the code was running the clear state program (defaults to approval program) | + +#### Returns + +`Error` + +The new error, or if there was no logic error or source map then the wrapped error with source details + +#### Defined in + +[src/types/app-client.ts:733](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L733) + +___ + +### fromCreatorAndName + +▸ **fromCreatorAndName**(`params`): `Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +Returns a new `AppClient` client, resolving the app by creator address and name +using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters to create the app client | +| `params.algorand` | [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) | An `AlgorandClient` instance | +| `params.appLookupCache?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | An optional cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this `ClientManager` on construction. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.creatorAddress` | `string` | The address of the creator account for the app | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.ignoreCache?` | `boolean` | Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value | + +#### Returns + +`Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +#### Defined in + +[src/types/app-client.ts:460](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L460) + +___ + +### fromNetwork + +▸ **fromNetwork**(`params`): `Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +Returns an `AppClient` instance for the current network based on +pre-determined network-specific app IDs specified in the ARC-56 app spec. + +If no IDs are in the app spec or the network isn't recognised, an error is thrown. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters to create the app client | +| `params.algorand` | [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) | An `AlgorandClient` instance | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | + +#### Returns + +`Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +#### Defined in + +[src/types/app-client.ts:482](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L482) + +___ + +### getABIArgsWithDefaultValues + +▸ **getABIArgsWithDefaultValues**(`methodNameOrSignature`, `args`, `appSpec`): `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] + +Returns ABI method arguments ready for a method call params object with default values populated +and structs replaced with tuples. + +It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `methodNameOrSignature` | `string` | The method name or method signature to call if an ABI call is being emitted. e.g. `my_method` or `my_method(unit64,string)bytes` | +| `args` | `undefined` \| (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] | The arguments to the method with `undefined` for any that should be populated with a default value | +| `appSpec` | [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) | The app spec for the app | + +#### Returns + +`undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] + +#### Defined in + +[src/types/app-client.ts:836](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L836) + +___ + +### normaliseAppSpec + +▸ **normaliseAppSpec**(`spec`): [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and +normalises it into a parsed ARC-56 contract object. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `spec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The spec to normalise | + +#### Returns + +[`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +The normalised ARC-56 contract object + +#### Defined in + +[src/types/app-client.ts:506](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L506) diff --git a/docs/code/classes/types_app_client.ApplicationClient.md b/docs/code/classes/types_app_client.ApplicationClient.md index e17e3e8f..c9fd0af2 100644 --- a/docs/code/classes/types_app_client.ApplicationClient.md +++ b/docs/code/classes/types_app_client.ApplicationClient.md @@ -4,6 +4,13 @@ [types/app-client](../modules/types_app_client.md).ApplicationClient +**`Deprecated`** + +Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or +`algorand.client.getAppClientByCreatorAndName`. +If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, +which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app ## Table of contents @@ -63,8 +70,6 @@ Application client - a class that wraps an ARC-0032 app spec and provides high p • **new ApplicationClient**(`appDetails`, `algod`): [`ApplicationClient`](types_app_client.ApplicationClient.md) -Create a new ApplicationClient instance - #### Parameters | Name | Type | Description | @@ -76,9 +81,18 @@ Create a new ApplicationClient instance [`ApplicationClient`](types_app_client.ApplicationClient.md) +**`Deprecated`** + +Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or +`algorand.client.getAppClientByCreatorAndName`. +If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, +which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + +Create a new ApplicationClient instance + #### Defined in -[src/types/app-client.ts:299](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L299) +[src/types/app-client.ts:1381](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1381) ## Properties @@ -88,7 +102,7 @@ Create a new ApplicationClient instance #### Defined in -[src/types/app-client.ts:282](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L282) +[src/types/app-client.ts:1364](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1364) ___ @@ -98,7 +112,7 @@ ___ #### Defined in -[src/types/app-client.ts:281](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L281) +[src/types/app-client.ts:1363](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1363) ___ @@ -108,7 +122,7 @@ ___ #### Defined in -[src/types/app-client.ts:284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L284) +[src/types/app-client.ts:1366](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1366) ___ @@ -118,7 +132,7 @@ ___ #### Defined in -[src/types/app-client.ts:286](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L286) +[src/types/app-client.ts:1368](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1368) ___ @@ -128,7 +142,7 @@ ___ #### Defined in -[src/types/app-client.ts:287](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L287) +[src/types/app-client.ts:1369](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1369) ___ @@ -138,7 +152,7 @@ ___ #### Defined in -[src/types/app-client.ts:283](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L283) +[src/types/app-client.ts:1365](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1365) ___ @@ -148,7 +162,7 @@ ___ #### Defined in -[src/types/app-client.ts:273](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L273) +[src/types/app-client.ts:1355](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1355) ___ @@ -158,7 +172,7 @@ ___ #### Defined in -[src/types/app-client.ts:275](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L275) +[src/types/app-client.ts:1357](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1357) ___ @@ -168,7 +182,7 @@ ___ #### Defined in -[src/types/app-client.ts:279](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L279) +[src/types/app-client.ts:1361](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1361) ___ @@ -178,7 +192,7 @@ ___ #### Defined in -[src/types/app-client.ts:278](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L278) +[src/types/app-client.ts:1360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1360) ___ @@ -188,7 +202,7 @@ ___ #### Defined in -[src/types/app-client.ts:274](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L274) +[src/types/app-client.ts:1356](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1356) ___ @@ -198,7 +212,7 @@ ___ #### Defined in -[src/types/app-client.ts:277](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L277) +[src/types/app-client.ts:1359](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1359) ___ @@ -208,7 +222,7 @@ ___ #### Defined in -[src/types/app-client.ts:276](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L276) +[src/types/app-client.ts:1358](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1358) ## Methods @@ -216,8 +230,6 @@ ___ ▸ **call**(`call?`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a no_op (normal) call to the app. - #### Parameters | Name | Type | Description | @@ -230,9 +242,15 @@ Issues a no_op (normal) call to the app. The result of the call +**`Deprecated`** + +Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead. + +Issues a no_op (normal) call to the app. + #### Defined in -[src/types/app-client.ts:617](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L617) +[src/types/app-client.ts:1709](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1709) ___ @@ -240,8 +258,6 @@ ___ ▸ **callOfType**(`call?`, `callType`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a call to the app with the given call type. - #### Parameters | Name | Type | Description | @@ -255,9 +271,15 @@ Issues a call to the app with the given call type. The result of the call +**`Deprecated`** + +Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead. + +Issues a call to the app with the given call type. + #### Defined in -[src/types/app-client.ts:690](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L690) +[src/types/app-client.ts:1792](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1792) ___ @@ -265,8 +287,6 @@ ___ ▸ **clearState**(`call?`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a clear_state call to the app. - #### Parameters | Name | Type | Description | @@ -279,9 +299,15 @@ Issues a clear_state call to the app. The result of the call +**`Deprecated`** + +Use `appClient.send.clearState` or `appClient.transactions.clearState` from an `AppClient` instance instead. + +Issues a clear_state call to the app. + #### Defined in -[src/types/app-client.ts:671](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L671) +[src/types/app-client.ts:1769](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1769) ___ @@ -289,8 +315,6 @@ ___ ▸ **closeOut**(`call?`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a close_out call to the app. - #### Parameters | Name | Type | Description | @@ -303,9 +327,15 @@ Issues a close_out call to the app. The result of the call +**`Deprecated`** + +Use `appClient.send.closeOut` or `appClient.transactions.closeOut` from an `AppClient` instance instead. + +Issues a close_out call to the app. + #### Defined in -[src/types/app-client.ts:662](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L662) +[src/types/app-client.ts:1758](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1758) ___ @@ -313,8 +343,6 @@ ___ ▸ **compile**(`compilation?`): `Promise`\<\{ `approvalCompiled`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `clearCompiled`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> -Compiles the approval and clear programs and sets up the source map. - #### Parameters | Name | Type | Description | @@ -325,11 +353,17 @@ Compiles the approval and clear programs and sets up the source map. `Promise`\<\{ `approvalCompiled`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `clearCompiled`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> -The compiled approval and clear programs +The compiled approval and clear state programs + +**`Deprecated`** + +Use `AppClient.compile()` instead. + +Compiles the approval and clear state programs and sets up the source map. #### Defined in -[src/types/app-client.ts:336](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L336) +[src/types/app-client.ts:1420](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1420) ___ @@ -337,8 +371,6 @@ ___ ▸ **create**(`create?`): `Promise`\<\{ `appAddress`: `string` ; `appId`: `number` \| `bigint` ; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation?`: `PendingTransactionResponse` ; `confirmations?`: `PendingTransactionResponse`[] ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] }\> -Creates a smart contract app, returns the details of the created app. - #### Parameters | Name | Type | Description | @@ -351,9 +383,15 @@ Creates a smart contract app, returns the details of the created app. The details of the created app, or the transaction to create it if `skipSending` and the compilation result +**`Deprecated`** + +Use `create` from an `AppFactory` instance instead. + +Creates a smart contract app, returns the details of the created app. + #### Defined in -[src/types/app-client.ts:515](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L515) +[src/types/app-client.ts:1603](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1603) ___ @@ -361,8 +399,6 @@ ___ ▸ **delete**(`call?`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a delete_application call to the app. - #### Parameters | Name | Type | Description | @@ -375,9 +411,15 @@ Issues a delete_application call to the app. The result of the call +**`Deprecated`** + +Use `appClient.send.delete` or `appClient.transactions.delete` from an `AppClient` instance instead. + +Issues a delete_application call to the app. + #### Defined in -[src/types/app-client.ts:680](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L680) +[src/types/app-client.ts:1780](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1780) ___ @@ -385,14 +427,6 @@ ___ ▸ **deploy**(`deploy?`): `Promise`\<`Partial`\<[`AppCompilationResult`](../interfaces/types_app.AppCompilationResult.md)\> & [`AppMetadata`](../interfaces/types_app.AppMetadata.md) & \{ `operationPerformed`: ``"nothing"`` } \| \{ `appAddress`: `string` ; `appId`: `number` \| `bigint` ; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `number` ; `deletable?`: `boolean` ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"update"`` \| ``"create"`` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `updatable?`: `boolean` ; `updatedRound`: `number` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `number` \| `bigint` ; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `number` ; `deletable?`: `boolean` ; `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"replace"`` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `updatable?`: `boolean` ; `updatedRound`: `number` ; `version`: `string` }\> -Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions. - -To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md - -**Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created. - -**Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created. - #### Parameters | Name | Type | Description | @@ -405,9 +439,21 @@ To understand the architecture decisions behind this functionality please see ht The metadata and transaction result(s) of the deployment, or just the metadata if it didn't need to issue transactions +**`Deprecated`** + +Use `deploy` from an `AppFactory` instance instead. + +Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions. + +To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md + +**Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created. + +**Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created. + #### Defined in -[src/types/app-client.ts:405](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L405) +[src/types/app-client.ts:1491](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1491) ___ @@ -425,7 +471,7 @@ The source maps #### Defined in -[src/types/app-client.ts:372](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L372) +[src/types/app-client.ts:1456](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1456) ___ @@ -452,7 +498,7 @@ The new error, or if there was no logic error or source map then the wrapped err #### Defined in -[src/types/app-client.ts:1008](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1008) +[src/types/app-client.ts:2116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2116) ___ @@ -476,7 +522,7 @@ The result of the funding #### Defined in -[src/types/app-client.ts:730](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L730) +[src/types/app-client.ts:1832](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1832) ___ @@ -500,7 +546,7 @@ The ABI method for the given method #### Defined in -[src/types/app-client.ts:967](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L967) +[src/types/app-client.ts:2073](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2073) ___ @@ -508,8 +554,6 @@ ___ ▸ **getABIMethodParams**(`method`): `undefined` \| `ABIMethodParams` -Returns the ABI Method parameters for the given method name string for the app represented by this application client instance - #### Parameters | Name | Type | Description | @@ -522,9 +566,15 @@ Returns the ABI Method parameters for the given method name string for the app r The ABI method params for the given method +**`Deprecated`** + +Use `appClient.getABIMethod` instead. + +Returns the ABI Method parameters for the given method name string for the app represented by this application client instance + #### Defined in -[src/types/app-client.ts:945](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L945) +[src/types/app-client.ts:2051](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2051) ___ @@ -544,7 +594,7 @@ ___ #### Defined in -[src/types/app-client.ts:1025](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1025) +[src/types/app-client.ts:2133](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2133) ___ @@ -552,18 +602,22 @@ ___ ▸ **getAppReference**(): `Promise`\<[`AppReference`](../interfaces/types_app.AppReference.md) \| [`AppMetadata`](../interfaces/types_app.AppMetadata.md)\> -Gets the reference information for the current application instance. -`appId` will be 0 if it can't find an app. - #### Returns `Promise`\<[`AppReference`](../interfaces/types_app.AppReference.md) \| [`AppMetadata`](../interfaces/types_app.AppMetadata.md)\> The app reference, or if deployed using the `deploy` method, the app metadata too +**`Deprecated`** + +Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead. + +Gets the reference information for the current application instance. +`appId` will be 0 if it can't find an app. + #### Defined in -[src/types/app-client.ts:977](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L977) +[src/types/app-client.ts:2085](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2085) ___ @@ -581,7 +635,7 @@ The names of the boxes #### Defined in -[src/types/app-client.ts:786](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L786) +[src/types/app-client.ts:1888](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1888) ___ @@ -605,7 +659,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:801](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L801) +[src/types/app-client.ts:1903](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1903) ___ @@ -630,7 +684,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:817](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L817) +[src/types/app-client.ts:1919](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1919) ___ @@ -655,7 +709,7 @@ The (name, value) pair of the boxes with values as raw byte arrays #### Defined in -[src/types/app-client.ts:833](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L833) +[src/types/app-client.ts:1935](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1935) ___ @@ -681,7 +735,7 @@ The (name, value) pair of the boxes with values as the ABI Value #### Defined in -[src/types/app-client.ts:855](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L855) +[src/types/app-client.ts:1957](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1957) ___ @@ -689,8 +743,6 @@ ___ ▸ **getCallArgs**(`args`, `sender`): `Promise`\<`undefined` \| [`AppCallArgs`](../modules/types_app.md#appcallargs)\> -Returns the arguments for an app call for the given ABI method or raw method specification. - #### Parameters | Name | Type | Description | @@ -704,9 +756,15 @@ Returns the arguments for an app call for the given ABI method or raw method spe The call args ready to pass into an app call +**`Deprecated`** + +Use `appClient.params.*` from an `AppClient` instance instead. + +Returns the arguments for an app call for the given ABI method or raw method specification. + #### Defined in -[src/types/app-client.ts:877](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L877) +[src/types/app-client.ts:1981](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1981) ___ @@ -724,7 +782,7 @@ The global state #### Defined in -[src/types/app-client.ts:758](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L758) +[src/types/app-client.ts:1860](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1860) ___ @@ -748,7 +806,7 @@ The global state #### Defined in -[src/types/app-client.ts:772](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L772) +[src/types/app-client.ts:1874](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1874) ___ @@ -770,7 +828,7 @@ Import source maps for the app. #### Defined in -[src/types/app-client.ts:389](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L389) +[src/types/app-client.ts:1473](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1473) ___ @@ -778,8 +836,6 @@ ___ ▸ **optIn**(`call?`): `Promise`\<[`AppCallTransactionResult`](../interfaces/types_app.AppCallTransactionResult.md)\> -Issues a opt_in call to the app. - #### Parameters | Name | Type | Description | @@ -792,9 +848,15 @@ Issues a opt_in call to the app. The result of the call +**`Deprecated`** + +Use `appClient.send.optIn` or `appClient.transactions.optIn` from an `AppClient` instance instead. + +Issues a opt_in call to the app. + #### Defined in -[src/types/app-client.ts:653](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L653) +[src/types/app-client.ts:1747](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1747) ___ @@ -802,8 +864,6 @@ ___ ▸ **update**(`update?`): `Promise`\<\{ `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation?`: `PendingTransactionResponse` ; `confirmations?`: `PendingTransactionResponse`[] ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] }\> -Updates the smart contract app. - #### Parameters | Name | Type | Description | @@ -816,6 +876,12 @@ Updates the smart contract app. The transaction send result and the compilation result +**`Deprecated`** + +Use `appClient.send.update` or `appClient.transactions.update` from an `AppClient` instance instead. + +Updates the smart contract app. + #### Defined in -[src/types/app-client.ts:578](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L578) +[src/types/app-client.ts:1668](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1668) diff --git a/docs/code/classes/types_app_deployer.AppDeployer.md b/docs/code/classes/types_app_deployer.AppDeployer.md index aa429e6a..25a88630 100644 --- a/docs/code/classes/types_app_deployer.AppDeployer.md +++ b/docs/code/classes/types_app_deployer.AppDeployer.md @@ -47,7 +47,7 @@ Creates an `AppManager` #### Defined in -[src/types/app-deployer.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L116) +[src/types/app-deployer.ts:122](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L122) ## Properties @@ -57,7 +57,7 @@ Creates an `AppManager` #### Defined in -[src/types/app-deployer.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L108) +[src/types/app-deployer.ts:114](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L114) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[src/types/app-deployer.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L105) +[src/types/app-deployer.ts:111](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L111) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[src/types/app-deployer.ts:107](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L107) +[src/types/app-deployer.ts:113](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L113) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[src/types/app-deployer.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L106) +[src/types/app-deployer.ts:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L112) ## Methods @@ -109,7 +109,19 @@ To understand the architecture decisions behind this functionality please see ht | Name | Type | Description | | :------ | :------ | :------ | -| `deployment` | [`AppDeployParams`](../interfaces/types_app_deployer.AppDeployParams.md) | The arguments to control the app deployment | +| `deployment` | `Object` | The arguments to control the app deployment | +| `deployment.createParams` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| [`AppCreateMethodCall`](../modules/types_composer.md#appcreatemethodcall) | Create transaction parameters to use if a create needs to be issued as part of deployment | +| `deployment.deleteParams` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `ABIMethod` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } | Delete transaction parameters to use if a delete needs to be issued as part of deployment | +| `deployment.deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string) | +| `deployment.existingDeployments?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup | +| `deployment.ignoreCache?` | `boolean` | Whether or not to ignore the app metadata cache and force a lookup, default: use the cache * | +| `deployment.maxRoundsToWaitForConfirmation?` | `number` | The number of rounds to wait for confirmation. By default until the latest lastValid has past. | +| `deployment.metadata` | [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) | The deployment metadata | +| `deployment.onSchemaBreak?` | [`OnSchemaBreak`](../enums/types_app.OnSchemaBreak.md) \| ``"replace"`` \| ``"fail"`` \| ``"append"`` | What action to perform if a schema break (storage schema or extra pages change) is detected: * `fail` - Fail the deployment (throw an error, **default**) * `replace` - Delete the old app and create a new one * `append` - Deploy a new app and leave the old one as is | +| `deployment.onUpdate?` | ``"replace"`` \| ``"fail"`` \| ``"append"`` \| [`OnUpdate`](../enums/types_app.OnUpdate.md) \| ``"update"`` | What action to perform if a TEAL code update is detected: * `fail` - Fail the deployment (throw an error, **default**) * `update` - Update the app with the new TEAL code * `replace` - Delete the old app and create a new one * `append` - Deploy a new app and leave the old one as is | +| `deployment.populateAppCallResources?` | `boolean` | Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. | +| `deployment.suppressLog?` | `boolean` | Whether to suppress log messages from transaction send, default: do not suppress. | +| `deployment.updateParams` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `ABIMethod` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } | Update transaction parameters to use if an update needs to be issued as part of deployment | #### Returns @@ -119,7 +131,7 @@ The app reference of the new/existing app #### Defined in -[src/types/app-deployer.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L135) +[src/types/app-deployer.ts:141](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L141) ___ @@ -140,7 +152,7 @@ If the `AppManager` instance wasn't created with an indexer client, this functio | Name | Type | Description | | :------ | :------ | :------ | | `creatorAddress` | `string` | The address of the account that is the creator of the apps you want to search for | -| `ignoreCache?` | `boolean` | Whether ot not to ignore the cache and force a lookup, default: use the cache | +| `ignoreCache?` | `boolean` | Whether or not to ignore the cache and force a lookup, default: use the cache | #### Returns @@ -150,7 +162,7 @@ A name-based lookup of the app metadata #### Defined in -[src/types/app-deployer.ts:448](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L448) +[src/types/app-deployer.ts:454](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L454) ___ @@ -171,4 +183,4 @@ ___ #### Defined in -[src/types/app-deployer.ts:426](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L426) +[src/types/app-deployer.ts:432](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L432) diff --git a/docs/code/classes/types_app_factory.AppFactory.md b/docs/code/classes/types_app_factory.AppFactory.md new file mode 100644 index 00000000..e03fa248 --- /dev/null +++ b/docs/code/classes/types_app_factory.AppFactory.md @@ -0,0 +1,638 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-factory](../modules/types_app_factory.md) / AppFactory + +# Class: AppFactory + +[types/app-factory](../modules/types_app_factory.md).AppFactory + +ARC-56/ARC-32 app factory that, for a given app spec, allows you to create +and deploy one or more app instances and to create one or more app clients +to interact with those (or other) app instances. + +## Table of contents + +### Constructors + +- [constructor](types_app_factory.AppFactory.md#constructor) + +### Properties + +- [\_algorand](types_app_factory.AppFactory.md#_algorand) +- [\_appName](types_app_factory.AppFactory.md#_appname) +- [\_appSpec](types_app_factory.AppFactory.md#_appspec) +- [\_approvalSourceMap](types_app_factory.AppFactory.md#_approvalsourcemap) +- [\_clearSourceMap](types_app_factory.AppFactory.md#_clearsourcemap) +- [\_defaultSender](types_app_factory.AppFactory.md#_defaultsender) +- [\_deletable](types_app_factory.AppFactory.md#_deletable) +- [\_deployTimeParams](types_app_factory.AppFactory.md#_deploytimeparams) +- [\_paramsMethods](types_app_factory.AppFactory.md#_paramsmethods) +- [\_updatable](types_app_factory.AppFactory.md#_updatable) +- [\_version](types_app_factory.AppFactory.md#_version) + +### Accessors + +- [params](types_app_factory.AppFactory.md#params) + +### Methods + +- [compile](types_app_factory.AppFactory.md#compile) +- [create](types_app_factory.AppFactory.md#create) +- [deploy](types_app_factory.AppFactory.md#deploy) +- [exportSourceMaps](types_app_factory.AppFactory.md#exportsourcemaps) +- [exposeLogicError](types_app_factory.AppFactory.md#exposelogicerror) +- [getABIParams](types_app_factory.AppFactory.md#getabiparams) +- [getAppClientByCreatorAddressAndName](types_app_factory.AppFactory.md#getappclientbycreatoraddressandname) +- [getAppClientById](types_app_factory.AppFactory.md#getappclientbyid) +- [getBareParams](types_app_factory.AppFactory.md#getbareparams) +- [getDeployTimeControl](types_app_factory.AppFactory.md#getdeploytimecontrol) +- [getParamsMethods](types_app_factory.AppFactory.md#getparamsmethods) +- [getSender](types_app_factory.AppFactory.md#getsender) +- [handleCallErrors](types_app_factory.AppFactory.md#handlecallerrors) +- [importSourceMaps](types_app_factory.AppFactory.md#importsourcemaps) +- [parseMethodCallReturn](types_app_factory.AppFactory.md#parsemethodcallreturn) + +## Constructors + +### constructor + +• **new AppFactory**(`params`): [`AppFactory`](types_app_factory.AppFactory.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | [`AppFactoryParams`](../interfaces/types_app_factory.AppFactoryParams.md) | + +#### Returns + +[`AppFactory`](types_app_factory.AppFactory.md) + +#### Defined in + +[src/types/app-factory.ts:161](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L161) + +## Properties + +### \_algorand + +• `Private` **\_algorand**: [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) + +#### Defined in + +[src/types/app-factory.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L149) + +___ + +### \_appName + +• `Private` **\_appName**: `string` + +#### Defined in + +[src/types/app-factory.ts:148](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L148) + +___ + +### \_appSpec + +• `Private` **\_appSpec**: [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +#### Defined in + +[src/types/app-factory.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L147) + +___ + +### \_approvalSourceMap + +• `Private` **\_approvalSourceMap**: `undefined` \| `SourceMap` + +#### Defined in + +[src/types/app-factory.ts:156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L156) + +___ + +### \_clearSourceMap + +• `Private` **\_clearSourceMap**: `undefined` \| `SourceMap` + +#### Defined in + +[src/types/app-factory.ts:157](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L157) + +___ + +### \_defaultSender + +• `Private` `Optional` **\_defaultSender**: `string` + +#### Defined in + +[src/types/app-factory.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L151) + +___ + +### \_deletable + +• `Private` `Optional` **\_deletable**: `boolean` + +#### Defined in + +[src/types/app-factory.ts:154](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L154) + +___ + +### \_deployTimeParams + +• `Private` `Optional` **\_deployTimeParams**: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) + +#### Defined in + +[src/types/app-factory.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L152) + +___ + +### \_paramsMethods + +• `Private` **\_paramsMethods**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bare` | \{ `create`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> ; `deployDelete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } ; `deployUpdate`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } } | - | +| `bare.create` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `bare.deployDelete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `bare.deployUpdate` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | +| `create` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `deployDelete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `deployUpdate` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | + +#### Defined in + +[src/types/app-factory.ts:159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L159) + +___ + +### \_updatable + +• `Private` `Optional` **\_updatable**: `boolean` + +#### Defined in + +[src/types/app-factory.ts:153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L153) + +___ + +### \_version + +• `Private` **\_version**: `string` + +#### Defined in + +[src/types/app-factory.ts:150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L150) + +## Accessors + +### params + +• `get` **params**(): `Object` + +Get parameters to define create and deploy related calls to the current app + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bare` | \{ `create`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> ; `deployDelete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } ; `deployUpdate`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } } | - | +| `bare.create` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `bare.deployDelete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `bare.deployUpdate` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | +| `create` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `deployDelete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `deployUpdate` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | + +#### Defined in + +[src/types/app-factory.ts:174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L174) + +## Methods + +### compile + +▸ **compile**(`compilation?`): `Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +Compiles the approval and clear state programs (if TEAL templates provided), +performing any provided deploy-time parameter replacement and stores +the source maps. + +If no TEAL templates provided it will use any byte code provided in the app spec. + +Will store any generated source maps for later use in debugging. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `compilation?` | [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) | + +#### Returns + +`Promise`\<\{ `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` } \| \{ `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) }\> + +#### Defined in + +[src/types/app-factory.ts:451](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L451) + +___ + +### create + +▸ **create**(`params?`): `Promise`\<\{ `app`: [`AppClient`](types_app_client.AppClient.md) ; `result`: \{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return`: `undefined` = undefined; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } }\> + +Creates an instance of the app and returns the result of the creation +transaction and an app client to interact with that app instance. + +Performs deploy-time TEAL template placeholder substitutions (if specified). + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params?` | [`AppFactoryCreateParams`](../modules/types_app_factory.md#appfactorycreateparams) | The parameters to create the app | + +#### Returns + +`Promise`\<\{ `app`: [`AppClient`](types_app_client.AppClient.md) ; `result`: \{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return`: `undefined` = undefined; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } }\> + +The app client and the result of the creation transaction + +#### Defined in + +[src/types/app-factory.ts:186](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L186) + +___ + +### deploy + +▸ **deploy**(`params`): `Promise`\<\{ `app`: [`AppClient`](types_app_client.AppClient.md) ; `result`: \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"create"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"create"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"update"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"update"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"replace"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"replace"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"nothing"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"nothing"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } }\> + +Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified). + +**Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`. + +**Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created. + +**Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The arguments to control the app deployment | +| `params.createParams?` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } | Create transaction parameters to use if a create needs to be issued as part of deployment | +| `params.deletable?` | `boolean` | Whether or not the contract should have deploy-time permanence control set. `undefined` = use AppFactory constructor value if set or base it on the app spec. | +| `params.deleteParams?` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } | Delete transaction parameters to use if a create needs to be issued as part of deployment | +| `params.deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string) | +| `params.existingDeployments?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup | +| `params.ignoreCache?` | `boolean` | Whether or not to ignore the app metadata cache and force a lookup, default: use the cache * | +| `params.maxRoundsToWaitForConfirmation?` | `number` | The number of rounds to wait for confirmation. By default until the latest lastValid has past. | +| `params.onSchemaBreak?` | [`OnSchemaBreak`](../enums/types_app.OnSchemaBreak.md) \| ``"replace"`` \| ``"fail"`` \| ``"append"`` | What action to perform if a schema break (storage schema or extra pages change) is detected: * `fail` - Fail the deployment (throw an error, **default**) * `replace` - Delete the old app and create a new one * `append` - Deploy a new app and leave the old one as is | +| `params.onUpdate?` | ``"replace"`` \| ``"fail"`` \| ``"append"`` \| [`OnUpdate`](../enums/types_app.OnUpdate.md) \| ``"update"`` | What action to perform if a TEAL code update is detected: * `fail` - Fail the deployment (throw an error, **default**) * `update` - Update the app with the new TEAL code * `replace` - Delete the old app and create a new one * `append` - Deploy a new app and leave the old one as is | +| `params.populateAppCallResources?` | `boolean` | Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. | +| `params.suppressLog?` | `boolean` | Whether to suppress log messages from transaction send, default: do not suppress. | +| `params.updatable?` | `boolean` | Whether or not the contract should have deploy-time immutability control set. `undefined` = use AppFactory constructor value if set or base it on the app spec. | +| `params.updateParams?` | \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } | Update transaction parameters to use if a create needs to be issued as part of deployment | + +#### Returns + +`Promise`\<\{ `app`: [`AppClient`](types_app_client.AppClient.md) ; `result`: \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"create"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"create"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"update"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"update"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear?`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"replace"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `groupId`: `string` ; `name`: `string` ; `operationPerformed`: ``"replace"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Buffer` ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"nothing"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } \| \{ `appAddress`: `string` ; `appId`: `bigint` ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `createdMetadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `createdRound`: `bigint` ; `deletable?`: `boolean` ; `deleteReturn`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `deleted`: `boolean` ; `name`: `string` ; `operationPerformed`: ``"nothing"`` ; `return`: `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) ; `updatable?`: `boolean` ; `updatedRound`: `bigint` ; `version`: `string` } }\> + +The app client and the result of the deployment + +#### Defined in + +[src/types/app-factory.ts:224](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L224) + +___ + +### exportSourceMaps + +▸ **exportSourceMaps**(): [`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) + +Export the current source maps for the app. + +#### Returns + +[`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) + +The source maps + +#### Defined in + +[src/types/app-factory.ts:340](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L340) + +___ + +### exposeLogicError + +▸ **exposeLogicError**(`e`, `isClearStateProgram?`): `Error` + +Takes an error that may include a logic error from a call to the current app and re-exposes the +error to include source code information via the source map and ARC-56 spec. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `e` | `Error` | The error to parse | +| `isClearStateProgram?` | `boolean` | Whether or not the code was running the clear state program (defaults to approval program) | + +#### Returns + +`Error` + +The new error, or if there was no logic error or source map then the wrapped error with source details + +#### Defined in + +[src/types/app-factory.ts:328](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L328) + +___ + +### getABIParams + +▸ **getABIParams**\<`TParams`, `TOnComplete`\>(`params`, `onComplete`): `TParams` & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TParams` | extends `Object` | +| `TOnComplete` | extends `OnApplicationComplete` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `TParams` | +| `onComplete` | `TOnComplete` | + +#### Returns + +`TParams` & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Defined in + +[src/types/app-factory.ts:475](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L475) + +___ + +### getAppClientByCreatorAddressAndName + +▸ **getAppClientByCreatorAddressAndName**(`params`): `Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +Returns a new `AppClient` client, resolving the app by creator address and name +using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). + +Automatically populates appName, defaultSender and source maps from the factory +if not specified in the params. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters to create the app client | +| `params.algorand` | [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) | An `AlgorandClient` instance | +| `params.appLookupCache?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | An optional cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this `ClientManager` on construction. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.creatorAddress` | `string` | The address of the creator account for the app | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.ignoreCache?` | `boolean` | Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value | + +#### Returns + +`Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +The `AppClient` + +#### Defined in + +[src/types/app-factory.ts:307](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L307) + +___ + +### getAppClientById + +▸ **getAppClientById**(`params`): [`AppClient`](types_app_client.AppClient.md) + +Returns a new `AppClient` client for an app instance of the given ID. + +Automatically populates appName, defaultSender and source maps from the factory +if not specified in the params. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters to create the app client | +| `params.appId` | `bigint` | The ID of the app instance this client should make calls against. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | + +#### Returns + +[`AppClient`](types_app_client.AppClient.md) + +The `AppClient` + +#### Defined in + +[src/types/app-factory.ts:286](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L286) + +___ + +### getBareParams + +▸ **getBareParams**\<`TParams`, `TOnComplete`\>(`params`, `onComplete`): `TParams` & \{ `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TParams` | extends `undefined` \| \{ `sender?`: `string` } | +| `TOnComplete` | extends `OnApplicationComplete` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `TParams` | +| `onComplete` | `TOnComplete` | + +#### Returns + +`TParams` & \{ `onComplete`: `TOnComplete` ; `sender`: `string` } + +#### Defined in + +[src/types/app-factory.ts:464](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L464) + +___ + +### getDeployTimeControl + +▸ **getDeployTimeControl**(`control`): `undefined` \| `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `control` | ``"deletable"`` \| ``"updatable"`` | + +#### Returns + +`undefined` \| `boolean` + +#### Defined in + +[src/types/app-factory.ts:362](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L362) + +___ + +### getParamsMethods + +▸ **getParamsMethods**(): `Object` + +#### Returns + +`Object` + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bare` | \{ `create`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> ; `deployDelete`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } ; `deployUpdate`: (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } } | - | +| `bare.create` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `bare.deployDelete` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `bare.deployUpdate` | (`params?`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | +| `create` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `deletable?`: `boolean` ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` }) => `Promise`\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Buffer` ; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Buffer` ; `compiledApproval`: `undefined` ; `compiledClear`: `undefined` ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `Uint8Array` = compiledApproval.compiledBase64ToBytes; `args?`: ABIValue \| AppMethodCallTransactionArgument \| ABIStruct \| undefined[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `Uint8Array` = compiledClear.compiledBase64ToBytes; `compiledApproval`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `compiledClear`: [`CompiledTeal`](../interfaces/types_app.CompiledTeal.md) ; `deletable?`: `boolean` ; `deployTimeParams`: `undefined` \| [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `updatable?`: `boolean` ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| Transaction \| ABIValue \| TransactionWithSigner \| Promise\ \| AppMethodCall\<\{ lease?: string \| Uint8Array \| undefined; ... 19 more ...; extraProgramPages?: number \| undefined; }\> \| AppMethodCall\<...\> \| AppMethodCall\<...\>[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `sender`: `string` }\> | - | +| `deployDelete` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `DeleteApplicationOC` ; `sender`: `string` } | - | +| `deployUpdate` | (`params`: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }) => \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`undefined` \| `ABIValue` \| [`AppMethodCallTransactionArgument`](../modules/types_composer.md#appmethodcalltransactionargument) \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct))[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `method`: `string` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `OnApplicationComplete` ; `rekeyTo?`: `string` ; `sender?`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } & \{ `args`: `undefined` \| (`Transaction` \| `ABIValue` \| `TransactionWithSigner` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: ... ; `globalInts`: ... ; `localByteSlices`: ... ; `localInts`: ... } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: ...[] ; `appId`: `bigint` ; `appReferences?`: ...[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: ...[] ; `assetReferences?`: ...[] ; `boxReferences?`: ...[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppMethodCallParams`](../modules/types_composer.md#appmethodcallparams)\>)[] ; `method`: [`Arc56Method`](types_app_arc56.Arc56Method.md) ; `onComplete`: `UpdateApplicationOC` ; `sender`: `string` } | - | + +#### Defined in + +[src/types/app-factory.ts:376](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L376) + +___ + +### getSender + +▸ **getSender**(`sender`): `string` + +Returns the sender for a call, using the `defaultSender` +if none provided and throws an error if neither provided + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `sender` | `undefined` \| `string` | + +#### Returns + +`string` + +#### Defined in + +[src/types/app-factory.ts:490](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L490) + +___ + +### handleCallErrors + +▸ **handleCallErrors**\<`TResult`\>(`call`): `Promise`\<`TResult`\> + +Make the given call and catch any errors, augmenting with debugging information before re-throwing. + +#### Type parameters + +| Name | +| :------ | +| `TResult` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `call` | () => `Promise`\<`TResult`\> | + +#### Returns + +`Promise`\<`TResult`\> + +#### Defined in + +[src/types/app-factory.ts:434](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L434) + +___ + +### importSourceMaps + +▸ **importSourceMaps**(`sourceMaps`): `void` + +Import source maps for the app. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `sourceMaps` | [`AppSourceMaps`](../interfaces/types_app_client.AppSourceMaps.md) | The source maps to import | + +#### Returns + +`void` + +#### Defined in + +[src/types/app-factory.ts:357](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L357) + +___ + +### parseMethodCallReturn + +▸ **parseMethodCallReturn**\<`TReturn`, `TResult`\>(`result`, `method`): `Promise`\<[`Expand`](../modules/types_expand.md#expand)\<`Omit`\<`TResult`, ``"return"``\> & [`AppReturn`](../modules/types_app.md#appreturn)\<`TReturn`\>\>\> + +Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type +on the ARC-56 method. + +If the return type is a struct then the struct will be returned. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TReturn` | extends `undefined` \| `ABIValue` \| [`ABIStruct`](../modules/types_app_arc56.md#abistruct) | +| `TResult` | extends `Object` = \{ `confirmation`: `PendingTransactionResponse` ; `confirmations`: `PendingTransactionResponse`[] ; `groupId`: `string` ; `return?`: [`ABIReturn`](../modules/types_app.md#abireturn) ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: `Transaction` ; `transactions`: `Transaction`[] ; `txIds`: `string`[] } | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `result` | `TResult` \| `Promise`\<`TResult`\> | The SendAppTransactionResult to be mapped | +| `method` | [`Arc56Method`](types_app_arc56.Arc56Method.md) | The method that was called | + +#### Returns + +`Promise`\<[`Expand`](../modules/types_expand.md#expand)\<`Omit`\<`TResult`, ``"return"``\> & [`AppReturn`](../modules/types_app.md#appreturn)\<`TReturn`\>\>\> + +The smart contract response with an updated return value + +#### Defined in + +[src/types/app-factory.ts:507](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L507) diff --git a/docs/code/classes/types_app_manager.AppManager.md b/docs/code/classes/types_app_manager.AppManager.md index f7ff5808..acd4d38d 100644 --- a/docs/code/classes/types_app_manager.AppManager.md +++ b/docs/code/classes/types_app_manager.AppManager.md @@ -28,6 +28,7 @@ Allows management of application information. - [getBoxValuesFromABIType](types_app_manager.AppManager.md#getboxvaluesfromabitype) - [getById](types_app_manager.AppManager.md#getbyid) - [getCompilationResult](types_app_manager.AppManager.md#getcompilationresult) +- [getGlobalState](types_app_manager.AppManager.md#getglobalstate) - [getLocalState](types_app_manager.AppManager.md#getlocalstate) - [decodeAppState](types_app_manager.AppManager.md#decodeappstate) - [getABIReturn](types_app_manager.AppManager.md#getabireturn) @@ -56,7 +57,7 @@ Creates an `AppManager` #### Defined in -[src/types/app-manager.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L106) +[src/types/app-manager.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L105) ## Properties @@ -66,7 +67,7 @@ Creates an `AppManager` #### Defined in -[src/types/app-manager.ts:99](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L99) +[src/types/app-manager.ts:98](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L98) ___ @@ -76,7 +77,7 @@ ___ #### Defined in -[src/types/app-manager.ts:100](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L100) +[src/types/app-manager.ts:99](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L99) ## Methods @@ -105,7 +106,7 @@ The information about the compiled file #### Defined in -[src/types/app-manager.ts:121](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L121) +[src/types/app-manager.ts:120](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L120) ___ @@ -127,7 +128,9 @@ if deployment metadata is specified. | :------ | :------ | :------ | | `tealTemplateCode` | `string` | The TEAL logic to compile | | `templateParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Any parameters to replace in the .teal file before compiling | -| `deploymentMetadata?` | [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) | The deployment metadata the app will be deployed with | +| `deploymentMetadata?` | `Object` | The deployment metadata the app will be deployed with | +| `deploymentMetadata.deletable?` | `boolean` | - | +| `deploymentMetadata.updatable?` | `boolean` | - | #### Returns @@ -161,7 +164,7 @@ The current box names #### Defined in -[src/types/app-manager.ts:230](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L230) +[src/types/app-manager.ts:240](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L240) ___ @@ -186,7 +189,7 @@ The current box value as a byte array #### Defined in -[src/types/app-manager.ts:247](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L247) +[src/types/app-manager.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L257) ___ @@ -210,7 +213,7 @@ The current box value as an ABI value #### Defined in -[src/types/app-manager.ts:268](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L268) +[src/types/app-manager.ts:278](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L278) ___ @@ -235,7 +238,7 @@ The current box values as a byte array in the same order as the passed in box na #### Defined in -[src/types/app-manager.ts:259](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L259) +[src/types/app-manager.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L269) ___ @@ -259,7 +262,7 @@ The current box values as an ABI value in the same order as the passed in box na #### Defined in -[src/types/app-manager.ts:279](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L279) +[src/types/app-manager.ts:289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L289) ___ @@ -318,6 +321,30 @@ The information about the previously compiled file ___ +### getGlobalState + +▸ **getGlobalState**(`appId`): `Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +Returns the current global state values for the given app ID and account address + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `appId` | `bigint` | The ID of the app to return global state for | + +#### Returns + +`Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> + +The current global state for the given app + +#### Defined in + +[src/types/app-manager.ts:212](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L212) + +___ + ### getLocalState ▸ **getLocalState**(`appId`, `address`): `Promise`\<[`AppState`](../interfaces/types_app.AppState.md)\> @@ -339,7 +366,7 @@ The current local state for the given (app, account) combination #### Defined in -[src/types/app-manager.ts:213](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L213) +[src/types/app-manager.ts:223](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L223) ___ @@ -364,7 +391,7 @@ An object keyeed by the UTF-8 representation of the key with various parsings of #### Defined in -[src/types/app-manager.ts:308](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L308) +[src/types/app-manager.ts:318](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L318) ___ @@ -389,7 +416,7 @@ The return value for the method call #### Defined in -[src/types/app-manager.ts:356](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L356) +[src/types/app-manager.ts:366](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L366) ___ @@ -413,7 +440,7 @@ The box reference ready to pass into a `algosdk.Transaction` #### Defined in -[src/types/app-manager.ts:289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L289) +[src/types/app-manager.ts:299](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L299) ___ @@ -446,7 +473,7 @@ The replaced TEAL code #### Defined in -[src/types/app-manager.ts:398](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L398) +[src/types/app-manager.ts:408](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L408) ___ @@ -473,7 +500,7 @@ The TEAL code with replacements #### Defined in -[src/types/app-manager.ts:429](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L429) +[src/types/app-manager.ts:439](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L439) ___ @@ -497,4 +524,4 @@ The TEAL without comments #### Defined in -[src/types/app-manager.ts:463](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L463) +[src/types/app-manager.ts:473](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L473) diff --git a/docs/code/classes/types_asset_manager.AssetManager.md b/docs/code/classes/types_asset_manager.AssetManager.md index 7a2a062a..9e14cb5d 100644 --- a/docs/code/classes/types_asset_manager.AssetManager.md +++ b/docs/code/classes/types_asset_manager.AssetManager.md @@ -51,7 +51,7 @@ const assetManager = new AssetManager(algod, () => new AlgoKitComposer({algod, ( #### Defined in -[src/types/asset-manager.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L151) +[src/types/asset-manager.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L152) ## Properties @@ -61,7 +61,7 @@ const assetManager = new AssetManager(algod, () => new AlgoKitComposer({algod, ( #### Defined in -[src/types/asset-manager.ts:139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L139) +[src/types/asset-manager.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L140) ___ @@ -79,7 +79,7 @@ ___ #### Defined in -[src/types/asset-manager.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L140) +[src/types/asset-manager.ts:141](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L141) ## Methods @@ -97,7 +97,7 @@ Transactions will be sent in batches of 16 as transaction groups. | :------ | :------ | :------ | | `account` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to opt-in | | `assetIds` | `bigint`[] | The list of asset IDs to opt-in to | -| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | Any parameters to control the transaction or execution of the transaction | +| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | Any parameters to control the transaction or execution of the transaction | #### Returns @@ -116,7 +116,7 @@ algorand.asset.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).mi #### Defined in -[src/types/asset-manager.ts:233](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L233) +[src/types/asset-manager.ts:234](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L234) ___ @@ -134,7 +134,7 @@ Transactions will be sent in batches of 16 as transaction groups. | :------ | :------ | :------ | | `account` | `string` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The account to opt-in | | `assetIds` | `bigint`[] | The list of asset IDs to opt-out of | -| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) & \{ `ensureZeroBalance?`: `boolean` } | Any parameters to control the transaction or execution of the transaction | +| `options?` | `Omit`\<[`CommonTransactionParams`](../modules/types_composer.md#commontransactionparams), ``"sender"``\> & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & \{ `ensureZeroBalance?`: `boolean` } | Any parameters to control the transaction or execution of the transaction | #### Returns @@ -153,7 +153,7 @@ algorand.asset.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalanc #### Defined in -[src/types/asset-manager.ts:283](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L283) +[src/types/asset-manager.ts:284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L284) ___ @@ -188,7 +188,7 @@ const accountInfo = await algorand.asset.getAccountInformation(address, assetId) #### Defined in -[src/types/asset-manager.ts:205](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L205) +[src/types/asset-manager.ts:206](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L206) ___ @@ -218,4 +218,4 @@ const assetInfo = await assetManager.getById(12353n); #### Defined in -[src/types/asset-manager.ts:167](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L167) +[src/types/asset-manager.ts:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L168) diff --git a/docs/code/classes/types_client_manager.ClientManager.md b/docs/code/classes/types_client_manager.ClientManager.md index 0303b1d4..a27b280a 100644 --- a/docs/code/classes/types_client_manager.ClientManager.md +++ b/docs/code/classes/types_client_manager.ClientManager.md @@ -15,6 +15,7 @@ Exposes access to various API clients. ### Properties - [\_algod](types_client_manager.ClientManager.md#_algod) +- [\_algorand](types_client_manager.ClientManager.md#_algorand) - [\_getNetworkPromise](types_client_manager.ClientManager.md#_getnetworkpromise) - [\_indexer](types_client_manager.ClientManager.md#_indexer) - [\_kmd](types_client_manager.ClientManager.md#_kmd) @@ -30,10 +31,14 @@ Exposes access to various API clients. - [getAppClientByCreatorAndName](types_client_manager.ClientManager.md#getappclientbycreatorandname) - [getAppClientById](types_client_manager.ClientManager.md#getappclientbyid) +- [getAppClientByNetwork](types_client_manager.ClientManager.md#getappclientbynetwork) +- [getAppFactory](types_client_manager.ClientManager.md#getappfactory) - [getTestNetDispenser](types_client_manager.ClientManager.md#gettestnetdispenser) - [getTestNetDispenserFromEnvironment](types_client_manager.ClientManager.md#gettestnetdispenserfromenvironment) - [getTypedAppClientByCreatorAndName](types_client_manager.ClientManager.md#gettypedappclientbycreatorandname) - [getTypedAppClientById](types_client_manager.ClientManager.md#gettypedappclientbyid) +- [getTypedAppClientByNetwork](types_client_manager.ClientManager.md#gettypedappclientbynetwork) +- [getTypedAppFactory](types_client_manager.ClientManager.md#gettypedappfactory) - [isLocalNet](types_client_manager.ClientManager.md#islocalnet) - [isMainNet](types_client_manager.ClientManager.md#ismainnet) - [isTestNet](types_client_manager.ClientManager.md#istestnet) @@ -55,7 +60,7 @@ Exposes access to various API clients. ### constructor -• **new ClientManager**(`clientsOrConfig`): [`ClientManager`](types_client_manager.ClientManager.md) +• **new ClientManager**(`clientsOrConfig`, `algorandClient?`): [`ClientManager`](types_client_manager.ClientManager.md) algosdk clients or config for interacting with the official Algorand APIs. @@ -64,6 +69,7 @@ algosdk clients or config for interacting with the official Algorand APIs. | Name | Type | Description | | :------ | :------ | :------ | | `clientsOrConfig` | [`AlgoConfig`](../interfaces/types_network_client.AlgoConfig.md) \| [`AlgoSdkClients`](../interfaces/types_client_manager.AlgoSdkClients.md) | The clients or config to use | +| `algorandClient?` | [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) | - | #### Returns @@ -95,7 +101,7 @@ const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig #### Defined in -[src/types/client-manager.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L70) +[src/types/client-manager.ts:52](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L52) ## Properties @@ -105,7 +111,17 @@ const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig #### Defined in -[src/types/client-manager.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L46) +[src/types/client-manager.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L27) + +___ + +### \_algorand + +• `Private` `Optional` **\_algorand**: [`AlgorandClientInterface`](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) + +#### Defined in + +[src/types/client-manager.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L30) ___ @@ -115,7 +131,7 @@ ___ #### Defined in -[src/types/client-manager.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L106) +[src/types/client-manager.ts:89](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L89) ___ @@ -125,7 +141,7 @@ ___ #### Defined in -[src/types/client-manager.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L47) +[src/types/client-manager.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L28) ___ @@ -135,7 +151,7 @@ ___ #### Defined in -[src/types/client-manager.ts:48](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L48) +[src/types/client-manager.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L29) ## Accessors @@ -151,7 +167,7 @@ Returns an algosdk Algod API client. #### Defined in -[src/types/client-manager.ts:85](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L85) +[src/types/client-manager.ts:68](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L68) ___ @@ -167,7 +183,7 @@ Returns an algosdk Indexer API client or throws an error if it's not been provid #### Defined in -[src/types/client-manager.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L90) +[src/types/client-manager.ts:73](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L73) ___ @@ -183,7 +199,7 @@ Returns an algosdk Indexer API client or `undefined` if it's not been provided. #### Defined in -[src/types/client-manager.ts:96](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L96) +[src/types/client-manager.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L79) ___ @@ -199,56 +215,186 @@ Returns an algosdk KMD API client or throws an error if it's not been provided. #### Defined in -[src/types/client-manager.ts:101](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L101) +[src/types/client-manager.ts:84](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L84) ## Methods ### getAppClientByCreatorAndName -▸ **getAppClientByCreatorAndName**(`details`, `cachedAppLookup?`): [`ApplicationClient`](types_app_client.ApplicationClient.md) +▸ **getAppClientByCreatorAndName**(`params`): `Promise`\<[`AppClient`](types_app_client.AppClient.md)\> -Returns a new `ApplicationClient` client, resolving the app by creator address and name. +Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app. +This method resolves the app ID by looking up the creator address and name +using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `details` | [`AppClientByCreatorAndNameDetails`](../modules/types_client_manager.md#appclientbycreatorandnamedetails) | The details to resolve the app by creator address and name | -| `cachedAppLookup?` | [`AppLookup`](../interfaces/types_app.AppLookup.md) | A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction. | +| `params` | `Object` | The parameters to create the app client | +| `params.appLookupCache?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | An optional cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this `ClientManager` on construction. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.creatorAddress` | `string` | The address of the creator account for the app | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.ignoreCache?` | `boolean` | Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value | #### Returns -[`ApplicationClient`](types_app_client.ApplicationClient.md) +`Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +The `AppClient` + +**`Example`** -The `ApplicationClient` +```ts +Basic +const appClient = algorand.client.getAppClientByCreatorAndName({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON *}', + // appId resolved by looking for app ID of named app by this creator + creatorAddress: 'CREATORADDRESS', +}) +``` #### Defined in -[src/types/client-manager.ts:209](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L209) +[src/types/client-manager.ts:228](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L228) ___ ### getAppClientById -▸ **getAppClientById**(`details`): [`ApplicationClient`](types_app_client.ApplicationClient.md) +▸ **getAppClientById**(`params`): [`AppClient`](types_app_client.AppClient.md) -Returns a new `ApplicationClient` client, resolving the app by app ID. +Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app. #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `details` | [`AppClientByIdDetails`](../modules/types_client_manager.md#appclientbyiddetails) | The details to resolve the app by ID | +| `params` | `Object` | The parameters to create the app client | +| `params.appId` | `bigint` | The ID of the app instance this client should make calls against. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | #### Returns -[`ApplicationClient`](types_app_client.ApplicationClient.md) +[`AppClient`](types_app_client.AppClient.md) + +The `AppClient` -The `ApplicationClient` +**`Example`** + +```ts +Basic +const appClient = algorand.client.getAppClientById({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON *}', + appId: 12345n, +}) +``` + +#### Defined in + +[src/types/client-manager.ts:249](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L249) + +___ + +### getAppClientByNetwork + +▸ **getAppClientByNetwork**(`params`): `Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +Returns a new `AppClient` client for managing calls and state for an ARC-56 app. +This method resolves the app ID for the current network based on +pre-determined network-specific app IDs specified in the ARC-56 app spec. + +If no IDs are in the app spec or the network isn't recognised, an error is thrown. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | The parameters to create the app client | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | + +#### Returns + +`Promise`\<[`AppClient`](types_app_client.AppClient.md)\> + +The `AppClient` + +**`Example`** + +```ts +Basic +const appClient = algorand.client.getAppClientByNetwork({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON *}', + // appId resolved by using ARC-56 spec to find app ID for current network +}) +``` + +#### Defined in + +[src/types/client-manager.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L270) + +___ + +### getAppFactory + +▸ **getAppFactory**(`params`): [`AppFactory`](types_app_factory.AppFactory.md) + +Returns a new `AppFactory` client + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `params` | `Object` | - | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name. | +| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.deletable?` | `boolean` | Whether or not the contract should have deploy-time permanence control set, undefined = ignore. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optional deploy-time TEAL template replacement parameters. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.updatable?` | `boolean` | Whether or not the contract should have deploy-time immutability control set, undefined = ignore. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.version?` | `string` | The version of app that is / will be deployed; defaults to 1.0 | + +#### Returns + +[`AppFactory`](types_app_factory.AppFactory.md) + +**`Example`** + +```typescript +const factory = algorand.client.getAppFactory({ + appSpec: '{/* ARC-56 or ARC-32 compatible JSON */}', +}) +``` + +**`Example`** + +```typescript +const factory = algorand.client.getAppFactory({ + appSpec: parsedAppSpec_AppSpec_or_Arc56Contract, + defaultSender: "SENDERADDRESS", + appName: "OverriddenAppName", + version: "2.0.0", + updatable: true, + deletable: false, + deployTimeParams: { ONE: 1, TWO: 'value' } +}) +``` #### Defined in -[src/types/client-manager.ts:221](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L221) +[src/types/client-manager.ts:207](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L207) ___ @@ -285,7 +431,7 @@ const client = clientManager.getTestNetDispenser( #### Defined in -[src/types/client-manager.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L180) +[src/types/client-manager.ts:163](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L163) ___ @@ -321,33 +467,39 @@ const client = clientManager.getTestNetDispenserFromEnvironment( #### Defined in -[src/types/client-manager.ts:199](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L199) +[src/types/client-manager.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L182) ___ ### getTypedAppClientByCreatorAndName -▸ **getTypedAppClientByCreatorAndName**\<`TClient`\>(`typedClient`, `details`, `cachedAppLookup?`): `TClient` +▸ **getTypedAppClientByCreatorAndName**\<`TClient`\>(`typedClient`, `params`): `Promise`\<`InstanceType`\<`TClient`\>\> Returns a new typed client, resolving the app by creator address and name. #### Type parameters -| Name | -| :------ | -| `TClient` | +| Name | Type | +| :------ | :------ | +| `TClient` | extends [`TypedAppClient`](../interfaces/types_client_manager.TypedAppClient.md)\<`InstanceType`\<`TClient`\>\> | #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `typedClient` | [`TypedAppClient`](../interfaces/types_client_manager.TypedAppClient.md)\<`TClient`\> | The typed client type to use | -| `details` | [`TypedAppClientByCreatorAndNameDetails`](../modules/types_client_manager.md#typedappclientbycreatorandnamedetails) | The details to resolve the app by creator address and name | -| `cachedAppLookup?` | [`AppLookup`](../interfaces/types_app.AppLookup.md) | A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction. | +| `typedClient` | `TClient` | The typed client type to use | +| `params` | `Object` | The params to resolve the app by creator address and name | +| `params.appLookupCache?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | An optional cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this `ClientManager` on construction. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.creatorAddress` | `string` | The address of the creator account for the app | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.ignoreCache?` | `boolean` | Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value | #### Returns -`TClient` +`Promise`\<`InstanceType`\<`TClient`\>\> The typed client instance @@ -356,7 +508,7 @@ The typed client instance ```typescript const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, { creatorAddress: "CREATORADDRESS", - sender: alice, + defaultSender: alice, }) ``` @@ -366,24 +518,115 @@ const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractCl const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, { creatorAddress: "CREATORADDRESS", name: "contract-name", - sender: alice, + defaultSender: alice, }) ``` #### Defined in -[src/types/client-manager.ts:247](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L247) +[src/types/client-manager.ts:298](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L298) ___ ### getTypedAppClientById -▸ **getTypedAppClientById**\<`TClient`\>(`typedClient`, `details`): `TClient` +▸ **getTypedAppClientById**\<`TClient`\>(`typedClient`, `params`): `InstanceType`\<`TClient`\> Returns a new typed client, resolving the app by app ID. #### Type parameters +| Name | Type | +| :------ | :------ | +| `TClient` | extends [`TypedAppClient`](../interfaces/types_client_manager.TypedAppClient.md)\<`InstanceType`\<`TClient`\>\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `typedClient` | `TClient` | The typed client type to use | +| `params` | `Object` | The params to resolve the app by ID | +| `params.appId` | `bigint` | The ID of the app instance this client should make calls against. | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | + +#### Returns + +`InstanceType`\<`TClient`\> + +The typed client instance + +**`Example`** + +```typescript +const appClient = algorand.client.getTypedAppClientById(MyContractClient, { + appId: 12345n, + defaultSender: alice, +}) +``` + +#### Defined in + +[src/types/client-manager.ts:322](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L322) + +___ + +### getTypedAppClientByNetwork + +▸ **getTypedAppClientByNetwork**\<`TClient`\>(`typedClient`, `params?`): `Promise`\<`InstanceType`\<`TClient`\>\> + +Returns a new typed client, resolves the app ID for the current network based on +pre-determined network-specific app IDs specified in the ARC-56 app spec. + +If no IDs are in the app spec or the network isn't recognised, an error is thrown. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TClient` | extends [`TypedAppClient`](../interfaces/types_client_manager.TypedAppClient.md)\<`InstanceType`\<`TClient`\>\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `typedClient` | `TClient` | The typed client type to use | +| `params?` | `Object` | The params to resolve the app by network | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name | +| `params.approvalSourceMap?` | `SourceMap` | Optional source map for the approval program | +| `params.clearSourceMap?` | `SourceMap` | Optional source map for the clear state program | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | + +#### Returns + +`Promise`\<`InstanceType`\<`TClient`\>\> + +The typed client instance + +**`Example`** + +```typescript +const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, { + defaultSender: alice, +}) +``` + +#### Defined in + +[src/types/client-manager.ts:348](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L348) + +___ + +### getTypedAppFactory + +▸ **getTypedAppFactory**\<`TClient`\>(`typedFactory`, `params?`): `TClient` + +Returns a new typed app factory. + +#### Type parameters + | Name | | :------ | | `TClient` | @@ -392,8 +635,14 @@ Returns a new typed client, resolving the app by app ID. | Name | Type | Description | | :------ | :------ | :------ | -| `typedClient` | [`TypedAppClient`](../interfaces/types_client_manager.TypedAppClient.md)\<`TClient`\> | The typed client type to use | -| `details` | [`TypedAppClientByIdDetails`](../modules/types_client_manager.md#typedappclientbyiddetails) | The details to resolve the app by ID | +| `typedFactory` | [`TypedAppFactory`](../interfaces/types_client_manager.TypedAppFactory.md)\<`TClient`\> | The typed factory type to use | +| `params?` | `Object` | The params to resolve the factory by | +| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name. | +| `params.defaultSender?` | `string` | Optional address to use for the account to use as the default sender for calls. | +| `params.deletable?` | `boolean` | Whether or not the contract should have deploy-time permanence control set, undefined = ignore. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optional deploy-time TEAL template replacement parameters. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.updatable?` | `boolean` | Whether or not the contract should have deploy-time immutability control set, undefined = ignore. If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. Useful if you want to vend multiple contracts from the same factory without specifying this value for each call. | +| `params.version?` | `string` | The version of app that is / will be deployed; defaults to 1.0 | #### Returns @@ -404,15 +653,14 @@ The typed client instance **`Example`** ```typescript -const appClient = algorand.client.getTypedAppClientById(MyContractClient, { - id: 12345, +const appFactory = algorand.client.getTypedAppFactory(MyContractClient, { sender: alice, }) ``` #### Defined in -[src/types/client-manager.ts:268](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L268) +[src/types/client-manager.ts:371](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L371) ___ @@ -430,7 +678,7 @@ True if the current network is LocalNet. #### Defined in -[src/types/client-manager.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L144) +[src/types/client-manager.ts:127](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L127) ___ @@ -448,7 +696,7 @@ True if the current network is MainNet. #### Defined in -[src/types/client-manager.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L160) +[src/types/client-manager.ts:143](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L143) ___ @@ -466,19 +714,19 @@ True if the current network is TestNet. #### Defined in -[src/types/client-manager.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L152) +[src/types/client-manager.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L135) ___ ### network -▸ **network**(): `Promise`\<[`NetworkDetails`](../interfaces/types_client_manager.NetworkDetails.md)\> +▸ **network**(): `Promise`\<[`NetworkDetails`](../interfaces/types_network_client.NetworkDetails.md)\> Get details about the current network. #### Returns -`Promise`\<[`NetworkDetails`](../interfaces/types_client_manager.NetworkDetails.md)\> +`Promise`\<[`NetworkDetails`](../interfaces/types_network_client.NetworkDetails.md)\> The current network details @@ -491,7 +739,7 @@ const genesisId = network.genesisId #### Defined in -[src/types/client-manager.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L116) +[src/types/client-manager.ts:99](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L99) ___ @@ -515,7 +763,7 @@ Whether the given genesis ID is associated with a LocalNet network #### Defined in -[src/types/client-manager.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L136) +[src/types/client-manager.ts:119](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L119) ___ @@ -538,7 +786,7 @@ Returns the Algorand configuration to point to the free tier of the AlgoNode ser #### Defined in -[src/types/client-manager.ts:360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L360) +[src/types/client-manager.ts:470](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L470) ___ @@ -581,7 +829,7 @@ Returns an algod SDK client that automatically retries on idempotent calls. #### Defined in -[src/types/client-manager.ts:399](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L399) +[src/types/client-manager.ts:509](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L509) ___ @@ -605,7 +853,7 @@ Returns an algod SDK client that automatically retries on idempotent calls loade #### Defined in -[src/types/client-manager.ts:416](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L416) +[src/types/client-manager.ts:526](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L526) ___ @@ -623,7 +871,7 @@ Expects `process.env.ALGOD_SERVER` to be defined, and you can also specify `proc #### Defined in -[src/types/client-manager.ts:318](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L318) +[src/types/client-manager.ts:428](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L428) ___ @@ -656,7 +904,7 @@ const config = ClientManager.getConfigFromEnvironmentOrLocalNet() #### Defined in -[src/types/client-manager.ts:289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L289) +[src/types/client-manager.ts:399](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L399) ___ @@ -678,7 +926,7 @@ Returns the Algorand configuration to point to the default LocalNet. #### Defined in -[src/types/client-manager.ts:371](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L371) +[src/types/client-manager.ts:481](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L481) ___ @@ -728,7 +976,7 @@ Returns an indexer SDK client that automatically retries on idempotent calls #### Defined in -[src/types/client-manager.ts:445](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L445) +[src/types/client-manager.ts:555](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L555) ___ @@ -758,7 +1006,7 @@ Returns an indexer SDK client that automatically retries on idempotent calls loa #### Defined in -[src/types/client-manager.ts:467](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L467) +[src/types/client-manager.ts:577](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L577) ___ @@ -776,7 +1024,7 @@ Expects `process.env.INDEXER_SERVER` to be defined, and you can also specify `pr #### Defined in -[src/types/client-manager.ts:339](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L339) +[src/types/client-manager.ts:449](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L449) ___ @@ -806,7 +1054,7 @@ KMD client allows you to export private keys, which is useful to (for instance) #### Defined in -[src/types/client-manager.ts:482](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L482) +[src/types/client-manager.ts:592](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L592) ___ @@ -829,4 +1077,4 @@ Returns a KMD SDK client that automatically retries on idempotent calls loaded f #### Defined in -[src/types/client-manager.ts:496](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L496) +[src/types/client-manager.ts:606](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L606) diff --git a/docs/code/classes/types_composer.default.md b/docs/code/classes/types_composer.default.md index 55712539..c60bb5ea 100644 --- a/docs/code/classes/types_composer.default.md +++ b/docs/code/classes/types_composer.default.md @@ -45,6 +45,7 @@ AlgoKit Composer helps you compose and execute transactions as a transaction gro - [addAtc](types_composer.default.md#addatc) - [addOnlineKeyRegistration](types_composer.default.md#addonlinekeyregistration) - [addPayment](types_composer.default.md#addpayment) +- [addTransaction](types_composer.default.md#addtransaction) - [build](types_composer.default.md#build) - [buildAppCall](types_composer.default.md#buildappcall) - [buildAssetConfig](types_composer.default.md#buildassetconfig) @@ -63,6 +64,7 @@ AlgoKit Composer helps you compose and execute transactions as a transaction gro - [count](types_composer.default.md#count) - [execute](types_composer.default.md#execute) - [rebuild](types_composer.default.md#rebuild) +- [simulate](types_composer.default.md#simulate) - [arc2Note](types_composer.default.md#arc2note) ## Constructors @@ -85,7 +87,7 @@ Create an `AlgoKitComposer`. #### Defined in -[src/types/composer.ts:495](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L495) +[src/types/composer.ts:513](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L513) ## Properties @@ -97,7 +99,7 @@ The algod client used by the composer. #### Defined in -[src/types/composer.ts:475](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L475) +[src/types/composer.ts:493](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L493) ___ @@ -107,7 +109,7 @@ ___ #### Defined in -[src/types/composer.ts:489](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L489) +[src/types/composer.ts:507](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L507) ___ @@ -119,7 +121,7 @@ The ATC used to compose the group #### Defined in -[src/types/composer.ts:466](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L466) +[src/types/composer.ts:484](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L484) ___ @@ -131,7 +133,7 @@ The default transaction validity window #### Defined in -[src/types/composer.ts:484](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L484) +[src/types/composer.ts:502](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L502) ___ @@ -143,7 +145,7 @@ Whether the validity window was explicitly set on construction #### Defined in -[src/types/composer.ts:487](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L487) +[src/types/composer.ts:505](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L505) ___ @@ -169,7 +171,7 @@ A function that takes in an address and return a signer function for that addres #### Defined in -[src/types/composer.ts:481](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L481) +[src/types/composer.ts:499](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L499) ___ @@ -189,7 +191,7 @@ An async function that will return suggested params for the transaction. #### Defined in -[src/types/composer.ts:478](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L478) +[src/types/composer.ts:496](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L496) ___ @@ -201,7 +203,7 @@ Map of txid to ABI method #### Defined in -[src/types/composer.ts:469](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L469) +[src/types/composer.ts:487](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L487) ___ @@ -213,7 +215,7 @@ Transactions that have not yet been composed #### Defined in -[src/types/composer.ts:472](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L472) +[src/types/composer.ts:490](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L490) ___ @@ -225,7 +227,7 @@ Signer used to represent a lack of signer #### Defined in -[src/types/composer.ts:463](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L463) +[src/types/composer.ts:481](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L481) ## Methods @@ -253,7 +255,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:641](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L641) +[src/types/composer.ts:675](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L675) ___ @@ -279,7 +281,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:690](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L690) +[src/types/composer.ts:724](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L724) ___ @@ -304,13 +306,13 @@ Note: we recommend using app clients to make it easier to make app calls. | `params.boxReferences?` | ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] | Any boxes to load to the [boxes array](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#reference-arrays). Either the name identifier (which will be set against app ID of `0` i.e. the current app), or a box identifier with the name identifier and app ID. | | `params.clearStateProgram` | `string` \| `Uint8Array` | The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). | | `params.extraFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. | -| `params.extraProgramPages?` | `number` | Number of extra pages required for the programs. This is immutable once the app is created. | +| `params.extraProgramPages?` | `number` | Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created. | | `params.firstValidRound?` | `bigint` | Set the first round this transaction is valid. If left undefined, the value from algod will be used. We recommend you only set this when you intentionally want this to be some time in the future. | | `params.lastValidRound?` | `bigint` | The last round this transaction is valid. It is recommended to use `validityWindow` instead. | | `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). | | `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. | | `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. | -| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. | +| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. | | `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). | | `params.schema?` | `Object` | The state schema for the app. This is immutable once the app is created. | | `params.schema.globalByteSlices` | `number` | The number of byte slices saved in global state. | @@ -330,7 +332,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:600](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L600) +[src/types/composer.ts:634](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L634) ___ @@ -356,7 +358,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:654](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L654) +[src/types/composer.ts:688](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L688) ___ @@ -382,7 +384,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:626](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L626) +[src/types/composer.ts:660](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L660) ___ @@ -408,7 +410,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:678](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L678) +[src/types/composer.ts:712](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L712) ___ @@ -439,7 +441,7 @@ Note: we recommend using app clients to make it easier to make app calls. | `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). | | `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. | | `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. | -| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. | +| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. | | `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). | | `params.sender` | `string` | The address of the account sending the transaction. | | `params.signer?` | `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The function used to sign transaction(s); if not specified then an attempt will be made to find a registered signer for the given `sender` or use a default signer (if configured). | @@ -454,7 +456,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:613](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L613) +[src/types/composer.ts:647](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L647) ___ @@ -480,7 +482,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:666](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L666) +[src/types/composer.ts:700](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L700) ___ @@ -504,7 +506,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:532](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L532) +[src/types/composer.ts:566](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L566) ___ @@ -528,7 +530,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:521](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L521) +[src/types/composer.ts:555](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L555) ___ @@ -552,7 +554,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:554](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L554) +[src/types/composer.ts:588](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L588) ___ @@ -576,7 +578,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:543](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L543) +[src/types/composer.ts:577](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L577) ___ @@ -600,7 +602,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:576](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L576) +[src/types/composer.ts:610](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L610) ___ @@ -624,7 +626,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:587](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L587) +[src/types/composer.ts:621](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L621) ___ @@ -648,7 +650,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:565](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L565) +[src/types/composer.ts:599](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L599) ___ @@ -672,7 +674,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:711](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L711) +[src/types/composer.ts:745](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L745) ___ @@ -696,7 +698,7 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:700](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L700) +[src/types/composer.ts:734](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L734) ___ @@ -720,7 +722,32 @@ The composer so you can chain method calls #### Defined in -[src/types/composer.ts:510](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L510) +[src/types/composer.ts:544](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L544) + +___ + +### addTransaction + +▸ **addTransaction**(`transaction`, `signer?`): [`default`](types_composer.default.md) + +Add a pre-built transaction to the transaction group. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `transaction` | `Transaction` | The pre-built transaction | +| `signer?` | `TransactionSigner` | Optional signer override for the transaction | + +#### Returns + +[`default`](types_composer.default.md) + +The composer so you can chain method calls + +#### Defined in + +[src/types/composer.ts:529](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L529) ___ @@ -743,7 +770,7 @@ The built atomic transaction composer and the transactions #### Defined in -[src/types/composer.ts:1145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1145) +[src/types/composer.ts:1185](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1185) ___ @@ -764,7 +791,7 @@ ___ #### Defined in -[src/types/composer.ts:968](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L968) +[src/types/composer.ts:1008](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1008) ___ @@ -785,7 +812,7 @@ ___ #### Defined in -[src/types/composer.ts:917](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L917) +[src/types/composer.ts:957](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L957) ___ @@ -806,7 +833,7 @@ ___ #### Defined in -[src/types/composer.ts:897](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L897) +[src/types/composer.ts:937](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L937) ___ @@ -827,7 +854,7 @@ ___ #### Defined in -[src/types/composer.ts:932](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L932) +[src/types/composer.ts:972](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L972) ___ @@ -848,7 +875,7 @@ ___ #### Defined in -[src/types/composer.ts:942](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L942) +[src/types/composer.ts:982](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L982) ___ @@ -869,7 +896,7 @@ ___ #### Defined in -[src/types/composer.ts:954](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L954) +[src/types/composer.ts:994](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L994) ___ @@ -892,7 +919,7 @@ Build an ATC and return transactions ready to be incorporated into a broader set #### Defined in -[src/types/composer.ts:717](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L717) +[src/types/composer.ts:751](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L751) ___ @@ -913,7 +940,7 @@ ___ #### Defined in -[src/types/composer.ts:1023](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1023) +[src/types/composer.ts:1063](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1063) ___ @@ -937,7 +964,7 @@ Builds an ABI method call transaction and any other associated transactions repr #### Defined in -[src/types/composer.ts:782](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L782) +[src/types/composer.ts:817](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L817) ___ @@ -958,7 +985,7 @@ ___ #### Defined in -[src/types/composer.ts:885](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L885) +[src/types/composer.ts:925](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L925) ___ @@ -976,7 +1003,7 @@ The array of built transactions and any corresponding method calls #### Defined in -[src/types/composer.ts:1092](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1092) +[src/types/composer.ts:1132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1132) ___ @@ -999,7 +1026,7 @@ Builds all transaction types apart from `txnWithSigner`, `atc` and `methodCall` #### Defined in -[src/types/composer.ts:1042](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1042) +[src/types/composer.ts:1082](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1082) ___ @@ -1020,7 +1047,7 @@ ___ #### Defined in -[src/types/composer.ts:1069](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1069) +[src/types/composer.ts:1109](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1109) ___ @@ -1042,7 +1069,7 @@ ___ #### Defined in -[src/types/composer.ts:738](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L738) +[src/types/composer.ts:772](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L772) ___ @@ -1058,7 +1085,7 @@ Get the number of transactions currently added to this composer. #### Defined in -[src/types/composer.ts:1132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1132) +[src/types/composer.ts:1172](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1172) ___ @@ -1072,7 +1099,7 @@ Compose the atomic transaction group and send it to the network | Name | Type | Description | | :------ | :------ | :------ | -| `params?` | [`ExecuteParams`](../interfaces/types_composer.ExecuteParams.md) | The parameters to control execution with | +| `params?` | [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) | The parameters to control execution with | #### Returns @@ -1082,7 +1109,7 @@ The execution result #### Defined in -[src/types/composer.ts:1184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1184) +[src/types/composer.ts:1224](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1224) ___ @@ -1101,7 +1128,37 @@ The newly built atomic transaction composer and the transactions #### Defined in -[src/types/composer.ts:1174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1174) +[src/types/composer.ts:1214](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1214) + +___ + +### simulate + +▸ **simulate**(`options?`): `Promise`\<[`SendAtomicTransactionComposerResults`](../interfaces/types_transaction.SendAtomicTransactionComposerResults.md) & \{ `simulateResponse`: `SimulateResponse` }\> + +Compose the atomic transaction group and simulate sending it to the network + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options?` | `Object` | +| `options.allowEmptySignatures?` | `boolean` | +| `options.allowMoreLogging?` | `boolean` | +| `options.allowUnnamedResources?` | `boolean` | +| `options.execTraceConfig?` | `SimulateTraceConfig` | +| `options.extraOpcodeBudget?` | `number` \| `bigint` | +| `options.round?` | `number` \| `bigint` | + +#### Returns + +`Promise`\<[`SendAtomicTransactionComposerResults`](../interfaces/types_transaction.SendAtomicTransactionComposerResults.md) & \{ `simulateResponse`: `SimulateResponse` }\> + +The simulation result + +#### Defined in + +[src/types/composer.ts:1251](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1251) ___ @@ -1121,4 +1178,4 @@ ___ #### Defined in -[src/types/composer.ts:1207](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1207) +[src/types/composer.ts:1291](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L1291) diff --git a/docs/code/classes/types_debugging.AVMDebuggerSourceMap.md b/docs/code/classes/types_debugging.AVMDebuggerSourceMap.md index b603b730..386f085a 100644 --- a/docs/code/classes/types_debugging.AVMDebuggerSourceMap.md +++ b/docs/code/classes/types_debugging.AVMDebuggerSourceMap.md @@ -39,7 +39,7 @@ AVM debugger source map class. #### Defined in -[src/types/debugging.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L47) +[src/types/debugging.ts:48](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L48) ## Properties @@ -49,7 +49,7 @@ AVM debugger source map class. #### Defined in -[src/types/debugging.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L41) +[src/types/debugging.ts:42](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L42) ## Methods @@ -67,7 +67,7 @@ The dictionary #### Defined in -[src/types/debugging.ts:66](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L66) +[src/types/debugging.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L67) ___ @@ -91,4 +91,4 @@ The source map #### Defined in -[src/types/debugging.ts:56](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L56) +[src/types/debugging.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L57) diff --git a/docs/code/classes/types_debugging.AVMDebuggerSourceMapEntry.md b/docs/code/classes/types_debugging.AVMDebuggerSourceMapEntry.md index 57036d13..b66d1f35 100644 --- a/docs/code/classes/types_debugging.AVMDebuggerSourceMapEntry.md +++ b/docs/code/classes/types_debugging.AVMDebuggerSourceMapEntry.md @@ -43,7 +43,7 @@ Create an AVM debugger source map entry. #### Defined in -[src/types/debugging.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L23) +[src/types/debugging.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L24) ## Properties @@ -55,7 +55,7 @@ The location of the file the source map is for. #### Defined in -[src/types/debugging.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L24) +[src/types/debugging.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L25) ___ @@ -67,7 +67,7 @@ The hash of the TEAL binary. #### Defined in -[src/types/debugging.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L25) +[src/types/debugging.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L26) ## Methods @@ -87,7 +87,7 @@ The hash of the TEAL binary. #### Defined in -[src/types/debugging.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L28) +[src/types/debugging.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L29) ___ @@ -101,4 +101,4 @@ ___ #### Defined in -[src/types/debugging.ts:32](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L32) +[src/types/debugging.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L33) diff --git a/docs/code/classes/types_debugging.PersistSourceMapInput.md b/docs/code/classes/types_debugging.PersistSourceMapInput.md index fa95159f..e802671c 100644 --- a/docs/code/classes/types_debugging.PersistSourceMapInput.md +++ b/docs/code/classes/types_debugging.PersistSourceMapInput.md @@ -53,7 +53,7 @@ Note: rawTeal and compiledTeal are mutually exclusive. Only one of them should b #### Defined in -[src/types/debugging.ts:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L82) +[src/types/debugging.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L83) ## Properties @@ -63,7 +63,7 @@ Note: rawTeal and compiledTeal are mutually exclusive. Only one of them should b #### Defined in -[src/types/debugging.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L79) +[src/types/debugging.ts:80](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L80) ___ @@ -73,7 +73,7 @@ ___ #### Defined in -[src/types/debugging.ts:80](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L80) +[src/types/debugging.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L81) ___ @@ -83,7 +83,7 @@ ___ #### Defined in -[src/types/debugging.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L77) +[src/types/debugging.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L78) ___ @@ -93,7 +93,7 @@ ___ #### Defined in -[src/types/debugging.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L78) +[src/types/debugging.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L79) ## Accessors @@ -109,7 +109,7 @@ Get the file name #### Defined in -[src/types/debugging.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L123) +[src/types/debugging.ts:124](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L124) ___ @@ -125,7 +125,7 @@ Get the underlying raw teal #### Defined in -[src/types/debugging.ts:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L112) +[src/types/debugging.ts:113](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L113) ## Methods @@ -149,7 +149,7 @@ The filename without the '.teal' extension. #### Defined in -[src/types/debugging.ts:133](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L133) +[src/types/debugging.ts:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L134) ___ @@ -175,7 +175,7 @@ The persist source map input #### Defined in -[src/types/debugging.ts:107](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L107) +[src/types/debugging.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L108) ___ @@ -201,4 +201,4 @@ The persist source map input #### Defined in -[src/types/debugging.ts:96](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L96) +[src/types/debugging.ts:97](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L97) diff --git a/docs/code/classes/types_dispenser_client.TestNetDispenserApiClient.md b/docs/code/classes/types_dispenser_client.TestNetDispenserApiClient.md index 25aa8aea..e283fecb 100644 --- a/docs/code/classes/types_dispenser_client.TestNetDispenserApiClient.md +++ b/docs/code/classes/types_dispenser_client.TestNetDispenserApiClient.md @@ -145,7 +145,7 @@ Sends a funding request to the dispenser API to fund the specified address with | Name | Type | Description | | :------ | :------ | :------ | | `address` | `string` | The address to fund. | -| `amount` | `number` | The amount of µAlgo to fund. | +| `amount` | `number` \| `bigint` | The amount of µAlgo to fund. | #### Returns diff --git a/docs/code/interfaces/types_algorand_client_interface.AlgorandClientInterface.md b/docs/code/interfaces/types_algorand_client_interface.AlgorandClientInterface.md new file mode 100644 index 00000000..64dd48e7 --- /dev/null +++ b/docs/code/interfaces/types_algorand_client_interface.AlgorandClientInterface.md @@ -0,0 +1,102 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/algorand-client-interface](../modules/types_algorand_client_interface.md) / AlgorandClientInterface + +# Interface: AlgorandClientInterface + +[types/algorand-client-interface](../modules/types_algorand_client_interface.md).AlgorandClientInterface + +Interface for the bulk of the `AlgorandClient` functionality. + +Used to take a dependency on AlgorandClient without generating a circular dependency. + +## Implemented by + +- [`AlgorandClient`](../classes/types_algorand_client.AlgorandClient.md) + +## Table of contents + +### Properties + +- [app](types_algorand_client_interface.AlgorandClientInterface.md#app) +- [appDeployer](types_algorand_client_interface.AlgorandClientInterface.md#appdeployer) +- [client](types_algorand_client_interface.AlgorandClientInterface.md#client) +- [send](types_algorand_client_interface.AlgorandClientInterface.md#send) +- [transactions](types_algorand_client_interface.AlgorandClientInterface.md#transactions) + +### Methods + +- [newGroup](types_algorand_client_interface.AlgorandClientInterface.md#newgroup) + +## Properties + +### app + +• **app**: [`AppManager`](../classes/types_app_manager.AppManager.md) + +#### Defined in + +[src/types/algorand-client-interface.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L16) + +___ + +### appDeployer + +• **appDeployer**: [`AppDeployer`](../classes/types_app_deployer.AppDeployer.md) + +#### Defined in + +[src/types/algorand-client-interface.ts:17](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L17) + +___ + +### client + +• **client**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `algod` | `default` | +| `indexer?` | `default` | +| `isLocalNet` | () => `Promise`\<`boolean`\> | +| `isMainNet` | () => `Promise`\<`boolean`\> | +| `isTestNet` | () => `Promise`\<`boolean`\> | +| `network` | () => `Promise`\<[`NetworkDetails`](types_network_client.NetworkDetails.md)\> | + +#### Defined in + +[src/types/algorand-client-interface.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L21) + +___ + +### send + +• **send**: [`AlgorandClientTransactionSender`](../classes/types_algorand_client_transaction_sender.AlgorandClientTransactionSender.md) + +#### Defined in + +[src/types/algorand-client-interface.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L18) + +___ + +### transactions + +• **transactions**: [`AlgorandClientTransactionCreator`](../classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md) + +#### Defined in + +[src/types/algorand-client-interface.ts:19](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L19) + +## Methods + +### newGroup + +▸ **newGroup**(): [`default`](../classes/types_composer.default.md) + +#### Returns + +[`default`](../classes/types_composer.default.md) + +#### Defined in + +[src/types/algorand-client-interface.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-interface.ts#L20) diff --git a/docs/code/interfaces/types_app.AppCompilationResult.md b/docs/code/interfaces/types_app.AppCompilationResult.md index 53a01a0c..15b61874 100644 --- a/docs/code/interfaces/types_app.AppCompilationResult.md +++ b/docs/code/interfaces/types_app.AppCompilationResult.md @@ -4,7 +4,7 @@ [types/app](../modules/types_app.md).AppCompilationResult -The result of compiling the approval and clear TEAL for an app +The result of compiling the approval and clear state TEAL programs for an app ## Table of contents diff --git a/docs/code/interfaces/types_app.AppState.md b/docs/code/interfaces/types_app.AppState.md index 4ae331e6..f92066be 100644 --- a/docs/code/interfaces/types_app.AppState.md +++ b/docs/code/interfaces/types_app.AppState.md @@ -8,4 +8,4 @@ Object holding app state values ## Indexable -▪ [key: `string`]: \{ `keyBase64`: `string` ; `keyRaw`: `Uint8Array` ; `value`: `number` \| `bigint` } \| \{ `keyBase64`: `string` ; `keyRaw`: `Uint8Array` ; `value`: `string` ; `valueBase64`: `string` ; `valueRaw`: `Uint8Array` } +▪ [key: `string`]: \{ `keyBase64`: `string` ; `keyRaw`: `Uint8Array` ; `value`: `bigint` } \| \{ `keyBase64`: `string` ; `keyRaw`: `Uint8Array` ; `value`: `string` ; `valueBase64`: `string` ; `valueRaw`: `Uint8Array` } diff --git a/docs/code/interfaces/types_app.BoxName.md b/docs/code/interfaces/types_app.BoxName.md index edbb0e9b..16dc8fda 100644 --- a/docs/code/interfaces/types_app.BoxName.md +++ b/docs/code/interfaces/types_app.BoxName.md @@ -24,7 +24,7 @@ Name in UTF-8 #### Defined in -[src/types/app.ts:382](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L382) +[src/types/app.ts:387](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L387) ___ @@ -36,7 +36,7 @@ Name in Base64 #### Defined in -[src/types/app.ts:386](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L386) +[src/types/app.ts:391](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L391) ___ @@ -48,4 +48,4 @@ Name in binary bytes #### Defined in -[src/types/app.ts:384](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L384) +[src/types/app.ts:389](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L389) diff --git a/docs/code/interfaces/types_app.BoxValueRequestParams.md b/docs/code/interfaces/types_app.BoxValueRequestParams.md index 18cc9669..c9e6b693 100644 --- a/docs/code/interfaces/types_app.BoxValueRequestParams.md +++ b/docs/code/interfaces/types_app.BoxValueRequestParams.md @@ -27,7 +27,7 @@ The ID of the app return box names for #### Defined in -[src/types/app.ts:395](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L395) +[src/types/app.ts:400](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L400) ___ @@ -39,7 +39,7 @@ The name of the box to return either as a string, binary array or `BoxName` #### Defined in -[src/types/app.ts:397](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L397) +[src/types/app.ts:402](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L402) ___ @@ -51,4 +51,4 @@ The ABI type to decode the value using #### Defined in -[src/types/app.ts:399](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L399) +[src/types/app.ts:404](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L404) diff --git a/docs/code/interfaces/types_app.BoxValuesRequestParams.md b/docs/code/interfaces/types_app.BoxValuesRequestParams.md index ede1f3e5..df0fbfe6 100644 --- a/docs/code/interfaces/types_app.BoxValuesRequestParams.md +++ b/docs/code/interfaces/types_app.BoxValuesRequestParams.md @@ -27,7 +27,7 @@ The ID of the app return box names for #### Defined in -[src/types/app.ts:408](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L408) +[src/types/app.ts:413](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L413) ___ @@ -39,7 +39,7 @@ The names of the boxes to return either as a string, binary array or BoxName` #### Defined in -[src/types/app.ts:410](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L410) +[src/types/app.ts:415](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L415) ___ @@ -51,4 +51,4 @@ The ABI type to decode the value using #### Defined in -[src/types/app.ts:412](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L412) +[src/types/app.ts:417](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L417) diff --git a/docs/code/interfaces/types_app_arc56.Arc56Contract.md b/docs/code/interfaces/types_app_arc56.Arc56Contract.md new file mode 100644 index 00000000..d2e040cc --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.Arc56Contract.md @@ -0,0 +1,285 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / Arc56Contract + +# Interface: Arc56Contract + +[types/app-arc56](../modules/types_app_arc56.md).Arc56Contract + +Describes the entire contract. This interface is an extension of the interface described in ARC-4 + +## Table of contents + +### Properties + +- [arcs](types_app_arc56.Arc56Contract.md#arcs) +- [bareActions](types_app_arc56.Arc56Contract.md#bareactions) +- [byteCode](types_app_arc56.Arc56Contract.md#bytecode) +- [compilerInfo](types_app_arc56.Arc56Contract.md#compilerinfo) +- [desc](types_app_arc56.Arc56Contract.md#desc) +- [events](types_app_arc56.Arc56Contract.md#events) +- [methods](types_app_arc56.Arc56Contract.md#methods) +- [name](types_app_arc56.Arc56Contract.md#name) +- [networks](types_app_arc56.Arc56Contract.md#networks) +- [scratchVariables](types_app_arc56.Arc56Contract.md#scratchvariables) +- [source](types_app_arc56.Arc56Contract.md#source) +- [sourceInfo](types_app_arc56.Arc56Contract.md#sourceinfo) +- [state](types_app_arc56.Arc56Contract.md#state) +- [structs](types_app_arc56.Arc56Contract.md#structs) +- [templateVariables](types_app_arc56.Arc56Contract.md#templatevariables) + +## Properties + +### arcs + +• **arcs**: `number`[] + +The ARCs used and/or supported by this contract. All contracts implicity support ARC4 and ARC56 + +#### Defined in + +[src/types/app-arc56.ts:203](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L203) + +___ + +### bareActions + +• **bareActions**: `Object` + +Supported bare actions for the contract. An action is a combination of call/create and an OnComplete + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (``"NoOp"`` \| ``"OptIn"`` \| ``"DeleteApplication"`` \| ``"CloseOut"`` \| ``"ClearState"`` \| ``"UpdateApplication"``)[] | OnCompletes this method allows when appID !== 0 | +| `create` | (``"NoOp"`` \| ``"OptIn"`` \| ``"DeleteApplication"``)[] | OnCompletes this method allows when appID === 0 | + +#### Defined in + +[src/types/app-arc56.ts:253](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L253) + +___ + +### byteCode + +• `Optional` **byteCode**: `Object` + +The compiled bytecode for the application. MUST be omitted if included as part of ARC23 + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `approval` | `string` | The approval program | +| `clear` | `string` | The clear program | + +#### Defined in + +[src/types/app-arc56.ts:274](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L274) + +___ + +### compilerInfo + +• `Optional` **compilerInfo**: `Object` + +Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `compiler` | ``"algod"`` \| ``"puya"`` | The name of the compiler | +| `compilerVersion` | \{ `commit?`: `string` ; `major`: `number` ; `minor`: `number` ; `patch`: `number` } | Compiler version information | +| `compilerVersion.commit?` | `string` | - | +| `compilerVersion.major` | `number` | - | +| `compilerVersion.minor` | `number` | - | +| `compilerVersion.patch` | `number` | - | + +#### Defined in + +[src/types/app-arc56.ts:281](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L281) + +___ + +### desc + +• `Optional` **desc**: `string` + +Optional, user-friendly description for the interface + +#### Defined in + +[src/types/app-arc56.ts:207](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L207) + +___ + +### events + +• `Optional` **events**: [`Event`](types_app_arc56.Event.md)[] + +ARC-28 events that MAY be emitted by this contract + +#### Defined in + +[src/types/app-arc56.ts:293](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L293) + +___ + +### methods + +• **methods**: [`Method`](types_app_arc56.Method.md)[] + +All of the methods that the contract implements + +#### Defined in + +[src/types/app-arc56.ts:226](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L226) + +___ + +### name + +• **name**: `string` + +A user-friendly name for the contract + +#### Defined in + +[src/types/app-arc56.ts:205](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L205) + +___ + +### networks + +• `Optional` **networks**: `Object` + +Optional object listing the contract instances across different networks + +#### Index signature + +▪ [network: `string`]: \{ `appID`: `number` } + +The key is the base64 genesis hash of the network, and the value contains +information about the deployed contract in the network indicated by the +key. A key containing the human-readable name of the network MAY be +included, but the corresponding genesis hash key MUST also be defined + +#### Defined in + +[src/types/app-arc56.ts:211](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L211) + +___ + +### scratchVariables + +• `Optional` **scratchVariables**: `Object` + +The scratch variables used during runtime + +#### Index signature + +▪ [name: `string`]: \{ `slot`: `number` ; `type`: [`ABIType`](../modules/types_app_arc56.md#abitype) \| [`AVMBytes`](../modules/types_app_arc56.md#avmbytes) \| [`StructName`](../modules/types_app_arc56.md#structname) } + +#### Defined in + +[src/types/app-arc56.ts:304](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L304) + +___ + +### source + +• `Optional` **source**: `Object` + +The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `approval` | `string` | The approval program | +| `clear` | `string` | The clear program | + +#### Defined in + +[src/types/app-arc56.ts:267](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L267) + +___ + +### sourceInfo + +• `Optional` **sourceInfo**: `Object` + +Information about the TEAL programs + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `approval` | [`SourceInfo`](types_app_arc56.SourceInfo.md)[] | Approval program information | +| `clear` | [`SourceInfo`](types_app_arc56.SourceInfo.md)[] | Clear program information | + +#### Defined in + +[src/types/app-arc56.ts:260](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L260) + +___ + +### state + +• **state**: `Object` + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `keys` | \{ `box`: \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } ; `global`: \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } ; `local`: \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } } | Mapping of human-readable names to StorageKey objects | +| `keys.box` | \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } | - | +| `keys.global` | \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } | - | +| `keys.local` | \{ `[name: string]`: [`StorageKey`](types_app_arc56.StorageKey.md); } | - | +| `maps` | \{ `box`: \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } ; `global`: \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } ; `local`: \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } } | Mapping of human-readable names to StorageMap objects | +| `maps.box` | \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } | - | +| `maps.global` | \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } | - | +| `maps.local` | \{ `[name: string]`: [`StorageMap`](types_app_arc56.StorageMap.md); } | - | +| `schema` | \{ `global`: \{ `bytes`: `number` ; `ints`: `number` } ; `local`: \{ `bytes`: `number` ; `ints`: `number` } } | Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application | +| `schema.global` | \{ `bytes`: `number` ; `ints`: `number` } | - | +| `schema.global.bytes` | `number` | - | +| `schema.global.ints` | `number` | - | +| `schema.local` | \{ `bytes`: `number` ; `ints`: `number` } | - | +| `schema.local.bytes` | `number` | - | +| `schema.local.ints` | `number` | - | + +#### Defined in + +[src/types/app-arc56.ts:227](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L227) + +___ + +### structs + +• **structs**: `Object` + +Named structs use by the application + +#### Index signature + +▪ [structName: [`StructName`](../modules/types_app_arc56.md#structname)]: [`StructFields`](types_app_arc56.StructFields.md) + +#### Defined in + +[src/types/app-arc56.ts:224](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L224) + +___ + +### templateVariables + +• `Optional` **templateVariables**: `Object` + +A mapping of template variable names as they appear in the teal (not including TMPL_ prefix) to their respecive types and values (if applicable) + +#### Index signature + +▪ [name: `string`]: \{ `type`: [`ABIType`](../modules/types_app_arc56.md#abitype) \| [`AVMBytes`](../modules/types_app_arc56.md#avmbytes) \| [`StructName`](../modules/types_app_arc56.md#structname) ; `value?`: `string` } + +#### Defined in + +[src/types/app-arc56.ts:295](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L295) diff --git a/docs/code/interfaces/types_app_arc56.Event.md b/docs/code/interfaces/types_app_arc56.Event.md new file mode 100644 index 00000000..1eebd347 --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.Event.md @@ -0,0 +1,51 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / Event + +# Interface: Event + +[types/app-arc56](../modules/types_app_arc56.md).Event + +ARC-28 event + +## Table of contents + +### Properties + +- [args](types_app_arc56.Event.md#args) +- [desc](types_app_arc56.Event.md#desc) +- [name](types_app_arc56.Event.md#name) + +## Properties + +### args + +• **args**: \{ `desc?`: `string` ; `name?`: `string` ; `struct?`: `string` ; `type`: `string` }[] + +The arguments of the event, in order + +#### Defined in + +[src/types/app-arc56.ts:382](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L382) + +___ + +### desc + +• `Optional` **desc**: `string` + +Optional, user-friendly description for the event + +#### Defined in + +[src/types/app-arc56.ts:380](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L380) + +___ + +### name + +• **name**: `string` + +The name of the event + +#### Defined in + +[src/types/app-arc56.ts:378](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L378) diff --git a/docs/code/interfaces/types_app_arc56.Method.md b/docs/code/interfaces/types_app_arc56.Method.md new file mode 100644 index 00000000..9653d87e --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.Method.md @@ -0,0 +1,145 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / Method + +# Interface: Method + +[types/app-arc56](../modules/types_app_arc56.md).Method + +Describes a method in the contract. This interface is an extension of the interface described in ARC-4 + +## Table of contents + +### Properties + +- [actions](types_app_arc56.Method.md#actions) +- [args](types_app_arc56.Method.md#args) +- [desc](types_app_arc56.Method.md#desc) +- [events](types_app_arc56.Method.md#events) +- [name](types_app_arc56.Method.md#name) +- [readonly](types_app_arc56.Method.md#readonly) +- [recommendations](types_app_arc56.Method.md#recommendations) +- [returns](types_app_arc56.Method.md#returns) + +## Properties + +### actions + +• **actions**: `Object` + +an action is a combination of call/create and an OnComplete + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `call` | (``"NoOp"`` \| ``"OptIn"`` \| ``"DeleteApplication"`` \| ``"CloseOut"`` \| ``"ClearState"`` \| ``"UpdateApplication"``)[] | OnCompletes this method allows when appID !== 0 | +| `create` | (``"NoOp"`` \| ``"OptIn"`` \| ``"DeleteApplication"``)[] | OnCompletes this method allows when appID === 0 | + +#### Defined in + +[src/types/app-arc56.ts:341](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L341) + +___ + +### args + +• **args**: \{ `defaultValue?`: `string` ; `desc?`: `string` ; `name?`: `string` ; `struct?`: `string` ; `type`: `string` }[] + +The arguments of the method, in order + +#### Defined in + +[src/types/app-arc56.ts:319](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L319) + +___ + +### desc + +• `Optional` **desc**: `string` + +Optional, user-friendly description for the method + +#### Defined in + +[src/types/app-arc56.ts:317](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L317) + +___ + +### events + +• `Optional` **events**: [`Event`](types_app_arc56.Event.md)[] + +ARC-28 events that MAY be emitted by this method + +#### Defined in + +[src/types/app-arc56.ts:350](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L350) + +___ + +### name + +• **name**: `string` + +The name of the method + +#### Defined in + +[src/types/app-arc56.ts:315](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L315) + +___ + +### readonly + +• `Optional` **readonly**: `boolean` + +If this method does not write anything to the ledger (ARC-22) + +#### Defined in + +[src/types/app-arc56.ts:348](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L348) + +___ + +### recommendations + +• `Optional` **recommendations**: `Object` + +Information that clients can use when calling the method + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `accounts?` | `string`[] | Recommended foreign accounts | +| `apps?` | `number`[] | Recommended foreign apps | +| `assets?` | `number`[] | Recommended foreign assets | +| `boxes?` | \{ `app?`: `number` ; `key`: `string` ; `readBytes`: `number` ; `writeBytes`: `number` } | Recommended box references to include | +| `boxes.app?` | `number` | The app ID for the box | +| `boxes.key` | `string` | The base64 encoded box key | +| `boxes.readBytes` | `number` | The number of bytes being read from the box | +| `boxes.writeBytes` | `number` | The number of bytes being written to the box | +| `innerTransactionCount?` | `number` | The number of inner transactions the caller should cover the fees for | + +#### Defined in + +[src/types/app-arc56.ts:352](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L352) + +___ + +### returns + +• **returns**: `Object` + +Information about the method's return value + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `desc?` | `string` | Optional, user-friendly description for the return value | +| `struct?` | `string` | If the type is a struct, the name of the struct | +| `type` | `string` | The type of the return value, or "void" to indicate no return value. | + +#### Defined in + +[src/types/app-arc56.ts:332](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L332) diff --git a/docs/code/interfaces/types_app_arc56.SourceInfo.md b/docs/code/interfaces/types_app_arc56.SourceInfo.md new file mode 100644 index 00000000..3a7a730a --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.SourceInfo.md @@ -0,0 +1,62 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / SourceInfo + +# Interface: SourceInfo + +[types/app-arc56](../modules/types_app_arc56.md).SourceInfo + +## Table of contents + +### Properties + +- [disassembledTeal](types_app_arc56.SourceInfo.md#disassembledteal) +- [errorMessage](types_app_arc56.SourceInfo.md#errormessage) +- [pc](types_app_arc56.SourceInfo.md#pc) +- [teal](types_app_arc56.SourceInfo.md#teal) + +## Properties + +### disassembledTeal + +• `Optional` **disassembledTeal**: `number` + +The line of the dissasembled TEAL this line of pre-compiled TEAL corresponds to + +#### Defined in + +[src/types/app-arc56.ts:441](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L441) + +___ + +### errorMessage + +• `Optional` **errorMessage**: `string` + +A human-readable string that describes the error when the program fails at this given line of TEAL + +#### Defined in + +[src/types/app-arc56.ts:439](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L439) + +___ + +### pc + +• `Optional` **pc**: `number`[] + +The program counter offset(s) that correspond to this line of TEAL + +#### Defined in + +[src/types/app-arc56.ts:437](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L437) + +___ + +### teal + +• `Optional` **teal**: `number` + +The line of pre-compiled TEAL + +#### Defined in + +[src/types/app-arc56.ts:435](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L435) diff --git a/docs/code/interfaces/types_app_arc56.StorageKey.md b/docs/code/interfaces/types_app_arc56.StorageKey.md new file mode 100644 index 00000000..f2ab9711 --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.StorageKey.md @@ -0,0 +1,64 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / StorageKey + +# Interface: StorageKey + +[types/app-arc56](../modules/types_app_arc56.md).StorageKey + +Describes a single key in app storage + +## Table of contents + +### Properties + +- [desc](types_app_arc56.StorageKey.md#desc) +- [key](types_app_arc56.StorageKey.md#key) +- [keyType](types_app_arc56.StorageKey.md#keytype) +- [valueType](types_app_arc56.StorageKey.md#valuetype) + +## Properties + +### desc + +• `Optional` **desc**: `string` + +Description of what this storage key holds + +#### Defined in + +[src/types/app-arc56.ts:411](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L411) + +___ + +### key + +• **key**: `string` + +The bytes of the key encoded as base64 + +#### Defined in + +[src/types/app-arc56.ts:418](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L418) + +___ + +### keyType + +• **keyType**: `string` + +The type of the key + +#### Defined in + +[src/types/app-arc56.ts:413](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L413) + +___ + +### valueType + +• **valueType**: `string` + +The type of the value + +#### Defined in + +[src/types/app-arc56.ts:416](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L416) diff --git a/docs/code/interfaces/types_app_arc56.StorageMap.md b/docs/code/interfaces/types_app_arc56.StorageMap.md new file mode 100644 index 00000000..b1cbcb48 --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.StorageMap.md @@ -0,0 +1,64 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / StorageMap + +# Interface: StorageMap + +[types/app-arc56](../modules/types_app_arc56.md).StorageMap + +Describes a mapping of key-value pairs in storage + +## Table of contents + +### Properties + +- [desc](types_app_arc56.StorageMap.md#desc) +- [keyType](types_app_arc56.StorageMap.md#keytype) +- [prefix](types_app_arc56.StorageMap.md#prefix) +- [valueType](types_app_arc56.StorageMap.md#valuetype) + +## Properties + +### desc + +• `Optional` **desc**: `string` + +Description of what the key-value pairs in this mapping hold + +#### Defined in + +[src/types/app-arc56.ts:424](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L424) + +___ + +### keyType + +• **keyType**: `string` + +The type of the keys in the map + +#### Defined in + +[src/types/app-arc56.ts:426](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L426) + +___ + +### prefix + +• `Optional` **prefix**: `string` + +The base64-encoded prefix of the map keys + +#### Defined in + +[src/types/app-arc56.ts:430](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L430) + +___ + +### valueType + +• **valueType**: `string` + +The type of the values in the map + +#### Defined in + +[src/types/app-arc56.ts:428](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L428) diff --git a/docs/code/interfaces/types_app_arc56.StructFields.md b/docs/code/interfaces/types_app_arc56.StructFields.md new file mode 100644 index 00000000..b10aa73c --- /dev/null +++ b/docs/code/interfaces/types_app_arc56.StructFields.md @@ -0,0 +1,11 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-arc56](../modules/types_app_arc56.md) / StructFields + +# Interface: StructFields + +[types/app-arc56](../modules/types_app_arc56.md).StructFields + +Mapping of named structs to the ABI type of their fields + +## Indexable + +▪ [fieldName: `string`]: [`ABIType`](../modules/types_app_arc56.md#abitype) \| [`StructFields`](types_app_arc56.StructFields.md) diff --git a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md index 2343d88c..80f72dc7 100644 --- a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md +++ b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md @@ -113,7 +113,7 @@ If calling an ABI method then either the name of the method, or the ABI signatur #### Defined in -[src/types/app-client.ts:169](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L169) +[src/types/app-client.ts:200](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L200) ___ diff --git a/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md b/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md index 8b7649b5..6585b308 100644 --- a/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md +++ b/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md @@ -24,7 +24,7 @@ The transaction note for the smart contract call #### Defined in -[src/types/app-client.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L180) +[src/types/app-client.ts:211](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L211) ___ @@ -36,7 +36,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L182) +[src/types/app-client.ts:213](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L213) ___ @@ -48,4 +48,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:178](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L178) +[src/types/app-client.ts:209](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L209) diff --git a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md index 3b44839e..38b659d3 100644 --- a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md +++ b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md @@ -18,9 +18,11 @@ • `Optional` **deletable**: `boolean` +Whether or not the contract should have deploy-time permanence control set, undefined = ignore + #### Defined in -[src/types/app-client.ts:197](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L197) +[src/types/app-client.ts:228](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L228) ___ @@ -32,7 +34,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:193](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L193) +[src/types/app-client.ts:224](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L224) ___ @@ -40,6 +42,8 @@ ___ • `Optional` **updatable**: `boolean` +Whether or not the contract should have deploy-time immutability control set, undefined = ignore + #### Defined in -[src/types/app-client.ts:195](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L195) +[src/types/app-client.ts:226](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L226) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md index 419d6d1b..05c297b3 100644 --- a/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md +++ b/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md @@ -32,7 +32,7 @@ Any args to pass to any create transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L149) +[src/types/app-client.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L180) ___ @@ -44,7 +44,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L151) +[src/types/app-client.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L182) ___ @@ -56,7 +56,7 @@ Any args to pass to any delete transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:155](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L155) +[src/types/app-client.ts:186](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L186) ___ @@ -68,7 +68,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L147) +[src/types/app-client.ts:178](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L178) ___ @@ -80,4 +80,4 @@ Any args to pass to any update transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L153) +[src/types/app-client.ts:184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L184) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md index ce6c23d8..23c20c8a 100644 --- a/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md +++ b/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md @@ -35,7 +35,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:137](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L137) +[src/types/app-client.ts:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L168) ___ @@ -48,7 +48,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:133](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L133) +[src/types/app-client.ts:164](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L164) ___ @@ -60,7 +60,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L139) +[src/types/app-client.ts:170](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L170) ___ @@ -72,7 +72,7 @@ What action to perform if a TEAL update is detected #### Defined in -[src/types/app-client.ts:141](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L141) +[src/types/app-client.ts:172](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L172) ___ @@ -84,7 +84,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:129](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L129) +[src/types/app-client.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L160) ___ @@ -96,7 +96,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:127](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L127) +[src/types/app-client.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L158) ___ @@ -108,4 +108,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:125](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L125) +[src/types/app-client.ts:156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L156) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployParams.md b/docs/code/interfaces/types_app_client.AppClientDeployParams.md index a7bff6cc..895267fe 100644 --- a/docs/code/interfaces/types_app_client.AppClientDeployParams.md +++ b/docs/code/interfaces/types_app_client.AppClientDeployParams.md @@ -47,7 +47,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:137](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L137) +[src/types/app-client.ts:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L168) ___ @@ -64,7 +64,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:133](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L133) +[src/types/app-client.ts:164](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L164) ___ @@ -80,7 +80,7 @@ Any args to pass to any create transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L149) +[src/types/app-client.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L180) ___ @@ -96,7 +96,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L151) +[src/types/app-client.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L182) ___ @@ -112,7 +112,7 @@ Any args to pass to any delete transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:155](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L155) +[src/types/app-client.ts:186](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L186) ___ @@ -128,7 +128,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L147) +[src/types/app-client.ts:178](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L178) ___ @@ -144,7 +144,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L139) +[src/types/app-client.ts:170](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L170) ___ @@ -160,7 +160,7 @@ What action to perform if a TEAL update is detected #### Defined in -[src/types/app-client.ts:141](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L141) +[src/types/app-client.ts:172](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L172) ___ @@ -172,7 +172,7 @@ Any overrides for the storage schema to request for the created app; by default #### Defined in -[src/types/app-client.ts:161](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L161) +[src/types/app-client.ts:192](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L192) ___ @@ -188,7 +188,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:129](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L129) +[src/types/app-client.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L160) ___ @@ -204,7 +204,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:127](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L127) +[src/types/app-client.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L158) ___ @@ -220,7 +220,7 @@ Any args to pass to any update transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L153) +[src/types/app-client.ts:184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L184) ___ @@ -236,4 +236,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:125](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L125) +[src/types/app-client.ts:156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L156) diff --git a/docs/code/interfaces/types_app_client.AppClientParams.md b/docs/code/interfaces/types_app_client.AppClientParams.md new file mode 100644 index 00000000..310d0307 --- /dev/null +++ b/docs/code/interfaces/types_app_client.AppClientParams.md @@ -0,0 +1,107 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-client](../modules/types_app_client.md) / AppClientParams + +# Interface: AppClientParams + +[types/app-client](../modules/types_app_client.md).AppClientParams + +Parameters to create an app client + +## Table of contents + +### Properties + +- [algorand](types_app_client.AppClientParams.md#algorand) +- [appId](types_app_client.AppClientParams.md#appid) +- [appName](types_app_client.AppClientParams.md#appname) +- [appSpec](types_app_client.AppClientParams.md#appspec) +- [approvalSourceMap](types_app_client.AppClientParams.md#approvalsourcemap) +- [clearSourceMap](types_app_client.AppClientParams.md#clearsourcemap) +- [defaultSender](types_app_client.AppClientParams.md#defaultsender) + +## Properties + +### algorand + +• **algorand**: [`AlgorandClientInterface`](types_algorand_client_interface.AlgorandClientInterface.md) + +An `AlgorandClient` instance + +#### Defined in + +[src/types/app-client.ts:315](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L315) + +___ + +### appId + +• **appId**: `bigint` + +The ID of the app instance this client should make calls against. + +#### Defined in + +[src/types/app-client.ts:305](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L305) + +___ + +### appName + +• `Optional` **appName**: `string` + +Optional override for the app name; used for on-chain metadata and lookups. +Defaults to the ARC-32/ARC-56 app spec name + +#### Defined in + +[src/types/app-client.ts:321](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L321) + +___ + +### appSpec + +• **appSpec**: `string` \| [`Arc56Contract`](types_app_arc56.Arc56Contract.md) \| [`AppSpec`](types_app_spec.AppSpec.md) + +The ARC-56 or ARC-32 application spec as either: + * Parsed JSON ARC-56 `Contract` + * Parsed JSON ARC-32 `AppSpec` + * Raw JSON string (in either ARC-56 or ARC-32 format) + +#### Defined in + +[src/types/app-client.ts:312](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L312) + +___ + +### approvalSourceMap + +• `Optional` **approvalSourceMap**: `SourceMap` + +Optional source map for the approval program + +#### Defined in + +[src/types/app-client.ts:325](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L325) + +___ + +### clearSourceMap + +• `Optional` **clearSourceMap**: `SourceMap` + +Optional source map for the clear state program + +#### Defined in + +[src/types/app-client.ts:327](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L327) + +___ + +### defaultSender + +• `Optional` **defaultSender**: `string` + +Optional address to use for the account to use as the default sender for calls. + +#### Defined in + +[src/types/app-client.ts:323](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L323) diff --git a/docs/code/interfaces/types_app_client.AppSourceMaps.md b/docs/code/interfaces/types_app_client.AppSourceMaps.md index 66662f7b..dd4f02fe 100644 --- a/docs/code/interfaces/types_app_client.AppSourceMaps.md +++ b/docs/code/interfaces/types_app_client.AppSourceMaps.md @@ -23,7 +23,7 @@ The source map of the approval program #### Defined in -[src/types/app-client.ts:231](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L231) +[src/types/app-client.ts:262](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L262) ___ @@ -35,4 +35,4 @@ The source map of the clear program #### Defined in -[src/types/app-client.ts:233](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L233) +[src/types/app-client.ts:264](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L264) diff --git a/docs/code/interfaces/types_app_client.FundAppAccountParams.md b/docs/code/interfaces/types_app_client.FundAppAccountParams.md index b5d01b22..e1ac916d 100644 --- a/docs/code/interfaces/types_app_client.FundAppAccountParams.md +++ b/docs/code/interfaces/types_app_client.FundAppAccountParams.md @@ -23,7 +23,7 @@ Parameters for funding an app account #### Defined in -[src/types/app-client.ts:219](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L219) +[src/types/app-client.ts:250](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L250) ___ @@ -35,7 +35,7 @@ The transaction note for the smart contract call #### Defined in -[src/types/app-client.ts:223](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L223) +[src/types/app-client.ts:254](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L254) ___ @@ -47,7 +47,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:225](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L225) +[src/types/app-client.ts:256](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L256) ___ @@ -59,4 +59,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:221](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L221) +[src/types/app-client.ts:252](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L252) diff --git a/docs/code/interfaces/types_app_client.ResolveAppById.md b/docs/code/interfaces/types_app_client.ResolveAppById.md index 654dd522..7e925fac 100644 --- a/docs/code/interfaces/types_app_client.ResolveAppById.md +++ b/docs/code/interfaces/types_app_client.ResolveAppById.md @@ -34,7 +34,7 @@ The id of an existing app to call using this client, or 0 if the app hasn't been #### Defined in -[src/types/app-client.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L79) +[src/types/app-client.ts:110](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L110) ___ @@ -50,7 +50,7 @@ The optional name to use to mark the app when deploying `ApplicationClient.deplo #### Defined in -[src/types/app-client.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L81) +[src/types/app-client.ts:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L112) ___ @@ -62,4 +62,4 @@ How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'cr #### Defined in -[src/types/app-client.ts:86](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L86) +[src/types/app-client.ts:117](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L117) diff --git a/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md b/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md index 9ddb2acb..1d07b614 100644 --- a/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md +++ b/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md @@ -29,7 +29,7 @@ The id of an existing app to call using this client, or 0 if the app hasn't been #### Defined in -[src/types/app-client.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L79) +[src/types/app-client.ts:110](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L110) ___ @@ -41,4 +41,4 @@ The optional name to use to mark the app when deploying `ApplicationClient.deplo #### Defined in -[src/types/app-client.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L81) +[src/types/app-client.ts:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L112) diff --git a/docs/code/interfaces/types_app_client.SourceMapExport.md b/docs/code/interfaces/types_app_client.SourceMapExport.md index f53aaf64..37e6347e 100644 --- a/docs/code/interfaces/types_app_client.SourceMapExport.md +++ b/docs/code/interfaces/types_app_client.SourceMapExport.md @@ -21,7 +21,7 @@ #### Defined in -[src/types/app-client.ts:240](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L240) +[src/types/app-client.ts:271](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L271) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[src/types/app-client.ts:239](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L239) +[src/types/app-client.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L270) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[src/types/app-client.ts:238](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L238) +[src/types/app-client.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L269) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[src/types/app-client.ts:237](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L237) +[src/types/app-client.ts:268](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L268) diff --git a/docs/code/interfaces/types_app_deployer.AppDeployParams.md b/docs/code/interfaces/types_app_deployer.AppDeployParams.md deleted file mode 100644 index eda3ee9d..00000000 --- a/docs/code/interfaces/types_app_deployer.AppDeployParams.md +++ /dev/null @@ -1,151 +0,0 @@ -[@algorandfoundation/algokit-utils](../README.md) / [types/app-deployer](../modules/types_app_deployer.md) / AppDeployParams - -# Interface: AppDeployParams - -[types/app-deployer](../modules/types_app_deployer.md).AppDeployParams - -The parameters to idempotently deploy an app - -## Table of contents - -### Properties - -- [createParams](types_app_deployer.AppDeployParams.md#createparams) -- [deleteParams](types_app_deployer.AppDeployParams.md#deleteparams) -- [deployTimeParams](types_app_deployer.AppDeployParams.md#deploytimeparams) -- [executeParams](types_app_deployer.AppDeployParams.md#executeparams) -- [existingDeployments](types_app_deployer.AppDeployParams.md#existingdeployments) -- [ignoreCache](types_app_deployer.AppDeployParams.md#ignorecache) -- [metadata](types_app_deployer.AppDeployParams.md#metadata) -- [onSchemaBreak](types_app_deployer.AppDeployParams.md#onschemabreak) -- [onUpdate](types_app_deployer.AppDeployParams.md#onupdate) -- [updateParams](types_app_deployer.AppDeployParams.md#updateparams) - -## Properties - -### createParams - -• **createParams**: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| [`AppCreateMethodCall`](../modules/types_composer.md#appcreatemethodcall) - -Create transaction parameters to use if a create needs to be issued as part of deployment - -#### Defined in - -[src/types/app-deployer.ts:50](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L50) - -___ - -### deleteParams - -• **deleteParams**: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `method`: `ABIMethod` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } - -Delete transaction parameters to use if a delete needs to be issued as part of deployment - -#### Defined in - -[src/types/app-deployer.ts:56](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L56) - -___ - -### deployTimeParams - -• `Optional` **deployTimeParams**: [`TealTemplateParams`](types_app.TealTemplateParams.md) - -Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string) - -#### Defined in - -[src/types/app-deployer.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L33) - -___ - -### executeParams - -• `Optional` **executeParams**: [`ExecuteParams`](types_composer.ExecuteParams.md) - -Parameters to use for transaction execution - -#### Defined in - -[src/types/app-deployer.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L58) - -___ - -### existingDeployments - -• `Optional` **existingDeployments**: [`AppLookup`](types_app_deployer.AppLookup.md) - -Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup - -#### Defined in - -[src/types/app-deployer.ts:60](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L60) - -___ - -### ignoreCache - -• `Optional` **ignoreCache**: `boolean` - -Whether or not to ignore the app metadata cache and force a lookup, default: use the cache * - -#### Defined in - -[src/types/app-deployer.ts:62](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L62) - -___ - -### metadata - -• **metadata**: [`AppDeployMetadata`](types_app.AppDeployMetadata.md) - -The deployment metadata - -#### Defined in - -[src/types/app-deployer.ts:31](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L31) - -___ - -### onSchemaBreak - -• `Optional` **onSchemaBreak**: [`OnSchemaBreak`](../enums/types_app.OnSchemaBreak.md) \| ``"replace"`` \| ``"fail"`` \| ``"append"`` - -What action to perform if a schema break (storage schema or extra pages change) is detected: - -* `replace` - Delete the old app and create a new one -* `fail` - Fail the deployment (throw an error) -* `append` - Deploy a new app and leave the old one as is - -#### Defined in - -[src/types/app-deployer.ts:40](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L40) - -___ - -### onUpdate - -• `Optional` **onUpdate**: ``"replace"`` \| ``"fail"`` \| ``"append"`` \| [`OnUpdate`](../enums/types_app.OnUpdate.md) \| ``"update"`` - -What action to perform if a TEAL code update is detected: - -* `update` - Update the app with the new TEAL code -* `replace` - Delete the old app and create a new one -* `fail` - Fail the deployment (throw an error) -* `append` - Deploy a new app and leave the old one as is - -#### Defined in - -[src/types/app-deployer.ts:48](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L48) - -___ - -### updateParams - -• **updateParams**: \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } \| \{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `args?`: (`TransactionWithSigner` \| `Transaction` \| `ABIValue` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<\{ `accountReferences?`: `string`[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: BoxIdentifier \| BoxReference[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` }\> \| [`AppMethodCall`](../modules/types_composer.md#appmethodcall)\<[`AppCallParams`](../modules/types_composer.md#appcallparams)\>)[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](types_app_manager.BoxReference.md))[] ; `extraFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `method`: `ABIMethod` ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` ; `sender`: `string` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](../classes/types_amount.AlgoAmount.md) ; `validityWindow?`: `number` } - -Update transaction parameters to use if an update needs to be issued as part of deployment - -#### Defined in - -[src/types/app-deployer.ts:52](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L52) diff --git a/docs/code/interfaces/types_app_deployer.AppLookup.md b/docs/code/interfaces/types_app_deployer.AppLookup.md index 1a31776e..14e8bfe9 100644 --- a/docs/code/interfaces/types_app_deployer.AppLookup.md +++ b/docs/code/interfaces/types_app_deployer.AppLookup.md @@ -27,7 +27,7 @@ A hash map of app name to app metadata #### Defined in -[src/types/app-deployer.ts:86](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L86) +[src/types/app-deployer.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L92) ___ @@ -39,4 +39,4 @@ The address of the creator associated with this lookup #### Defined in -[src/types/app-deployer.ts:84](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L84) +[src/types/app-deployer.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L90) diff --git a/docs/code/interfaces/types_app_deployer.AppMetadata.md b/docs/code/interfaces/types_app_deployer.AppMetadata.md index 2f9039e4..95f8f926 100644 --- a/docs/code/interfaces/types_app_deployer.AppMetadata.md +++ b/docs/code/interfaces/types_app_deployer.AppMetadata.md @@ -37,7 +37,7 @@ The Algorand address of the account associated with the app #### Defined in -[src/types/app-deployer.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L70) +[src/types/app-deployer.ts:76](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L76) ___ @@ -49,7 +49,7 @@ The id of the app #### Defined in -[src/types/app-deployer.ts:68](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L68) +[src/types/app-deployer.ts:74](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L74) ___ @@ -61,7 +61,7 @@ The metadata when the app was created #### Defined in -[src/types/app-deployer.ts:76](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L76) +[src/types/app-deployer.ts:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L82) ___ @@ -73,7 +73,7 @@ The round the app was created #### Defined in -[src/types/app-deployer.ts:72](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L72) +[src/types/app-deployer.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L78) ___ @@ -101,7 +101,7 @@ Whether or not the app is deleted #### Defined in -[src/types/app-deployer.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L78) +[src/types/app-deployer.ts:84](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L84) ___ @@ -145,7 +145,7 @@ The last round that the app was updated #### Defined in -[src/types/app-deployer.ts:74](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L74) +[src/types/app-deployer.ts:80](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L80) ___ diff --git a/docs/code/interfaces/types_app_factory.AppFactoryParams.md b/docs/code/interfaces/types_app_factory.AppFactoryParams.md new file mode 100644 index 00000000..f0f814de --- /dev/null +++ b/docs/code/interfaces/types_app_factory.AppFactoryParams.md @@ -0,0 +1,132 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-factory](../modules/types_app_factory.md) / AppFactoryParams + +# Interface: AppFactoryParams + +[types/app-factory](../modules/types_app_factory.md).AppFactoryParams + +Parameters to create an app client + +## Table of contents + +### Properties + +- [algorand](types_app_factory.AppFactoryParams.md#algorand) +- [appName](types_app_factory.AppFactoryParams.md#appname) +- [appSpec](types_app_factory.AppFactoryParams.md#appspec) +- [defaultSender](types_app_factory.AppFactoryParams.md#defaultsender) +- [deletable](types_app_factory.AppFactoryParams.md#deletable) +- [deployTimeParams](types_app_factory.AppFactoryParams.md#deploytimeparams) +- [updatable](types_app_factory.AppFactoryParams.md#updatable) +- [version](types_app_factory.AppFactoryParams.md#version) + +## Properties + +### algorand + +• **algorand**: [`AlgorandClientInterface`](types_algorand_client_interface.AlgorandClientInterface.md) + +`AlgorandClient` instance + +#### Defined in + +[src/types/app-factory.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L46) + +___ + +### appName + +• `Optional` **appName**: `string` + +Optional override for the app name; used for on-chain metadata and lookups. +Defaults to the ARC-32/ARC-56 app spec name. + +#### Defined in + +[src/types/app-factory.ts:52](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L52) + +___ + +### appSpec + +• **appSpec**: `string` \| [`Arc56Contract`](types_app_arc56.Arc56Contract.md) \| [`AppSpec`](types_app_spec.AppSpec.md) + +The ARC-56 or ARC-32 application spec as either: + * Parsed JSON ARC-56 `Contract` + * Parsed JSON ARC-32 `AppSpec` + * Raw JSON string (in either ARC-56 or ARC-32 format) + +#### Defined in + +[src/types/app-factory.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L43) + +___ + +### defaultSender + +• `Optional` **defaultSender**: `string` + +Optional address to use for the account to use as the default sender for calls. + +#### Defined in + +[src/types/app-factory.ts:55](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L55) + +___ + +### deletable + +• `Optional` **deletable**: `boolean` + +Whether or not the contract should have deploy-time permanence control set, undefined = ignore. +If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + +Useful if you want to vend multiple contracts from the same factory without specifying this value +for each call. + +#### Defined in + +[src/types/app-factory.ts:76](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L76) + +___ + +### deployTimeParams + +• `Optional` **deployTimeParams**: [`TealTemplateParams`](types_app.TealTemplateParams.md) + +Optional deploy-time TEAL template replacement parameters. +If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + +Useful if you want to vend multiple contracts from the same factory without specifying this value +for each call. + +#### Defined in + +[src/types/app-factory.ts:85](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L85) + +___ + +### updatable + +• `Optional` **updatable**: `boolean` + +Whether or not the contract should have deploy-time immutability control set, undefined = ignore. +If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + +Useful if you want to vend multiple contracts from the same factory without specifying this value +for each call. + +#### Defined in + +[src/types/app-factory.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L67) + +___ + +### version + +• `Optional` **version**: `string` + +The version of app that is / will be deployed; defaults to 1.0 + +#### Defined in + +[src/types/app-factory.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L58) diff --git a/docs/code/interfaces/types_app_manager.AppInformation.md b/docs/code/interfaces/types_app_manager.AppInformation.md index f55849d1..c8c17bcb 100644 --- a/docs/code/interfaces/types_app_manager.AppInformation.md +++ b/docs/code/interfaces/types_app_manager.AppInformation.md @@ -32,7 +32,7 @@ The escrow address that the app operates with. #### Defined in -[src/types/app-manager.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L20) +[src/types/app-manager.ts:19](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L19) ___ @@ -44,7 +44,7 @@ The ID of the app. #### Defined in -[src/types/app-manager.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L18) +[src/types/app-manager.ts:17](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L17) ___ @@ -56,7 +56,7 @@ Approval program. #### Defined in -[src/types/app-manager.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L24) +[src/types/app-manager.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L23) ___ @@ -68,7 +68,7 @@ Clear state program. #### Defined in -[src/types/app-manager.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L28) +[src/types/app-manager.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L27) ___ @@ -81,7 +81,7 @@ parameters and global state for this application can be found. #### Defined in -[src/types/app-manager.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L33) +[src/types/app-manager.ts:32](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L32) ___ @@ -93,7 +93,7 @@ Any extra pages that are needed for the smart contract. #### Defined in -[src/types/app-manager.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L47) +[src/types/app-manager.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L46) ___ @@ -105,7 +105,7 @@ The number of allocated byte slices in global state. #### Defined in -[src/types/app-manager.ts:45](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L45) +[src/types/app-manager.ts:44](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L44) ___ @@ -117,7 +117,7 @@ The number of allocated ints in global state. #### Defined in -[src/types/app-manager.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L43) +[src/types/app-manager.ts:42](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L42) ___ @@ -129,7 +129,7 @@ Current global state values. #### Defined in -[src/types/app-manager.ts:37](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L37) +[src/types/app-manager.ts:36](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L36) ___ @@ -141,7 +141,7 @@ The number of allocated byte slices in per-user local state. #### Defined in -[src/types/app-manager.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L41) +[src/types/app-manager.ts:40](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L40) ___ @@ -153,4 +153,4 @@ The number of allocated ints in per-user local state. #### Defined in -[src/types/app-manager.ts:39](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L39) +[src/types/app-manager.ts:38](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L38) diff --git a/docs/code/interfaces/types_app_manager.BoxReference.md b/docs/code/interfaces/types_app_manager.BoxReference.md index d9e83a41..af950640 100644 --- a/docs/code/interfaces/types_app_manager.BoxReference.md +++ b/docs/code/interfaces/types_app_manager.BoxReference.md @@ -23,7 +23,7 @@ A unique application id #### Defined in -[src/types/app-manager.ts:66](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L66) +[src/types/app-manager.ts:65](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L65) ___ @@ -35,4 +35,4 @@ Identifier for a box name #### Defined in -[src/types/app-manager.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L70) +[src/types/app-manager.ts:69](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L69) diff --git a/docs/code/interfaces/types_app_manager.BoxValueRequestParams.md b/docs/code/interfaces/types_app_manager.BoxValueRequestParams.md index c9ef2c00..70726a75 100644 --- a/docs/code/interfaces/types_app_manager.BoxValueRequestParams.md +++ b/docs/code/interfaces/types_app_manager.BoxValueRequestParams.md @@ -24,7 +24,7 @@ The ID of the app return box names for #### Defined in -[src/types/app-manager.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L78) +[src/types/app-manager.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L77) ___ @@ -36,7 +36,7 @@ The name of the box to return either as a string, binary array or `BoxName` #### Defined in -[src/types/app-manager.ts:80](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L80) +[src/types/app-manager.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L79) ___ @@ -48,4 +48,4 @@ The ABI type to decode the value using #### Defined in -[src/types/app-manager.ts:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L82) +[src/types/app-manager.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L81) diff --git a/docs/code/interfaces/types_app_manager.BoxValuesRequestParams.md b/docs/code/interfaces/types_app_manager.BoxValuesRequestParams.md index 7e20dc0d..5b2cc047 100644 --- a/docs/code/interfaces/types_app_manager.BoxValuesRequestParams.md +++ b/docs/code/interfaces/types_app_manager.BoxValuesRequestParams.md @@ -24,7 +24,7 @@ The ID of the app return box names for #### Defined in -[src/types/app-manager.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L90) +[src/types/app-manager.ts:89](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L89) ___ @@ -36,7 +36,7 @@ The names of the boxes to return either as a string, binary array or BoxName` #### Defined in -[src/types/app-manager.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L92) +[src/types/app-manager.ts:91](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L91) ___ @@ -48,4 +48,4 @@ The ABI type to decode the value using #### Defined in -[src/types/app-manager.ts:94](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L94) +[src/types/app-manager.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L93) diff --git a/docs/code/interfaces/types_app_spec.AppSources.md b/docs/code/interfaces/types_app_spec.AppSources.md index 8f981887..272db178 100644 --- a/docs/code/interfaces/types_app_spec.AppSources.md +++ b/docs/code/interfaces/types_app_spec.AppSources.md @@ -23,7 +23,7 @@ The TEAL source of the approval program #### Defined in -[src/types/app-spec.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L27) +[src/types/app-spec.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L147) ___ @@ -35,4 +35,4 @@ The TEAL source of the clear program #### Defined in -[src/types/app-spec.ts:29](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L29) +[src/types/app-spec.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L149) diff --git a/docs/code/interfaces/types_app_spec.AppSpec.md b/docs/code/interfaces/types_app_spec.AppSpec.md index 10de5d8b..cd69ed3b 100644 --- a/docs/code/interfaces/types_app_spec.AppSpec.md +++ b/docs/code/interfaces/types_app_spec.AppSpec.md @@ -27,7 +27,7 @@ The config of all BARE calls (i.e. non ABI calls with no args) #### Defined in -[src/types/app-spec.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L18) +[src/types/app-spec.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L138) ___ @@ -39,7 +39,7 @@ The ABI-0004 contract definition see https://github.com/algorandfoundation/ARCs/ #### Defined in -[src/types/app-spec.ts:12](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L12) +[src/types/app-spec.ts:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L132) ___ @@ -51,7 +51,7 @@ Method call hints #### Defined in -[src/types/app-spec.ts:8](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L8) +[src/types/app-spec.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L128) ___ @@ -63,7 +63,7 @@ The values that make up the local and global state #### Defined in -[src/types/app-spec.ts:14](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L14) +[src/types/app-spec.ts:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L134) ___ @@ -75,7 +75,7 @@ The TEAL source #### Defined in -[src/types/app-spec.ts:10](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L10) +[src/types/app-spec.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L130) ___ @@ -87,4 +87,4 @@ The rolled-up schema allocation values for local and global state #### Defined in -[src/types/app-spec.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L16) +[src/types/app-spec.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L136) diff --git a/docs/code/interfaces/types_app_spec.CallConfig.md b/docs/code/interfaces/types_app_spec.CallConfig.md index 78b33bc6..edabc787 100644 --- a/docs/code/interfaces/types_app_spec.CallConfig.md +++ b/docs/code/interfaces/types_app_spec.CallConfig.md @@ -26,7 +26,7 @@ Close out call config #### Defined in -[src/types/app-spec.ts:47](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L47) +[src/types/app-spec.ts:167](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L167) ___ @@ -38,7 +38,7 @@ Delete call config #### Defined in -[src/types/app-spec.ts:51](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L51) +[src/types/app-spec.ts:171](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L171) ___ @@ -50,7 +50,7 @@ NoOp call config #### Defined in -[src/types/app-spec.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L43) +[src/types/app-spec.ts:163](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L163) ___ @@ -62,7 +62,7 @@ Opt-in call config #### Defined in -[src/types/app-spec.ts:45](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L45) +[src/types/app-spec.ts:165](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L165) ___ @@ -74,4 +74,4 @@ Update call config #### Defined in -[src/types/app-spec.ts:49](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L49) +[src/types/app-spec.ts:169](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L169) diff --git a/docs/code/interfaces/types_app_spec.DeclaredSchemaValueSpec.md b/docs/code/interfaces/types_app_spec.DeclaredSchemaValueSpec.md index 7af5e30c..56644021 100644 --- a/docs/code/interfaces/types_app_spec.DeclaredSchemaValueSpec.md +++ b/docs/code/interfaces/types_app_spec.DeclaredSchemaValueSpec.md @@ -25,7 +25,7 @@ A description of the variable #### Defined in -[src/types/app-spec.ts:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L132) +[src/types/app-spec.ts:252](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L252) ___ @@ -37,7 +37,7 @@ The name of the key #### Defined in -[src/types/app-spec.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L130) +[src/types/app-spec.ts:250](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L250) ___ @@ -49,7 +49,7 @@ Whether or not the value is set statically (at create time only) or dynamically #### Defined in -[src/types/app-spec.ts:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L134) +[src/types/app-spec.ts:254](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L254) ___ @@ -61,4 +61,4 @@ The type of value #### Defined in -[src/types/app-spec.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L128) +[src/types/app-spec.ts:248](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L248) diff --git a/docs/code/interfaces/types_app_spec.Hint.md b/docs/code/interfaces/types_app_spec.Hint.md index 740d857c..3ee1e837 100644 --- a/docs/code/interfaces/types_app_spec.Hint.md +++ b/docs/code/interfaces/types_app_spec.Hint.md @@ -23,7 +23,7 @@ Hint information for a given method call to allow client generation #### Defined in -[src/types/app-spec.ts:60](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L60) +[src/types/app-spec.ts:180](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L180) ___ @@ -33,7 +33,7 @@ ___ #### Defined in -[src/types/app-spec.ts:59](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L59) +[src/types/app-spec.ts:179](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L179) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[src/types/app-spec.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L58) +[src/types/app-spec.ts:178](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L178) ___ @@ -55,4 +55,4 @@ Any user-defined struct/tuple types used in the method call, keyed by parameter #### Defined in -[src/types/app-spec.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L57) +[src/types/app-spec.ts:177](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L177) diff --git a/docs/code/interfaces/types_app_spec.ReservedSchemaValueSpec.md b/docs/code/interfaces/types_app_spec.ReservedSchemaValueSpec.md index 72ddb3cf..58e7b2cd 100644 --- a/docs/code/interfaces/types_app_spec.ReservedSchemaValueSpec.md +++ b/docs/code/interfaces/types_app_spec.ReservedSchemaValueSpec.md @@ -24,7 +24,7 @@ The description of the reserved storage space #### Defined in -[src/types/app-spec.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L142) +[src/types/app-spec.ts:262](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L262) ___ @@ -36,7 +36,7 @@ The maximum number of slots to reserve #### Defined in -[src/types/app-spec.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L144) +[src/types/app-spec.ts:264](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L264) ___ @@ -48,4 +48,4 @@ The type of value #### Defined in -[src/types/app-spec.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L140) +[src/types/app-spec.ts:260](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L260) diff --git a/docs/code/interfaces/types_app_spec.Schema.md b/docs/code/interfaces/types_app_spec.Schema.md index 9e5ee469..396efb94 100644 --- a/docs/code/interfaces/types_app_spec.Schema.md +++ b/docs/code/interfaces/types_app_spec.Schema.md @@ -23,7 +23,7 @@ Declared storage schema #### Defined in -[src/types/app-spec.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L158) +[src/types/app-spec.ts:278](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L278) ___ @@ -35,4 +35,4 @@ Reserved storage schema #### Defined in -[src/types/app-spec.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L160) +[src/types/app-spec.ts:280](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L280) diff --git a/docs/code/interfaces/types_app_spec.SchemaSpec.md b/docs/code/interfaces/types_app_spec.SchemaSpec.md index 276f53a3..3b4c8673 100644 --- a/docs/code/interfaces/types_app_spec.SchemaSpec.md +++ b/docs/code/interfaces/types_app_spec.SchemaSpec.md @@ -23,7 +23,7 @@ The global storage schema #### Defined in -[src/types/app-spec.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L152) +[src/types/app-spec.ts:272](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L272) ___ @@ -35,4 +35,4 @@ The local storage schema #### Defined in -[src/types/app-spec.ts:150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L150) +[src/types/app-spec.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L270) diff --git a/docs/code/interfaces/types_app_spec.StateSchemaSpec.md b/docs/code/interfaces/types_app_spec.StateSchemaSpec.md index 3ddcf61e..b7d54bd9 100644 --- a/docs/code/interfaces/types_app_spec.StateSchemaSpec.md +++ b/docs/code/interfaces/types_app_spec.StateSchemaSpec.md @@ -23,7 +23,7 @@ Global storage spec #### Defined in -[src/types/app-spec.ts:166](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L166) +[src/types/app-spec.ts:286](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L286) ___ @@ -35,4 +35,4 @@ Local storage spec #### Defined in -[src/types/app-spec.ts:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L168) +[src/types/app-spec.ts:288](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L288) diff --git a/docs/code/interfaces/types_app_spec.Struct.md b/docs/code/interfaces/types_app_spec.Struct.md index 830a780d..0209446b 100644 --- a/docs/code/interfaces/types_app_spec.Struct.md +++ b/docs/code/interfaces/types_app_spec.Struct.md @@ -23,7 +23,7 @@ The elements (in order) that make up the struct/tuple #### Defined in -[src/types/app-spec.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L77) +[src/types/app-spec.ts:197](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L197) ___ @@ -35,4 +35,4 @@ The name of the type #### Defined in -[src/types/app-spec.ts:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L75) +[src/types/app-spec.ts:195](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L195) diff --git a/docs/code/interfaces/types_asset_manager.AssetInformation.md b/docs/code/interfaces/types_asset_manager.AssetInformation.md index 206d187e..95939337 100644 --- a/docs/code/interfaces/types_asset_manager.AssetInformation.md +++ b/docs/code/interfaces/types_asset_manager.AssetInformation.md @@ -37,7 +37,7 @@ The ID of the asset. #### Defined in -[src/types/asset-manager.ts:19](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L19) +[src/types/asset-manager.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L20) ___ @@ -51,7 +51,7 @@ Max size is 32 bytes. #### Defined in -[src/types/asset-manager.ts:110](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L110) +[src/types/asset-manager.ts:111](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L111) ___ @@ -65,7 +65,7 @@ Max size is 32 bytes. #### Defined in -[src/types/asset-manager.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L116) +[src/types/asset-manager.ts:117](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L117) ___ @@ -83,7 +83,7 @@ If not set the field is permanently empty. #### Defined in -[src/types/asset-manager.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L92) +[src/types/asset-manager.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L93) ___ @@ -99,7 +99,7 @@ closing out an asset position and opting-out of the asset. #### Defined in -[src/types/asset-manager.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L27) +[src/types/asset-manager.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L28) ___ @@ -117,7 +117,7 @@ The amount of decimal places the asset was created with. #### Defined in -[src/types/asset-manager.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L43) +[src/types/asset-manager.ts:44](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L44) ___ @@ -133,7 +133,7 @@ transaction from the `freeze` account. #### Defined in -[src/types/asset-manager.ts:51](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L51) +[src/types/asset-manager.ts:52](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L52) ___ @@ -149,7 +149,7 @@ If not set the field is permanently empty. #### Defined in -[src/types/asset-manager.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L81) +[src/types/asset-manager.ts:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L82) ___ @@ -163,7 +163,7 @@ If not set the asset is permanently immutable. #### Defined in -[src/types/asset-manager.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L57) +[src/types/asset-manager.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L58) ___ @@ -177,7 +177,7 @@ The format of this metadata is up to the application. #### Defined in -[src/types/asset-manager.ts:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L134) +[src/types/asset-manager.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L135) ___ @@ -199,7 +199,7 @@ If not set the field is permanently empty. #### Defined in -[src/types/asset-manager.ts:72](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L72) +[src/types/asset-manager.ts:73](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L73) ___ @@ -213,7 +213,7 @@ For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 who #### Defined in -[src/types/asset-manager.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L33) +[src/types/asset-manager.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L34) ___ @@ -227,7 +227,7 @@ Max size is 8 bytes. #### Defined in -[src/types/asset-manager.ts:98](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L98) +[src/types/asset-manager.ts:99](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L99) ___ @@ -241,7 +241,7 @@ Max size is 8 bytes. #### Defined in -[src/types/asset-manager.ts:104](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L104) +[src/types/asset-manager.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L105) ___ @@ -255,7 +255,7 @@ Max size is 96 bytes. #### Defined in -[src/types/asset-manager.ts:122](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L122) +[src/types/asset-manager.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L123) ___ @@ -269,4 +269,4 @@ Max size is 96 bytes. #### Defined in -[src/types/asset-manager.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L128) +[src/types/asset-manager.ts:129](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L129) diff --git a/docs/code/interfaces/types_asset_manager.BulkAssetOptInOutResult.md b/docs/code/interfaces/types_asset_manager.BulkAssetOptInOutResult.md index 1297e837..b3db484d 100644 --- a/docs/code/interfaces/types_asset_manager.BulkAssetOptInOutResult.md +++ b/docs/code/interfaces/types_asset_manager.BulkAssetOptInOutResult.md @@ -23,7 +23,7 @@ The ID of the asset opted into / out of #### Defined in -[src/types/asset-manager.ts:11](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L11) +[src/types/asset-manager.ts:12](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L12) ___ @@ -35,4 +35,4 @@ The transaction ID of the resulting opt in / out #### Defined in -[src/types/asset-manager.ts:13](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L13) +[src/types/asset-manager.ts:14](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/asset-manager.ts#L14) diff --git a/docs/code/interfaces/types_client_manager.AlgoSdkClients.md b/docs/code/interfaces/types_client_manager.AlgoSdkClients.md index 28199120..bd2f3af9 100644 --- a/docs/code/interfaces/types_client_manager.AlgoSdkClients.md +++ b/docs/code/interfaces/types_client_manager.AlgoSdkClients.md @@ -24,7 +24,7 @@ Algod client, see https://developer.algorand.org/docs/rest-apis/algod/ #### Defined in -[src/types/client-manager.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L23) +[src/types/client-manager.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L18) ___ @@ -36,7 +36,7 @@ Optional indexer client, see https://developer.algorand.org/docs/rest-apis/index #### Defined in -[src/types/client-manager.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L25) +[src/types/client-manager.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L20) ___ @@ -48,4 +48,4 @@ Optional KMD client, see https://developer.algorand.org/docs/rest-apis/kmd/ #### Defined in -[src/types/client-manager.ts:27](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L27) +[src/types/client-manager.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L22) diff --git a/docs/code/interfaces/types_client_manager.NetworkDetails.md b/docs/code/interfaces/types_client_manager.NetworkDetails.md deleted file mode 100644 index a2b45c36..00000000 --- a/docs/code/interfaces/types_client_manager.NetworkDetails.md +++ /dev/null @@ -1,77 +0,0 @@ -[@algorandfoundation/algokit-utils](../README.md) / [types/client-manager](../modules/types_client_manager.md) / NetworkDetails - -# Interface: NetworkDetails - -[types/client-manager](../modules/types_client_manager.md).NetworkDetails - -Details of the current network. - -## Table of contents - -### Properties - -- [genesisHash](types_client_manager.NetworkDetails.md#genesishash) -- [genesisId](types_client_manager.NetworkDetails.md#genesisid) -- [isLocalNet](types_client_manager.NetworkDetails.md#islocalnet) -- [isMainNet](types_client_manager.NetworkDetails.md#ismainnet) -- [isTestNet](types_client_manager.NetworkDetails.md#istestnet) - -## Properties - -### genesisHash - -• **genesisHash**: `string` - -The base64 genesis hash of the current network. - -#### Defined in - -[src/types/client-manager.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L41) - -___ - -### genesisId - -• **genesisId**: `string` - -The genesis ID of the current network. - -#### Defined in - -[src/types/client-manager.ts:39](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L39) - -___ - -### isLocalNet - -• **isLocalNet**: `boolean` - -Whether or not the network is LocalNet. - -#### Defined in - -[src/types/client-manager.ts:37](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L37) - -___ - -### isMainNet - -• **isMainNet**: `boolean` - -Whether or not the network is MainNet. - -#### Defined in - -[src/types/client-manager.ts:35](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L35) - -___ - -### isTestNet - -• **isTestNet**: `boolean` - -Whether or not the network is TestNet. - -#### Defined in - -[src/types/client-manager.ts:33](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L33) diff --git a/docs/code/interfaces/types_client_manager.TypedAppClient.md b/docs/code/interfaces/types_client_manager.TypedAppClient.md index ee54c56e..cbab5c8d 100644 --- a/docs/code/interfaces/types_client_manager.TypedAppClient.md +++ b/docs/code/interfaces/types_client_manager.TypedAppClient.md @@ -18,18 +18,22 @@ Interface to identify a typed client that can be used to interact with an applic - [constructor](types_client_manager.TypedAppClient.md#constructor) +### Methods + +- [fromCreatorAndName](types_client_manager.TypedAppClient.md#fromcreatorandname) +- [fromNetwork](types_client_manager.TypedAppClient.md#fromnetwork) + ## Constructors ### constructor -• **new TypedAppClient**(`details`, `algod`): `TClient` +• **new TypedAppClient**(`params`): `TClient` #### Parameters | Name | Type | | :------ | :------ | -| `details` | [`AppDetails`](../modules/types_app_client.md#appdetails) | -| `algod` | `default` | +| `params` | `Omit`\<[`AppClientParams`](types_app_client.AppClientParams.md), ``"appSpec"``\> | #### Returns @@ -37,4 +41,44 @@ Interface to identify a typed client that can be used to interact with an applic #### Defined in -[src/types/client-manager.ts:507](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L507) +[src/types/client-manager.ts:617](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L617) + +## Methods + +### fromCreatorAndName + +▸ **fromCreatorAndName**(`params`): `Promise`\<`TClient`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `Omit`\<\{ `algorand`: [`AlgorandClientInterface`](types_algorand_client_interface.AlgorandClientInterface.md) ; `appLookupCache?`: [`AppLookup`](types_app_deployer.AppLookup.md) ; `appName?`: `string` ; `appSpec`: `string` \| [`Arc56Contract`](types_app_arc56.Arc56Contract.md) \| [`AppSpec`](types_app_spec.AppSpec.md) ; `approvalSourceMap?`: `SourceMap` ; `clearSourceMap?`: `SourceMap` ; `creatorAddress`: `string` ; `defaultSender?`: `string` ; `ignoreCache?`: `boolean` }, ``"appSpec"``\> | + +#### Returns + +`Promise`\<`TClient`\> + +#### Defined in + +[src/types/client-manager.ts:619](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L619) + +___ + +### fromNetwork + +▸ **fromNetwork**(`params`): `Promise`\<`TClient`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `Omit`\<[`AppClientParams`](types_app_client.AppClientParams.md), ``"appId"`` \| ``"appSpec"``\> | + +#### Returns + +`Promise`\<`TClient`\> + +#### Defined in + +[src/types/client-manager.ts:618](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L618) diff --git a/docs/code/interfaces/types_client_manager.TypedAppFactory.md b/docs/code/interfaces/types_client_manager.TypedAppFactory.md new file mode 100644 index 00000000..350601cc --- /dev/null +++ b/docs/code/interfaces/types_client_manager.TypedAppFactory.md @@ -0,0 +1,39 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/client-manager](../modules/types_client_manager.md) / TypedAppFactory + +# Interface: TypedAppFactory\ + +[types/client-manager](../modules/types_client_manager.md).TypedAppFactory + +Interface to identify a typed factory that can be used to create and deploy an application. + +## Type parameters + +| Name | +| :------ | +| `TClient` | + +## Table of contents + +### Constructors + +- [constructor](types_client_manager.TypedAppFactory.md#constructor) + +## Constructors + +### constructor + +• **new TypedAppFactory**(`params`): `TClient` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `params` | `Omit`\<[`AppFactoryParams`](types_app_factory.AppFactoryParams.md), ``"appSpec"``\> | + +#### Returns + +`TClient` + +#### Defined in + +[src/types/client-manager.ts:626](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L626) diff --git a/docs/code/interfaces/types_composer.BuiltTransactions.md b/docs/code/interfaces/types_composer.BuiltTransactions.md index f337f389..103acea1 100644 --- a/docs/code/interfaces/types_composer.BuiltTransactions.md +++ b/docs/code/interfaces/types_composer.BuiltTransactions.md @@ -24,7 +24,7 @@ Any `ABIMethod` objects associated with any of the transactions in a map keyed b #### Defined in -[src/types/composer.ts:455](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L455) +[src/types/composer.ts:473](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L473) ___ @@ -36,7 +36,7 @@ Any `TransactionSigner` objects associated with any of the transactions in a map #### Defined in -[src/types/composer.ts:457](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L457) +[src/types/composer.ts:475](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L475) ___ @@ -48,4 +48,4 @@ The built transactions #### Defined in -[src/types/composer.ts:453](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L453) +[src/types/composer.ts:471](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L471) diff --git a/docs/code/interfaces/types_composer.ExecuteParams.md b/docs/code/interfaces/types_composer.ExecuteParams.md deleted file mode 100644 index fcf90804..00000000 --- a/docs/code/interfaces/types_composer.ExecuteParams.md +++ /dev/null @@ -1,51 +0,0 @@ -[@algorandfoundation/algokit-utils](../README.md) / [types/composer](../modules/types_composer.md) / ExecuteParams - -# Interface: ExecuteParams - -[types/composer](../modules/types_composer.md).ExecuteParams - -Parameters to configure transaction execution. - -## Table of contents - -### Properties - -- [maxRoundsToWaitForConfirmation](types_composer.ExecuteParams.md#maxroundstowaitforconfirmation) -- [populateAppCallResources](types_composer.ExecuteParams.md#populateappcallresources) -- [suppressLog](types_composer.ExecuteParams.md#suppresslog) - -## Properties - -### maxRoundsToWaitForConfirmation - -• `Optional` **maxRoundsToWaitForConfirmation**: `number` - -The number of rounds to wait for confirmation. By default until the latest lastValid has past. - -#### Defined in - -[src/types/composer.ts:424](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L424) - -___ - -### populateAppCallResources - -• `Optional` **populateAppCallResources**: `boolean` - -Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. - -#### Defined in - -[src/types/composer.ts:428](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L428) - -___ - -### suppressLog - -• `Optional` **suppressLog**: `boolean` - -Whether to suppress log messages from transaction send, default: do not suppress. - -#### Defined in - -[src/types/composer.ts:426](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L426) diff --git a/docs/code/interfaces/types_debugging.AVMDebuggerSourceMapDict.md b/docs/code/interfaces/types_debugging.AVMDebuggerSourceMapDict.md index 4b6a0567..abfe60b1 100644 --- a/docs/code/interfaces/types_debugging.AVMDebuggerSourceMapDict.md +++ b/docs/code/interfaces/types_debugging.AVMDebuggerSourceMapDict.md @@ -20,4 +20,4 @@ AVM debugger source map format. #### Defined in -[src/types/debugging.ts:8](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L8) +[src/types/debugging.ts:9](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L9) diff --git a/docs/code/interfaces/types_debugging.PersistSourceMapsParams.md b/docs/code/interfaces/types_debugging.PersistSourceMapsParams.md index 165ba394..e1eba4ed 100644 --- a/docs/code/interfaces/types_debugging.PersistSourceMapsParams.md +++ b/docs/code/interfaces/types_debugging.PersistSourceMapsParams.md @@ -10,22 +10,22 @@ Parameters to a call that persists source maps ### Properties -- [client](types_debugging.PersistSourceMapsParams.md#client) +- [appManager](types_debugging.PersistSourceMapsParams.md#appmanager) - [projectRoot](types_debugging.PersistSourceMapsParams.md#projectroot) - [sources](types_debugging.PersistSourceMapsParams.md#sources) - [withSources](types_debugging.PersistSourceMapsParams.md#withsources) ## Properties -### client +### appManager -• **client**: `default` +• **appManager**: [`AppManager`](../classes/types_app_manager.AppManager.md) -An Algodv2 client to perform the compilation. +An `AppManager` to perform the compilation. #### Defined in -[src/types/debugging.ts:148](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L148) +[src/types/debugging.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L149) ___ @@ -37,7 +37,7 @@ The root directory of the project. #### Defined in -[src/types/debugging.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L146) +[src/types/debugging.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L147) ___ @@ -49,7 +49,7 @@ An array of PersistSourceMapInput objects. Each object can either contain rawTea #### Defined in -[src/types/debugging.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L144) +[src/types/debugging.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L145) ___ @@ -61,4 +61,4 @@ A boolean indicating whether to include the source files in the output. #### Defined in -[src/types/debugging.ts:150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L150) +[src/types/debugging.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L151) diff --git a/docs/code/interfaces/types_debugging.SimulateAndPersistResponseParams.md b/docs/code/interfaces/types_debugging.SimulateAndPersistResponseParams.md index 19ed8f79..e9b5b1ec 100644 --- a/docs/code/interfaces/types_debugging.SimulateAndPersistResponseParams.md +++ b/docs/code/interfaces/types_debugging.SimulateAndPersistResponseParams.md @@ -25,7 +25,7 @@ algod An Algodv2 client to perform the simulation. #### Defined in -[src/types/debugging.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L158) +[src/types/debugging.ts:159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L159) ___ @@ -37,7 +37,7 @@ The AtomicTransactionComposer with transaction(s) loaded. #### Defined in -[src/types/debugging.ts:160](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L160) +[src/types/debugging.ts:161](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L161) ___ @@ -49,7 +49,7 @@ bufferSizeMb The buffer size in megabytes. #### Defined in -[src/types/debugging.ts:164](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L164) +[src/types/debugging.ts:165](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L165) ___ @@ -61,4 +61,4 @@ projectRoot The root directory of the project. #### Defined in -[src/types/debugging.ts:162](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L162) +[src/types/debugging.ts:163](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/debugging.ts#L163) diff --git a/docs/code/interfaces/types_network_client.NetworkDetails.md b/docs/code/interfaces/types_network_client.NetworkDetails.md new file mode 100644 index 00000000..7c03383f --- /dev/null +++ b/docs/code/interfaces/types_network_client.NetworkDetails.md @@ -0,0 +1,77 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/network-client](../modules/types_network_client.md) / NetworkDetails + +# Interface: NetworkDetails + +[types/network-client](../modules/types_network_client.md).NetworkDetails + +Details of the current network. + +## Table of contents + +### Properties + +- [genesisHash](types_network_client.NetworkDetails.md#genesishash) +- [genesisId](types_network_client.NetworkDetails.md#genesisid) +- [isLocalNet](types_network_client.NetworkDetails.md#islocalnet) +- [isMainNet](types_network_client.NetworkDetails.md#ismainnet) +- [isTestNet](types_network_client.NetworkDetails.md#istestnet) + +## Properties + +### genesisHash + +• **genesisHash**: `string` + +The base64 genesis hash of the current network. + +#### Defined in + +[src/types/network-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L34) + +___ + +### genesisId + +• **genesisId**: `string` + +The genesis ID of the current network. + +#### Defined in + +[src/types/network-client.ts:32](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L32) + +___ + +### isLocalNet + +• **isLocalNet**: `boolean` + +Whether or not the network is LocalNet. + +#### Defined in + +[src/types/network-client.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L30) + +___ + +### isMainNet + +• **isMainNet**: `boolean` + +Whether or not the network is MainNet. + +#### Defined in + +[src/types/network-client.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L28) + +___ + +### isTestNet + +• **isTestNet**: `boolean` + +Whether or not the network is TestNet. + +#### Defined in + +[src/types/network-client.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L26) diff --git a/docs/code/interfaces/types_testing.LogSnapshotConfig.md b/docs/code/interfaces/types_testing.LogSnapshotConfig.md index 7d9cde07..7fa77959 100644 --- a/docs/code/interfaces/types_testing.LogSnapshotConfig.md +++ b/docs/code/interfaces/types_testing.LogSnapshotConfig.md @@ -20,7 +20,7 @@ This helps ensure that the provided configuration items won't appear ### accounts -• `Optional` **accounts**: (`string` \| [`SendTransactionFrom`](../modules/types_transaction.md#sendtransactionfrom))[] +• `Optional` **accounts**: (`string` \| [`MultisigAccount`](../classes/types_account.MultisigAccount.md) \| `default` \| [`SigningAccount`](../classes/types_account.SigningAccount.md) \| [`TransactionSignerAccount`](types_account.TransactionSignerAccount.md) \| `LogicSigAccount`)[] Any accounts/addresses to replace the address for predictably diff --git a/docs/code/interfaces/types_transaction.AtomicTransactionComposerToSend.md b/docs/code/interfaces/types_transaction.AtomicTransactionComposerToSend.md index 9f0c79f5..77a79067 100644 --- a/docs/code/interfaces/types_transaction.AtomicTransactionComposerToSend.md +++ b/docs/code/interfaces/types_transaction.AtomicTransactionComposerToSend.md @@ -11,6 +11,7 @@ An `AtomicTransactionComposer` with transactions to send. ### Properties - [atc](types_transaction.AtomicTransactionComposerToSend.md#atc) +- [executeParams](types_transaction.AtomicTransactionComposerToSend.md#executeparams) - [sendParams](types_transaction.AtomicTransactionComposerToSend.md#sendparams) ## Properties @@ -23,7 +24,19 @@ The `AtomicTransactionComposer` with transactions loaded to send #### Defined in -[src/types/transaction.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L136) +[src/types/transaction.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L146) + +___ + +### executeParams + +• `Optional` **executeParams**: [`ExecuteParams`](types_transaction.ExecuteParams.md) + +Any parameters to control the semantics of the send to the network + +#### Defined in + +[src/types/transaction.ts:148](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L148) ___ @@ -31,8 +44,11 @@ ___ • `Optional` **sendParams**: `Omit`\<[`SendTransactionParams`](types_transaction.SendTransactionParams.md), ``"fee"`` \| ``"maxFee"`` \| ``"skipSending"`` \| ``"atc"``\> +**`Deprecated`** + +- use executeParams instead Any parameters to control the semantics of the send to the network #### Defined in -[src/types/transaction.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L138) +[src/types/transaction.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L152) diff --git a/docs/code/interfaces/types_transaction.ExecuteParams.md b/docs/code/interfaces/types_transaction.ExecuteParams.md new file mode 100644 index 00000000..e5e6de0c --- /dev/null +++ b/docs/code/interfaces/types_transaction.ExecuteParams.md @@ -0,0 +1,51 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/transaction](../modules/types_transaction.md) / ExecuteParams + +# Interface: ExecuteParams + +[types/transaction](../modules/types_transaction.md).ExecuteParams + +Parameters to configure transaction execution. + +## Table of contents + +### Properties + +- [maxRoundsToWaitForConfirmation](types_transaction.ExecuteParams.md#maxroundstowaitforconfirmation) +- [populateAppCallResources](types_transaction.ExecuteParams.md#populateappcallresources) +- [suppressLog](types_transaction.ExecuteParams.md#suppresslog) + +## Properties + +### maxRoundsToWaitForConfirmation + +• `Optional` **maxRoundsToWaitForConfirmation**: `number` + +The number of rounds to wait for confirmation. By default until the latest lastValid has past. + +#### Defined in + +[src/types/transaction.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L136) + +___ + +### populateAppCallResources + +• `Optional` **populateAppCallResources**: `boolean` + +Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. + +#### Defined in + +[src/types/transaction.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L140) + +___ + +### suppressLog + +• `Optional` **suppressLog**: `boolean` + +Whether to suppress log messages from transaction send, default: do not suppress. + +#### Defined in + +[src/types/transaction.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/transaction.ts#L138) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 08032575..838bdee4 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -233,7 +233,7 @@ Returns an amount of Algo using AlgoAmount | Name | Type | Description | | :------ | :------ | :------ | -| `algos` | `number` | The amount of Algo | +| `algos` | `number` \| `bigint` | The amount of Algo | #### Returns @@ -241,7 +241,7 @@ Returns an amount of Algo using AlgoAmount #### Defined in -[src/amount.ts:51](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L51) +[src/amount.ts:69](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L69) ___ @@ -255,7 +255,7 @@ Returns an amount of Algo using AlgoAmount | Name | Type | Description | | :------ | :------ | :------ | -| `algos` | `number` | The amount of Algo | +| `algos` | `number` \| `bigint` | The amount of Algo | #### Returns @@ -263,7 +263,7 @@ Returns an amount of Algo using AlgoAmount #### Defined in -[src/amount.ts:44](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L44) +[src/amount.ts:62](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L62) ___ @@ -302,7 +302,7 @@ algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod) #### Defined in -[src/asset.ts:131](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L131) +[src/asset.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L130) ___ @@ -341,7 +341,7 @@ algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod) #### Defined in -[src/asset.ts:159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L159) +[src/asset.ts:157](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L157) ___ @@ -376,7 +376,7 @@ await algokit.assetOptIn({ account, assetId }, algod) #### Defined in -[src/asset.ts:68](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L68) +[src/asset.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L67) ___ @@ -411,7 +411,7 @@ await algokit.assetOptOut({ account, assetId, assetCreatorAddress }, algod) #### Defined in -[src/asset.ts:99](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L99) +[src/asset.ts:98](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L98) ___ @@ -441,7 +441,7 @@ Issues a call to a given app. #### Defined in -[src/app.ts:185](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L185) +[src/app.ts:183](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L183) ___ @@ -449,10 +449,6 @@ ___ ▸ **capTransactionFee**(`transaction`, `maxAcceptableFee`): `void` -Limit the acceptable fee to a defined amount of µAlgo. -This also sets the transaction to be flatFee to ensure the transaction only succeeds at -the estimated rate. - #### Parameters | Name | Type | Description | @@ -464,9 +460,17 @@ the estimated rate. `void` +**`Deprecated`** + +Use `AlgoKitComposer` and the `maxFee` field in the transaction params instead. + +Limit the acceptable fee to a defined amount of µAlgo. +This also sets the transaction to be flatFee to ensure the transaction only succeeds at +the estimated rate. + #### Defined in -[src/transaction/transaction.ts:816](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L816) +[src/transaction/transaction.ts:848](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L848) ___ @@ -495,7 +499,7 @@ Compiles the given TEAL using algod and returns the result, including source map #### Defined in -[src/app.ts:413](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L413) +[src/app.ts:415](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L415) ___ @@ -503,8 +507,6 @@ ___ ▸ **controlFees**\<`T`\>(`transaction`, `feeControl`): `T` -Allows for control of fees on a `Transaction` or `SuggestedParams` object - #### Type parameters | Name | Type | @@ -524,9 +526,15 @@ Allows for control of fees on a `Transaction` or `SuggestedParams` object `T` +**`Deprecated`** + +Use `AlgoKitComposer` and the `maxFee` and `staticFee` fields in the transaction params instead. + +Allows for control of fees on a `Transaction` or `SuggestedParams` object + #### Defined in -[src/transaction/transaction.ts:839](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L839) +[src/transaction/transaction.ts:873](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L873) ___ @@ -556,7 +564,7 @@ Creates a smart contract app, returns the details of the created app. #### Defined in -[src/app.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L46) +[src/app.ts:44](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L44) ___ @@ -591,7 +599,7 @@ await algokit.createAsset({ creator: account, total: 1, decimals: 0, name: 'My a #### Defined in -[src/asset.ts:24](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L24) +[src/asset.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/asset.ts#L23) ___ @@ -620,7 +628,7 @@ generic object keyed by the UTF-8 value of the key. #### Defined in -[src/app.ts:339](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L339) +[src/app.ts:341](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L341) ___ @@ -698,7 +706,7 @@ algokit.encodeLease(new Uint8Array([1, 2, 3])) #### Defined in -[src/transaction/transaction.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L67) +[src/transaction/transaction.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L70) ___ @@ -706,8 +714,6 @@ ___ ▸ **encodeTransactionNote**(`note?`): `Uint8Array` \| `undefined` -Encodes a transaction note into a byte array ready to be included in an Algorand transaction. - #### Parameters | Name | Type | Description | @@ -727,9 +733,15 @@ the transaction note ready for inclusion in a transaction * Arc2TransactionNote object: ARC-0002 compatible transaction note * Else: The object/value converted into a JSON string representation +**`Deprecated`** + +Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `AlgoKitComposer.arc2Note`. + +Encodes a transaction note into a byte array ready to be included in an Algorand transaction. + #### Defined in -[src/transaction/transaction.ts:43](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L43) +[src/transaction/transaction.ts:46](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L46) ___ @@ -797,7 +809,7 @@ Returns the encoded ABI spec for a given ABI Method #### Defined in -[src/app.ts:424](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L424) +[src/app.ts:426](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L426) ___ @@ -826,7 +838,7 @@ Returns any ABI return values for the given app call arguments and transaction c #### Defined in -[src/app.ts:229](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L229) +[src/app.ts:231](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L231) ___ @@ -1288,7 +1300,7 @@ ___ ### getAppArgsForABICall -▸ **getAppArgsForABICall**(`args`, `from`): `Promise`\<\{ `appAccounts`: `undefined` \| `string`[] ; `appForeignApps`: `undefined` \| `number`[] = args.apps; `appForeignAssets`: `undefined` \| `number`[] = args.assets; `boxes`: `undefined` \| `BoxReference`[] ; `lease`: `undefined` \| `Uint8Array` ; `method`: `ABIMethod` ; `methodArgs`: (`string` \| `number` \| `bigint` \| `boolean` \| `TransactionWithSigner` \| `Uint8Array` \| `ABIValue`[])[] = methodArgs; `rekeyTo`: `undefined` \| `string` ; `sender`: `string` ; `signer`: `TransactionSigner` = signer }\> +▸ **getAppArgsForABICall**(`args`, `from`): `Promise`\<\{ `appAccounts`: `undefined` \| `string`[] ; `appForeignApps`: `undefined` \| `number`[] = args.apps; `appForeignAssets`: `undefined` \| `number`[] = args.assets; `boxes`: `undefined` \| `BoxReference`[] ; `lease`: `undefined` \| `Uint8Array` ; `method`: `ABIMethod` ; `methodArgs`: (`string` \| `number` \| `bigint` \| `boolean` \| `Uint8Array` \| `ABIValue`[] \| `TransactionWithSigner`)[] = methodArgs; `rekeyTo`: `undefined` \| `string` ; `sender`: `string` ; `signer`: `TransactionSigner` = signer }\> #### Parameters @@ -1299,7 +1311,7 @@ ___ #### Returns -`Promise`\<\{ `appAccounts`: `undefined` \| `string`[] ; `appForeignApps`: `undefined` \| `number`[] = args.apps; `appForeignAssets`: `undefined` \| `number`[] = args.assets; `boxes`: `undefined` \| `BoxReference`[] ; `lease`: `undefined` \| `Uint8Array` ; `method`: `ABIMethod` ; `methodArgs`: (`string` \| `number` \| `bigint` \| `boolean` \| `TransactionWithSigner` \| `Uint8Array` \| `ABIValue`[])[] = methodArgs; `rekeyTo`: `undefined` \| `string` ; `sender`: `string` ; `signer`: `TransactionSigner` = signer }\> +`Promise`\<\{ `appAccounts`: `undefined` \| `string`[] ; `appForeignApps`: `undefined` \| `number`[] = args.apps; `appForeignAssets`: `undefined` \| `number`[] = args.assets; `boxes`: `undefined` \| `BoxReference`[] ; `lease`: `undefined` \| `Uint8Array` ; `method`: `ABIMethod` ; `methodArgs`: (`string` \| `number` \| `bigint` \| `boolean` \| `Uint8Array` \| `ABIValue`[] \| `TransactionWithSigner`)[] = methodArgs; `rekeyTo`: `undefined` \| `string` ; `sender`: `string` ; `signer`: `TransactionSigner` = signer }\> The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer @@ -1311,7 +1323,7 @@ Returns the app args ready to load onto an ABI method call in `AtomicTransaction #### Defined in -[src/app.ts:372](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L372) +[src/app.ts:374](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L374) ___ @@ -1339,7 +1351,7 @@ Returns the app args ready to load onto an app `Transaction` object #### Defined in -[src/app.ts:350](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L350) +[src/app.ts:352](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L352) ___ @@ -1367,7 +1379,7 @@ Returns the names of the boxes for the given app. #### Defined in -[src/app.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L270) +[src/app.ts:272](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L272) ___ @@ -1396,7 +1408,7 @@ Returns the value of the given box name for the given app. #### Defined in -[src/app.ts:282](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L282) +[src/app.ts:284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L284) ___ @@ -1424,7 +1436,7 @@ Returns the value of the given box name for the given app decoded based on the g #### Defined in -[src/app.ts:308](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L308) +[src/app.ts:310](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L310) ___ @@ -1453,7 +1465,7 @@ Returns the value of the given box names for the given app. #### Defined in -[src/app.ts:294](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L294) +[src/app.ts:296](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L296) ___ @@ -1481,7 +1493,7 @@ Returns the value of the given box names for the given app decoded based on the #### Defined in -[src/app.ts:323](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L323) +[src/app.ts:325](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L325) ___ @@ -1510,7 +1522,7 @@ Gets the current data for the given app from algod. #### Defined in -[src/app.ts:400](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L400) +[src/app.ts:402](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L402) ___ @@ -1518,8 +1530,6 @@ ___ ▸ **getAppClient**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) -Create a new ApplicationClient instance - #### Parameters | Name | Type | Description | @@ -1533,6 +1543,15 @@ Create a new ApplicationClient instance The application client +**`Deprecated`** + +Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or +`algorand.client.getAppClientByCreatorAndName`. +If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, +which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + +Create a new ApplicationClient instance + **`Example`** ```ts @@ -1566,7 +1585,7 @@ const client = algokit.getAppClient( #### Defined in -[src/app-client.ts:35](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L35) +[src/app-client.ts:40](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L40) ___ @@ -1574,8 +1593,6 @@ ___ ▸ **getAppClientByCreatorAndName**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) -Create a new ApplicationClient instance by creator and name - #### Parameters | Name | Type | Description | @@ -1589,6 +1606,14 @@ Create a new ApplicationClient instance by creator and name The application client +**`Deprecated`** + +Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`. +If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, +which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + +Create a new ApplicationClient instance by creator and name + **`Example`** ```ts @@ -1605,7 +1630,7 @@ const client = algokit.getAppClientByCreatorAndName( #### Defined in -[src/app-client.ts:78](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L78) +[src/app-client.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L93) ___ @@ -1613,8 +1638,6 @@ ___ ▸ **getAppClientById**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) -Create a new ApplicationClient instance by id - #### Parameters | Name | Type | Description | @@ -1628,6 +1651,14 @@ Create a new ApplicationClient instance by id The application client +**`Deprecated`** + +Use `AppClient` instead e.g. via `algorand.client.getAppClientById`. +If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, +which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + +Create a new ApplicationClient instance by id + **`Example`** ```ts @@ -1643,7 +1674,7 @@ const client = algokit.getAppClientById( #### Defined in -[src/app-client.ts:56](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L56) +[src/app-client.ts:66](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L66) ___ @@ -1671,7 +1702,7 @@ Return the transaction note for an app deployment. #### Defined in -[src/app-deploy.ts:253](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L253) +[src/app-deploy.ts:252](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L252) ___ @@ -1694,13 +1725,13 @@ The current global state **`Deprecated`** -Use `(await appManager.getById(appId)).globalState` instead. +Use `algorand.app.getGlobalState` instead. Returns the current global state values for the given app ID #### Defined in -[src/app.ts:246](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L246) +[src/app.ts:248](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L248) ___ @@ -1730,7 +1761,7 @@ Returns the current global state values for the given app ID and account #### Defined in -[src/app.ts:259](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L259) +[src/app.ts:261](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L261) ___ @@ -1762,7 +1793,7 @@ If given an `AppCallType` will convert the string enum to the correct underlying #### Defined in -[src/app.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L152) +[src/app.ts:150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L150) ___ @@ -1770,8 +1801,6 @@ ___ ▸ **getAtomicTransactionComposerTransactions**(`atc`): `TransactionWithSigner`[] -Returns the array of transactions currently present in the given `AtomicTransactionComposer` - #### Parameters | Name | Type | Description | @@ -1784,9 +1813,15 @@ Returns the array of transactions currently present in the given `AtomicTransact The array of transactions with signers +**`Deprecated`** + +Use `atc.clone().buildGroup()` instead. + +Returns the array of transactions currently present in the given `AtomicTransactionComposer` + #### Defined in -[src/transaction/transaction.ts:871](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L871) +[src/transaction/transaction.ts:909](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L909) ___ @@ -1814,7 +1849,7 @@ Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`. #### Defined in -[src/app.ts:383](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L383) +[src/app.ts:385](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L385) ___ @@ -1865,7 +1900,7 @@ Returns a lookup of name => app metadata (id, address, ...metadata) for all apps #### Defined in -[src/app-deploy.ts:232](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L232) +[src/app-deploy.ts:231](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L231) ___ @@ -2053,8 +2088,6 @@ ___ ▸ **getSenderAddress**(`sender`): `string` -Returns the public address of the given transaction sender. - #### Parameters | Name | Type | Description | @@ -2067,9 +2100,16 @@ Returns the public address of the given transaction sender. The public address +**`Deprecated`** + +Use `algorand.client` to interact with accounts, and use `.addr` to get the address +and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead. + +Returns the public address of the given transaction sender. + #### Defined in -[src/transaction/transaction.ts:100](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L100) +[src/transaction/transaction.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L106) ___ @@ -2077,9 +2117,6 @@ ___ ▸ **getSenderTransactionSigner**(`val`): `TransactionSigner` -Returns a `TransactionSigner` for the given transaction sender. -This function has memoization, so will return the same transaction signer for a given sender. - #### Parameters | Name | Type | @@ -2092,9 +2129,17 @@ This function has memoization, so will return the same transaction signer for a A transaction signer +**`Deprecated`** + +Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use +`algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`. + +Returns a `TransactionSigner` for the given transaction sender. +This function has memoization, so will return the same transaction signer for a given sender. + #### Defined in -[src/transaction/transaction.ts:152](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L152) +[src/transaction/transaction.ts:164](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L164) ___ @@ -2142,8 +2187,6 @@ ___ ▸ **getTransactionParams**(`params`, `algod`): `Promise`\<`SuggestedParamsWithMinFee` \| \{ `fee`: `number` ; `firstRound`: `number` ; `flatFee?`: `boolean` ; `genesisHash`: `string` ; `genesisID`: `string` ; `lastRound`: `number` }\> -Returns suggested transaction parameters from algod unless some are already provided. - #### Parameters | Name | Type | Description | @@ -2157,9 +2200,15 @@ Returns suggested transaction parameters from algod unless some are already prov The suggested transaction parameters +**`Deprecated`** + +Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead + +Returns suggested transaction parameters from algod unless some are already provided. + #### Defined in -[src/transaction/transaction.ts:862](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L862) +[src/transaction/transaction.ts:898](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L898) ___ @@ -2167,14 +2216,11 @@ ___ ▸ **getTransactionWithSigner**(`transaction`, `defaultSender?`): `Promise`\<`TransactionWithSigner`\> -Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an -AtomicTransactionComposer's addTransaction method. - #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `transaction` | `TransactionWithSigner` \| `Transaction` \| [`TransactionToSign`](../interfaces/types_transaction.TransactionToSign.md) \| `Promise`\<[`SendTransactionResult`](../interfaces/types_transaction.SendTransactionResult.md)\> | One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils' helpers (signer is obtained from the defaultSender parameter) | +| `transaction` | `Transaction` \| [`TransactionToSign`](../interfaces/types_transaction.TransactionToSign.md) \| `Promise`\<[`SendTransactionResult`](../interfaces/types_transaction.SendTransactionResult.md)\> \| `TransactionWithSigner` | One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils' helpers (signer is obtained from the defaultSender parameter) | | `defaultSender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. | #### Returns @@ -2183,9 +2229,17 @@ AtomicTransactionComposer's addTransaction method. A TransactionWithSigner object. +**`Deprecated`** + +Use `AlgorandClient` / `AlgoKitComposer` to construct transactions instead or +construct an `algosdk.TransactionWithSigner` manually instead. + +Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an +AtomicTransactionComposer's addTransaction method. + #### Defined in -[src/transaction/transaction.ts:114](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L114) +[src/transaction/transaction.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L123) ___ @@ -2266,7 +2320,7 @@ Returns true is there is a breaking change in the application state schema from #### Defined in -[src/app-deploy.ts:217](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L217) +[src/app-deploy.ts:216](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L216) ___ @@ -2304,7 +2358,7 @@ Returns an amount of µAlgo using AlgoAmount | Name | Type | Description | | :------ | :------ | :------ | -| `microAlgos` | `number` | The amount of µAlgo | +| `microAlgos` | `number` \| `bigint` | The amount of µAlgo | #### Returns @@ -2312,7 +2366,7 @@ Returns an amount of µAlgo using AlgoAmount #### Defined in -[src/amount.ts:65](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L65) +[src/amount.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L83) ___ @@ -2326,7 +2380,7 @@ Returns an amount of µAlgo using AlgoAmount | Name | Type | Description | | :------ | :------ | :------ | -| `microAlgos` | `number` | The amount of µAlgo | +| `microAlgos` | `number` \| `bigint` | The amount of µAlgo | #### Returns @@ -2334,7 +2388,7 @@ Returns an amount of µAlgo using AlgoAmount #### Defined in -[src/amount.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L58) +[src/amount.ts:76](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L76) ___ @@ -2449,9 +2503,6 @@ ___ ▸ **performAtomicTransactionComposerDryrun**(`atc`, `algod`): `Promise`\<`DryrunResult`\> -Performs a dry run of the transactions loaded into the given AtomicTransactionComposer` -@param atc The AtomicTransactionComposer` with transaction(s) loaded - #### Parameters | Name | Type | Description | @@ -2465,9 +2516,16 @@ Performs a dry run of the transactions loaded into the given AtomicTransactionCo The dryrun result +**`Deprecated`** + +Use `performAtomicTransactionComposerSimulate`, dry-run is a deprecated Algorand feature. + +Performs a dry run of the transactions loaded into the given AtomicTransactionComposer` +@param atc The AtomicTransactionComposer` with transaction(s) loaded + #### Defined in -[src/transaction/transaction.ts:696](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L696) +[src/transaction/transaction.ts:724](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L724) ___ @@ -2523,7 +2581,7 @@ Looks for `TMPL_{parameter}` for template replacements. #### Defined in -[src/app-deploy.ts:291](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L291) +[src/app-deploy.ts:290](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L290) ___ @@ -2556,7 +2614,7 @@ Looks for `TMPL_{parameter}` for template replacements. #### Defined in -[src/app-deploy.ts:308](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L308) +[src/app-deploy.ts:307](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L307) ___ @@ -2580,7 +2638,7 @@ A promise that resolves when the source maps have been persisted. #### Defined in -[src/debugging/debugging.ts:131](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/debugging/debugging.ts#L131) +[src/debugging/debugging.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/debugging/debugging.ts#L130) ___ @@ -2606,7 +2664,7 @@ A new ATC with the resources packed into the transactions #### Defined in -[src/transaction/transaction.ts:308](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L308) +[src/transaction/transaction.ts:327](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L327) ___ @@ -2731,7 +2789,7 @@ Note: If these values are not undefined, but the corresponding `TMPL_*` value #### Defined in -[src/app-deploy.ts:276](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L276) +[src/app-deploy.ts:275](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L275) ___ @@ -2745,7 +2803,7 @@ Signs and sends transactions that have been collected by an `AtomicTransactionCo | Name | Type | Description | | :------ | :------ | :------ | -| `atcSend` | [`AtomicTransactionComposerToSend`](../interfaces/types_transaction.AtomicTransactionComposerToSend.md) | The parameters controlling the send, including: * `atc` The `AtomicTransactionComposer` * `sendParams` The parameters to control the send behaviour | +| `atcSend` | [`AtomicTransactionComposerToSend`](../interfaces/types_transaction.AtomicTransactionComposerToSend.md) | The parameters controlling the send, including: * `atc` The `AtomicTransactionComposer` * `executeParams` The parameters to control the send behaviour | | `algod` | `default` | An algod client | #### Returns @@ -2756,7 +2814,7 @@ An object with transaction IDs, transactions, group transaction ID (`groupTransa #### Defined in -[src/transaction/transaction.ts:561](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L561) +[src/transaction/transaction.ts:580](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L580) ___ @@ -2764,8 +2822,6 @@ ___ ▸ **sendGroupOfTransactions**(`groupSend`, `algod`): `Promise`\<`Omit`\<[`SendAtomicTransactionComposerResults`](../interfaces/types_transaction.SendAtomicTransactionComposerResults.md), ``"returns"``\>\> -Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain - #### Parameters | Name | Type | Description | @@ -2779,9 +2835,15 @@ Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-de An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`) +**`Deprecated`** + +Use `AlgoKitComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead. + +Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain + #### Defined in -[src/transaction/transaction.ts:714](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L714) +[src/transaction/transaction.ts:744](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L744) ___ @@ -2789,8 +2851,6 @@ ___ ▸ **sendTransaction**(`send`, `algod`): `Promise`\<[`SendTransactionResult`](../interfaces/types_transaction.SendTransactionResult.md)\> -Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain. - #### Parameters | Name | Type | Description | @@ -2807,9 +2867,15 @@ Prepares a transaction for sending and then (if instructed) signs and sends the An object with transaction (`transaction`) and (if `skipWaiting` is `false` or `undefined`) confirmation (`confirmation`) +**`Deprecated`** + +Use `AlgorandClient` / `AlgoKitComposer` to send transactions. + +Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain. + #### Defined in -[src/transaction/transaction.ts:186](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L186) +[src/transaction/transaction.ts:205](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L205) ___ @@ -2817,8 +2883,6 @@ ___ ▸ **signTransaction**(`transaction`, `signer`): `Promise`\<`Uint8Array`\> -Signs a single transaction by the given signer. - #### Parameters | Name | Type | Description | @@ -2832,9 +2896,17 @@ Signs a single transaction by the given signer. The signed transaction as a `Uint8Array` +**`Deprecated`** + +Use `AlgorandClient` / `AlgoKitComposer` to sign transactions +or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject` +/ `multiSigAccount.sign` / `TransactionSigner` methods directly. + +Signs a single transaction by the given signer. + #### Defined in -[src/transaction/transaction.ts:166](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L166) +[src/transaction/transaction.ts:182](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L182) ___ @@ -2899,7 +2971,7 @@ Remove comments from TEAL Code #### Defined in -[src/app-deploy.ts:333](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L333) +[src/app-deploy.ts:332](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L332) ___ @@ -2921,7 +2993,7 @@ Returns an amount of µAlgo to cover standard fees for the given number of trans #### Defined in -[src/amount.ts:72](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L72) +[src/amount.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/amount.ts#L90) ___ @@ -3050,7 +3122,7 @@ Updates a smart contract app. #### Defined in -[src/app.ts:102](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L102) +[src/app.ts:100](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app.ts#L100) ___ @@ -3081,4 +3153,4 @@ Throws an error if the transaction is not confirmed or rejected in the next `tim #### Defined in -[src/transaction/transaction.ts:759](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L759) +[src/transaction/transaction.ts:789](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction/transaction.ts#L789) diff --git a/docs/code/modules/types_algorand_client_interface.md b/docs/code/modules/types_algorand_client_interface.md new file mode 100644 index 00000000..aa47e40d --- /dev/null +++ b/docs/code/modules/types_algorand_client_interface.md @@ -0,0 +1,9 @@ +[@algorandfoundation/algokit-utils](../README.md) / types/algorand-client-interface + +# Module: types/algorand-client-interface + +## Table of contents + +### Interfaces + +- [AlgorandClientInterface](../interfaces/types_algorand_client_interface.AlgorandClientInterface.md) diff --git a/docs/code/modules/types_app.md b/docs/code/modules/types_app.md index 82b40bdc..ca17b674 100644 --- a/docs/code/modules/types_app.md +++ b/docs/code/modules/types_app.md @@ -40,6 +40,7 @@ - [ABIReturn](types_app.md#abireturn) - [AppCallArgs](types_app.md#appcallargs) - [AppCallType](types_app.md#appcalltype) +- [AppReturn](types_app.md#appreturn) - [BoxIdentifier](types_app.md#boxidentifier) - [SendAppCreateTransactionResult](types_app.md#sendappcreatetransactionresult) - [SendAppTransactionResult](types_app.md#sendapptransactionresult) @@ -130,6 +131,28 @@ Equivalent of `algosdk.OnApplicationComplete`, but as a more convenient string e ___ +### AppReturn + +Ƭ **AppReturn**\<`TReturn`\>: `Object` + +#### Type parameters + +| Name | +| :------ | +| `TReturn` | + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `return?` | `TReturn` | The ABI method call return value | + +#### Defined in + +[src/types/app.ts:340](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L340) + +___ + ### BoxIdentifier Ƭ **BoxIdentifier**: `string` \| `Uint8Array` \| [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) @@ -157,7 +180,7 @@ Result from sending a single app transaction. #### Defined in -[src/types/app.ts:352](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L352) +[src/types/app.ts:357](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L357) ___ @@ -169,7 +192,7 @@ Result from sending a single app transaction. #### Defined in -[src/types/app.ts:341](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L341) +[src/types/app.ts:346](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L346) ___ @@ -181,7 +204,7 @@ Result from sending a single app transaction. #### Defined in -[src/types/app.ts:349](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L349) +[src/types/app.ts:354](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app.ts#L354) ## Variables diff --git a/docs/code/modules/types_app_arc56.md b/docs/code/modules/types_app_arc56.md new file mode 100644 index 00000000..8d4be46a --- /dev/null +++ b/docs/code/modules/types_app_arc56.md @@ -0,0 +1,278 @@ +[@algorandfoundation/algokit-utils](../README.md) / types/app-arc56 + +# Module: types/app-arc56 + +## Table of contents + +### Classes + +- [Arc56Method](../classes/types_app_arc56.Arc56Method.md) + +### Interfaces + +- [Arc56Contract](../interfaces/types_app_arc56.Arc56Contract.md) +- [Event](../interfaces/types_app_arc56.Event.md) +- [Method](../interfaces/types_app_arc56.Method.md) +- [SourceInfo](../interfaces/types_app_arc56.SourceInfo.md) +- [StorageKey](../interfaces/types_app_arc56.StorageKey.md) +- [StorageMap](../interfaces/types_app_arc56.StorageMap.md) +- [StructFields](../interfaces/types_app_arc56.StructFields.md) + +### Type Aliases + +- [ABIStruct](types_app_arc56.md#abistruct) +- [ABIType](types_app_arc56.md#abitype) +- [AVMBytes](types_app_arc56.md#avmbytes) +- [StructName](types_app_arc56.md#structname) + +### Functions + +- [getABIDecodedValue](types_app_arc56.md#getabidecodedvalue) +- [getABIEncodedValue](types_app_arc56.md#getabiencodedvalue) +- [getABIStructFromABITuple](types_app_arc56.md#getabistructfromabituple) +- [getABITupleFromABIStruct](types_app_arc56.md#getabituplefromabistruct) +- [getABITupleTypeFromABIStructDefinition](types_app_arc56.md#getabitupletypefromabistructdefinition) +- [getArc56Method](types_app_arc56.md#getarc56method) +- [getArc56ReturnValue](types_app_arc56.md#getarc56returnvalue) + +## Type Aliases + +### ABIStruct + +Ƭ **ABIStruct**: `Object` + +Decoded ARC-56 struct as a struct rather than a tuple. + +#### Index signature + +▪ [key: `string`]: [`ABIStruct`](types_app_arc56.md#abistruct) \| `algosdk.ABIValue` + +#### Defined in + +[src/types/app-arc56.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L83) + +___ + +### ABIType + +Ƭ **ABIType**: `string` + +An ABI-encoded type + +#### Defined in + +[src/types/app-arc56.ts:395](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L395) + +___ + +### AVMBytes + +Ƭ **AVMBytes**: ``"bytes"`` + +Raw byteslice without the length prefixed that is specified in ARC-4 + +#### Defined in + +[src/types/app-arc56.ts:401](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L401) + +___ + +### StructName + +Ƭ **StructName**: `string` + +The name of a defined struct + +#### Defined in + +[src/types/app-arc56.ts:398](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L398) + +## Functions + +### getABIDecodedValue + +▸ **getABIDecodedValue**(`value`, `type`, `structs`): `algosdk.ABIValue` \| [`ABIStruct`](types_app_arc56.md#abistruct) + +Returns the decoded ABI value (or struct for a struct type) +for the given raw Algorand value given an ARC-56 type and defined ARC-56 structs. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value` | `number` \| `bigint` \| `Uint8Array` | The raw Algorand value (bytes or uint64) | +| `type` | `string` | The ARC-56 type - either an ABI Type string or a struct name | +| `structs` | `Record`\<`string`, [`StructFields`](../interfaces/types_app_arc56.StructFields.md)\> | The defined ARC-56 structs | + +#### Returns + +`algosdk.ABIValue` \| [`ABIStruct`](types_app_arc56.md#abistruct) + +The decoded ABI value or struct + +#### Defined in + +[src/types/app-arc56.ts:95](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L95) + +___ + +### getABIEncodedValue + +▸ **getABIEncodedValue**(`value`, `type`, `structs`): `Uint8Array` + +Returns the ABI-encoded value for the given value. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `value` | `ABIValue` \| [`ABIStruct`](types_app_arc56.md#abistruct) | The value to encode either already in encoded binary form (`Uint8Array`), a decoded ABI value or an ARC-56 struct | +| `type` | `string` | The ARC-56 type - either an ABI Type string or a struct name | +| `structs` | `Record`\<`string`, [`StructFields`](../interfaces/types_app_arc56.StructFields.md)\> | The defined ARC-56 structs | + +#### Returns + +`Uint8Array` + +The binary ABI-encoded value + +#### Defined in + +[src/types/app-arc56.ts:115](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L115) + +___ + +### getABIStructFromABITuple + +▸ **getABIStructFromABITuple**\<`TReturn`\>(`decodedABITuple`, `structFields`): `TReturn` + +Converts a decoded ABI tuple as a struct. + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TReturn` | extends [`ABIStruct`](types_app_arc56.md#abistruct) = `Record`\<`string`, `any`\> | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `decodedABITuple` | `ABIValue`[] | The decoded ABI tuple value | +| `structFields` | [`StructFields`](../interfaces/types_app_arc56.StructFields.md) | The struct fields from an ARC-56 app spec | + +#### Returns + +`TReturn` + +The struct as a Record + +#### Defined in + +[src/types/app-arc56.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L57) + +___ + +### getABITupleFromABIStruct + +▸ **getABITupleFromABIStruct**(`struct`, `structFields`): `algosdk.ABIValue`[] + +Converts an ARC-56 struct as an ABI tuple. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `struct` | [`ABIStruct`](types_app_arc56.md#abistruct) | The struct to convert | +| `structFields` | [`StructFields`](../interfaces/types_app_arc56.StructFields.md) | The struct fields from an ARC-56 app spec | + +#### Returns + +`algosdk.ABIValue`[] + +The struct as a decoded ABI tuple + +#### Defined in + +[src/types/app-arc56.ts:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L75) + +___ + +### getABITupleTypeFromABIStructDefinition + +▸ **getABITupleTypeFromABIStructDefinition**(`struct`): `algosdk.ABITupleType` + +Returns the `ABITupleType` for the given ARC-56 struct definition + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `struct` | [`StructFields`](../interfaces/types_app_arc56.StructFields.md) | The ARC-56 struct definition | + +#### Returns + +`algosdk.ABITupleType` + +The `ABITupleType` + +#### Defined in + +[src/types/app-arc56.ts:44](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L44) + +___ + +### getArc56Method + +▸ **getArc56Method**(`methodNameOrSignature`, `appSpec`): [`Arc56Method`](../classes/types_app_arc56.Arc56Method.md) + +Returns the ARC-56 ABI method object for a given method name or signature and ARC-56 app spec. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `methodNameOrSignature` | `string` | The method name or method signature to call if an ABI call is being emitted. e.g. `my_method` or `my_method(unit64,string)bytes` | +| `appSpec` | [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) | The app spec for the app | + +#### Returns + +[`Arc56Method`](../classes/types_app_arc56.Arc56Method.md) + +The `Arc56Method` + +#### Defined in + +[src/types/app-arc56.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L144) + +___ + +### getArc56ReturnValue + +▸ **getArc56ReturnValue**\<`TReturn`\>(`returnValue`, `method`, `structs`): `TReturn` + +Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `TReturn` | extends `undefined` \| `ABIValue` \| [`ABIStruct`](types_app_arc56.md#abistruct) | + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `returnValue` | `undefined` \| [`ABIReturn`](types_app.md#abireturn) | The smart contract response | +| `method` | [`Arc56Method`](../classes/types_app_arc56.Arc56Method.md) \| [`Method`](../interfaces/types_app_arc56.Method.md) | The method that was called | +| `structs` | [`StructFields`](../interfaces/types_app_arc56.StructFields.md) | The struct fields from the app spec | + +#### Returns + +`TReturn` + +The smart contract response with an updated return value + +#### Defined in + +[src/types/app-arc56.ts:175](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-arc56.ts#L175) diff --git a/docs/code/modules/types_app_client.md b/docs/code/modules/types_app_client.md index 9987d9db..b52682b5 100644 --- a/docs/code/modules/types_app_client.md +++ b/docs/code/modules/types_app_client.md @@ -6,6 +6,7 @@ ### Classes +- [AppClient](../classes/types_app_client.AppClient.md) - [ApplicationClient](../classes/types_app_client.ApplicationClient.md) ### Interfaces @@ -17,6 +18,7 @@ - [AppClientDeployCallInterfaceParams](../interfaces/types_app_client.AppClientDeployCallInterfaceParams.md) - [AppClientDeployCoreParams](../interfaces/types_app_client.AppClientDeployCoreParams.md) - [AppClientDeployParams](../interfaces/types_app_client.AppClientDeployParams.md) +- [AppClientParams](../interfaces/types_app_client.AppClientParams.md) - [AppSourceMaps](../interfaces/types_app_client.AppSourceMaps.md) - [FundAppAccountParams](../interfaces/types_app_client.FundAppAccountParams.md) - [ResolveAppById](../interfaces/types_app_client.ResolveAppById.md) @@ -25,11 +27,13 @@ ### Type Aliases +- [AppClientBareCallParams](types_app_client.md#appclientbarecallparams) - [AppClientCallArgs](types_app_client.md#appclientcallargs) - [AppClientCallParams](types_app_client.md#appclientcallparams) - [AppClientClearStateParams](types_app_client.md#appclientclearstateparams) - [AppClientCreateOnComplete](types_app_client.md#appclientcreateoncomplete) - [AppClientCreateParams](types_app_client.md#appclientcreateparams) +- [AppClientMethodCallParams](types_app_client.md#appclientmethodcallparams) - [AppClientUpdateParams](types_app_client.md#appclientupdateparams) - [AppDetails](types_app_client.md#appdetails) - [AppDetailsBase](types_app_client.md#appdetailsbase) @@ -37,11 +41,26 @@ - [AppSpecAppDetailsBase](types_app_client.md#appspecappdetailsbase) - [AppSpecAppDetailsByCreatorAndName](types_app_client.md#appspecappdetailsbycreatorandname) - [AppSpecAppDetailsById](types_app_client.md#appspecappdetailsbyid) +- [CallOnComplete](types_app_client.md#calloncomplete) +- [FundAppParams](types_app_client.md#fundappparams) - [ResolveAppByCreatorAndName](types_app_client.md#resolveappbycreatorandname) - [ResolveAppByCreatorAndNameBase](types_app_client.md#resolveappbycreatorandnamebase) +- [ResolveAppClientByCreatorAndName](types_app_client.md#resolveappclientbycreatorandname) ## Type Aliases +### AppClientBareCallParams + +Ƭ **AppClientBareCallParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`CommonAppCallParams`](types_composer.md#commonappcallparams), ``"appId"`` \| ``"sender"`` \| ``"onComplete"``\> & \{ `sender?`: `string` }\> + +AppClient parameters for a bare app call + +#### Defined in + +[src/types/app-client.ts:337](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L337) + +___ + ### AppClientCallArgs Ƭ **AppClientCallArgs**: [`AppClientCallRawArgs`](../interfaces/types_app_client.AppClientCallRawArgs.md) \| [`AppClientCallABIArgs`](../interfaces/types_app_client.AppClientCallABIArgs.md) @@ -50,7 +69,7 @@ The arguments to pass to an Application Client smart contract call #### Defined in -[src/types/app-client.ts:173](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L173) +[src/types/app-client.ts:204](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L204) ___ @@ -62,7 +81,7 @@ Parameters to construct a ApplicationClient contract call #### Defined in -[src/types/app-client.ts:186](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L186) +[src/types/app-client.ts:217](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L217) ___ @@ -74,7 +93,7 @@ Parameters to construct a ApplicationClient clear state contract call #### Defined in -[src/types/app-client.ts:189](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L189) +[src/types/app-client.ts:220](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L220) ___ @@ -92,7 +111,7 @@ On-complete action parameter for creating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:201](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L201) +[src/types/app-client.ts:232](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L232) ___ @@ -104,7 +123,19 @@ Parameters for creating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:207](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L207) +[src/types/app-client.ts:238](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L238) + +___ + +### AppClientMethodCallParams + +Ƭ **AppClientMethodCallParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`CommonAppCallParams`](types_composer.md#commonappcallparams), ``"appId"`` \| ``"sender"`` \| ``"method"`` \| ``"args"``\> & \{ `args?`: (`ABIValue` \| [`ABIStruct`](types_app_arc56.md#abistruct) \| [`AppMethodCallTransactionArgument`](types_composer.md#appmethodcalltransactionargument) \| `undefined`)[] ; `method`: `string` ; `sender?`: `string` }\> + +AppClient parameters for an ABI method call + +#### Defined in + +[src/types/app-client.ts:345](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L345) ___ @@ -116,7 +147,7 @@ Parameters for updating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:215](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L215) +[src/types/app-client.ts:246](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L246) ___ @@ -128,7 +159,7 @@ The details of an AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:102](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L102) +[src/types/app-client.ts:133](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L133) ___ @@ -148,7 +179,7 @@ The details of an AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L90) +[src/types/app-client.ts:121](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L121) ___ @@ -160,7 +191,7 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:120](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L120) +[src/types/app-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L151) ___ @@ -178,7 +209,7 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L105) +[src/types/app-client.ts:136](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L136) ___ @@ -190,7 +221,7 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by cre #### Defined in -[src/types/app-client.ts:117](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L117) +[src/types/app-client.ts:148](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L148) ___ @@ -202,7 +233,37 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id #### Defined in -[src/types/app-client.ts:114](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L114) +[src/types/app-client.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L145) + +___ + +### CallOnComplete + +Ƭ **CallOnComplete**: `Object` + +onComplete parameter for a non-update app call + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `onComplete?` | `Exclude`\<`OnApplicationComplete`, `OnApplicationComplete.UpdateApplicationOC`\> | On-complete of the call; defaults to no-op | + +#### Defined in + +[src/types/app-client.ts:331](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L331) + +___ + +### FundAppParams + +Ƭ **FundAppParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`PaymentParams`](types_composer.md#paymentparams), ``"receiver"`` \| ``"sender"``\> & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & \{ `sender?`: `string` }\> + +Parameters for funding an app account + +#### Defined in + +[src/types/app-client.ts:369](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L369) ___ @@ -214,7 +275,7 @@ Configuration to resolve app by creator and name `getCreatorAppsByName` #### Defined in -[src/types/app-client.ts:71](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L71) +[src/types/app-client.ts:102](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L102) ___ @@ -234,4 +295,16 @@ Configuration to resolve app by creator and name `getCreatorAppsByName` #### Defined in -[src/types/app-client.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L58) +[src/types/app-client.ts:89](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L89) + +___ + +### ResolveAppClientByCreatorAndName + +Ƭ **ResolveAppClientByCreatorAndName**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppClientParams`](../interfaces/types_app_client.AppClientParams.md), ``"appId"``\> & \{ `appLookupCache?`: [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) ; `creatorAddress`: `string` ; `ignoreCache?`: `boolean` }\> + +Resolve an app client instance by looking up an app created by the given creator with the given name + +#### Defined in + +[src/types/app-client.ts:378](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L378) diff --git a/docs/code/modules/types_app_deployer.md b/docs/code/modules/types_app_deployer.md index ebe31dcd..d32ad12e 100644 --- a/docs/code/modules/types_app_deployer.md +++ b/docs/code/modules/types_app_deployer.md @@ -10,20 +10,84 @@ ### Interfaces -- [AppDeployParams](../interfaces/types_app_deployer.AppDeployParams.md) - [AppLookup](../interfaces/types_app_deployer.AppLookup.md) - [AppMetadata](../interfaces/types_app_deployer.AppMetadata.md) ### Type Aliases +- [AppDeployParams](types_app_deployer.md#appdeployparams) - [AppDeployResult](types_app_deployer.md#appdeployresult) +- [DeployAppDeleteMethodCall](types_app_deployer.md#deployappdeletemethodcall) +- [DeployAppDeleteParams](types_app_deployer.md#deployappdeleteparams) +- [DeployAppUpdateMethodCall](types_app_deployer.md#deployappupdatemethodcall) +- [DeployAppUpdateParams](types_app_deployer.md#deployappupdateparams) ## Type Aliases +### AppDeployParams + +Ƭ **AppDeployParams**: [`Expand`](types_expand.md#expand)\<[`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & \{ `createParams`: [`AppCreateParams`](types_composer.md#appcreateparams) \| [`AppCreateMethodCall`](types_composer.md#appcreatemethodcall) ; `deleteParams`: [`DeployAppDeleteParams`](types_app_deployer.md#deployappdeleteparams) \| [`DeployAppDeleteMethodCall`](types_app_deployer.md#deployappdeletemethodcall) ; `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `existingDeployments?`: [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) ; `ignoreCache?`: `boolean` ; `metadata`: [`AppDeployMetadata`](../interfaces/types_app.AppDeployMetadata.md) ; `onSchemaBreak?`: ``"replace"`` \| ``"fail"`` \| ``"append"`` \| [`OnSchemaBreak`](../enums/types_app.OnSchemaBreak.md) ; `onUpdate?`: ``"update"`` \| ``"replace"`` \| ``"fail"`` \| ``"append"`` \| [`OnUpdate`](../enums/types_app.OnUpdate.md) ; `updateParams`: [`DeployAppUpdateParams`](types_app_deployer.md#deployappupdateparams) \| [`DeployAppUpdateMethodCall`](types_app_deployer.md#deployappupdatemethodcall) }\> + +The parameters to idempotently deploy an app + +#### Defined in + +[src/types/app-deployer.ts:37](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L37) + +___ + ### AppDeployResult -Ƭ **AppDeployResult**: [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"create"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md) & [`SendAppCreateTransactionResult`](types_app.md#sendappcreatetransactionresult)\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"update"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md) & [`SendAppUpdateTransactionResult`](types_app.md#sendappupdatetransactionresult)\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"replace"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md) & [`SendAppCreateTransactionResult`](types_app.md#sendappcreatetransactionresult) & \{ `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn?`: [`ABIReturn`](types_app.md#abireturn) }\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"nothing"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md)\> +Ƭ **AppDeployResult**: [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"create"`` } & `Omit`\<[`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md), ``"appId"`` \| ``"appAddress"``\> & [`SendAppCreateTransactionResult`](types_app.md#sendappcreatetransactionresult)\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"update"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md) & [`SendAppUpdateTransactionResult`](types_app.md#sendappupdatetransactionresult)\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"replace"`` } & `Omit`\<[`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md), ``"appId"`` \| ``"appAddress"``\> & [`SendAppCreateTransactionResult`](types_app.md#sendappcreatetransactionresult) & \{ `deleteResult`: [`ConfirmedTransactionResult`](../interfaces/types_transaction.ConfirmedTransactionResult.md) ; `deleteReturn?`: [`ABIReturn`](types_app.md#abireturn) }\> \| [`Expand`](types_expand.md#expand)\<\{ `operationPerformed`: ``"nothing"`` } & [`AppMetadata`](../interfaces/types_app_deployer.AppMetadata.md)\> + +#### Defined in + +[src/types/app-deployer.ts:97](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L97) + +___ + +### DeployAppDeleteMethodCall + +Ƭ **DeployAppDeleteMethodCall**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppDeleteMethodCall`](types_composer.md#appdeletemethodcall), ``"appId"``\>\> + +Params to specify a delete method call for an app deployment + +#### Defined in + +[src/types/app-deployer.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L34) + +___ + +### DeployAppDeleteParams + +Ƭ **DeployAppDeleteParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppDeleteParams`](types_composer.md#appdeleteparams), ``"appId"``\>\> + +Params to specify a transaction for an app deployment + +#### Defined in + +[src/types/app-deployer.ts:32](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L32) + +___ + +### DeployAppUpdateMethodCall + +Ƭ **DeployAppUpdateMethodCall**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppUpdateMethodCall`](types_composer.md#appupdatemethodcall), ``"appId"`` \| ``"approvalProgram"`` \| ``"clearStateProgram"``\>\> + +Params to specify an update method call for an app deployment + +#### Defined in + +[src/types/app-deployer.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L30) + +___ + +### DeployAppUpdateParams + +Ƭ **DeployAppUpdateParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppUpdateParams`](types_composer.md#appupdateparams), ``"appId"`` \| ``"approvalProgram"`` \| ``"clearStateProgram"``\>\> + +Params to specify an update transaction for an app deployment #### Defined in -[src/types/app-deployer.ts:91](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L91) +[src/types/app-deployer.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-deployer.ts#L28) diff --git a/docs/code/modules/types_app_factory.md b/docs/code/modules/types_app_factory.md new file mode 100644 index 00000000..bde43768 --- /dev/null +++ b/docs/code/modules/types_app_factory.md @@ -0,0 +1,85 @@ +[@algorandfoundation/algokit-utils](../README.md) / types/app-factory + +# Module: types/app-factory + +## Table of contents + +### Classes + +- [AppFactory](../classes/types_app_factory.AppFactory.md) + +### Interfaces + +- [AppFactoryParams](../interfaces/types_app_factory.AppFactoryParams.md) + +### Type Aliases + +- [AppFactoryCreateParams](types_app_factory.md#appfactorycreateparams) +- [AppFactoryDeployParams](types_app_factory.md#appfactorydeployparams) +- [CreateOnComplete](types_app_factory.md#createoncomplete) +- [CreateSchema](types_app_factory.md#createschema) + +## Type Aliases + +### AppFactoryCreateParams + +Ƭ **AppFactoryCreateParams**: [`Expand`](types_expand.md#expand)\<[`AppClientMethodCallParams`](types_app_client.md#appclientmethodcallparams) & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`CreateOnComplete`](types_app_factory.md#createoncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & [`CreateSchema`](types_app_factory.md#createschema)\> \| [`Expand`](types_expand.md#expand)\<[`AppClientBareCallParams`](types_app_client.md#appclientbarecallparams) & [`AppClientCompilationParams`](../interfaces/types_app_client.AppClientCompilationParams.md) & [`CreateOnComplete`](types_app_factory.md#createoncomplete) & [`ExecuteParams`](../interfaces/types_transaction.ExecuteParams.md) & [`CreateSchema`](types_app_factory.md#createschema)\> + +Parameters to define a create call for an `AppFactory` + +#### Defined in + +[src/types/app-factory.ts:113](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L113) + +___ + +### AppFactoryDeployParams + +Ƭ **AppFactoryDeployParams**: [`Expand`](types_expand.md#expand)\<`Omit`\<[`AppDeployParams`](types_app_deployer.md#appdeployparams), ``"createParams"`` \| ``"updateParams"`` \| ``"deleteParams"`` \| ``"metadata"``\> & \{ `createParams?`: [`Expand`](types_expand.md#expand)\<[`AppClientMethodCallParams`](types_app_client.md#appclientmethodcallparams) & [`CreateOnComplete`](types_app_factory.md#createoncomplete) & [`CreateSchema`](types_app_factory.md#createschema)\> \| [`Expand`](types_expand.md#expand)\<[`AppClientBareCallParams`](types_app_client.md#appclientbarecallparams) & [`CreateOnComplete`](types_app_factory.md#createoncomplete) & [`CreateSchema`](types_app_factory.md#createschema)\> ; `deletable?`: `boolean` ; `deleteParams?`: [`AppClientMethodCallParams`](types_app_client.md#appclientmethodcallparams) \| [`AppClientBareCallParams`](types_app_client.md#appclientbarecallparams) ; `updatable?`: `boolean` ; `updateParams?`: [`AppClientMethodCallParams`](types_app_client.md#appclientmethodcallparams) \| [`AppClientBareCallParams`](types_app_client.md#appclientbarecallparams) }\> + +Parameters to define a deployment for an `AppFactory` + +#### Defined in + +[src/types/app-factory.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L118) + +___ + +### CreateOnComplete + +Ƭ **CreateOnComplete**: `Object` + +onComplete parameter for a create app call + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `onComplete?` | `Exclude`\<`OnApplicationComplete`, `OnApplicationComplete.ClearStateOC`\> | + +#### Defined in + +[src/types/app-factory.ts:89](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L89) + +___ + +### CreateSchema + +Ƭ **CreateSchema**: `Object` + +Specifies a schema used for creating an app + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `extraProgramPages?` | `number` | Number of extra pages required for the programs. Defaults to the number needed for the programs in this call if not specified. This is immutable once the app is created. | +| `schema?` | \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } | The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. | +| `schema.globalByteSlices` | `number` | The number of byte slices saved in global state. | +| `schema.globalInts` | `number` | The number of integers saved in global state. | +| `schema.localByteSlices` | `number` | The number of byte slices saved in local state. | +| `schema.localInts` | `number` | The number of integers saved in local state. | + +#### Defined in + +[src/types/app-factory.ts:94](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-factory.ts#L94) diff --git a/docs/code/modules/types_app_factory_and_client_spec.md b/docs/code/modules/types_app_factory_and_client_spec.md new file mode 100644 index 00000000..3143cddb --- /dev/null +++ b/docs/code/modules/types_app_factory_and_client_spec.md @@ -0,0 +1,3 @@ +[@algorandfoundation/algokit-utils](../README.md) / types/app-factory-and-client.spec + +# Module: types/app-factory-and-client.spec diff --git a/docs/code/modules/types_app_manager.md b/docs/code/modules/types_app_manager.md index fa8b9f9d..04828bc5 100644 --- a/docs/code/modules/types_app_manager.md +++ b/docs/code/modules/types_app_manager.md @@ -33,4 +33,4 @@ Something that identifies an app box name - either a: #### Defined in -[src/types/app-manager.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L57) +[src/types/app-manager.ts:56](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-manager.ts#L56) diff --git a/docs/code/modules/types_app_spec.md b/docs/code/modules/types_app_spec.md index 97b18c29..360db595 100644 --- a/docs/code/modules/types_app_spec.md +++ b/docs/code/modules/types_app_spec.md @@ -28,6 +28,10 @@ - [StateSchema](types_app_spec.md#stateschema) - [StructElement](types_app_spec.md#structelement) +### Functions + +- [arc32ToArc56](types_app_spec.md#arc32toarc56) + ## Type Aliases ### ABIType @@ -38,7 +42,7 @@ The string name of an ABI type #### Defined in -[src/types/app-spec.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L67) +[src/types/app-spec.ts:187](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L187) ___ @@ -50,7 +54,7 @@ AVM data type #### Defined in -[src/types/app-spec.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L123) +[src/types/app-spec.ts:243](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L243) ___ @@ -66,7 +70,7 @@ The various call configs: #### Defined in -[src/types/app-spec.ts:38](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L38) +[src/types/app-spec.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L158) ___ @@ -78,7 +82,7 @@ Defines a strategy for obtaining a default value for a given ABI arg. #### Defined in -[src/types/app-spec.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L83) +[src/types/app-spec.ts:203](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L203) ___ @@ -90,7 +94,7 @@ The name of a field #### Defined in -[src/types/app-spec.ts:64](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L64) +[src/types/app-spec.ts:184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L184) ___ @@ -102,7 +106,7 @@ A lookup of encoded method call spec to hint #### Defined in -[src/types/app-spec.ts:22](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L22) +[src/types/app-spec.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L142) ___ @@ -121,7 +125,7 @@ Schema spec summary for global or local storage #### Defined in -[src/types/app-spec.ts:172](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L172) +[src/types/app-spec.ts:292](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L292) ___ @@ -133,4 +137,24 @@ The elements of the struct/tuple: `FieldName`, `ABIType` #### Defined in -[src/types/app-spec.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L70) +[src/types/app-spec.ts:190](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L190) + +## Functions + +### arc32ToArc56 + +▸ **arc32ToArc56**(`appSpec`): [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `appSpec` | [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | + +#### Returns + +[`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) + +#### Defined in + +[src/types/app-spec.ts:7](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-spec.ts#L7) diff --git a/docs/code/modules/types_client_manager.md b/docs/code/modules/types_client_manager.md index fdcba192..9982b119 100644 --- a/docs/code/modules/types_client_manager.md +++ b/docs/code/modules/types_client_manager.md @@ -11,60 +11,5 @@ ### Interfaces - [AlgoSdkClients](../interfaces/types_client_manager.AlgoSdkClients.md) -- [NetworkDetails](../interfaces/types_client_manager.NetworkDetails.md) - [TypedAppClient](../interfaces/types_client_manager.TypedAppClient.md) - -### Type Aliases - -- [AppClientByCreatorAndNameDetails](types_client_manager.md#appclientbycreatorandnamedetails) -- [AppClientByIdDetails](types_client_manager.md#appclientbyiddetails) -- [TypedAppClientByCreatorAndNameDetails](types_client_manager.md#typedappclientbycreatorandnamedetails) -- [TypedAppClientByIdDetails](types_client_manager.md#typedappclientbyiddetails) - -## Type Aliases - -### AppClientByCreatorAndNameDetails - -Ƭ **AppClientByCreatorAndNameDetails**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & `Omit`\<[`ResolveAppByCreatorAndNameBase`](types_app_client.md#resolveappbycreatorandnamebase), ``"findExistingUsing"``\> - -Details to resolve an app client by creator address and name. - -#### Defined in - -[src/types/client-manager.ts:513](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L513) - -___ - -### AppClientByIdDetails - -Ƭ **AppClientByIdDetails**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByIdBase`](../interfaces/types_app_client.ResolveAppByIdBase.md) - -Details to resolve an app client by app ID. - -#### Defined in - -[src/types/client-manager.ts:525](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L525) - -___ - -### TypedAppClientByCreatorAndNameDetails - -Ƭ **TypedAppClientByCreatorAndNameDetails**: [`AppDetailsBase`](types_app_client.md#appdetailsbase) & `Omit`\<[`ResolveAppByCreatorAndNameBase`](types_app_client.md#resolveappbycreatorandnamebase), ``"findExistingUsing"``\> - -Details to resolve a typed app creator address and name. - -#### Defined in - -[src/types/client-manager.ts:520](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L520) - -___ - -### TypedAppClientByIdDetails - -Ƭ **TypedAppClientByIdDetails**: [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByIdBase`](../interfaces/types_app_client.ResolveAppByIdBase.md) - -Details to resolve a typed app by app ID. - -#### Defined in - -[src/types/client-manager.ts:530](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/client-manager.ts#L530) +- [TypedAppFactory](../interfaces/types_client_manager.TypedAppFactory.md) diff --git a/docs/code/modules/types_composer.md b/docs/code/modules/types_composer.md index cf96b843..32b400ef 100644 --- a/docs/code/modules/types_composer.md +++ b/docs/code/modules/types_composer.md @@ -11,7 +11,6 @@ ### Interfaces - [BuiltTransactions](../interfaces/types_composer.BuiltTransactions.md) -- [ExecuteParams](../interfaces/types_composer.ExecuteParams.md) ### Type Aliases @@ -23,6 +22,8 @@ - [AppDeleteMethodCall](types_composer.md#appdeletemethodcall) - [AppDeleteParams](types_composer.md#appdeleteparams) - [AppMethodCall](types_composer.md#appmethodcall) +- [AppMethodCallParams](types_composer.md#appmethodcallparams) +- [AppMethodCallTransactionArgument](types_composer.md#appmethodcalltransactionargument) - [AppUpdateMethodCall](types_composer.md#appupdatemethodcall) - [AppUpdateParams](types_composer.md#appupdateparams) - [AssetConfigParams](types_composer.md#assetconfigparams) @@ -36,6 +37,7 @@ - [CommonTransactionParams](types_composer.md#commontransactionparams) - [OnlineKeyRegistrationParams](types_composer.md#onlinekeyregistrationparams) - [PaymentParams](types_composer.md#paymentparams) +- [SimulateOptions](types_composer.md#simulateoptions) ### Variables @@ -61,17 +63,17 @@ Parameters to create an `AlgoKitComposer`. #### Defined in -[src/types/composer.ts:432](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L432) +[src/types/composer.ts:450](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L450) ___ ### AppCallMethodCall -Ƭ **AppCallMethodCall**: [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppCallParams`](types_composer.md#appcallparams)\> +Ƭ **AppCallMethodCall**: [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppMethodCallParams`](types_composer.md#appmethodcallparams)\> #### Defined in -[src/types/composer.ts:383](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L383) +[src/types/composer.ts:401](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L401) ___ @@ -83,7 +85,7 @@ Parameters to define an application call transaction. #### Defined in -[src/types/composer.ts:371](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L371) +[src/types/composer.ts:381](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L381) ___ @@ -93,7 +95,7 @@ ___ #### Defined in -[src/types/composer.ts:380](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L380) +[src/types/composer.ts:398](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L398) ___ @@ -103,7 +105,7 @@ ___ #### Defined in -[src/types/composer.ts:337](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L337) +[src/types/composer.ts:345](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L345) ___ @@ -113,7 +115,7 @@ ___ #### Defined in -[src/types/composer.ts:382](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L382) +[src/types/composer.ts:400](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L400) ___ @@ -125,13 +127,13 @@ Parameters to define an application delete call transaction. #### Defined in -[src/types/composer.ts:376](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L376) +[src/types/composer.ts:394](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L394) ___ ### AppMethodCall -Ƭ **AppMethodCall**\<`T`\>: [`Expand`](types_expand.md#expand)\<`Omit`\<`T`, ``"args"``\>\> & \{ `args?`: (`algosdk.ABIValue` \| `TransactionWithSigner` \| `Transaction` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppCreateParams`](types_composer.md#appcreateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppUpdateParams`](types_composer.md#appupdateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppCallParams`](types_composer.md#appcallparams)\>)[] ; `method`: `algosdk.ABIMethod` } +Ƭ **AppMethodCall**\<`T`\>: [`Expand`](types_expand.md#expand)\<`Omit`\<`T`, ``"args"``\>\> & \{ `args?`: (`algosdk.ABIValue` \| `TransactionWithSigner` \| `Transaction` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppCreateParams`](types_composer.md#appcreateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppUpdateParams`](types_composer.md#appupdateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppMethodCallParams`](types_composer.md#appmethodcallparams)\>)[] ; `method`: `algosdk.ABIMethod` } #### Type parameters @@ -141,7 +143,29 @@ ___ #### Defined in -[src/types/composer.ts:385](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L385) +[src/types/composer.ts:412](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L412) + +___ + +### AppMethodCallParams + +Ƭ **AppMethodCallParams**: [`CommonAppCallParams`](types_composer.md#commonappcallparams) & \{ `onComplete?`: `Exclude`\<`algosdk.OnApplicationComplete`, `algosdk.OnApplicationComplete.UpdateApplicationOC` \| `algosdk.OnApplicationComplete.ClearStateOC`\> } + +Parameters to define a method call transaction. + +#### Defined in + +[src/types/composer.ts:386](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L386) + +___ + +### AppMethodCallTransactionArgument + +Ƭ **AppMethodCallTransactionArgument**: `TransactionWithSigner` \| `Transaction` \| `Promise`\<`Transaction`\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppCreateParams`](types_composer.md#appcreateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppUpdateParams`](types_composer.md#appupdateparams)\> \| [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppMethodCallParams`](types_composer.md#appmethodcallparams)\> + +#### Defined in + +[src/types/composer.ts:403](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L403) ___ @@ -151,7 +175,7 @@ ___ #### Defined in -[src/types/composer.ts:381](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L381) +[src/types/composer.ts:399](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L399) ___ @@ -161,7 +185,7 @@ ___ #### Defined in -[src/types/composer.ts:360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L360) +[src/types/composer.ts:370](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L370) ___ @@ -177,7 +201,7 @@ all fields are immutable from that point forward. #### Defined in -[src/types/composer.ts:191](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L191) +[src/types/composer.ts:199](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L199) ___ @@ -191,7 +215,7 @@ The account that sends this transaction will automatically be opted in to the as #### Defined in -[src/types/composer.ts:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L75) +[src/types/composer.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L83) ___ @@ -205,7 +229,7 @@ Created assets can be destroyed only by the asset manager account. All of the as #### Defined in -[src/types/composer.ts:249](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L249) +[src/types/composer.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L257) ___ @@ -217,7 +241,7 @@ Parameters to define an asset freeze transaction. #### Defined in -[src/types/composer.ts:236](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L236) +[src/types/composer.ts:244](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L244) ___ @@ -229,7 +253,7 @@ Parameters to define an asset opt-in transaction. #### Defined in -[src/types/composer.ts:277](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L277) +[src/types/composer.ts:285](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L285) ___ @@ -241,7 +265,7 @@ Parameters to define an asset opt-out transaction. #### Defined in -[src/types/composer.ts:283](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L283) +[src/types/composer.ts:291](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L291) ___ @@ -253,7 +277,7 @@ Parameters to define an asset transfer transaction. #### Defined in -[src/types/composer.ts:255](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L255) +[src/types/composer.ts:263](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L263) ___ @@ -265,7 +289,7 @@ Common parameters for defining an application call transaction. #### Defined in -[src/types/composer.ts:316](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L316) +[src/types/composer.ts:324](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L324) ___ @@ -293,7 +317,7 @@ Common parameters for defining a transaction. #### Defined in -[src/types/composer.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L18) +[src/types/composer.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L26) ___ @@ -305,7 +329,7 @@ Parameters to define an online key registration transaction. #### Defined in -[src/types/composer.ts:294](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L294) +[src/types/composer.ts:302](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L302) ___ @@ -317,7 +341,19 @@ Parameters to define a payment transaction. #### Defined in -[src/types/composer.ts:59](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L59) +[src/types/composer.ts:67](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L67) + +___ + +### SimulateOptions + +Ƭ **SimulateOptions**: [`Expand`](types_expand.md#expand)\<`Omit`\<`ConstructorParameters`\[``0``], ``"txnGroups"``\>\> + +Options to control a simulate request + +#### Defined in + +[src/types/composer.ts:23](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L23) ## Variables @@ -327,4 +363,4 @@ Parameters to define a payment transaction. #### Defined in -[src/types/composer.ts:15](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L15) +[src/types/composer.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L20) diff --git a/docs/code/modules/types_network_client.md b/docs/code/modules/types_network_client.md index 10c87334..9967140b 100644 --- a/docs/code/modules/types_network_client.md +++ b/docs/code/modules/types_network_client.md @@ -8,6 +8,7 @@ - [AlgoClientConfig](../interfaces/types_network_client.AlgoClientConfig.md) - [AlgoConfig](../interfaces/types_network_client.AlgoConfig.md) +- [NetworkDetails](../interfaces/types_network_client.NetworkDetails.md) ### Functions @@ -35,4 +36,4 @@ Whether the given genesis ID is associated with a LocalNet network #### Defined in -[src/types/network-client.ts:28](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L28) +[src/types/network-client.ts:42](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/network-client.ts#L42) diff --git a/docs/code/modules/types_transaction.md b/docs/code/modules/types_transaction.md index dd1978f5..e20d2ff5 100644 --- a/docs/code/modules/types_transaction.md +++ b/docs/code/modules/types_transaction.md @@ -9,6 +9,7 @@ - [AtomicTransactionComposerToSend](../interfaces/types_transaction.AtomicTransactionComposerToSend.md) - [ConfirmedTransactionResult](../interfaces/types_transaction.ConfirmedTransactionResult.md) - [ConfirmedTransactionResults](../interfaces/types_transaction.ConfirmedTransactionResults.md) +- [ExecuteParams](../interfaces/types_transaction.ExecuteParams.md) - [SendAtomicTransactionComposerResults](../interfaces/types_transaction.SendAtomicTransactionComposerResults.md) - [SendTransactionParams](../interfaces/types_transaction.SendTransactionParams.md) - [SendTransactionResult](../interfaces/types_transaction.SendTransactionResult.md) @@ -62,7 +63,7 @@ many types of accounts, including: * `SigningAccount` - An AlgoKit Utils class that wraps Account to provide support for rekeyed accounts * `LogicSigAccount` - The in-built `algosdk.LogicSigAccount` type for logic signatures * `MultisigAccount` - An AlgoKit Utils class that wraps a multisig account and provides mechanisms to get a multisig account -* `TransactionSignerAccount` - An AlgoKitUtils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address +* `TransactionSignerAccount` - An AlgoKit Utils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address #### Defined in diff --git a/docs/v7-migration.md b/docs/v7-migration.md new file mode 100644 index 00000000..fdeedf11 --- /dev/null +++ b/docs/v7-migration.md @@ -0,0 +1,123 @@ +# v7 migration + +Version 7 of AlgoKit Utils moved from a stateless function-based interface to a stateful class-based interface. Doing this allowed for a much easier and simpler consumption experience guided by intellisense, involves less passing around of redundant values (e.g. `algod` client) and is more performant since commonly retrieved values like transaction parameters are able to be cached. + +The entry point to the vast majority of functionality in AlgoKit Utils is now available via a single entry-point, the [`AlgorandClient` class](./capabilities/algorand-client.md). + +The old version will still work until the next major version bump (we have been careful to keep those functions working with backwards compatibility), but it exposes an older, function-based interface to the functionality that is deprecated. The new way to use AlgoKit Utils is via the `AlgorandClient` class, which is easier, simpler and more convenient to use and has powerful new features. + +A simple example of the before and after follows: + +```typescript +/**** Before ****/ +import * as algokit from '@algorandfoundation/algokit-utils' +const algod = algokit.getAlgoClient() +const account = await algokit.mnemonicAccountFromEnvironment( + { + name: 'MY_ACCOUNT', + fundWith: algokit.algos(2), + }, + algod, +) +const payment = await algokit.transferAlgos({ + from: account, + to: 'RECEIVER', + amount: algokit.algos(1), +}) + +/**** After ****/ +import { AlgorandClient } from '@algorandfoundation/algokit-utils' +const algorand = await AlgorandClient.fromEnvironment() +const account = algorand.account.fromEnvironment('MY_ACCOUNT', (2).algo()) +const payment = await algorand.send.payment({ + sender: account.addr, + receiver: 'RECEIVER', + amount: (1).algo(), +}) +``` + +If you were following the recommended guidance for AlgoKit Utils then you can easily tell if you are using the old version by looking for this import line (which can act as a good todo checklist if you are migrating): + +```typescript +import * as algokit from '@algorandfoundation/algokit-utils' +``` + +## Migrating + +### Step 1 - Accomodate AlgoAmount change + +There is a class in AlgoKit Utils called `AlgoAmount` that wraps the representation of microAlgo / Algo amounts. The `microAlgo` property on that class now returns a `bigint` rather than a `number`, which is a breaking change. This is to align with the new consistent way of representing certain types of values (in this case Algo balances and microAlgo amounts) as bigints. + +### Step 1 - Replace sdk clients with `AlgorandClient` + +To migrate the first step is to get an `AlgorandClient` instance at the same place(s) you had an algod instance. To do this you can look for anywhere you called the `getAlgoClient` method and replace them with an [equivalent mechanism](./capabilities/algorand-client.md#algorand-client) for getting an `AlgorandClient` instance. + +You can retrieve an algod / indexer / kmd object to avoid the need to immediately have to rewrite all of the old calls by accessing them from the algorand client, e.g.: + +```typescript +const algorand = AlgorandClient.mainnet() // ... or whichever other method you want to get a client +const algod = algorand.client.algod +// And if you need these... +const indexer = algorand.client.indexer +const kmd = algorand.client.kmd +``` + +Once you have fully migrated you will likely find you wont need these sdk client instances and can delete those variables. + +### Step 2 - Replace function calls + +Now you can replace the function calls one-by-one. Almost every call should have a `@deprecation` notice that will show up in intellisense for your IDE (e.g. VS Code). The method call will show up with ~~strikethrough~~ and if you hover over it then the deprecation notice will show the new functionality. + +For instance, the `algokit.transferAlgos` call shown in the above example has the following deprecation notice: + +> @deprecated Use `algorand.send.payment()` / `algorand.transactions.payment()` instead + +These deprecation notices should largely let you follow the bouncing ball and make quick work of the migration. Largely the old vs new calls are fairly equivalent with some naming changes to improve consistency within AlgoKit Utils and more broadly to align to the core Algorand protocol (e.g. using `payment` rather than `transferAlgos` since it's a payment transaction on the Algorand blockchain). In saying that, there are some key differences that you will need to tweak: + +- No longer any need to pass `algod`, `indexer`, or `kmd` around - remove those arguments +- Consistently using `sender` rather than `from`/`sender`/etc. for the transaction sender, and this argument is a string rather than taking a `SendTransactionFrom` type to improve simplicity (so you may need to add `.addr` or similar to an account object) +- Transfer receivers are now `receiver` rather than `to` and always take a string of the address (so you may need to add `.addr` or similar to an account object) +- `clearProgram` parameter is renamed to `clearStateProgram` and `extraPages` to `extraProgramPages` for create and update app calls (to align with Algorand protocol names). +- `extraProgramPages` appears as a top-level params property rather than nested in a `schema` property. +- Round numbers, app IDs and asset IDs are now consistently `BigInt`'s rather than `number` or `number | bigint` +- If you previously used `skipSending: true` that no longer exists; the new equivalent of that is to use `algorand.transactions...`, but otherwise you should use `algorand.send...` to immediately sign and send. +- If you previously used `atc` as a parameter when constructing a transaction that no longer exists; the new equivalent of that is to use `algorand.newGroup()` to get an [`AlgoKitComposer`](./capabilities/algokit-composer.md) and chain method calls to build up a group of transactions and then call `execute()` to execute the group. +- Functions that took multiple params objects largely only take a single, combined object now (intellisense is your friend, ctrl+space or your IDE's equivalent auto-complete keyboard shortcut will help you see all of the options!). + +Other things to note that you may come across: + +- We now restrict the number of valid rounds (10 rounds, except when pointing to LocalNet, which is still 1000 to avoid problems given the round advances for every transaction) to a much smaller window than the default (1000 rounds), but this is configurable [by default](./capabilities/algorand-client.md#transaction-configuration) and [per transaction](./capabilities/algorand-client.md#transaction-parameters) if that's a problem. If you come across this problem it will present as a dead transaction error. +- Transaction parameters are cached for a period of time to prevent repeated calls to the algod API to get default transaction parameters, but this sometimes means that you can create duplicate transaction IDs when previously that wouldn't happen, you will get an obvious error if that happens though and can adjust it by ensuring one of the parameters in your transaction change slightly (e.g. note, lease, validity window, etc.), you can also [exert control over default transaction parameter caching](./capabilities/algorand-client.md#transaction-configuration) +- Rather than always passing a signer into transaction calls (which is what the `SendTransactionFrom` instance previously combined with the address), we have decoupled signing and sender address via the `AccountManager` (`algorand.account`), which keeps track of the signer associated with a sender address so the signer can be resolved just in time. + - Most of the time you don't need to worry about it since it will magically happen for you, but if you have situations where you are creating a signer outside of the `AccountManager` you will need to [register the signer](./capabilities/account.md#registering-a-signer) with the `AccountManager` first. + - Note: you can also explicitly [pass a `signer`](./capabilities/algorand-client.md#transaction-parameters) in as well if you want an escape hatch. + +### Step 3 - Replace `ApplicationClient` usage + +The existing `ApplicationClient` (untyped app client) class is still present until the next major version bump, but it's worthwhile migrating to the new [`AppClient` and `AppFactory` classes](./capabilities/app-client.md). These new clients are [ARC-56](https://github.com/algorandfoundation/ARCs/pull/258) compatible, but also take an [ARC-32](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0032.md) app spec file and will continue to support this indefinitely until such time the community deems they are deprecated. + +All of the functionality in `ApplicationClient` is available within the new classes, but their interface is slightly different to make it easier to use and more consistent with the new `AlgorandClient` functionality. The key existing methods that have changed all have `@deprecation` notices to help guide you on this, but broadly the changes are: + +- If you want to call `create` or `deploy` then you need an `AppFactory` to do that, and then it will in turn give you an `AppClient` instance that is connected to the app you just created / deployed. This significantly simplifies the app client because now the app client has a clear operating purpose: allow for calls and state management for an _instance_ of an app, whereas the app factory handles all of the calls when you don't have an instance yet (or may or may not have an instance in the case of `deploy`). +- This means that you can simply access `client.appId` and `client.appAddress` on `AppClient` since these values are known statically and won't change (previously you had to awkwardly call `await client.getAppReference()` since these values weren't always available and potentially required an API call to resolve). +- `fundAppAccount` no longer takes an `AlgoAmount` directly - it always expects the params object (more consistent with) +- `compile` is replaced with static methods on `AppClient` and `getABIMethodParams` is deprecated in favour of `getABIMethod`, which now returns the params _and_ the `ABIMethod` +- All of the methods that return or execute a transaction (`update`, `call`, `optIn`, etc.) are now exposed in an interface similar to the one in [`AlgorandClient`](./capabilities/algorand-client.md#creating-and-issuing-transactions), namely (where `{callType}` is one of: `update` / `delete` / `optIn` / `closeOut` / `clearState` / `call`): + - `appClient.transactions.{callType}` to get a transaction for an ABI method call + - `appClient.send.{callType}` to sign and send a transaction for an ABI method call + - `appClient.params.{callType}` to get a [params object](./capabilities/algorand-client.md#transaction-parameters) for an ABI method call + - `appClient.transactions.bare.{callType}` to get a transaction for a bare app call + - `appClient.send.bare.{callType}` to sign and send a transaction for a bare app call + - `appClient.params.bare.{callType}` to get a [params object](./capabilities/algorand-client.md#transaction-parameters) for a bare app call +- The `resolveBy` functionality has disappeared in favour of [much simpler entrypoints within `algorand.client`](./capabilities/app-client.md#appclient) +- When making an ABI method call, the method arguments property is now `args` rather than `methodArgs` +- The foreign reference arrays have been renamed (and are affected by the switch to `BigInt` for app and asset IDs) and appear in the top level params object rather than nested in an `args` property: + - `boxes` -> `boxReferences` + - `apps` -> `appReferences` + - `assets` -> `assetReferences` + - `accounts` -> `accountReferences` +- The return value for methods that send a transaction will have any ABI return value directly in the `return` property rather than the `ABIReturn` type (this behaviour matches what happened in typed clients, but has now been brought down to the underlying `AppClient`) + +### Step 4 - Replace typed app client usage + +TODO diff --git a/src/__snapshots__/app-deploy.spec.ts.snap b/src/__snapshots__/app-deploy.spec.ts.snap index 3f7fe4e7..1f45e17b 100644 --- a/src/__snapshots__/app-deploy.spec.ts.snap +++ b/src/__snapshots__/app-deploy.spec.ts.snap @@ -92,7 +92,8 @@ INFO: Existing app test found by creator ACCOUNT_1, with app id APP_1 and versio INFO: Detected a TEAL update in app APP_1 for creator ACCOUNT_1 INFO: App is updatable and onUpdate=UpdateApp, updating app... INFO: Updating existing test app for ACCOUNT_1 to version 2.0. -VERBOSE: Sent transaction ID TXID_2 appl from ACCOUNT_1" +VERBOSE: Sent transaction ID TXID_2 appl from ACCOUNT_1 +DEBUG: App APP_1 updated by ACCOUNT_1 via transaction TXID_2" `; exports[`deploy-app Do nothing if deploying app with no changes 1`] = ` diff --git a/src/amount.ts b/src/amount.ts index 924914b2..d51989ed 100644 --- a/src/amount.ts +++ b/src/amount.ts @@ -20,6 +20,16 @@ declare global { */ algo(this: number): AlgoAmount } + interface BigInt { + /** + * Returns an `AlgoAmount` using this number of microAlgo. + */ + microAlgo(this: bigint): AlgoAmount + /** + * Returns an `AlgoAmount` using this number of Algo. + */ + algo(this: bigint): AlgoAmount + } } Number.prototype.microAlgos = function () { @@ -38,31 +48,39 @@ Number.prototype.algo = function () { return AlgoAmount.Algo(this) } +BigInt.prototype.microAlgo = function () { + return AlgoAmount.MicroAlgo(this) +} + +BigInt.prototype.algo = function () { + return AlgoAmount.Algo(this) +} + /** Returns an amount of Algo using AlgoAmount * @param algos The amount of Algo */ -export const algos = (algos: number) => { +export const algos = (algos: number | bigint) => { return AlgoAmount.Algo(algos) } /** Returns an amount of Algo using AlgoAmount * @param algos The amount of Algo */ -export const algo = (algos: number) => { +export const algo = (algos: number | bigint) => { return AlgoAmount.Algo(algos) } /** Returns an amount of µAlgo using AlgoAmount * @param microAlgos The amount of µAlgo */ -export const microAlgos = (microAlgos: number) => { +export const microAlgos = (microAlgos: number | bigint) => { return AlgoAmount.MicroAlgo(microAlgos) } /** Returns an amount of µAlgo using AlgoAmount * @param microAlgos The amount of µAlgo */ -export const microAlgo = (microAlgos: number) => { +export const microAlgo = (microAlgos: number | bigint) => { return AlgoAmount.MicroAlgo(microAlgos) } diff --git a/src/app-client.ts b/src/app-client.ts index 507d8196..93eb54b4 100644 --- a/src/app-client.ts +++ b/src/app-client.ts @@ -3,6 +3,11 @@ import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetails import Algodv2 = algosdk.Algodv2 /** + * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or + * `algorand.client.getAppClientByCreatorAndName`. + * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, + * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + * * Create a new ApplicationClient instance * @param appDetails The details of the app * @param algod An algod instance @@ -37,6 +42,11 @@ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { } /** + * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`. + * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, + * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + * + * * Create a new ApplicationClient instance by id * @param appDetails The details of the app * @param algod An algod instance @@ -58,6 +68,11 @@ export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algod } /** + * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`. + * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, + * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + * + * * Create a new ApplicationClient instance by creator and name * @param appDetails The details of the app by creator and name * @param algod An algod instance diff --git a/src/app-deploy.spec.ts b/src/app-deploy.spec.ts index 5c8b0d06..b651df68 100644 --- a/src/app-deploy.spec.ts +++ b/src/app-deploy.spec.ts @@ -1,11 +1,12 @@ import { describe, test } from '@jest/globals' import { getApplicationAddress } from 'algosdk' import invariant from 'tiny-invariant' -import * as algokit from '.' import { getTestingAppCreateParams, getTestingAppDeployParams } from '../tests/example-contracts/testing-app/contract' +import { Config } from './config' import { algoKitLogCaptureFixture, algorandFixture } from './testing' import { AppDeployMetadata } from './types/app' import { AppDeployParams } from './types/app-deployer' +import { AppManager } from './types/app-manager' import { LogicError } from './types/logic-error' describe('deploy-app', () => { @@ -298,7 +299,7 @@ describe('deploy-app', () => { }) test('Deploy failure for replacement of permanent, updated app', async () => { - algokit.Config.configure({ debug: false }) // Remove noise from snapshot + Config.configure({ debug: false }) // Remove noise from snapshot const { algorand, testAccount, waitForIndexer } = localnet.context const metadata = getMetadata({ deletable: false }) const deployment1 = (await getTestingAppDeployParams({ @@ -378,7 +379,7 @@ describe('deploy-app', () => { }) test('Deploy replacement to schema broken, permanent app fails', async () => { - algokit.Config.configure({ debug: false }) // Remove noise from snapshot + Config.configure({ debug: false }) // Remove noise from snapshot const { algorand, testAccount, waitForIndexer } = localnet.context const metadata = getMetadata({ deletable: false }) const deployment1 = (await getTestingAppDeployParams({ @@ -567,7 +568,7 @@ test('Strip comments remove comments without removing commands', async () => { '//comment\nop arg //comment\nop "arg" //comment\nop "//" //comment\nop " //comment " //comment\nop "" //" //comment\nop "" //comment\n//\nop 123\nop 123 // something\nop "" // more comments\nop "//" //op "//"\nop "//"' const tealCodeResult = '\nop arg\nop "arg"\nop "//"\nop " //comment "\nop "" //"\nop ""\n\nop 123\nop 123\nop ""\nop "//"\nop "//"' - const result = algokit.stripTealComments(tealCode) + const result = AppManager.stripTealComments(tealCode) expect(result).toBe(tealCodeResult) }) @@ -580,7 +581,7 @@ test('Can substitute template variable with multiple underscores', async () => { const test_params = { SOME_VALUE: 123, } - const substituted = algokit.performTemplateSubstitution(test_teal, test_params) + const substituted = AppManager.replaceTealTemplateParams(test_teal, test_params) expect(substituted).toBe(` int 123 return @@ -598,7 +599,7 @@ test('Can substitue both bytes and int uint64', async () => { const test_params = { SOME_VALUE: 123, } - const substituted = algokit.performTemplateSubstitution(test_teal, test_params) + const substituted = AppManager.replaceTealTemplateParams(test_teal, test_params) expect(substituted).toBe(` int 123 pushint 123 diff --git a/src/app-deploy.ts b/src/app-deploy.ts index 07e830d6..3424fb0c 100644 --- a/src/app-deploy.ts +++ b/src/app-deploy.ts @@ -1,7 +1,7 @@ import algosdk from 'algosdk' import { compileTeal, getAppOnCompleteAction } from './app' import { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge' -import { getSenderAddress, getSenderTransactionSigner, getTransactionParams } from './transaction/transaction' +import { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction' import { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender' import { ABIReturn, @@ -70,7 +70,8 @@ export async function deployApp( new AlgoKitComposer({ algod, getSigner: () => getSenderTransactionSigner(deployment.from), - getSuggestedParams: async () => await getTransactionParams(deployment.transactionParams, algod), + getSuggestedParams: async () => + deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(), appManager, }) const deployer = new AppDeployer( @@ -193,11 +194,9 @@ export async function deployApp( ), } : undefined, - executeParams: { - maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation, - populateAppCallResources: deployment.populateAppCallResources, - suppressLog: deployment.suppressLog, - }, + maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation, + populateAppCallResources: deployment.populateAppCallResources, + suppressLog: deployment.suppressLog, }) return { ...result, appId: Number(result.appId), createdRound: Number(result.createdRound), updatedRound: Number(result.updatedRound) } diff --git a/src/app.ts b/src/app.ts index b1557906..b41dbab6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -29,10 +29,8 @@ import ABIMethodParams = algosdk.ABIMethodParams import ABIValue = algosdk.ABIValue import Address = algosdk.Address import Algodv2 = algosdk.Algodv2 -import AtomicTransactionComposer = algosdk.AtomicTransactionComposer import modelsv2 = algosdk.modelsv2 import OnApplicationComplete = algosdk.OnApplicationComplete -import Transaction = algosdk.Transaction /** * @deprecated Use `algorand.send.appCreate()` / `algorand.transactions.appCreate()` / `algorand.send.appCreateMethodCall()` @@ -187,6 +185,9 @@ export async function callApp(call: AppCallParams, algod: Algodv2): Promise c.appCallMethodCall, @@ -236,7 +238,7 @@ export function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.Pending } /** - * @deprecated Use `(await appManager.getById(appId)).globalState` instead. + * @deprecated Use `algorand.app.getGlobalState` instead. * * Returns the current global state values for the given app ID * @param appId The ID of the app return global state for @@ -244,7 +246,7 @@ export function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.Pending * @returns The current global state */ export async function getAppGlobalState(appId: number | bigint, algod: Algodv2) { - return (await new AppManager(algod).getById(BigInt(appId))).globalState + return await new AppManager(algod).getGlobalState(BigInt(appId)) } /** diff --git a/src/asset.ts b/src/asset.ts index dac56b02..0a81cedf 100644 --- a/src/asset.ts +++ b/src/asset.ts @@ -3,7 +3,6 @@ import { encodeTransactionNote, getSenderAddress } from './transaction' import { legacySendTransactionBridge } from './transaction/legacy-bridge' import { AlgorandClient } from './types/algorand-client' import { AssetBulkOptInOutParams, AssetOptInParams, AssetOptOutParams, CreateAssetParams } from './types/asset' -import { ClientManager } from './types/client-manager' import { AssetCreateParams, AssetOptInParams as NewAssetOptInParams, AssetOptOutParams as NewAssetOptOutParams } from './types/composer' import { SendTransactionResult } from './types/transaction' import Algodv2 = algosdk.Algodv2 @@ -129,7 +128,6 @@ export async function assetOptOut(optOut: AssetOptOutParams, algod: Algodv2): Pr * @example algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod) */ export async function assetBulkOptIn(optIn: AssetBulkOptInOutParams, algod: Algodv2): Promise> { - const clientManager = new ClientManager({ algod }) const result = await AlgorandClient.fromClients({ algod }) .setSignerFromAccount(optIn.account) .asset.bulkOptIn(getSenderAddress(optIn.account), optIn.assetIds.map(BigInt), { @@ -157,7 +155,6 @@ export async function assetBulkOptIn(optIn: AssetBulkOptInOutParams, algod: Algo * @example algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod) */ export async function assetBulkOptOut(optOut: AssetBulkOptInOutParams, algod: Algodv2): Promise> { - const clientManager = new ClientManager({ algod }) const result = await AlgorandClient.fromClients({ algod }) .setSignerFromAccount(optOut.account) .asset.bulkOptOut(getSenderAddress(optOut.account), optOut.assetIds.map(BigInt), { diff --git a/src/debugging/debugging.spec.ts b/src/debugging/debugging.spec.ts index b8d473a9..bd783ddf 100644 --- a/src/debugging/debugging.spec.ts +++ b/src/debugging/debugging.spec.ts @@ -27,7 +27,6 @@ describe('debug utils tests', () => { test( 'build teal sourceMaps', async () => { - const { algod } = localnet.context const cwd = await fs.mkdtemp(path.join(os.tmpdir(), 'cwd')) const approval = ` @@ -43,7 +42,7 @@ int 1 PersistSourceMapInput.fromRawTeal(clear, 'cool_app', 'clear'), ] - await persistSourceMaps({ sources: sources, projectRoot: cwd, client: algod }) + await persistSourceMaps({ sources: sources, projectRoot: cwd, appManager: localnet.algorand.app }) const rootPath = path.join(cwd, '.algokit', 'sources') const sourcemapFilePath = path.join(rootPath, 'sources.avm.json') @@ -64,7 +63,7 @@ int 1 expect(result).toMatchSnapshot() // check for updates in case of multiple runs - await persistSourceMaps({ sources: sources, projectRoot: cwd, client: algod }) + await persistSourceMaps({ sources: sources, projectRoot: cwd, appManager: localnet.algorand.app }) const resultAfterUpdate = AVMDebuggerSourceMap.fromDict(JSON.parse(await fs.readFile(sourcemapFilePath, 'utf8'))) for (const item of resultAfterUpdate.txnGroupSources) { expect(item.location).not.toBe('dummy') @@ -76,7 +75,7 @@ int 1 test( 'build teal sourceMaps without sources', async () => { - const { algod, algorand } = localnet.context + const { algorand } = localnet.context const cwd = await fs.mkdtemp(path.join(os.tmpdir(), 'cwd')) const approval = ` @@ -94,7 +93,7 @@ int 1 PersistSourceMapInput.fromCompiledTeal(clearCompiled, 'cool_app', 'clear'), ] - await persistSourceMaps({ sources: sources, projectRoot: cwd, client: algod, withSources: false }) + await persistSourceMaps({ sources: sources, projectRoot: cwd, appManager: localnet.algorand.app, withSources: false }) const rootPath = path.join(cwd, '.algokit', 'sources') const sourcemapFilePath = path.join(rootPath, 'sources.avm.json') diff --git a/src/debugging/debugging.ts b/src/debugging/debugging.ts index a47c832f..eb63c885 100644 --- a/src/debugging/debugging.ts +++ b/src/debugging/debugging.ts @@ -1,4 +1,3 @@ -import algosdk from 'algosdk' import * as crypto from 'crypto' import { Config } from '../config' import { CompiledTeal } from '../types/app' @@ -85,7 +84,7 @@ async function buildAVMSourcemap({ appName, fileName, outputPath, - client, + appManager, withSources = true, }: { rawTeal?: string @@ -93,7 +92,7 @@ async function buildAVMSourcemap({ appName: string fileName: string outputPath: string - client: algosdk.Algodv2 + appManager: AppManager withSources?: boolean }): Promise { if (!rawTeal && !compiledTeal) { @@ -102,7 +101,7 @@ async function buildAVMSourcemap({ const path = await import('path') // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const result = rawTeal ? await new AppManager(client).compileTeal(rawTeal) : compiledTeal! + const result = rawTeal ? await appManager.compileTeal(rawTeal) : compiledTeal! const programHash = crypto.createHash('SHA-512/256').update(Buffer.from(result.compiled, 'base64')).digest('base64') const sourceMap = result.sourceMap sourceMap.sources = withSources ? [`${fileName}${TEAL_FILE_EXT}`] : [] @@ -128,7 +127,7 @@ async function buildAVMSourcemap({ * * @returns A promise that resolves when the source maps have been persisted. */ -export async function persistSourceMaps({ sources, projectRoot, client, withSources }: PersistSourceMapsParams): Promise { +export async function persistSourceMaps({ sources, projectRoot, appManager, withSources }: PersistSourceMapsParams): Promise { if (!isNode()) { throw new Error('Sourcemaps can only be persisted in Node.js environment.') } @@ -142,7 +141,7 @@ export async function persistSourceMaps({ sources, projectRoot, client, withSour appName: source.appName, fileName: source.fileName, outputPath: projectRoot, - client: client, + appManager: appManager, withSources: withSources, }), ), diff --git a/src/index.ts b/src/index.ts index 26c4ccd3..6a269d6c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,12 +1,8 @@ -// TODO review exports -export * from './app-client' -export * from './app-deploy' -export * from './debugging' -export * from './transaction' - // Legacy exports - remove after 2 x major version bumps export * from './account' export * from './app' +export * from './app-client' +export * from './app-deploy' export * from './asset' export * from './dispenser-client' export * from './indexer-lookup' @@ -17,5 +13,7 @@ export * from './transfer' // Up to date exports export * from './amount' export * from './config' +export * from './debugging' export * as indexer from './indexer-lookup' +export * from './transaction' export { AlgorandClient } from './types/algorand-client' diff --git a/src/indexer-lookup.spec.ts b/src/indexer-lookup.spec.ts index 26b6b6f7..d7430e71 100644 --- a/src/indexer-lookup.spec.ts +++ b/src/indexer-lookup.spec.ts @@ -65,19 +65,20 @@ describe('indexer-lookup', () => { }) const app = await getTestingAppContract() - const app1 = await algorand.client - .getAppClientById({ app: app.appSpec, id: 0, sender: testAccount }) - .create({ deletable: false, updatable: false, deployTimeParams: { VALUE: 1 } }) - const app2 = await algorand.client - .getAppClientById({ app: app.appSpec, id: 0, sender: testAccount }) - .create({ deletable: false, updatable: false, deployTimeParams: { VALUE: 1 } }) - await algorand.client - .getAppClientById({ app: app.appSpec, id: 0, sender: secondAccount }) - .create({ deletable: false, updatable: false, deployTimeParams: { VALUE: 1 } }) + const factory = algorand.client.getAppFactory({ + appSpec: app.appSpec, + defaultSender: testAccount.addr, + deletable: false, + updatable: false, + deployTimeParams: { VALUE: 1 }, + }) + const { result: app1 } = await factory.create() + const { result: app2 } = await factory.create({ deployTimeParams: { VALUE: 2 } }) + await factory.create({ sender: secondAccount.addr }) await waitForIndexer() const apps = await indexer.lookupAccountCreatedApplicationByAddress(algorand.client.indexer, testAccount.addr, true, 1) - expect(apps.map((a) => a.id).sort()).toEqual([app1.appId, app2.appId].sort()) + expect(apps.map((a) => BigInt(a.id)).sort()).toEqual([app1.appId, app2.appId].sort()) }, 20_000) }) diff --git a/src/testing/test-logger.ts b/src/testing/test-logger.ts index 2afcfc49..9803a119 100644 --- a/src/testing/test-logger.ts +++ b/src/testing/test-logger.ts @@ -1,4 +1,3 @@ -import { getSenderAddress } from '../' import { Logger } from '../types/logging' import { LogSnapshotConfig } from '../types/testing' @@ -52,7 +51,10 @@ export class TestLogger implements Logger { ) accounts?.forEach( (sender, id) => - (snapshot = snapshot.replace(new RegExp(typeof sender === 'string' ? sender : getSenderAddress(sender), 'g'), `ACCOUNT_${id + 1}`)), + (snapshot = snapshot.replace( + new RegExp(typeof sender === 'string' ? sender : 'addr' in sender ? sender.addr : sender.address(), 'g'), + `ACCOUNT_${id + 1}`, + )), ) apps?.forEach((app, id) => (snapshot = snapshot.replace(new RegExp(`\\b${app.toString()}\\b(?! bytes)`, 'g'), `APP_${id + 1}`))) return snapshot diff --git a/src/transaction/legacy-bridge.ts b/src/transaction/legacy-bridge.ts index 00f1c18a..88a5dc72 100644 --- a/src/transaction/legacy-bridge.ts +++ b/src/transaction/legacy-bridge.ts @@ -15,16 +15,16 @@ import AlgoKitComposer, { AppUpdateParams, BuiltTransactions, CommonTransactionParams, - ExecuteParams, } from '../types/composer' import { + ExecuteParams, SendSingleTransactionResult, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionNote, } from '../types/transaction' -import { encodeLease, encodeTransactionNote, getSenderAddress, getSenderTransactionSigner, getTransactionParams } from './transaction' +import { encodeLease, encodeTransactionNote, getSenderAddress, getSenderTransactionSigner } from './transaction' import Algodv2 = algosdk.Algodv2 import Transaction = algosdk.Transaction import ABIMethod = algosdk.ABIMethod @@ -46,7 +46,7 @@ export async function legacySendTransactionBridge getSenderTransactionSigner(from), - getSuggestedParams: async () => await getTransactionParams(suggestedParams, algod), + getSuggestedParams: async () => (suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()), appManager, }) const transactionSender = new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager) diff --git a/src/transaction/transaction.spec.ts b/src/transaction/transaction.spec.ts index 81bc2bba..812f702b 100644 --- a/src/transaction/transaction.spec.ts +++ b/src/transaction/transaction.spec.ts @@ -5,128 +5,56 @@ import invariant from 'tiny-invariant' import externalARC32 from '../../tests/example-contracts/resource-packer/artifacts/ExternalApp.arc32.json' import v8ARC32 from '../../tests/example-contracts/resource-packer/artifacts/ResourcePackerv8.arc32.json' import v9ARC32 from '../../tests/example-contracts/resource-packer/artifacts/ResourcePackerv9.arc32.json' - -import * as algokit from '..' +import { Config } from '../config' import { algorandFixture } from '../testing' -import { ApplicationClient } from '../types/app-client' +import { AlgoAmount } from '../types/amount' +import { AppClient } from '../types/app-client' +import AlgoKitComposer, { PaymentParams } from '../types/composer' import { Arc2TransactionNote } from '../types/transaction' +import { waitForConfirmation } from './transaction' + describe('transaction', () => { const localnet = algorandFixture() beforeEach(localnet.beforeEach, 10_000) - const getTestTransaction = async (amount?: number, sender?: string) => { - return algosdk.makePaymentTxnWithSuggestedParamsFromObject({ - from: sender ?? localnet.context.testAccount.addr, - to: localnet.context.testAccount.addr, - amount: amount ?? 1, - suggestedParams: await localnet.context.algod.getTransactionParams().do(), - }) + const getTestTransaction = (amount?: AlgoAmount, sender?: string) => { + return { + sender: sender ?? localnet.context.testAccount.addr, + receiver: localnet.context.testAccount.addr, + amount: amount ?? (1).microAlgo(), + } as PaymentParams } - test('Transaction is sent and waited for', async () => { - const { algod, testAccount } = localnet.context - const txn = await getTestTransaction() - const { transaction, confirmation } = await algokit.sendTransaction({ transaction: txn, from: testAccount }, algod) - - expect(transaction.txID()).toBe(txn.txID()) - expect(confirmation?.confirmedRound).toBeGreaterThanOrEqual(txn.firstRound) - }) - test('Transaction is capped by low min txn fee', async () => { - const { algod, testAccount } = localnet.context - const txn = await getTestTransaction() + const { algorand } = localnet.context await expect(async () => { - await algokit.sendTransaction( - { - transaction: txn, - from: testAccount, - sendParams: { - maxFee: algokit.microAlgo(1), - }, - }, - algod, - ) - }).rejects.toThrowError( - 'Cancelled transaction due to high network congestion fees. ' + - 'Algorand suggested fees would cause this transaction to cost 1000 µALGO. ' + - 'Cap for this transaction is 1 µALGO.', - ) - }) - - test('Transaction cap is ignored if flat fee set', async () => { - const { algod, testAccount } = localnet.context - const txn = await getTestTransaction() - txn.flatFee = true - await algokit.sendTransaction( - { - transaction: txn, - from: testAccount, - sendParams: { - maxFee: algokit.microAlgo(1), - }, - }, - algod, - ) + await algorand.send.payment({ ...getTestTransaction(), maxFee: (1).microAlgo() }) + }).rejects.toThrowError('Transaction fee 1000 µALGO is greater than maxFee 1 µALGO') }) test('Transaction cap is ignored if higher than fee', async () => { - const { algod, testAccount } = localnet.context - const txn = await getTestTransaction() - const { confirmation } = await algokit.sendTransaction( - { - transaction: txn, - from: testAccount, - sendParams: { - maxFee: algokit.microAlgo(1000_000), - }, - }, - algod, - ) + const { algorand } = localnet.context + const { confirmation } = await algorand.send.payment({ ...getTestTransaction(), maxFee: (1_000_000).microAlgo() }) expect(confirmation?.txn.txn.fee).toBe(1000) }) test('Transaction fee is overridable', async () => { - const { algod, testAccount } = localnet.context - const txn = await getTestTransaction() - const fee = algokit.algo(1) - const result = await algokit.sendTransaction( - { - transaction: txn, - from: testAccount, - sendParams: { - fee: fee, - }, - }, - algod, - ) + const { algorand } = localnet.context + const fee = (1).algo() + const { confirmation } = await algorand.send.payment({ ...getTestTransaction(), staticFee: fee }) - invariant(result.confirmation) - expect(result.confirmation.txn.txn.fee).toBe(fee.microAlgo) + expect(confirmation.txn.txn.fee).toBe(Number(fee.microAlgo)) }) test('Transaction group is sent', async () => { - const { algod, testAccount } = localnet.context - const txn1 = await getTestTransaction(1) - const txn2 = await getTestTransaction(2) + const { algorand } = localnet.context - const { confirmations } = await algokit.sendGroupOfTransactions( - { - transactions: [ - { - transaction: txn1, - signer: testAccount, - }, - { - transaction: txn2, - signer: testAccount, - }, - ], - }, - algod, - ) + const { + transactions: [txn1, txn2], + confirmations, + } = await algorand.newGroup().addPayment(getTestTransaction((1).microAlgo())).addPayment(getTestTransaction((2).microAlgo())).execute() - invariant(confirmations) invariant(confirmations[0].txn.txn.grp) invariant(confirmations[1].txn.txn.grp) invariant(txn1.group) @@ -138,76 +66,6 @@ describe('transaction', () => { expect(Buffer.from(confirmations[1].txn.txn.grp).toString('hex')).toBe(Buffer.from(txn2.group).toString('hex')) }) - test('Transaction group is sent with same signer', async () => { - const { algod, algorand, testAccount } = localnet.context - const txn1 = await getTestTransaction(1) - const txn2 = await algorand.transactions.payment({ - amount: algokit.microAlgo(2), - sender: testAccount.addr, - receiver: testAccount.addr, - }) - - const { confirmations } = await algokit.sendGroupOfTransactions({ transactions: [txn1, txn2], signer: testAccount }, algod) - - invariant(confirmations) - invariant(confirmations[0].txn.txn.grp) - invariant(confirmations[1].txn.txn.grp) - invariant(txn1.group) - invariant(txn2.group) - expect(confirmations.length).toBe(2) - expect(confirmations[0].confirmedRound).toBeGreaterThanOrEqual(txn1.firstRound) - expect(confirmations[1].confirmedRound).toBeGreaterThanOrEqual(txn2.firstRound) - expect(Buffer.from(confirmations[0].txn.txn.grp).toString('hex')).toBe(Buffer.from(txn1.group).toString('hex')) - expect(Buffer.from(confirmations[1].txn.txn.grp).toString('hex')).toBe(Buffer.from(txn2.group).toString('hex')) - }) - - test('Transaction group is sent using transaction signers', async () => { - const { algod, testAccount, generateAccount } = localnet.context - const account2 = await generateAccount({ suppressLog: true, initialFunds: algokit.algo(10) }) - const txn1 = await getTestTransaction(1) - const txn2 = await getTestTransaction(2, account2.addr) - const txn3 = await getTestTransaction(3) - const txn4 = await getTestTransaction(4, account2.addr) - - const { confirmations } = await algokit.sendGroupOfTransactions( - { - transactions: [ - { - transaction: txn1, - signer: testAccount, - }, - { - transaction: txn2, - signer: account2, - }, - { - transaction: txn3, - signer: testAccount, - }, - { - transaction: txn4, - signer: account2, - }, - ], - }, - algod, - ) - - invariant(confirmations) - invariant(confirmations[0].confirmedRound) - invariant(confirmations[1].confirmedRound) - invariant(confirmations[2].confirmedRound) - invariant(confirmations[3].confirmedRound) - expect(confirmations[0].txn.txn.amt).toBe(1) - expect(algosdk.encodeAddress(confirmations[0].txn.txn.snd)).toBe(testAccount.addr) - expect(confirmations[1].txn.txn.amt).toBe(2) - expect(algosdk.encodeAddress(confirmations[1].txn.txn.snd)).toBe(account2.addr) - expect(confirmations[2].txn.txn.amt).toBe(3) - expect(algosdk.encodeAddress(confirmations[2].txn.txn.snd)).toBe(testAccount.addr) - expect(confirmations[3].txn.txn.amt).toBe(4) - expect(algosdk.encodeAddress(confirmations[3].txn.txn.snd)).toBe(account2.addr) - }) - test('Multisig single account', async () => { const { algorand, testAccount } = localnet.context @@ -225,21 +83,21 @@ describe('transaction', () => { await algorand.send.payment({ sender: testAccount.addr, receiver: multisig.addr, - amount: algokit.algo(1), + amount: (1).algo(), }) // Use multisig await algorand.send.payment({ sender: multisig.addr, receiver: testAccount.addr, - amount: algokit.microAlgo(500), + amount: (500).microAlgo(), }) }) test('Multisig double account', async () => { - const { algod, algorand, testAccount, generateAccount } = localnet.context + const { algorand, testAccount, generateAccount } = localnet.context const account2 = await generateAccount({ - initialFunds: algokit.algo(10), + initialFunds: (10).algo(), suppressLog: true, }) @@ -257,48 +115,34 @@ describe('transaction', () => { await algorand.send.payment({ sender: testAccount.addr, receiver: multisig.addr, - amount: algokit.algo(1), + amount: (1).algo(), }) // Use multisig await algorand.send.payment({ sender: multisig.addr, receiver: testAccount.addr, - amount: algokit.microAlgo(500), + amount: (500).microAlgo(), }) }) test('Transaction wait for confirmation http error', async () => { - const { algod } = localnet.context - const txn = await getTestTransaction() + const { algorand, algod } = localnet.context + const txn = await algorand.transactions.payment(getTestTransaction()) try { - await algokit.waitForConfirmation(txn.txID(), 5, algod) + await waitForConfirmation(txn.txID(), 5, algod) } catch (e: unknown) { expect((e as Error).message).toEqual(`Transaction ${txn.txID()} not confirmed after 5 rounds`) } }) test('Transaction fails in debug mode, error is enriched using simulate', async () => { - const { algod, testAccount } = localnet.context - const txn1 = await getTestTransaction(1) - const txn2 = await getTestTransaction(9999999999999) // This will fail due to fee being too high - + const { algorand, testAccount } = localnet.context + const txn1 = await algorand.transactions.payment(getTestTransaction((1).microAlgo())) + // This will fail due to fee being too high + const txn2 = await algorand.transactions.payment(getTestTransaction((9999999999999).microAlgo())) try { - await algokit.sendGroupOfTransactions( - { - transactions: [ - { - transaction: txn1, - signer: testAccount, - }, - { - transaction: txn2, - signer: testAccount, - }, - ], - }, - algod, - ) + await algorand.newGroup().addTransaction(txn1).addTransaction(txn2).execute() // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (e: any) { const messageRegex = new RegExp( @@ -309,40 +153,10 @@ describe('transaction', () => { }) }) -describe('transaction node encoder', () => { - test('null', () => { - expect(algokit.encodeTransactionNote(null)).toBeUndefined() - }) - test('undefined', () => { - expect(algokit.encodeTransactionNote(undefined)).toBeUndefined() - }) - test('string', () => { - expect(algokit.encodeTransactionNote('abc')).toMatchInlineSnapshot(` - Uint8Array [ - 97, - 98, - 99, - ] - `) - }) - test('object', () => { - expect(algokit.encodeTransactionNote({ a: 'b' })).toMatchInlineSnapshot(` - Uint8Array [ - 123, - 34, - 97, - 34, - 58, - 34, - 98, - 34, - 125, - ] - `) - }) +describe('arc2 transaction note', () => { test('arc-0002', () => { expect( - algokit.encodeTransactionNote({ + AlgoKitComposer.arc2Note({ dAppName: 'a', format: 'u', data: 'abc', @@ -363,58 +177,37 @@ describe('transaction node encoder', () => { const tests = (version: 8 | 9) => () => { const fixture = algorandFixture() - let appClient: ApplicationClient - let externalClient: ApplicationClient + let appClient: AppClient + let externalClient: AppClient beforeEach(fixture.beforeEach) beforeAll(async () => { - algokit.Config.configure({ populateAppCallResources: true }) + Config.configure({ populateAppCallResources: true }) await fixture.beforeEach() - const { algod, testAccount } = fixture.context - - if (version === 8) { - appClient = new ApplicationClient( - { - app: JSON.stringify(v8ARC32), - sender: testAccount, - resolveBy: 'id', - id: 0, - }, - algod, - ) - } else { - appClient = new ApplicationClient( - { - app: JSON.stringify(v9ARC32), - sender: testAccount, - resolveBy: 'id', - id: 0, - }, - algod, - ) - } + const { algorand, testAccount } = fixture.context - await appClient.create({ method: 'createApplication', methodArgs: [] }) + const appFactory = algorand.client.getAppFactory({ + appSpec: JSON.stringify(version === 8 ? v8ARC32 : v9ARC32), + defaultSender: testAccount.addr, + }) - await appClient.fundAppAccount(algokit.microAlgo(2334300)) + const { app } = await appFactory.create({ method: 'createApplication' }) + appClient = app - await appClient.call({ method: 'bootstrap', methodArgs: [], sendParams: { fee: algokit.microAlgo(3_000) } }) + await appClient.fundAppAccount({ amount: (2334300).microAlgo() }) - externalClient = new ApplicationClient( - { - app: JSON.stringify(externalARC32), - sender: testAccount, - resolveBy: 'id', - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - id: (await appClient.getGlobalState()).externalAppID!.value as bigint, - }, - algod, - ) + await appClient.send.call({ method: 'bootstrap', staticFee: (3_000).microAlgo() }) + + externalClient = algorand.client.getAppClientById({ + appSpec: JSON.stringify(externalARC32), + appId: (await app.getGlobalState()).externalAppID.value as bigint, + defaultSender: testAccount.addr, + }) }) afterAll(() => { - algokit.Config.configure({ populateAppCallResources: false }) + Config.configure({ populateAppCallResources: false }) }) let alice: algosdk.Account @@ -424,47 +217,44 @@ const tests = (version: 8 | 9) => () => { const { testAccount } = fixture.context alice = testAccount await expect( - appClient.call({ method: 'addressBalance', methodArgs: [testAccount.addr], sendParams: { populateAppCallResources: false } }), + appClient.send.call({ method: 'addressBalance', args: [testAccount.addr], populateAppCallResources: false }), ).rejects.toThrow('invalid Account reference') }) test('addressBalance', async () => { - await appClient.call({ method: 'addressBalance', methodArgs: [alice.addr] }) + await appClient.send.call({ method: 'addressBalance', args: [alice.addr] }) }) }) describe('boxes', () => { test('smallBox: invalid Box reference', async () => { - await expect(appClient.call({ method: 'smallBox', methodArgs: [], sendParams: { populateAppCallResources: false } })).rejects.toThrow( - 'invalid Box reference', - ) + await expect(appClient.send.call({ method: 'smallBox', populateAppCallResources: false })).rejects.toThrow('invalid Box reference') }) test('smallBox', async () => { - await appClient.call({ method: 'smallBox', methodArgs: [] }) + await appClient.send.call({ method: 'smallBox' }) }) test('mediumBox', async () => { - await appClient.call({ method: 'mediumBox', methodArgs: [] }) + await appClient.send.call({ method: 'mediumBox' }) }) }) describe('apps', () => { test('externalAppCall: unavailable App', async () => { await expect( - appClient.call({ + appClient.send.call({ method: 'externalAppCall', - methodArgs: [], - sendParams: { populateAppCallResources: false, fee: algokit.microAlgo(2_000) }, + populateAppCallResources: false, + staticFee: (2_000).microAlgo(), }), ).rejects.toThrow('unavailable App') }) test('externalAppCall', async () => { - await appClient.call({ + await appClient.send.call({ method: 'externalAppCall', - methodArgs: [], - sendParams: { fee: algokit.microAlgo(2_000) }, + staticFee: (2_000).microAlgo(), }) }) }) @@ -473,13 +263,11 @@ const tests = (version: 8 | 9) => () => { test('assetTotal: unavailable Asset', async () => { const { testAccount } = fixture.context alice = testAccount - await expect( - appClient.call({ method: 'assetTotal', methodArgs: [], sendParams: { populateAppCallResources: false } }), - ).rejects.toThrow('unavailable Asset') + await expect(appClient.send.call({ method: 'assetTotal', populateAppCallResources: false })).rejects.toThrow('unavailable Asset') }) test('assetTotal', async () => { - await appClient.call({ method: 'assetTotal', methodArgs: [] }) + await appClient.send.call({ method: 'assetTotal' }) }) }) @@ -489,81 +277,55 @@ const tests = (version: 8 | 9) => () => { test(`hasAsset: ${hasAssetErrorMsg}`, async () => { const { testAccount } = fixture.context alice = testAccount - await expect( - appClient.call({ method: 'hasAsset', methodArgs: [testAccount.addr], sendParams: { populateAppCallResources: false } }), - ).rejects.toThrow(hasAssetErrorMsg) + await expect(appClient.send.call({ method: 'hasAsset', args: [testAccount.addr], populateAppCallResources: false })).rejects.toThrow( + hasAssetErrorMsg, + ) }) test('hasAsset', async () => { const { testAccount } = fixture.context - await appClient.call({ method: 'hasAsset', methodArgs: [testAccount.addr] }) + await appClient.send.call({ method: 'hasAsset', args: [testAccount.addr] }) }) test(`externalLocal: ${hasAssetErrorMsg}`, async () => { const { testAccount } = fixture.context alice = testAccount await expect( - appClient.call({ method: 'externalLocal', methodArgs: [testAccount.addr], sendParams: { populateAppCallResources: false } }), + appClient.send.call({ method: 'externalLocal', args: [testAccount.addr], populateAppCallResources: false }), ).rejects.toThrow(hasAssetErrorMsg) }) test('externalLocal', async () => { - const { testAccount } = fixture.context - await externalClient.optIn({ method: 'optInToApplication', methodArgs: [], sender: testAccount }) + const { algorand, testAccount } = fixture.context - await appClient.call({ - method: 'externalLocal', - methodArgs: [testAccount.addr], - sender: testAccount, - }) + await algorand.send.appCallMethodCall(externalClient.params.optIn({ method: 'optInToApplication', sender: testAccount.addr })) + + await algorand.send.appCallMethodCall( + await appClient.params.call({ + method: 'externalLocal', + args: [testAccount.addr], + sender: testAccount.addr, + }), + ) }) }) describe('sendTransaction', () => { test('addressBalance: invalid Account reference', async () => { - const { testAccount, algod } = fixture.context - alice = testAccount - - const atc = new algosdk.AtomicTransactionComposer() - - atc.addMethodCall({ - appID: Number((await appClient.getAppReference()).appId), - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(testAccount), - method: appClient.getABIMethod('addressBalance')!, - methodArgs: [algosdk.generateAccount().addr], - suggestedParams: await fixture.context.algod.getTransactionParams().do(), - }) - - const txn = atc.buildGroup()[0] - - txn.txn.group = undefined - await expect( - algokit.sendTransaction({ transaction: txn.txn, from: testAccount, sendParams: { populateAppCallResources: false } }, algod), + appClient.send.call({ + method: 'addressBalance', + args: [algosdk.generateAccount().addr], + populateAppCallResources: false, + }), ).rejects.toThrow('invalid Account reference') }) test('addressBalance', async () => { - const { testAccount, algod } = fixture.context - alice = testAccount - - const atc = new algosdk.AtomicTransactionComposer() - - atc.addMethodCall({ - appID: Number((await appClient.getAppReference()).appId), - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(testAccount), - method: appClient.getABIMethod('addressBalance')!, - methodArgs: [algosdk.generateAccount().addr], - suggestedParams: await fixture.context.algod.getTransactionParams().do(), + appClient.send.call({ + method: 'addressBalance', + args: [algosdk.generateAccount().addr], }) - - const txn = atc.buildGroup()[0] - - txn.txn.group = undefined - - await algokit.sendTransaction({ transaction: txn.txn, from: testAccount }, algod) }) }) } @@ -573,194 +335,135 @@ describe('Resource Packer: AVM9', tests(9)) describe('Resource Packer: Mixed', () => { const fixture = algorandFixture() - let v9Client: ApplicationClient - - let v8Client: ApplicationClient + let v9Client: AppClient + let v8Client: AppClient beforeEach(fixture.beforeEach) beforeAll(async () => { - algokit.Config.configure({ populateAppCallResources: true }) + Config.configure({ populateAppCallResources: true }) await fixture.beforeEach() - const { algod, testAccount } = fixture.context - v9Client = new ApplicationClient( - { - app: JSON.stringify(v9ARC32), - sender: testAccount, - resolveBy: 'id', - id: 0, - }, - algod, - ) + const testAccount = fixture.context.testAccount - v8Client = new ApplicationClient( - { - app: JSON.stringify(v8ARC32), - sender: testAccount, - resolveBy: 'id', - id: 0, - }, - algod, - ) + const v8AppFactory = fixture.algorand.client.getAppFactory({ + appSpec: JSON.stringify(v8ARC32), + defaultSender: testAccount.addr, + }) - await v9Client.create({ method: 'createApplication', methodArgs: [] }) - await v8Client.create({ method: 'createApplication', methodArgs: [] }) + const v9AppFactory = fixture.algorand.client.getAppFactory({ + appSpec: JSON.stringify(v9ARC32), + defaultSender: testAccount.addr, + }) + + const v8Result = await v8AppFactory.create({ method: 'createApplication' }) + const v9Result = await v9AppFactory.create({ method: 'createApplication' }) + v8Client = v8Result.app + v9Client = v9Result.app }) afterAll(() => { - algokit.Config.configure({ populateAppCallResources: false }) + Config.configure({ populateAppCallResources: false }) }) // Temporarily skip this until this algod bug is fixed: https://github.com/algorand/go-algorand/issues/5914 - test.skip('same account', async () => { - const { algod, testAccount } = fixture.context + test('same account', async () => { + const { algorand, testAccount } = fixture.context const acct = algosdk.generateAccount() - const atc = new algosdk.AtomicTransactionComposer() - - const v8ID = Number((await v8Client.getAppReference()).appId) - const v9ID = Number((await v9Client.getAppReference()).appId) - const suggestedParams = await algod.getTransactionParams().do() - - const rekeyedTo = algosdk.generateAccount() - const rekeyTxn = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ - from: testAccount.addr, - to: testAccount.addr, - amount: 0, - rekeyTo: rekeyedTo.addr, - suggestedParams: await algod.getTransactionParams().do(), - }) - - await algokit.sendTransaction({ transaction: rekeyTxn, from: testAccount }, algod) - atc.addMethodCall({ - appID: v8ID, - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(rekeyedTo), - method: v8Client.getABIMethod('addressBalance')!, - methodArgs: [acct.addr], - suggestedParams, - }) - - atc.addMethodCall({ - appID: v9ID, - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(rekeyedTo), - method: v9Client.getABIMethod('addressBalance')!, - methodArgs: [acct.addr], - suggestedParams, - }) + const rekeyedTo = algorand.account.random() + await algorand.account.rekeyAccount(testAccount.addr, rekeyedTo) - const packedAtc = await algokit.populateAppCallResources(atc, fixture.context.algod) + const { transactions } = await algorand.send + .newGroup() + .addAppCallMethodCall(v8Client.params.call({ method: 'addressBalance', args: [acct.addr], sender: testAccount.addr })) + .addAppCallMethodCall(v9Client.params.call({ method: 'addressBalance', args: [acct.addr], sender: testAccount.addr })) + .execute({ populateAppCallResources: true }) - const v8CallAccts = packedAtc.buildGroup()[0].txn.appAccounts - const v9CallAccts = packedAtc.buildGroup()[1].txn.appAccounts + const v8CallAccts = transactions[0].appAccounts + const v9CallAccts = transactions[1].appAccounts // eslint-disable-next-line @typescript-eslint/no-non-null-assertion expect(v8CallAccts!.length + v9CallAccts!.length).toBe(1) - await packedAtc.execute(algod, 3) }) test('app account', async () => { - const { algod, testAccount } = fixture.context + const { algorand, testAccount } = fixture.context - await v8Client.fundAppAccount(algokit.microAlgo(328500)) - await v8Client.call({ method: 'bootstrap', methodArgs: [], sendParams: { fee: algokit.microAlgo(3_000) } }) + await v8Client.fundAppAccount({ amount: (328500).microAlgo() }) + await v8Client.send.call({ method: 'bootstrap', staticFee: (3_000).microAlgo() }) const externalAppID = (await v8Client.getGlobalState()).externalAppID!.value as bigint - const atc = new algosdk.AtomicTransactionComposer() - const v8ID = Number((await v8Client.getAppReference()).appId) - const v9ID = Number((await v9Client.getAppReference()).appId) - const suggestedParams = await algod.getTransactionParams().do() - - atc.addMethodCall({ - appID: v8ID, - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(testAccount), - method: v8Client.getABIMethod('externalAppCall')!, - methodArgs: [], - suggestedParams: { ...suggestedParams, fee: 2_000 }, - }) - - atc.addMethodCall({ - appID: v9ID, - sender: testAccount.addr, - signer: algosdk.makeBasicAccountTransactionSigner(testAccount), - method: v9Client.getABIMethod('addressBalance')!, - methodArgs: [algosdk.getApplicationAddress(externalAppID)], - suggestedParams, - }) - - const packedAtc = await algokit.populateAppCallResources(atc, fixture.context.algod) + const { transactions } = await algorand.send + .newGroup() + .addAppCallMethodCall(v8Client.params.call({ method: 'externalAppCall', staticFee: (2_000).microAlgo(), sender: testAccount.addr })) + .addAppCallMethodCall( + v9Client.params.call({ method: 'addressBalance', args: [algosdk.getApplicationAddress(externalAppID)], sender: testAccount.addr }), + ) + .execute({ populateAppCallResources: true }) - const v8CallApps = packedAtc.buildGroup()[0].txn.appForeignApps - const v9CallAccts = packedAtc.buildGroup()[1].txn.appAccounts + const v8CallApps = transactions[0].appForeignApps + const v9CallAccts = transactions[1].appAccounts expect(v8CallApps!.length + v9CallAccts!.length).toBe(1) - await packedAtc.execute(algod, 3) }) }) + describe('Resource Packer: meta', () => { const fixture = algorandFixture() - let externalClient: ApplicationClient + let externalClient: AppClient beforeEach(fixture.beforeEach) beforeAll(async () => { await fixture.beforeEach() - const { testAccount, algod } = fixture.context - algokit.Config.configure({ populateAppCallResources: true }) + const { algorand, testAccount } = fixture.context + Config.configure({ populateAppCallResources: true }) - externalClient = new ApplicationClient( - { - app: JSON.stringify(externalARC32), - sender: testAccount, - resolveBy: 'id', - id: 0, - }, - algod, - ) + const factory = algorand.client.getAppFactory({ + appSpec: JSON.stringify(externalARC32), + defaultSender: testAccount.addr, + }) - await externalClient.create({ method: 'createApplication', methodArgs: [] }) + const result = await factory.create({ method: 'createApplication' }) + externalClient = result.app }) afterAll(() => { - algokit.Config.configure({ populateAppCallResources: false }) + Config.configure({ populateAppCallResources: false }) }) test('error during simulate', async () => { - await expect(externalClient.call({ method: 'error', methodArgs: [] })).rejects.toThrow( + await expect(externalClient.send.call({ method: 'error' })).rejects.toThrow( 'Error during resource population simulation in transaction 0', ) }) test('box with txn arg', async () => { - const { testAccount, algod } = fixture.context + const { testAccount, algorand } = fixture.context - const payment = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ - from: testAccount.addr, - to: testAccount.addr, - suggestedParams: await algod.getTransactionParams().do(), - amount: 0, + const payment = await algorand.transactions.payment({ + sender: testAccount.addr, + receiver: testAccount.addr, + amount: (0).microAlgo(), }) - await externalClient.fundAppAccount(algokit.microAlgo(106100)) + await externalClient.fundAppAccount({ amount: (106100).microAlgo() }) - await externalClient.call({ method: 'boxWithPayment', methodArgs: [{ transaction: payment, signer: testAccount }] }) + await externalClient.send.call({ method: 'boxWithPayment', args: [{ txn: payment, signer: testAccount.signer }] }) }) test('sender asset holding', async () => { - await externalClient.fundAppAccount(algokit.microAlgo(200_000)) + await externalClient.fundAppAccount({ amount: (200_000).microAlgo() }) - await externalClient.call({ + await externalClient.send.call({ method: 'createAsset', - methodArgs: [], - sendParams: { fee: algokit.microAlgo(2_000) }, + staticFee: (2_000).microAlgo(), }) - const res = await externalClient.call({ method: 'senderAssetBalance', methodArgs: [] }) + const res = await externalClient.send.call({ method: 'senderAssetBalance' }) expect(res.transaction.appAccounts?.length || 0).toBe(0) }) @@ -773,18 +476,14 @@ describe('Resource Packer: meta', () => { await algorand.account.rekeyAccount(testAccount.addr, authAddr.addr) - await externalClient.fundAppAccount(algokit.microAlgo(200_000)) + await externalClient.fundAppAccount({ amount: (200_001).microAlgo() }) - await externalClient.call({ + await externalClient.send.call({ method: 'createAsset', - methodArgs: [], - sendParams: { fee: algokit.microAlgo(2_000) }, - sender: { addr: testAccount.addr, signer: algosdk.makeBasicAccountTransactionSigner(authAddr) }, + staticFee: (2_001).microAlgo(), }) - const res = await externalClient.call({ + const res = await externalClient.send.call({ method: 'senderAssetBalance', - methodArgs: [], - sender: { addr: testAccount.addr, signer: algosdk.makeBasicAccountTransactionSigner(authAddr) }, }) expect(res.transaction.appAccounts?.length || 0).toBe(0) diff --git a/src/transaction/transaction.ts b/src/transaction/transaction.ts index 925a4874..2caa2d4d 100644 --- a/src/transaction/transaction.ts +++ b/src/transaction/transaction.ts @@ -28,7 +28,10 @@ export const MAX_TRANSACTION_GROUP_SIZE = 16 export const MAX_APP_CALL_FOREIGN_REFERENCES = 8 export const MAX_APP_CALL_ACCOUNT_REFERENCES = 4 -/** Encodes a transaction note into a byte array ready to be included in an Algorand transaction. +/** + * @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `AlgoKitComposer.arc2Note`. + * + * Encodes a transaction note into a byte array ready to be included in an Algorand transaction. * * @param note The transaction note * @returns the transaction note ready for inclusion in a transaction @@ -93,6 +96,9 @@ export function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined } /** + * @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address + * and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead. + * * Returns the public address of the given transaction sender. * @param sender A transaction sender * @returns The public address @@ -102,6 +108,9 @@ export const getSenderAddress = function (sender: string | SendTransactionFrom) } /** + * @deprecated Use `AlgorandClient` / `AlgoKitComposer` to construct transactions instead or + * construct an `algosdk.TransactionWithSigner` manually instead. + * * Given a transaction in a variety of supported formats, returns a TransactionWithSigner object ready to be passed to an * AtomicTransactionComposer's addTransaction method. * @param transaction One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the @@ -144,6 +153,9 @@ const memoize = (fn: (val: T) => R) => { } /** + * @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use + * `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`. + * * Returns a `TransactionSigner` for the given transaction sender. * This function has memoization, so will return the same transaction signer for a given sender. * @param sender A transaction sender @@ -158,6 +170,10 @@ export const getSenderTransactionSigner = memoize(function (sender: SendTransact }) /** + * @deprecated Use `AlgorandClient` / `AlgoKitComposer` to sign transactions + * or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject` + * / `multiSigAccount.sign` / `TransactionSigner` methods directly. + * * Signs a single transaction by the given signer. * @param transaction The transaction to sign * @param signer The signer to sign @@ -173,7 +189,10 @@ export const signTransaction = async (transaction: Transaction, signer: SendTran : (await signer.signer([transaction], [0]))[0] } -/** Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain. +/** + * @deprecated Use `AlgorandClient` / `AlgoKitComposer` to send transactions. + * + * Prepares a transaction for sending and then (if instructed) signs and sends the given transaction to the chain. * * @param send The details for the transaction to prepare/send, including: * * `transaction`: The unsigned transaction @@ -554,12 +573,12 @@ export async function populateAppCallResources(atc: algosdk.AtomicTransactionCom * Signs and sends transactions that have been collected by an `AtomicTransactionComposer`. * @param atcSend The parameters controlling the send, including: * * `atc` The `AtomicTransactionComposer` - * * `sendParams` The parameters to control the send behaviour + * * `executeParams` The parameters to control the send behaviour * @param algod An algod client * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`) */ export const sendAtomicTransactionComposer = async function (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) { - const { atc: givenAtc, sendParams } = atcSend + const { atc: givenAtc, sendParams, executeParams } = atcSend let atc: AtomicTransactionComposer @@ -573,7 +592,8 @@ export const sendAtomicTransactionComposer = async function (atcSend: AtomicTran try { // If populateAppCallResources is true OR if populateAppCallResources is undefined and there are app calls, then populate resources // NOTE: Temporary false by default until this algod bug is fixed: https://github.com/algorand/go-algorand/issues/5914 - const populateResources = sendParams?.populateAppCallResources ?? Config.populateAppCallResources + const populateResources = + executeParams?.populateAppCallResources ?? sendParams?.populateAppCallResources ?? Config.populateAppCallResources if (populateResources) { atc = await populateAppCallResources(givenAtc, algod) @@ -587,11 +607,14 @@ export const sendAtomicTransactionComposer = async function (atcSend: AtomicTran let groupId: string | undefined = undefined if (transactionsToSend.length > 1) { groupId = transactionsToSend[0].group ? Buffer.from(transactionsToSend[0].group).toString('base64') : '' - Config.getLogger(sendParams?.suppressLog).verbose(`Sending group of ${transactionsToSend.length} transactions (${groupId})`, { - transactionsToSend, - }) + Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose( + `Sending group of ${transactionsToSend.length} transactions (${groupId})`, + { + transactionsToSend, + }, + ) - Config.getLogger(sendParams?.suppressLog).debug( + Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).debug( `Transaction IDs (${groupId})`, transactionsToSend.map((t) => t.txID()), ) @@ -606,14 +629,17 @@ export const sendAtomicTransactionComposer = async function (atcSend: AtomicTran bufferSizeMb: Config.traceBufferSizeMb, }) } - const result = await atc.execute(algod, sendParams?.maxRoundsToWaitForConfirmation ?? 5) + const result = await atc.execute( + algod, + executeParams?.maxRoundsToWaitForConfirmation ?? sendParams?.maxRoundsToWaitForConfirmation ?? 5, + ) if (transactionsToSend.length > 1) { - Config.getLogger(sendParams?.suppressLog).verbose( + Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose( `Group transaction (${groupId}) sent with ${transactionsToSend.length} transactions`, ) } else { - Config.getLogger(sendParams?.suppressLog).verbose( + Config.getLogger(executeParams?.suppressLog ?? sendParams?.suppressLog).verbose( `Sent transaction ID ${transactionsToSend[0].txID()} ${transactionsToSend[0].type} from ${algosdk.encodeAddress( transactionsToSend[0].from.publicKey, )}`, @@ -688,6 +714,8 @@ export const sendAtomicTransactionComposer = async function (atcSend: AtomicTran } /** + * @deprecated Use `performAtomicTransactionComposerSimulate`, dry-run is a deprecated Algorand feature. + * * Performs a dry run of the transactions loaded into the given AtomicTransactionComposer` * @param atc The AtomicTransactionComposer` with transaction(s) loaded * @param algod An Algod client @@ -703,6 +731,8 @@ export async function performAtomicTransactionComposerDryrun(atc: AtomicTransact } /** + * @deprecated Use `AlgoKitComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead. + * * Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain * * @param groupSend The group details to send, with: @@ -807,6 +837,8 @@ export const waitForConfirmation = async function ( } /** + * @deprecated Use `AlgoKitComposer` and the `maxFee` field in the transaction params instead. + * * Limit the acceptable fee to a defined amount of µAlgo. * This also sets the transaction to be flatFee to ensure the transaction only succeeds at * the estimated rate. @@ -832,6 +864,8 @@ export function capTransactionFee(transaction: algosdk.Transaction | SuggestedPa } /** + * @deprecated Use `AlgoKitComposer` and the `maxFee` and `staticFee` fields in the transaction params instead. + * * Allows for control of fees on a `Transaction` or `SuggestedParams` object * @param transaction The transaction or suggested params * @param feeControl The fee control parameters @@ -842,7 +876,7 @@ export function controlFees( ) { const { fee, maxFee } = feeControl if (fee) { - transaction.fee = fee.microAlgo + transaction.fee = Number(fee.microAlgo) transaction.flatFee = true } @@ -854,6 +888,8 @@ export function controlFees( } /** + * @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead + * * Returns suggested transaction parameters from algod unless some are already provided. * @param params Optionally provide parameters to use * @param algod Algod algod @@ -864,6 +900,8 @@ export async function getTransactionParams(params: SuggestedParams | undefined, } /** + * @deprecated Use `atc.clone().buildGroup()` instead. + * * Returns the array of transactions currently present in the given `AtomicTransactionComposer` * @param atc The atomic transaction composer * @returns The array of transactions with signers diff --git a/src/transfer/transfer.ts b/src/transfer/transfer.ts index 86314081..e9def06e 100644 --- a/src/transfer/transfer.ts +++ b/src/transfer/transfer.ts @@ -41,7 +41,7 @@ export async function ensureFunded( ) if (!result) return undefined return { - amount: result.amountFunded.microAlgo, + amount: Number(result.amountFunded.microAlgo), transactionId: result.transactionId, } } else { @@ -65,7 +65,7 @@ export async function ensureFunded( return result ? { - amount: result.amountFunded.microAlgo, + amount: Number(result.amountFunded.microAlgo), transactionId: result.txIds[0], } : undefined diff --git a/src/types/__snapshots__/app-factory-and-client.spec.ts.snap b/src/types/__snapshots__/app-factory-and-client.spec.ts.snap new file mode 100644 index 00000000..ae570521 --- /dev/null +++ b/src/types/__snapshots__/app-factory-and-client.spec.ts.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ARC32: app-factory-and-app-client Errors Display nice error messages when there is a logic error 2`] = ` +"INFO: Idempotently deploying app "TestingApp" from creator ACCOUNT_1 using 1498 bytes of AVM bytecode and 4 bytes of AVM bytecode +INFO: App TestingApp not found in apps created by ACCOUNT_1; deploying app with version 1.0. +VERBOSE: Sent transaction ID TXID_1 appl from ACCOUNT_1 +DEBUG: App created by ACCOUNT_1 with ID APP_1 via transaction TXID_1 +ERROR: Received error executing Atomic Transaction Composer and debug flag enabled; attempting simulation to get more information | [{"response":{"body":{"data":{"app-index":APP_1,"eval-states":[{"stack":[0]}],"group-index":0,"pc":885},"message":"TransactionPool.Remember: transaction TXID_2: logic eval error: assert failed pc=885. Details: app=APP_1, pc=885, opcodes=proto 0 0; intc_0 // 0; assert"},"status":400,"text":"{\\"data\\":{\\"app-index\\":APP_1,\\"eval-states\\":[{\\"stack\\":[0]}],\\"group-index\\":0,\\"pc\\":885},\\"message\\":\\"TransactionPool.Remember: transaction TXID_2: logic eval error: assert failed pc=885. Details: app=APP_1, pc=885, opcodes=proto 0 0; intc_0 // 0; assert\\"}\\n","ok":false},"name":"URLTokenBaseHTTPError","status":400,"traces":[]}]" +`; diff --git a/src/types/account-manager.ts b/src/types/account-manager.ts index d3ae2bc9..44f25558 100644 --- a/src/types/account-manager.ts +++ b/src/types/account-manager.ts @@ -4,10 +4,10 @@ import { calculateFundAmount, memoize } from '../util' import { AccountInformation, DISPENSER_ACCOUNT, MultisigAccount, SigningAccount, TransactionSignerAccount } from './account' import { AlgoAmount } from './amount' import { ClientManager } from './client-manager' -import AlgoKitComposer, { CommonTransactionParams, ExecuteParams } from './composer' +import AlgoKitComposer, { CommonTransactionParams } from './composer' import { TestNetDispenserApiClient } from './dispenser-client' import { KmdAccountManager } from './kmd-account-manager' -import { SendSingleTransactionResult } from './transaction' +import { ExecuteParams, SendSingleTransactionResult } from './transaction' import LogicSigAccount = algosdk.LogicSigAccount import Account = algosdk.Account import TransactionSigner = algosdk.TransactionSigner @@ -481,7 +481,7 @@ export class AccountManager { const accountInfo = await this.getInformation(sender) const currentSpendingBalance = accountInfo.balance.microAlgo - accountInfo.minBalance.microAlgo - const amountFunded = calculateFundAmount(minSpendingBalance.microAlgo, currentSpendingBalance, minFundingIncrement?.microAlgo ?? 0) + const amountFunded = calculateFundAmount(minSpendingBalance.microAlgo, currentSpendingBalance, minFundingIncrement?.microAlgo ?? 0n) return amountFunded === null ? undefined : AlgoAmount.MicroAlgo(amountFunded) } diff --git a/src/types/algorand-client-interface.ts b/src/types/algorand-client-interface.ts new file mode 100644 index 00000000..0aff776a --- /dev/null +++ b/src/types/algorand-client-interface.ts @@ -0,0 +1,29 @@ +import algosdk from 'algosdk' +import { AlgorandClientTransactionCreator } from './algorand-client-transaction-creator' +import { AlgorandClientTransactionSender } from './algorand-client-transaction-sender' +import { AppDeployer } from './app-deployer' +import { AppManager } from './app-manager' +import AlgoKitComposer from './composer' +import { NetworkDetails } from './network-client' +import Algodv2 = algosdk.Algodv2 +import Indexer = algosdk.Indexer + +/** Interface for the bulk of the `AlgorandClient` functionality. + * + * Used to take a dependency on AlgorandClient without generating a circular dependency. + */ +export interface AlgorandClientInterface { + app: AppManager + appDeployer: AppDeployer + send: AlgorandClientTransactionSender + transactions: AlgorandClientTransactionCreator + newGroup(): AlgoKitComposer + client: { + algod: Algodv2 + indexer?: Indexer + network(): Promise + isLocalNet(): Promise + isTestNet(): Promise + isMainNet(): Promise + } +} diff --git a/src/types/algorand-client-transaction-sender.ts b/src/types/algorand-client-transaction-sender.ts index 148d2571..860edf82 100644 --- a/src/types/algorand-client-transaction-sender.ts +++ b/src/types/algorand-client-transaction-sender.ts @@ -1,4 +1,5 @@ import algosdk from 'algosdk' +import { Buffer } from 'buffer' import { Config } from '../config' import { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app' import { AppManager } from './app-manager' @@ -14,11 +15,14 @@ import AlgoKitComposer, { AppUpdateParams, AssetCreateParams, AssetOptOutParams, - ExecuteParams, } from './composer' -import { SendSingleTransactionResult } from './transaction' +import { ExecuteParams, SendSingleTransactionResult } from './transaction' import Transaction = algosdk.Transaction +const getMethodCallForLog = ({ method, args }: { method: algosdk.ABIMethod; args?: unknown[] }) => { + return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v)) : a))})` +} + /** Orchestrates sending transactions for `AlgorandClient`. */ export class AlgorandClientTransactionSender { private _newGroup: () => AlgoKitComposer @@ -612,7 +616,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate) + appUpdate = this._sendAppUpdateCall((c) => c.addAppUpdate, { + postLog: (params, result) => + `App ${params.appId} updated ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** * Delete a smart contract. @@ -653,7 +660,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appDelete = this._sendAppCall((c) => c.addAppDelete) + appDelete = this._sendAppCall((c) => c.addAppDelete, { + postLog: (params, result) => + `App ${params.appId} deleted ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** * Call a smart contract. @@ -694,7 +704,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appCall = this._sendAppCall((c) => c.addAppCall) + appCall = this._sendAppCall((c) => c.addAppCall, { + postLog: (params, result) => + `App ${params.appId} called ${params.args ? ` with ${params.args.map((a) => Buffer.from(a).toString('base64'))}` : ''} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** * Create a smart contract via an ABI method. @@ -815,7 +828,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall) + appUpdateMethodCall = this._sendAppUpdateCall((c) => c.addAppUpdateMethodCall, { + postLog: (params, result) => + `App ${params.appId} updated with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** * Delete a smart contract via an ABI method. @@ -868,7 +884,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall) + appDeleteMethodCall = this._sendAppCall((c) => c.addAppDeleteMethodCall, { + postLog: (params, result) => + `App ${params.appId} deleted with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** * Call a smart contract via an ABI method. @@ -921,7 +940,10 @@ export class AlgorandClientTransactionSender { *}) * ``` */ - appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall) + appCallMethodCall = this._sendAppCall((c) => c.addAppCallMethodCall, { + postLog: (params, result) => + `App ${params.appId} called with ${getMethodCallForLog(params)} by ${params.sender} via transaction ${result.txIds.at(-1)}`, + }) /** Register an online key. */ onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, { diff --git a/src/types/algorand-client.spec.ts b/src/types/algorand-client.spec.ts index c3bfbdab..0ea544b3 100644 --- a/src/types/algorand-client.spec.ts +++ b/src/types/algorand-client.spec.ts @@ -30,10 +30,14 @@ describe('AlgorandClient', () => { bob = await fixture.context.generateAccount({ initialFunds: AlgoAmount.MicroAlgo(100_000) }) algorand = fixture.algorand - appClient = algorand.client.getTypedAppClientById(TestContractClient, { - id: 0, - sender: alice, - }) + appClient = new TestContractClient( + { + sender: alice, + resolveBy: 'id', + id: 0, + }, + algorand.client.algod, + ) const app = await appClient.create.createApplication({}) appId = BigInt(app.appId) @@ -46,8 +50,8 @@ describe('AlgorandClient', () => { const alicePostBalance = (await algorand.account.getInformation(alice)).balance const bobPostBalance = (await algorand.account.getInformation(bob)).balance - expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 1001) - expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1) + expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 1001n) + expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1n) }) test('sendAssetCreate', async () => { @@ -70,8 +74,8 @@ describe('AlgorandClient', () => { const alicePostBalance = (await algorand.account.getInformation(alice)).balance const bobPostBalance = (await algorand.account.getInformation(bob)).balance - expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 2001) - expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1) + expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 2001n) + expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1n) expect(result.returns?.[0].returnValue?.valueOf()).toBe(3n) }) @@ -94,8 +98,8 @@ describe('AlgorandClient', () => { const alicePostBalance = (await algorand.account.getInformation(alice)).balance const bobPostBalance = (await algorand.account.getInformation(bob)).balance - expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 2001) - expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1) + expect(alicePostBalance.microAlgo).toBe(alicePreBalance.microAlgo - 2001n) + expect(bobPostBalance.microAlgo).toBe(bobPreBalance.microAlgo + 1n) expect(methodRes.returns?.[0].returnValue?.valueOf()).toBe(3n) }) diff --git a/src/types/algorand-client.transfer.spec.ts b/src/types/algorand-client.transfer.spec.ts index f2746fe1..71f3330f 100644 --- a/src/types/algorand-client.transfer.spec.ts +++ b/src/types/algorand-client.transfer.spec.ts @@ -37,14 +37,14 @@ describe('Transfer capability', () => { expect(result.transaction.type).toBe(TransactionType.pay) expect(result.confirmation.txn.txn.type).toBe('pay') - expect(result.transaction.amount).toBe(5_000_000) + expect(result.transaction.amount).toBe(5_000_000n) expect(result.confirmation.txn.txn.amt).toBe(5_000_000) expect(algosdk.encodeAddress(result.transaction.from.publicKey)).toBe(testAccount.addr) // eslint-disable-next-line @typescript-eslint/no-non-null-assertion expect(algosdk.encodeAddress(result.confirmation.txn.txn.snd)).toBe(testAccount.addr) - expect(accountInfo.balance.microAlgo).toBe(5_000_000) + expect(accountInfo.balance.microAlgo).toBe(5_000_000n) }) test('Transfer Algo respects string lease', async () => { @@ -243,8 +243,8 @@ describe('Transfer capability', () => { invariant(result) expect(result.transactionId).toBe(result.transaction.txID()) - expect(result.amountFunded.microAlgo).toBe(100_001) - expect(accountInfo.balance.microAlgo).toBe(100_001) + expect(result.amountFunded.microAlgo).toBe(100_001n) + expect(accountInfo.balance.microAlgo).toBe(100_001n) }) test('ensureFunded respects minimum funding increment', async () => { @@ -258,7 +258,7 @@ describe('Transfer capability', () => { invariant(result) expect(result.amountFunded.algo).toBe(1) const accountInfo = await algorand.account.getInformation(secondAccount.addr) - expect(accountInfo.balance.microAlgo).toBe(1_100_000) + expect(accountInfo.balance.microAlgo).toBe(1_100_000n) }) test('ensureFunded uses dispenser account by default', async () => { diff --git a/src/types/algorand-client.ts b/src/types/algorand-client.ts index eba6f1bd..162c551c 100644 --- a/src/types/algorand-client.ts +++ b/src/types/algorand-client.ts @@ -1,6 +1,7 @@ import algosdk from 'algosdk' import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './account' import { AccountManager } from './account-manager' +import { AlgorandClientInterface } from './algorand-client-interface' import { AlgorandClientTransactionCreator } from './algorand-client-transaction-creator' import { AlgorandClientTransactionSender } from './algorand-client-transaction-sender' import { AppDeployer } from './app-deployer' @@ -15,7 +16,7 @@ import LogicSigAccount = algosdk.LogicSigAccount /** * A client that brokers easy access to Algorand functionality. */ -export class AlgorandClient { +export class AlgorandClient implements AlgorandClientInterface { private _clientManager: ClientManager private _accountManager: AccountManager private _appManager: AppManager @@ -31,7 +32,7 @@ export class AlgorandClient { private _defaultValidityWindow: number | undefined = undefined private constructor(config: AlgoConfig | AlgoSdkClients) { - this._clientManager = new ClientManager(config) + this._clientManager = new ClientManager(config, this) this._accountManager = new AccountManager(this._clientManager) this._appManager = new AppManager(this._clientManager.algod) this._assetManager = new AssetManager(this._clientManager.algod, () => this.newGroup()) diff --git a/src/types/amount.spec.ts b/src/types/amount.spec.ts index cd044b12..d2a5c39a 100644 --- a/src/types/amount.spec.ts +++ b/src/types/amount.spec.ts @@ -10,10 +10,10 @@ describe('amount', () => { expect(`${algos(100)}`).toBe(`100,000,000 µALGO`) }) test('microalgos to microalgos', () => { - expect(microAlgos(100).microAlgo).toBe(100) + expect(microAlgos(100).microAlgo).toBe(100n) }) test('algos to microalgos', () => { - expect(algos(100).microAlgo).toBe(100_000_000) + expect(algos(100).microAlgo).toBe(100_000_000n) }) test('algos to algos', () => { expect(algos(100).algo).toBe(100) @@ -25,10 +25,10 @@ describe('amount', () => { expect(microAlgos(100_000_000).algo).toBe(100) }) test('single transaction fee', () => { - expect(transactionFees(1).microAlgo).toBe(1_000) + expect(transactionFees(1).microAlgo).toBe(1_000n) }) test('multiple transaction fees', () => { - expect(transactionFees(10).microAlgo).toBe(10_000) + expect(transactionFees(10).microAlgo).toBe(10_000n) }) test('algos via Number.prototype', () => { expect((100).algo()).toBeInstanceOf(AlgoAmount) @@ -36,6 +36,6 @@ describe('amount', () => { }) test('microAlgos via Number.prototype', () => { expect((100).microAlgo()).toBeInstanceOf(AlgoAmount) - expect((100).microAlgo().microAlgo).toBe(100) + expect((100).microAlgo().microAlgo).toBe(100n) }) }) diff --git a/src/types/amount.ts b/src/types/amount.ts index 72ca54c3..0fc6110b 100644 --- a/src/types/amount.ts +++ b/src/types/amount.ts @@ -2,7 +2,7 @@ import algosdk from 'algosdk' /** Wrapper class to ensure safe, explicit conversion between µAlgo, Algo and numbers */ export class AlgoAmount { - private amountInMicroAlgo + private amountInMicroAlgo: bigint /** Return the amount as a number in µAlgo */ get microAlgos() { @@ -16,23 +16,25 @@ export class AlgoAmount { /** Return the amount as a number in Algo */ get algos() { - return algosdk.microalgosToAlgos(this.amountInMicroAlgo) + return algosdk.microalgosToAlgos(Number(this.amountInMicroAlgo)) } /** Return the amount as a number in Algo */ get algo() { - return algosdk.microalgosToAlgos(this.amountInMicroAlgo) + return algosdk.microalgosToAlgos(Number(this.amountInMicroAlgo)) } - constructor(amount: { algos: number } | { algo: number } | { microAlgos: number } | { microAlgo: number }) { + constructor( + amount: { algos: number | bigint } | { algo: number | bigint } | { microAlgos: number | bigint } | { microAlgo: number | bigint }, + ) { this.amountInMicroAlgo = 'microAlgos' in amount - ? amount.microAlgos + ? BigInt(amount.microAlgos) : 'microAlgo' in amount - ? amount.microAlgo + ? BigInt(amount.microAlgo) : 'algos' in amount - ? algosdk.algosToMicroalgos(amount.algos) - : algosdk.algosToMicroalgos(amount.algo) + ? BigInt(algosdk.algosToMicroalgos(Number(amount.algos))) + : BigInt(algosdk.algosToMicroalgos(Number(amount.algo))) } toString(): string { @@ -44,26 +46,26 @@ export class AlgoAmount { * the algos or microAlgos properties */ valueOf(): number { - return this.microAlgo + return Number(this.microAlgo) } /** Create a `AlgoAmount` object representing the given number of Algo */ - static Algos(amount: number) { + static Algos(amount: number | bigint) { return new AlgoAmount({ algos: amount }) } /** Create a `AlgoAmount` object representing the given number of Algo */ - static Algo(amount: number) { + static Algo(amount: number | bigint) { return new AlgoAmount({ algos: amount }) } /** Create a `AlgoAmount` object representing the given number of µAlgo */ - static MicroAlgos(amount: number) { + static MicroAlgos(amount: number | bigint) { return new AlgoAmount({ microAlgos: amount }) } /** Create a `AlgoAmount` object representing the given number of µAlgo */ - static MicroAlgo(amount: number) { + static MicroAlgo(amount: number | bigint) { return new AlgoAmount({ microAlgos: amount }) } } diff --git a/src/types/app-arc56.ts b/src/types/app-arc56.ts new file mode 100644 index 00000000..3a455869 --- /dev/null +++ b/src/types/app-arc56.ts @@ -0,0 +1,442 @@ +import algosdk from 'algosdk' +import { ABIReturn } from './app' +import { Expand } from './expand' + +/** + * Wrapper around `algosdk.ABIMethod` that represents an ARC-56 ABI method. + */ +export class Arc56Method extends algosdk.ABIMethod { + override readonly args: Array< + Expand< + Omit & { + type: algosdk.ABIArgumentType + } + > + > + override readonly returns: Expand< + Omit & { + type: algosdk.ABIReturnType + } + > + + constructor(public method: Method) { + super(method) + this.args = method.args.map((arg) => ({ + ...arg, + type: algosdk.abiTypeIsTransaction(arg.type) || algosdk.abiTypeIsReference(arg.type) ? arg.type : algosdk.ABIType.from(arg.type), + })) + this.returns = { + ...this.method.returns, + type: this.method.returns.type === 'void' ? 'void' : algosdk.ABIType.from(this.method.returns.type), + } + } + + override toJSON(): Method { + return this.method + } +} + +/** + * Returns the `ABITupleType` for the given ARC-56 struct definition + * @param struct The ARC-56 struct definition + * @returns The `ABITupleType` + */ +export function getABITupleTypeFromABIStructDefinition(struct: StructFields): algosdk.ABITupleType { + return new algosdk.ABITupleType( + Object.values(struct).map((v) => (typeof v === 'string' ? algosdk.ABIType.from(v) : getABITupleTypeFromABIStructDefinition(v))), + ) +} + +/** + * Converts a decoded ABI tuple as a struct. + * @param decodedABITuple The decoded ABI tuple value + * @param structFields The struct fields from an ARC-56 app spec + * @returns The struct as a Record + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export function getABIStructFromABITuple>( + decodedABITuple: algosdk.ABIValue[], + structFields: StructFields, +): TReturn { + return Object.fromEntries( + Object.entries(structFields).map(([key, type], i) => { + const abiValue = decodedABITuple[i] + return [key, typeof type === 'string' || !Array.isArray(abiValue) ? decodedABITuple[i] : getABIStructFromABITuple(abiValue, type)] + }), + ) as TReturn +} + +/** + * Converts an ARC-56 struct as an ABI tuple. + * @param struct The struct to convert + * @param structFields The struct fields from an ARC-56 app spec + * @returns The struct as a decoded ABI tuple + */ +export function getABITupleFromABIStruct(struct: ABIStruct, structFields: StructFields): algosdk.ABIValue[] { + return Object.entries(structFields).map(([key, type]) => { + const value = struct[key] + return typeof type === 'string' ? (value as algosdk.ABIValue) : getABITupleFromABIStruct(value as ABIStruct, type) + }) +} + +/** Decoded ARC-56 struct as a struct rather than a tuple. */ +export type ABIStruct = { + [key: string]: ABIStruct | algosdk.ABIValue +} + +/** + * Returns the decoded ABI value (or struct for a struct type) + * for the given raw Algorand value given an ARC-56 type and defined ARC-56 structs. + * @param value The raw Algorand value (bytes or uint64) + * @param type The ARC-56 type - either an ABI Type string or a struct name + * @param structs The defined ARC-56 structs + * @returns The decoded ABI value or struct + */ +export function getABIDecodedValue( + value: Uint8Array | number | bigint, + type: string, + structs: Record, +): algosdk.ABIValue | ABIStruct { + if (type === 'bytes' || typeof value !== 'object') return value + if (structs[type]) { + const tupleValue = getABITupleTypeFromABIStructDefinition(structs[type]).decode(value) + return getABIStructFromABITuple(tupleValue, structs[type]) + } + return algosdk.ABIType.from(type).decode(value) +} + +/** + * Returns the ABI-encoded value for the given value. + * @param value The value to encode either already in encoded binary form (`Uint8Array`), a decoded ABI value or an ARC-56 struct + * @param type The ARC-56 type - either an ABI Type string or a struct name + * @param structs The defined ARC-56 structs + * @returns The binary ABI-encoded value + */ +export function getABIEncodedValue( + value: Uint8Array | algosdk.ABIValue | ABIStruct, + type: string, + structs: Record, +): Uint8Array { + if (typeof value === 'object' && value instanceof Uint8Array) return value + if (type === 'bytes') { + if (typeof value === 'string') return Buffer.from(value, 'utf-8') + if (typeof value !== 'object' || !(value instanceof Uint8Array)) throw new Error(`Expected bytes value for ${type}, but got ${value}`) + return value + } + if (structs[type]) { + const tupleType = getABITupleTypeFromABIStructDefinition(structs[type]) + if (Array.isArray(value)) { + tupleType.encode(value as algosdk.ABIValue[]) + } else { + return tupleType.encode(getABITupleFromABIStruct(value as ABIStruct, structs[type])) + } + } + return algosdk.ABIType.from(type).encode(value as algosdk.ABIValue) +} + +/** + * Returns the ARC-56 ABI method object for a given method name or signature and ARC-56 app spec. + * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted. + * e.g. `my_method` or `my_method(unit64,string)bytes` + * @param appSpec The app spec for the app + * @returns The `Arc56Method` + */ +export function getArc56Method(methodNameOrSignature: string, appSpec: Arc56Contract): Arc56Method { + let method: Method + if (!methodNameOrSignature.includes('(')) { + const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature) + if (methods.length === 0) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`) + if (methods.length > 1) { + throw new Error( + `Received a call to method ${methodNameOrSignature} in contract ${ + appSpec.name + }, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods + .map((m) => new algosdk.ABIMethod(m).getSignature()) + .join(', ')}`, + ) + } + method = methods[0] + } else { + const m = appSpec.methods.find((m) => new algosdk.ABIMethod(m).getSignature() === methodNameOrSignature) + if (!m) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`) + method = m + } + return new Arc56Method(method) +} + +/** + * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type + * + * @param returnValue The smart contract response + * @param method The method that was called + * @param structs The struct fields from the app spec + * @returns The smart contract response with an updated return value + */ +export function getArc56ReturnValue( + returnValue: ABIReturn | undefined, + method: Method | Arc56Method, + structs: StructFields, +): TReturn { + const m = 'method' in method ? method.method : method + const type = m.returns.struct ?? m.returns.type + if (returnValue?.decodeError) { + throw returnValue.decodeError + } + if (type === undefined || type === 'void' || returnValue?.returnValue === undefined) return undefined as TReturn + + if (type === 'bytes') return returnValue.rawReturnValue as TReturn + + if (structs[type]) { + return getABIStructFromABITuple(returnValue.returnValue as algosdk.ABIValue[], structs[type] as StructFields) as TReturn + } + + return returnValue.returnValue as TReturn +} + +/****************/ +/** ARC-56 spec */ +/****************/ + +/** Describes the entire contract. This interface is an extension of the interface described in ARC-4 */ +export interface Arc56Contract { + /** The ARCs used and/or supported by this contract. All contracts implicity support ARC4 and ARC56 */ + arcs: number[] + /** A user-friendly name for the contract */ + name: string + /** Optional, user-friendly description for the interface */ + desc?: string + /** + * Optional object listing the contract instances across different networks + */ + networks?: { + /** + * The key is the base64 genesis hash of the network, and the value contains + * information about the deployed contract in the network indicated by the + * key. A key containing the human-readable name of the network MAY be + * included, but the corresponding genesis hash key MUST also be defined + */ + [network: string]: { + /** The app ID of the deployed contract in this network */ + appID: number + } + } + /** Named structs use by the application */ + structs: { [structName: StructName]: StructFields } + /** All of the methods that the contract implements */ + methods: Method[] + state: { + /** Defines the values that should be used for GlobalNumUint, GlobalNumByteSlice, LocalNumUint, and LocalNumByteSlice when creating the application */ + schema: { + global: { + ints: number + bytes: number + } + local: { + ints: number + bytes: number + } + } + /** Mapping of human-readable names to StorageKey objects */ + keys: { + global: { [name: string]: StorageKey } + local: { [name: string]: StorageKey } + box: { [name: string]: StorageKey } + } + /** Mapping of human-readable names to StorageMap objects */ + maps: { + global: { [name: string]: StorageMap } + local: { [name: string]: StorageMap } + box: { [name: string]: StorageMap } + } + } + /** Supported bare actions for the contract. An action is a combination of call/create and an OnComplete */ + bareActions: { + /** OnCompletes this method allows when appID === 0 */ + create: ('NoOp' | 'OptIn' | 'DeleteApplication')[] + /** OnCompletes this method allows when appID !== 0 */ + call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[] + } + /** Information about the TEAL programs */ + sourceInfo?: { + /** Approval program information */ + approval: SourceInfo[] + /** Clear program information */ + clear: SourceInfo[] + } + /** The pre-compiled TEAL that may contain template variables. MUST be omitted if included as part of ARC23 */ + source?: { + /** The approval program */ + approval: string + /** The clear program */ + clear: string + } + /** The compiled bytecode for the application. MUST be omitted if included as part of ARC23 */ + byteCode?: { + /** The approval program */ + approval: string + /** The clear program */ + clear: string + } + /** Information used to get the given byteCode and/or PC values in sourceInfo. MUST be given if byteCode or PC values are present */ + compilerInfo?: { + /** The name of the compiler */ + compiler: 'algod' | 'puya' + /** Compiler version information */ + compilerVersion: { + major: number + minor: number + patch: number + commit?: string + } + } + /** ARC-28 events that MAY be emitted by this contract */ + events?: Array + /** A mapping of template variable names as they appear in the teal (not including TMPL_ prefix) to their respecive types and values (if applicable) */ + templateVariables?: { + [name: string]: { + /** The type of the template variable */ + type: ABIType | AVMBytes | StructName + /** If given, the the base64 encoded value used for the given app/program */ + value?: string + } + } + /** The scratch variables used during runtime */ + scratchVariables?: { + [name: string]: { + slot: number + type: ABIType | AVMBytes | StructName + } + } +} + +/** Describes a method in the contract. This interface is an extension of the interface described in ARC-4 */ +export interface Method { + /** The name of the method */ + name: string + /** Optional, user-friendly description for the method */ + desc?: string + /** The arguments of the method, in order */ + args: Array<{ + /** The type of the argument */ + type: ABIType + /** If the type is a struct, the name of the struct */ + struct?: StructName + /** Optional, user-friendly name for the argument */ + name?: string + /** Optional, user-friendly description for the argument */ + desc?: string + /** The default value that clients should use. MUST be base64 encoded bytes */ + defaultValue?: string + }> + /** Information about the method's return value */ + returns: { + /** The type of the return value, or "void" to indicate no return value. */ + type: ABIType + /** If the type is a struct, the name of the struct */ + struct?: StructName + /** Optional, user-friendly description for the return value */ + desc?: string + } + /** an action is a combination of call/create and an OnComplete */ + actions: { + /** OnCompletes this method allows when appID === 0 */ + create: ('NoOp' | 'OptIn' | 'DeleteApplication')[] + /** OnCompletes this method allows when appID !== 0 */ + call: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[] + } + /** If this method does not write anything to the ledger (ARC-22) */ + readonly?: boolean + /** ARC-28 events that MAY be emitted by this method */ + events?: Array + /** Information that clients can use when calling the method */ + recommendations?: { + /** The number of inner transactions the caller should cover the fees for */ + innerTransactionCount?: number + /** Recommended box references to include */ + boxes?: { + /** The app ID for the box */ + app?: number + /** The base64 encoded box key */ + key: string + /** The number of bytes being read from the box */ + readBytes: number + /** The number of bytes being written to the box */ + writeBytes: number + } + /** Recommended foreign accounts */ + accounts?: string[] + /** Recommended foreign apps */ + apps?: number[] + /** Recommended foreign assets */ + assets?: number[] + } +} + +/** ARC-28 event */ +export interface Event { + /** The name of the event */ + name: string + /** Optional, user-friendly description for the event */ + desc?: string + /** The arguments of the event, in order */ + args: Array<{ + /** The type of the argument */ + type: ABIType + /** Optional, user-friendly name for the argument */ + name?: string + /** Optional, user-friendly description for the argument */ + desc?: string + /** If the type is a struct, the name of the struct */ + struct?: StructName + }> +} + +/** An ABI-encoded type */ +export type ABIType = string + +/** The name of a defined struct */ +export type StructName = string + +/** Raw byteslice without the length prefixed that is specified in ARC-4 */ +export type AVMBytes = 'bytes' + +/** Mapping of named structs to the ABI type of their fields */ +export interface StructFields { + [fieldName: string]: ABIType | StructFields +} + +/** Describes a single key in app storage */ +export interface StorageKey { + /** Description of what this storage key holds */ + desc?: string + /** The type of the key */ + keyType: ABIType | AVMBytes | StructName + + /** The type of the value */ + valueType: ABIType | AVMBytes | StructName + /** The bytes of the key encoded as base64 */ + key: string +} + +/** Describes a mapping of key-value pairs in storage */ +export interface StorageMap { + /** Description of what the key-value pairs in this mapping hold */ + desc?: string + /** The type of the keys in the map */ + keyType: ABIType | AVMBytes | StructName + /** The type of the values in the map */ + valueType: ABIType | AVMBytes | StructName + /** The base64-encoded prefix of the map keys*/ + prefix?: string +} + +export interface SourceInfo { + /** The line of pre-compiled TEAL */ + teal?: number + /** The program counter offset(s) that correspond to this line of TEAL */ + pc?: Array + /** A human-readable string that describes the error when the program fails at this given line of TEAL */ + errorMessage?: string + /** The line of the dissasembled TEAL this line of pre-compiled TEAL corresponds to */ + disassembledTeal?: number +} diff --git a/src/types/app-client.spec.ts b/src/types/app-client.spec.ts index c6a92711..a87ff6a2 100644 --- a/src/types/app-client.spec.ts +++ b/src/types/app-client.spec.ts @@ -754,8 +754,8 @@ describe('application-client', () => { invariant(globalState.bytes2) invariant('valueRaw' in globalState.bytes2) expect(Object.keys(globalState).sort()).toEqual(['bytes1', 'bytes2', 'int1', 'int2', 'value']) - expect(globalState.int1.value).toBe(1) - expect(globalState.int2.value).toBe(2) + expect(globalState.int1.value).toBe(1n) + expect(globalState.int2.value).toBe(2n) expect(globalState.bytes1.value).toBe('asdf') expect(globalState.bytes2.valueRaw).toEqual(new Uint8Array([1, 2, 3, 4])) @@ -769,8 +769,8 @@ describe('application-client', () => { invariant(localState.local_bytes2) invariant('valueRaw' in localState.local_bytes2) expect(Object.keys(localState).sort()).toEqual(['local_bytes1', 'local_bytes2', 'local_int1', 'local_int2']) - expect(localState.local_int1.value).toBe(1) - expect(localState.local_int2.value).toBe(2) + expect(localState.local_int1.value).toBe(1n) + expect(localState.local_int2.value).toBe(2n) expect(localState.local_bytes1.value).toBe('asdf') expect(localState.local_bytes2.valueRaw).toEqual(new Uint8Array([1, 2, 3, 4])) diff --git a/src/types/app-client.ts b/src/types/app-client.ts index efa9bec9..73cb9ae5 100644 --- a/src/types/app-client.ts +++ b/src/types/app-client.ts @@ -16,6 +16,8 @@ import { Config } from '../config' import { persistSourceMaps } from '../debugging/debugging' import { legacySendTransactionBridge } from '../transaction/legacy-bridge' import { encodeTransactionNote, getSenderAddress } from '../transaction/transaction' +import { binaryStartsWith } from '../util' +import { AlgorandClientInterface } from './algorand-client-interface' import { AlgoAmount } from './amount' import { ABIAppCallArg, @@ -25,23 +27,52 @@ import { AppCallTransactionResult, AppCallType, AppCompilationResult, - AppLookup, AppMetadata, AppReference, + AppReturn, AppState, AppStorageSchema, BoxName, DELETABLE_TEMPLATE_NAME, + AppLookup as LegacyAppLookup, OnSchemaBreak, OnUpdate, RawAppCallArgs, + SendAppTransactionResult, TealTemplateParams, UPDATABLE_TEMPLATE_NAME, } from './app' -import { AppSpec } from './app-spec' +import { + ABIStruct, + Arc56Contract, + Arc56Method, + StorageKey, + StorageMap, + getABIDecodedValue, + getABIEncodedValue, + getABITupleFromABIStruct, + getArc56Method, + getArc56ReturnValue, +} from './app-arc56' +import { AppLookup } from './app-deployer' +import { AppManager, BoxIdentifier } from './app-manager' +import { AppSpec, arc32ToArc56 } from './app-spec' +import AlgoKitComposer, { + AppCallMethodCall, + AppCallParams, + AppDeleteMethodCall, + AppDeleteParams, + AppMethodCall, + AppMethodCallTransactionArgument, + AppUpdateMethodCall, + AppUpdateParams, + CommonAppCallParams, + PaymentParams, +} from './composer' import { PersistSourceMapInput } from './debugging' +import { Expand } from './expand' import { LogicError } from './logic-error' -import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction' +import { ExecuteParams, SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction' import ABIMethod = algosdk.ABIMethod import ABIMethodParams = algosdk.ABIMethodParams import ABIType = algosdk.ABIType @@ -64,7 +95,7 @@ export type ResolveAppByCreatorAndNameBase = { * * An indexer instance to search the creator account apps; or * * The cached value of the existing apps for the given creator from `getCreatorAppsByName` */ - findExistingUsing: Indexer | AppLookup + findExistingUsing: Indexer | LegacyAppLookup } /** Configuration to resolve app by creator and name `getCreatorAppsByName` */ @@ -191,9 +222,9 @@ export type AppClientClearStateParams = AppClientCallRawArgs & AppClientCallCore export interface AppClientCompilationParams { /** Any deploy-time parameters to replace in the TEAL code */ deployTimeParams?: TealTemplateParams - /* Whether or not the contract should have deploy-time immutability control set, undefined = ignore */ + /** Whether or not the contract should have deploy-time immutability control set, undefined = ignore */ updatable?: boolean - /* Whether or not the contract should have deploy-time permanence control set, undefined = ignore */ + /** Whether or not the contract should have deploy-time permanence control set, undefined = ignore */ deletable?: boolean } @@ -268,14 +299,1065 @@ function getDeployTimeControl( }) } -/** Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */ +/** Parameters to create an app client */ +export interface AppClientParams { + /** The ID of the app instance this client should make calls against. */ + appId: bigint + + /** The ARC-56 or ARC-32 application spec as either: + * * Parsed JSON ARC-56 `Contract` + * * Parsed JSON ARC-32 `AppSpec` + * * Raw JSON string (in either ARC-56 or ARC-32 format) + */ + appSpec: Arc56Contract | AppSpec | string + + /** An `AlgorandClient` instance */ + algorand: AlgorandClientInterface + + /** + * Optional override for the app name; used for on-chain metadata and lookups. + * Defaults to the ARC-32/ARC-56 app spec name + */ + appName?: string + /** Optional address to use for the account to use as the default sender for calls. */ + defaultSender?: string + /** Optional source map for the approval program */ + approvalSourceMap?: SourceMap + /** Optional source map for the clear state program */ + clearSourceMap?: SourceMap +} + +/** onComplete parameter for a non-update app call */ +export type CallOnComplete = { + /** On-complete of the call; defaults to no-op */ + onComplete?: Exclude +} + +/** AppClient parameters for a bare app call */ +export type AppClientBareCallParams = Expand< + Omit & { + /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */ + sender?: string + } +> + +/** AppClient parameters for an ABI method call */ +export type AppClientMethodCallParams = Expand< + Omit & { + /** The address of the account sending the transaction, if undefined then the app client's defaultSender is used. */ + sender?: string + /** The method name or method signature to call if an ABI call is being emitted + * @example Method name + * `my_method` + * @example Method signature + * `my_method(unit64,string)bytes` + */ + method: string + /** Arguments to the ABI method, either: + * * An ABI value + * * An ARC-56 struct + * * A transaction with explicit signer + * * A transaction (where the signer will be automatically assigned) + * * An unawaited transaction (e.g. from algorand.transactions.transactionType()) + * * Another method call (via method call params object) + */ + args?: (ABIValue | ABIStruct | AppMethodCallTransactionArgument | undefined)[] + } +> + +/** Parameters for funding an app account */ +export type FundAppParams = Expand< + Omit & + ExecuteParams & { + /** The optional sender to send the transaction from, will use the application client's default sender by default if specified */ + sender?: string + } +> + +/** Resolve an app client instance by looking up an app created by the given creator with the given name */ +export type ResolveAppClientByCreatorAndName = Expand< + Omit & { + /** The address of the creator account for the app */ + creatorAddress: string + /** An optional cached app lookup that matches a name to on-chain details; + * either this is needed or indexer is required to be passed in to this `ClientManager` on construction. + */ + appLookupCache?: AppLookup + /** Whether or not to ignore the `AppDeployer` lookup cache and force an on-chain lookup, default: use any cached value */ + ignoreCache?: boolean + } +> + +/** ARC-56/ARC-32 application client that allows you to manage calls and + * state for a specific deployed instance of an app (with a known app ID). */ +export class AppClient { + private _appId: bigint + private _appAddress: string + private _appName: string + private _appSpec: Arc56Contract + private _algorand: AlgorandClientInterface + private _defaultSender?: string + + private _approvalSourceMap: SourceMap | undefined + private _clearSourceMap: SourceMap | undefined + + private _localStateMethods: (address: string) => ReturnType + private _globalStateMethods: ReturnType + private _boxStateMethods: ReturnType + + private _paramsMethods: ReturnType & { + /** Interact with bare (non-ABI) call parameters */ bare: ReturnType + } + private _transactionsMethods: ReturnType & { + /** Interact with bare (non-ABI) call transactions */ bare: ReturnType + } + private _sendMethods: ReturnType & { + /** Interact with bare (non-ABI) calls */ bare: ReturnType + } + + constructor(params: AppClientParams) { + this._appId = params.appId + this._appAddress = algosdk.getApplicationAddress(this._appId) + this._appSpec = AppClient.normaliseAppSpec(params.appSpec) + this._appName = params.appName ?? this._appSpec.name + this._algorand = params.algorand + this._defaultSender = params.defaultSender + + this._approvalSourceMap = params.approvalSourceMap + this._clearSourceMap = params.clearSourceMap + + this._localStateMethods = (address: string) => + this.getStateMethods( + () => this.getLocalState(address), + () => this._appSpec.state.keys.local, + () => this._appSpec.state.maps.local, + ) + this._globalStateMethods = this.getStateMethods( + () => this.getGlobalState(), + () => this._appSpec.state.keys.global, + () => this._appSpec.state.maps.global, + ) + this._boxStateMethods = this.getBoxMethods() + + this._paramsMethods = { + ...this.getMethodCallParamsMethods(), + bare: this.getBareParamsMethods(), + } + this._transactionsMethods = { ...this.getMethodCallTransactionsMethods(), bare: this.getBareTransactionsMethods() } + this._sendMethods = { ...this.getMethodCallSendMethods(), bare: this.getBareSendMethods() } + } + + /** Start a new `AlgoKitComposer` transaction group */ + newGroup(): AlgoKitComposer { + return this._algorand.newGroup() + } + + /** + * Returns a new `AppClient` client, resolving the app by creator address and name + * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). + * @param params The parameters to create the app client + */ + public static async fromCreatorAndName(params: Expand) { + const appSpec = AppClient.normaliseAppSpec(params.appSpec) + const appLookup = + params.appLookupCache ?? (await params.algorand.appDeployer.getCreatorAppsByName(params.creatorAddress, params.ignoreCache)) + const appMetadata = appLookup.apps[params.appName ?? appSpec.name] + if (!appMetadata) { + throw new Error(`App not found for creator ${params.creatorAddress} and name ${params.appName ?? appSpec.name}`) + } + return new AppClient({ + ...params, + algorand: params.algorand, + appId: appMetadata.appId, + }) + } + + /** + * Returns an `AppClient` instance for the current network based on + * pre-determined network-specific app IDs specified in the ARC-56 app spec. + * + * If no IDs are in the app spec or the network isn't recognised, an error is thrown. + * @param params The parameters to create the app client + */ + static async fromNetwork(params: Expand>): Promise { + const network = await params.algorand.client.network() + const appSpec = AppClient.normaliseAppSpec(params.appSpec) + const networkNames = [network.genesisHash] + if (network.isLocalNet) networkNames.push('localnet') + if (network.isTestNet) networkNames.push('testnet') + if (network.isMainNet) networkNames.push('mainnet') + const availableAppSpecNetworks = Object.keys(appSpec.networks ?? {}) + const networkIndex = availableAppSpecNetworks.findIndex((n) => networkNames.includes(n)) + + if (networkIndex === -1) { + throw new Error(`No app ID found for network ${JSON.stringify(networkNames)} in the app spec`) + } + + const appId = BigInt(appSpec.networks![networkIndex].appID) + return new AppClient({ ...params, appId, appSpec }) + } + + /** + * Takes a string or parsed JSON object that could be ARC-32 or ARC-56 format and + * normalises it into a parsed ARC-56 contract object. + * @param spec The spec to normalise + * @returns The normalised ARC-56 contract object + */ + static normaliseAppSpec(spec: Arc56Contract | AppSpec | string): Arc56Contract { + const parsedSpec = typeof spec === 'string' ? (JSON.parse(spec) as AppSpec | Arc56Contract) : spec + const appSpec = 'hints' in parsedSpec ? arc32ToArc56(parsedSpec) : parsedSpec + return appSpec + } + + /** The ID of the app instance this client is linked to. */ + get appId() { + return this._appId + } + + /** The app address of the app instance this client is linked to. */ + get appAddress() { + return this._appAddress + } + + /** The name of the app (from the ARC-32 / ARC-56 app spec). */ + get appName() { + return this._appName + } + + /** The ARC-56 app spec being used */ + get appSpec(): Arc56Contract { + return this._appSpec + } + + /** Get parameters to define transactions to the current app */ + get params() { + return this._paramsMethods + } + + /** Get transactions for the current app */ + get transactions() { + return this._transactionsMethods + } + + /** Send calls to the current app */ + get send() { + return this._sendMethods + } + + get state() { + return { + /** + * Methods to access local state for the current app + * @param address The address of the account to get the local state for + */ + local: this._localStateMethods, + /** + * Methods to access global state for the current app + */ + global: this._globalStateMethods, + /** + * Methods to access box storage for the current app + */ + box: this._boxStateMethods, + } + } + + /** + * Funds Algo into the app account for this app. + * @param params The parameters for the funding transaction + * @returns The result of the funding + */ + async fundAppAccount(params: FundAppParams) { + return this.send.fundAppAccount(params) + } + + /** + * Returns raw global state for the current app. + * @returns The global state + */ + async getGlobalState(): Promise { + return await this._algorand.app.getGlobalState(this.appId) + } + + /** + * Returns raw local state for the given account address. + * @param address The address of the account to get the local state for + * @returns The local state + */ + async getLocalState(address: string): Promise { + return await this._algorand.app.getLocalState(this.appId, address) + } + + /** + * Returns the names of all current boxes for the current app. + * @returns The names of the boxes + */ + async getBoxNames(): Promise { + return await this._algorand.app.getBoxNames(this.appId) + } + + /** + * Returns the value of the given box for the current app. + * @param name The identifier of the box to return + * @returns The current box value as a byte array + */ + async getBoxValue(name: BoxIdentifier): Promise { + return await this._algorand.app.getBoxValue(this.appId, name) + } + + /** + * Returns the value of the given box for the current app. + * @param name The identifier of the box to return + * @param type + * @returns The current box value as a byte array + */ + async getBoxValueFromABIType(name: BoxIdentifier, type: ABIType): Promise { + return await this._algorand.app.getBoxValueFromABIType({ + appId: this.appId, + boxName: name, + type, + }) + } + + /** + * Returns the values of all current boxes for the current app. + * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync. + * @param filter Optional filter to filter which boxes' values are returned + * @returns The (name, value) pair of the boxes with values as raw byte arrays + */ + async getBoxValues(filter?: (name: BoxName) => boolean): Promise<{ name: BoxName; value: Uint8Array }[]> { + const names = (await this.getBoxNames()).filter(filter ?? ((_) => true)) + const values = await this._algorand.app.getBoxValues( + this.appId, + names.map((name) => name.nameRaw), + ) + return names.map((name, i) => ({ name, value: values[i] })) + } + + /** + * Returns the values of all current boxes for the current app decoded using an ABI Type. + * Note: This will issue multiple HTTP requests (one per box) and it's not an atomic operation so values may be out of sync. + * @param type The ABI type to decode the values with + * @param filter Optional filter to filter which boxes' values are returned + * @returns The (name, value) pair of the boxes with values as the ABI Value + */ + async getBoxValuesFromABIType(type: ABIType, filter?: (name: BoxName) => boolean): Promise<{ name: BoxName; value: ABIValue }[]> { + const names = (await this.getBoxNames()).filter(filter ?? ((_) => true)) + const values = await this._algorand.app.getBoxValuesFromABIType({ + appId: this.appId, + boxNames: names.map((name) => name.nameRaw), + type, + }) + return names.map((name, i) => ({ name, value: values[i] })) + } + + /** + * Takes an error that may include a logic error from a call to the current app and re-exposes the + * error to include source code information via the source map and ARC-56 spec. + * @param e The error to parse + * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program) + * @returns The new error, or if there was no logic error or source map then the wrapped error with source details + */ + exposeLogicError(e: Error, isClearStateProgram?: boolean): Error { + return AppClient.exposeLogicError(e, this._appSpec, { + isClearStateProgram, + approvalSourceMap: this._approvalSourceMap, + clearSourceMap: this._clearSourceMap, + }) + } + + /** + * Export the current source maps for the app. + * @returns The source maps + */ + exportSourceMaps(): AppSourceMaps { + if (!this._approvalSourceMap || !this._clearSourceMap) { + throw new Error( + "Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first", + ) + } + + return { + approvalSourceMap: this._approvalSourceMap, + clearSourceMap: this._clearSourceMap, + } + } + + /** + * Import source maps for the app. + * @param sourceMaps The source maps to import + */ + importSourceMaps(sourceMaps: AppSourceMaps) { + this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap) + this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap) + } + + /** + * Returns the ABI Method for the given method name string for the app represented by this application client instance + * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted. + * e.g. `my_method` or `my_method(unit64,string)bytes` + * @returns A tuple with: [ARC-56 `Method`, algosdk `ABIMethod`] + */ + getABIMethod(methodNameOrSignature: string) { + return getArc56Method(methodNameOrSignature, this._appSpec) + } + + /** + * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type + * on the ARC-56 method. + * + * If the return type is a struct then the struct will be returned. + * + * @param result The SendAppTransactionResult to be mapped + * @param method The method that was called + * @returns The smart contract response with an updated return value + */ + async parseMethodCallReturn< + TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, + TResult extends SendAppTransactionResult = SendAppTransactionResult, + >(result: Promise | TResult, method: Arc56Method): Promise & AppReturn>> { + const resultValue = await result + return { ...resultValue, return: getArc56ReturnValue(resultValue.return, method, this._appSpec.structs) } as unknown as Expand< + Omit & AppReturn + > + } + + /** + * Takes an error that may include a logic error from a call to the current app and re-exposes the + * error to include source code information via the source map and ARC-56 spec. + * @param e The error to parse + * @param appSpec The app spec for the app + * @param details Additional information to inform the error + * @returns The new error, or if there was no logic error or source map then the wrapped error with source details + */ + public static exposeLogicError( + e: Error, + appSpec: Arc56Contract, + details: { + /** Whether or not the code was running the clear state program (defaults to approval program) */ isClearStateProgram?: boolean + /** Approval program source map */ approvalSourceMap?: SourceMap + /** Clear state program source map */ clearSourceMap?: SourceMap + }, + ): Error { + const { isClearStateProgram, approvalSourceMap, clearSourceMap } = details + if ((!isClearStateProgram && approvalSourceMap == undefined) || (isClearStateProgram && clearSourceMap == undefined)) return e + + const errorDetails = LogicError.parseLogicError(e) + + const errorMessage = (isClearStateProgram ? appSpec.sourceInfo?.clear : appSpec.sourceInfo?.approval)?.find((s) => + s?.pc?.includes(errorDetails?.pc ?? -1), + )?.errorMessage + + if (errorDetails !== undefined && appSpec.source) + e = new LogicError( + errorDetails, + Buffer.from(isClearStateProgram ? appSpec.source.clear : appSpec.source.approval, 'base64') + .toString() + .split('\n'), + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + isClearStateProgram ? clearSourceMap! : approvalSourceMap!, + ) + if (errorMessage) { + const appId = JSON.stringify(e).match(/(?<=app=)\d+/)?.[0] || '' + const txId = JSON.stringify(e).match(/(?<=transaction )\S+(?=:)/)?.[0] + const error = new Error(`Runtime error when executing ${appSpec.name} (appId: ${appId}) in transaction ${txId}: ${errorMessage}`) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ;(error as any).cause = e + return error + } + + return e + } + + /** + * Compiles the approval and clear state programs (if TEAL templates provided), + * performing any provided deploy-time parameter replacement and returns + * the compiled code and any compilation results (including source maps). + * + * If no TEAL templates provided it will use any byte code provided in the app spec. + * + * Will store any generated source maps for later use in debugging. + * @param appSpec The app spec for the app + * @param compilation Any compilation parameters to use + */ + public static async compile(appSpec: Arc56Contract, appManager: AppManager, compilation?: AppClientCompilationParams) { + const { deployTimeParams, updatable, deletable } = compilation ?? {} + + if (!appSpec.source) { + if (!appSpec.byteCode?.approval || !appSpec.byteCode?.clear) { + throw new Error(`Attempt to compile app ${appSpec.name} without source or byteCode`) + } + + return { + approvalProgram: Buffer.from(appSpec.byteCode.approval, 'base64'), + clearStateProgram: Buffer.from(appSpec.byteCode.clear, 'base64'), + } + } + + const approvalTemplate = Buffer.from(appSpec.source.approval, 'base64').toString('utf-8') + const compiledApproval = await appManager.compileTealTemplate(approvalTemplate, deployTimeParams, { + updatable, + deletable, + }) + + const clearTemplate = Buffer.from(appSpec.source.clear, 'base64').toString('utf-8') + const compiledClear = await appManager.compileTealTemplate(clearTemplate, deployTimeParams) + + if (Config.debug && Config.projectRoot) { + persistSourceMaps({ + sources: [ + PersistSourceMapInput.fromCompiledTeal(compiledApproval, appSpec.name, 'approval.teal'), + PersistSourceMapInput.fromCompiledTeal(compiledClear, appSpec.name, 'clear.teal'), + ], + projectRoot: Config.projectRoot, + appManager, + withSources: true, + }) + } + + return { + approvalProgram: compiledApproval.compiledBase64ToBytes, + compiledApproval, + clearStateProgram: compiledClear.compiledBase64ToBytes, + compiledClear, + } + } + + /** + * Returns ABI method arguments ready for a method call params object with default values populated + * and structs replaced with tuples. + * + * It does this by replacing any `undefined` values with the equivalent default value from the given ARC-56 app spec. + * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted. + * e.g. `my_method` or `my_method(unit64,string)bytes` + * @param args The arguments to the method with `undefined` for any that should be populated with a default value + * @param appSpec The app spec for the app + */ + public static getABIArgsWithDefaultValues( + methodNameOrSignature: string, + args: AppClientMethodCallParams['args'] | undefined, + appSpec: Arc56Contract, + ): AppMethodCall['args'] { + const m = getArc56Method(methodNameOrSignature, appSpec) + return args?.map((a, i) => { + const arg = m.args[i] + if (a !== undefined) { + // If a struct then convert to tuple for the underlying call + return arg.struct && typeof a === 'object' && !Array.isArray(a) + ? getABITupleFromABIStruct(a as ABIStruct, appSpec.structs[arg.struct]) + : (a as ABIValue | AppMethodCallTransactionArgument) + } + // todo: expand this to match previous ApplicationClient implementation when ARC-56 spec is updated to support other default value options + const defaultValue = arg.defaultValue + if (defaultValue) return getABIDecodedValue(Buffer.from(defaultValue, 'base64'), m.method.args[i].type, {}) as ABIValue + throw new Error(`No value provided for required argument ${arg.name ?? `arg${i + 1}`} in call to method ${m.name}`) + }) + } + + private getBareParamsMethods() { + return { + /** Return params for an update call, including deploy-time TEAL template replacements and compilation if provided */ + update: async (params?: AppClientBareCallParams & AppClientCompilationParams) => { + return this.getBareParams( + { + ...params, + ...(await this.compile(params)), + }, + OnApplicationComplete.UpdateApplicationOC, + ) as AppUpdateParams + }, + /** Return params for an opt-in call */ + optIn: (params?: AppClientBareCallParams) => { + return this.getBareParams(params, OnApplicationComplete.OptInOC) as AppCallParams + }, + /** Return params for a delete call */ + delete: (params?: AppClientBareCallParams) => { + return this.getBareParams(params, OnApplicationComplete.DeleteApplicationOC) as AppDeleteParams + }, + /** Return params for a clear state call */ + clearState: (params?: AppClientBareCallParams) => { + return this.getBareParams(params, OnApplicationComplete.ClearStateOC) as AppCallParams + }, + /** Return params for a close out call */ + closeOut: (params?: AppClientBareCallParams) => { + return this.getBareParams(params, OnApplicationComplete.CloseOutOC) as AppCallParams + }, + /** Return params for a call (defaults to no-op) */ + call: (params?: AppClientBareCallParams & CallOnComplete) => { + return this.getBareParams(params, params?.onComplete ?? OnApplicationComplete.NoOpOC) as AppCallParams + }, + } + } + + private getBareTransactionsMethods() { + return { + /** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */ + update: async (params?: AppClientBareCallParams & AppClientCompilationParams) => { + return this._algorand.transactions.appUpdate(await this.params.bare.update(params)) + }, + /** Returns a transaction for an opt-in call */ + optIn: (params?: AppClientBareCallParams) => { + return this._algorand.transactions.appCall(this.params.bare.optIn(params)) + }, + /** Returns a transaction for a delete call */ + delete: (params?: AppClientBareCallParams) => { + return this._algorand.transactions.appDelete(this.params.bare.delete(params)) + }, + /** Returns a transaction for a clear state call */ + clearState: (params?: AppClientBareCallParams) => { + return this._algorand.transactions.appCall(this.params.bare.clearState(params)) + }, + /** Returns a transaction for a close out call */ + closeOut: (params?: AppClientBareCallParams) => { + return this._algorand.transactions.appCall(this.params.bare.closeOut(params)) + }, + /** Returns a transaction for a call (defaults to no-op) */ + call: (params?: AppClientBareCallParams & CallOnComplete) => { + return this._algorand.transactions.appCall(this.params.bare.call(params)) + }, + } + } + + private getBareSendMethods() { + return { + /** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */ + update: async (params?: AppClientBareCallParams & AppClientCompilationParams & ExecuteParams) => { + return await this.handleCallErrors(async () => this._algorand.send.appUpdate(await this.params.bare.update(params))) + }, + /** Signs and sends an opt-in call */ + optIn: (params?: AppClientBareCallParams & ExecuteParams) => { + return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.optIn(params))) + }, + /** Signs and sends a delete call */ + delete: (params?: AppClientBareCallParams & ExecuteParams) => { + return this.handleCallErrors(() => this._algorand.send.appDelete(this.params.bare.delete(params))) + }, + /** Signs and sends a clear state call */ + clearState: (params?: AppClientBareCallParams & ExecuteParams) => { + return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.clearState(params))) + }, + /** Signs and sends a close out call */ + closeOut: (params?: AppClientBareCallParams & ExecuteParams) => { + return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.closeOut(params))) + }, + /** Signs and sends a call (defaults to no-op) */ + call: (params?: AppClientBareCallParams & CallOnComplete & ExecuteParams) => { + return this.handleCallErrors(() => this._algorand.send.appCall(this.params.bare.call(params))) + }, + } + } + + private getMethodCallParamsMethods() { + return { + /** Return params for a payment transaction to fund the app account */ + fundAppAccount: (params: FundAppParams) => { + return { + ...params, + sender: this.getSender(params.sender), + receiver: this.appAddress, + } satisfies PaymentParams + }, + /** Return params for an update ABI call, including deploy-time TEAL template replacements and compilation if provided */ + update: async (params: AppClientMethodCallParams & AppClientCompilationParams) => { + return this.getABIParams( + { + ...params, + ...(await this.compile(params)), + }, + OnApplicationComplete.UpdateApplicationOC, + ) satisfies AppUpdateMethodCall + }, + /** Return params for an opt-in ABI call */ + optIn: (params: AppClientMethodCallParams) => { + return this.getABIParams(params, OnApplicationComplete.OptInOC) as AppCallMethodCall + }, + /** Return params for an delete ABI call */ + delete: (params: AppClientMethodCallParams) => { + return this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC) as AppDeleteMethodCall + }, + /** Return params for an close out ABI call */ + closeOut: (params: AppClientMethodCallParams) => { + return this.getABIParams(params, OnApplicationComplete.CloseOutOC) as AppCallMethodCall + }, + /** Return params for an ABI call */ + call: (params: AppClientMethodCallParams & CallOnComplete) => { + return this.getABIParams(params, params.onComplete ?? OnApplicationComplete.NoOpOC) as AppCallMethodCall + }, + } + } + + private getMethodCallSendMethods() { + return { + /** Sign and send transactions for a payment transaction to fund the app account */ + fundAppAccount: (params: FundAppParams & ExecuteParams) => { + return this._algorand.send.payment(this.params.fundAppAccount(params)) + }, + /** + * Sign and send transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided + */ + update: async (params: AppClientMethodCallParams & AppClientCompilationParams & ExecuteParams) => { + const compiled = await this.compile(params) + return { + ...(await this.handleCallErrors(async () => + this.parseMethodCallReturn( + this._algorand.send.appUpdateMethodCall(await this.params.update({ ...params })), + getArc56Method(params.method, this._appSpec), + ), + )), + ...(compiled as Partial), + } + }, + /** + * Sign and send transactions for an opt-in ABI call + */ + optIn: (params: AppClientMethodCallParams & ExecuteParams) => { + return this.handleCallErrors(() => + this.parseMethodCallReturn( + this._algorand.send.appCallMethodCall(this.params.optIn(params)), + getArc56Method(params.method, this._appSpec), + ), + ) + }, + /** + * Sign and send transactions for a delete ABI call + */ + delete: (params: AppClientMethodCallParams & ExecuteParams) => { + return this.handleCallErrors(() => + this.parseMethodCallReturn( + this._algorand.send.appDeleteMethodCall(this.params.delete(params)), + getArc56Method(params.method, this._appSpec), + ), + ) + }, + /** + * Sign and send transactions for a close out ABI call + */ + closeOut: (params: AppClientMethodCallParams & ExecuteParams) => { + return this.handleCallErrors(() => + this.parseMethodCallReturn( + this._algorand.send.appCallMethodCall(this.params.closeOut(params)), + getArc56Method(params.method, this._appSpec), + ), + ) + }, + /** + * Sign and send transactions for a call (defaults to no-op) + */ + call: async (params: AppClientMethodCallParams & CallOnComplete & ExecuteParams) => { + // Read-only call - do it via simulate + if ( + params.onComplete === OnApplicationComplete.NoOpOC || + (!params.onComplete && getArc56Method(params.method, this._appSpec).method.readonly) + ) { + const result = await this._algorand.newGroup().addAppCallMethodCall(this.params.call(params)).simulate() + return this.parseMethodCallReturn( + { + ...result, + transaction: result.transactions.at(-1)!, + confirmation: result.confirmations.at(-1)!, + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain + return: result.returns?.length ?? 0 > 0 ? result.returns?.at(-1)! : undefined, + } satisfies SendAppTransactionResult, + getArc56Method(params.method, this._appSpec), + ) + } + + return this.handleCallErrors(() => + this.parseMethodCallReturn( + this._algorand.send.appCallMethodCall(this.params.call(params)), + getArc56Method(params.method, this._appSpec), + ), + ) + }, + } + } + + private getMethodCallTransactionsMethods() { + return { + /** Return transaction for a payment transaction to fund the app account */ + fundAppAccount: (params: FundAppParams) => { + return this._algorand.transactions.payment(this.params.fundAppAccount(params)) + }, + /** + * Return transactions for an update ABI call, including deploy-time TEAL template replacements and compilation if provided + */ + update: async (params: AppClientMethodCallParams & AppClientCompilationParams) => { + return this._algorand.transactions.appUpdateMethodCall(await this.params.update(params)) + }, + /** + * Return transactions for an opt-in ABI call + */ + optIn: (params: AppClientMethodCallParams) => { + return this._algorand.transactions.appCallMethodCall(this.params.optIn(params)) + }, + /** + * Return transactions for a delete ABI call + */ + delete: (params: AppClientMethodCallParams) => { + return this._algorand.transactions.appDeleteMethodCall(this.params.delete(params)) + }, + /** + * Return transactions for a close out ABI call + */ + closeOut: (params: AppClientMethodCallParams) => { + return this._algorand.transactions.appCallMethodCall(this.params.closeOut(params)) + }, + /** + * Return transactions for an ABI call (defaults to no-op) + */ + call: (params: AppClientMethodCallParams & CallOnComplete) => { + return this._algorand.transactions.appCallMethodCall(this.params.call(params)) + }, + } + } + + /** + * Compiles the approval and clear state programs (if TEAL templates provided), + * performing any provided deploy-time parameter replacement and stores + * the source maps. + * + * If no TEAL templates provided it will use any byte code provided in the app spec. + * + * Will store any generated source maps for later use in debugging. + */ + private async compile(compilation?: AppClientCompilationParams) { + const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation) + + if (result.compiledApproval) { + this._approvalSourceMap = result.compiledApproval.sourceMap + } + if (result.compiledClear) { + this._clearSourceMap = result.compiledClear.sourceMap + } + + return result + } + + /** Returns the sender for a call, using the `defaultSender` + * if none provided and throws an error if neither provided */ + private getSender(sender: string | undefined): string { + if (!sender && !this._defaultSender) { + throw new Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`) + } + return sender ?? this._defaultSender! + } + + private getBareParams( + params: TParams, + onComplete: TOnComplete, + ) { + return { + ...params, + appId: this._appId, + sender: this.getSender(params?.sender), + onComplete, + } + } + + private getABIParams< + TParams extends { method: string; sender?: string; args?: AppClientMethodCallParams['args'] }, + TOnComplete extends OnApplicationComplete, + >(params: TParams, onComplete: TOnComplete) { + const method = getArc56Method(params.method, this._appSpec) + const args = AppClient.getABIArgsWithDefaultValues(params.method, params.args, this._appSpec) + return { + ...params, + appId: this._appId, + sender: this.getSender(params.sender), + method, + onComplete, + args, + } + } + + /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */ + private async handleCallErrors(call: () => Promise) { + try { + return await call() + } catch (e) { + throw this.exposeLogicError(e as Error) + } + } + + private getBoxMethods() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const that = this + const stateMethods = { + /** + * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value. + */ + getAll: async () => { + return Object.fromEntries( + await Promise.all(Object.keys(that._appSpec.state.keys.box).map(async (key) => [key, await stateMethods.getValue(key)])), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) as Record + }, + /** + * Returns a single state value for the current app with the value a decoded ABI value. + * @param name The name of the state value to retrieve the value for + * @returns + */ + getValue: async (name: string) => { + const metadata = that._appSpec.state.keys.box[name] + const value = await that.getBoxValue(Buffer.from(metadata.key, 'base64')) + return getABIDecodedValue(value, metadata.valueType, that._appSpec.structs) + }, + /** + * + * @param mapName The name of the map to read from + * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value + * that will be converted to bytes by encoding it using the specified ABI key type + * in the ARC-56 spec + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + getMapValue: async (mapName: string, key: Uint8Array | any) => { + const metadata = that._appSpec.state.maps.box[mapName] + const prefix = Buffer.from(metadata.prefix ?? '', 'base64') + const encodedKey = Buffer.concat([prefix, getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]) + const base64Key = Buffer.from(encodedKey).toString('base64') + const value = await that.getBoxValue(Buffer.from(base64Key, 'base64')) + return getABIDecodedValue(value, metadata.valueType, that._appSpec.structs) + }, + + /** + * + * @param mapName The name of the map to read from + * @param key The key within the map as either a Buffer with the bytes or a value + * that will be converted to bytes by encoding it using the specified ABI key type + * in the ARC-56 spec + * @param appState + */ + getMap: async (mapName: string) => { + const metadata = that._appSpec.state.maps.box[mapName] + const prefix = Buffer.from(metadata.prefix ?? '', 'base64') + const boxNames = await that.getBoxNames() + + return new Map( + await Promise.all( + boxNames + .filter((b) => binaryStartsWith(b.nameRaw, prefix)) + .map(async (b) => { + const encodedKey = Buffer.concat([prefix, b.nameRaw]) + const base64Key = Buffer.from(encodedKey).toString('base64') + return [ + getABIDecodedValue(b.nameRaw.slice(prefix.length), metadata.keyType, that._appSpec.structs), + getABIDecodedValue(await that.getBoxValue(Buffer.from(base64Key, 'base64')), metadata.valueType, that._appSpec.structs), + ] as const + }), + ), + ) + }, + } + return stateMethods + } + + private getStateMethods( + stateGetter: () => Promise, + keyGetter: () => { + [name: string]: StorageKey + }, + mapGetter: () => { + [name: string]: StorageMap + }, + ) { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const that = this + const stateMethods = { + /** + * Returns all single-key state values in a record keyed by the key name and the value a decoded ABI value. + */ + getAll: async () => { + const appState = await stateGetter() + return Object.fromEntries( + await Promise.all(Object.keys(keyGetter()).map(async (key) => [key, await stateMethods.getValue(key, appState)])), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) as Record + }, + /** + * Returns a single state value for the current app with the value a decoded ABI value. + * @param name The name of the state value to retrieve the value for + * @param appState Optional cached value of the current state + * @returns + */ + getValue: async (name: string, appState?: AppState) => { + const state = Object.values(appState ?? (await stateGetter())) + const metadata = keyGetter()[name] + const value = state.find((s) => s.keyBase64 === metadata.key) + + if (value && 'valueRaw' in value) { + return getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs) + } + + return value?.value + }, + /** + * Returns a single value from the given map for the current app with the value a decoded ABI value. + * @param mapName The name of the map to read from + * @param key The key within the map (without any map prefix) as either a Buffer with the bytes or a value + * that will be converted to bytes by encoding it using the specified ABI key type + * in the ARC-56 spec + * @param appState Optional cached value of the current state + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + getMapValue: async (mapName: string, key: Uint8Array | any, appState?: AppState) => { + const state = Object.values(appState ?? (await stateGetter())) + const metadata = mapGetter()[mapName] + + const prefix = Buffer.from(metadata.prefix ?? '', 'base64') + const encodedKey = Buffer.concat([prefix, getABIEncodedValue(key, metadata.keyType, that._appSpec.structs)]) + const base64Key = Buffer.from(encodedKey).toString('base64') + const value = state.find((s) => s.keyBase64 === base64Key) + + if (value && 'valueRaw' in value) { + return getABIDecodedValue(value.valueRaw, metadata.valueType, that._appSpec.structs) + } + + return value?.value + }, + + /** + * Returns all map values for the given map. + * @param mapName The name of the map to read from + * @param appState Optional cached value of the current state + * @returns A map of all key-value pairs in the map as a `Record` + */ + getMap: async (mapName: string) => { + const state = Object.values(await stateGetter()) + const metadata = mapGetter()[mapName] + + const prefix = Buffer.from(metadata.prefix ?? '', 'base64') + + return new Map( + state + .filter((s) => binaryStartsWith(s.keyRaw, prefix)) + .map((s) => { + const key = s.keyRaw.slice(prefix.length) + return [ + getABIDecodedValue(key, metadata.keyType, this._appSpec.structs), + getABIDecodedValue('valueRaw' in s ? s.valueRaw : s.value, metadata.valueType, this._appSpec.structs), + ] as const + }), + ) + }, + } + return stateMethods + } +} + +/** + * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or + * `algorand.client.getAppClientByCreatorAndName`. + * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, + * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + * + * Application client - a class that wraps an ARC-0032 app spec and provides high productivity methods to deploy and call the app */ export class ApplicationClient { private algod: Algodv2 private indexer?: algosdk.Indexer private appSpec: AppSpec private sender: SendTransactionFrom | undefined private params: SuggestedParams | undefined - private existingDeployments: AppLookup | undefined + private existingDeployments: LegacyAppLookup | undefined private deployTimeParams?: TealTemplateParams private _appId: number | bigint @@ -286,12 +1368,12 @@ export class ApplicationClient { private _approvalSourceMap: SourceMap | undefined private _clearSourceMap: SourceMap | undefined - // todo: process ABI args as needed to make them nicer to deal with like beaker-ts - // todo: support readonly, noop method calls - // todo: find create, update, delete, etc. methods from app spec and call them by default - // todo: intelligent version management when deploying - /** + * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or + * `algorand.client.getAppClientByCreatorAndName`. + * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`, + * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls. + * * Create a new ApplicationClient instance * @param appDetails The details of the app * @param algod An algod instance @@ -329,9 +1411,11 @@ export class ApplicationClient { } /** - * Compiles the approval and clear programs and sets up the source map. + * @deprecated Use `AppClient.compile()` instead. + * + * Compiles the approval and clear state programs and sets up the source map. * @param compilation The deploy-time parameters for the compilation - * @returns The compiled approval and clear programs + * @returns The compiled approval and clear state programs */ async compile(compilation?: AppClientCompilationParams) { const { deployTimeParams, updatable, deletable } = compilation ?? {} @@ -357,7 +1441,7 @@ export class ApplicationClient { PersistSourceMapInput.fromCompiledTeal(clearCompiled, this._appName, 'clear.teal'), ], projectRoot: Config.projectRoot, - client: this.algod, + appManager: new AppManager(this.algod), withSources: true, }) } @@ -392,6 +1476,8 @@ export class ApplicationClient { } /** + * @deprecated Use `deploy` from an `AppFactory` instance instead. + * * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions. * * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md @@ -508,6 +1594,8 @@ export class ApplicationClient { } /** + * @deprecated Use `create` from an `AppFactory` instance instead. + * * Creates a smart contract app, returns the details of the created app. * @param create The parameters to create the app with * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result @@ -571,6 +1659,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.update` or `appClient.transactions.update` from an `AppClient` instance instead. + * * Updates the smart contract app. * @param update The parameters to update the app with * @returns The transaction send result and the compilation result @@ -610,6 +1700,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead. + * * Issues a no_op (normal) call to the app. * @param call The call details. * @returns The result of the call @@ -646,6 +1738,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.optIn` or `appClient.transactions.optIn` from an `AppClient` instance instead. + * * Issues a opt_in call to the app. * @param call The call details. * @returns The result of the call @@ -655,6 +1749,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.closeOut` or `appClient.transactions.closeOut` from an `AppClient` instance instead. + * * Issues a close_out call to the app. * @param call The call details. * @returns The result of the call @@ -664,6 +1760,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.clearState` or `appClient.transactions.clearState` from an `AppClient` instance instead. + * * Issues a clear_state call to the app. * @param call The call details. * @returns The result of the call @@ -673,6 +1771,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.delete` or `appClient.transactions.delete` from an `AppClient` instance instead. + * * Issues a delete_application call to the app. * @param call The call details. * @returns The result of the call @@ -682,6 +1782,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.send.call` or `appClient.transactions.call` from an `AppClient` instance instead. + * * Issues a call to the app with the given call type. * @param call The call details. * @param callType The call type @@ -869,6 +1971,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.params.*` from an `AppClient` instance instead. + * * Returns the arguments for an app call for the given ABI method or raw method specification. * @param args The call args specific to this application client * @param sender The sender of this call. Will be used to fetch any default argument values if applicable @@ -938,6 +2042,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.getABIMethod` instead. + * * Returns the ABI Method parameters for the given method name string for the app represented by this application client instance * @param method Either the name of the method or the ABI method spec definition string * @returns The ABI method params for the given method @@ -970,6 +2076,8 @@ export class ApplicationClient { } /** + * @deprecated Use `appClient.appId` and `appClient.appAddress` from an `AppClient` instance instead. + * * Gets the reference information for the current application instance. * `appId` will be 0 if it can't find an app. * @returns The app reference, or if deployed using the `deploy` method, the app metadata too diff --git a/src/types/app-deployer.ts b/src/types/app-deployer.ts index 6235b375..21641f46 100644 --- a/src/types/app-deployer.ts +++ b/src/types/app-deployer.ts @@ -20,47 +20,53 @@ import AlgoKitComposer, { AppDeleteParams, AppUpdateMethodCall, AppUpdateParams, - ExecuteParams, } from './composer' import { Expand } from './expand' -import { ConfirmedTransactionResult } from './transaction' +import { ConfirmedTransactionResult, ExecuteParams } from './transaction' + +/** Params to specify an update transaction for an app deployment */ +export type DeployAppUpdateParams = Expand> +/** Params to specify an update method call for an app deployment */ +export type DeployAppUpdateMethodCall = Expand> +/** Params to specify a transaction for an app deployment */ +export type DeployAppDeleteParams = Expand> +/** Params to specify a delete method call for an app deployment */ +export type DeployAppDeleteMethodCall = Expand> /** The parameters to idempotently deploy an app */ -export interface AppDeployParams { - /** The deployment metadata */ - metadata: AppDeployMetadata - /** Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string) */ - deployTimeParams?: TealTemplateParams - /** What action to perform if a schema break (storage schema or extra pages change) is detected: - * - * * `replace` - Delete the old app and create a new one - * * `fail` - Fail the deployment (throw an error) - * * `append` - Deploy a new app and leave the old one as is - */ - onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak - /** What action to perform if a TEAL code update is detected: - * - * * `update` - Update the app with the new TEAL code - * * `replace` - Delete the old app and create a new one - * * `fail` - Fail the deployment (throw an error) - * * `append` - Deploy a new app and leave the old one as is - */ - onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate - /** Create transaction parameters to use if a create needs to be issued as part of deployment */ - createParams: AppCreateParams | AppCreateMethodCall - /** Update transaction parameters to use if an update needs to be issued as part of deployment */ - updateParams: - | Expand> - | Expand> - /** Delete transaction parameters to use if a delete needs to be issued as part of deployment */ - deleteParams: Expand> | Expand> - /** Parameters to use for transaction execution */ - executeParams?: ExecuteParams - /** Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup */ - existingDeployments?: AppLookup - /** Whether or not to ignore the app metadata cache and force a lookup, default: use the cache **/ - ignoreCache?: boolean -} +export type AppDeployParams = Expand< + ExecuteParams & { + /** The deployment metadata */ + metadata: AppDeployMetadata + /** Any deploy-time parameters to replace in the TEAL code before compiling it (used if teal code is passed in as a string) */ + deployTimeParams?: TealTemplateParams + /** What action to perform if a schema break (storage schema or extra pages change) is detected: + * + * * `fail` - Fail the deployment (throw an error, **default**) + * * `replace` - Delete the old app and create a new one + * * `append` - Deploy a new app and leave the old one as is + */ + onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak + /** What action to perform if a TEAL code update is detected: + * + * * `fail` - Fail the deployment (throw an error, **default**) + * * `update` - Update the app with the new TEAL code + * * `replace` - Delete the old app and create a new one + * * `append` - Deploy a new app and leave the old one as is + */ + onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate + /** Create transaction parameters to use if a create needs to be issued as part of deployment */ + createParams: AppCreateParams | AppCreateMethodCall + /** Update transaction parameters to use if an update needs to be issued as part of deployment */ + updateParams: DeployAppUpdateParams | DeployAppUpdateMethodCall + /** Delete transaction parameters to use if a delete needs to be issued as part of deployment */ + deleteParams: DeployAppDeleteParams | DeployAppDeleteMethodCall + /** Optional cached value of the existing apps for the given creator; use this to avoid an indexer lookup */ + existingDeployments?: AppLookup + /** Whether or not to ignore the app metadata cache and force a lookup, default: use the cache **/ + ignoreCache?: boolean + } +> /** The metadata that can be collected about a deployed app */ export interface AppMetadata extends AppDeployMetadata { @@ -89,10 +95,10 @@ export interface AppLookup { } export type AppDeployResult = - | Expand<{ operationPerformed: 'create' } & AppMetadata & SendAppCreateTransactionResult> + | Expand<{ operationPerformed: 'create' } & Omit & SendAppCreateTransactionResult> | Expand<{ operationPerformed: 'update' } & AppMetadata & SendAppUpdateTransactionResult> | Expand< - { operationPerformed: 'replace' } & AppMetadata & + { operationPerformed: 'replace' } & Omit & SendAppCreateTransactionResult & { deleteReturn?: ABIReturn deleteResult: ConfirmedTransactionResult @@ -141,9 +147,9 @@ export class AppDeployer { createParams, updateParams, deleteParams, - executeParams, existingDeployments, ignoreCache, + ...executeParams } = deployment // Set creation note @@ -442,7 +448,7 @@ export class AppDeployer { * If the `AppManager` instance wasn't created with an indexer client, this function will throw an error. * * @param creatorAddress The address of the account that is the creator of the apps you want to search for - * @param ignoreCache Whether ot not to ignore the cache and force a lookup, default: use the cache + * @param ignoreCache Whether or not to ignore the cache and force a lookup, default: use the cache * @returns A name-based lookup of the app metadata */ async getCreatorAppsByName(creatorAddress: string, ignoreCache?: boolean): Promise { diff --git a/src/types/app-factory-and-client.spec.ts b/src/types/app-factory-and-client.spec.ts new file mode 100644 index 00000000..6585d341 --- /dev/null +++ b/src/types/app-factory-and-client.spec.ts @@ -0,0 +1,686 @@ +import { describe, test } from '@jest/globals' +import algosdk, { ABIUintType, OnApplicationComplete, TransactionSigner, TransactionType, getApplicationAddress } from 'algosdk' +import invariant from 'tiny-invariant' +import * as algokit from '..' +import { getTestingAppContract } from '../../tests/example-contracts/testing-app/contract' +import { algoKitLogCaptureFixture, algorandFixture } from '../testing' +import { getArc56Method } from './app-arc56' +import { AppClient } from './app-client' +import { AppFactory } from './app-factory' +import { AppManager } from './app-manager' +import { AppSpec } from './app-spec' + +describe('ARC32: app-factory-and-app-client', () => { + const localnet = algorandFixture() + beforeEach(async () => { + await localnet.beforeEach() + factory = await localnet.algorand.client.getAppFactory({ appSpec, defaultSender: localnet.context.testAccount.addr }) + }, 10_000) + + let appSpec: AppSpec + let factory: AppFactory + beforeAll(async () => { + appSpec = (await getTestingAppContract()).appSpec + }) + + const deploy = async () => { + const result = await factory.deploy({ + deployTimeParams: { VALUE: 1 }, + }) + return { + app: result.result, + client: result.app, + } + } + + test('Create app', async () => { + const { result: app } = await factory.create({ + deployTimeParams: { + // It should strip off the TMPL_ + TMPL_UPDATABLE: 0, + DELETABLE: 0, + VALUE: 1, + }, + }) + + expect(app.appId).toBeGreaterThan(0n) + expect(app.appAddress).toBe(getApplicationAddress(app.appId)) + expect(BigInt(app.confirmation?.applicationIndex ?? 0)).toBe(app.appId) + expect(app.compiledApproval).toBeTruthy() + }) + + test('Create app with constructor deployTimeParams', async () => { + const { algorand, testAccount } = localnet.context + + const factory = algorand.client.getAppFactory({ + appSpec, + defaultSender: testAccount.addr, + deployTimeParams: { + UPDATABLE: 0, + DELETABLE: 0, + VALUE: 1, + }, + }) + + const app = await factory.create() + + expect(app.result.appId).toBeGreaterThan(0n) + expect(app.app.appId).toBe(app.result.appId) + }) + + test('Create app with oncomplete overload', async () => { + const { result: app } = await factory.create({ + onComplete: OnApplicationComplete.OptInOC, + updatable: true, + deletable: true, + deployTimeParams: { + VALUE: 1, + }, + }) + + expect(app.transaction.appOnComplete).toBe(OnApplicationComplete.OptInOC) + expect(app.appId).toBeGreaterThan(0n) + expect(app.appAddress).toBe(getApplicationAddress(app.appId)) + expect(BigInt(app.confirmation?.applicationIndex ?? 0)).toBe(app.appId) + }) + + test('Deploy app - can still deploy when immutable and permanent', async () => { + await factory.deploy({ + deletable: false, + updatable: false, + onSchemaBreak: 'fail', + onUpdate: 'fail', + deployTimeParams: { + VALUE: 1, + }, + }) + }) + + test('Deploy app - create', async () => { + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + }) + + invariant(app.operationPerformed === 'create') + expect(app.appId).toBeGreaterThan(0n) + expect(app.appAddress).toBe(getApplicationAddress(app.appId)) + expect(BigInt(app.confirmation?.applicationIndex ?? 0)).toBe(app.appId) + expect(app.compiledApproval).toBeTruthy() + expect(app.compiledClear).toBeTruthy() + }) + + test('Deploy app - create (abi)', async () => { + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + createParams: { + method: 'create_abi', + args: ['arg_io'], + }, + }) + + invariant(app.operationPerformed === 'create') + expect(app.appId).toBeGreaterThan(0) + expect(app.appAddress).toBe(getApplicationAddress(app.appId)) + expect(BigInt(app.confirmation?.applicationIndex ?? 0)).toBe(app.appId) + expect(app.return).toBe('arg_io') + }) + + test('Deploy app - update', async () => { + const { result: createdApp } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + updatable: true, + }) + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 2, + }, + onUpdate: 'update', + }) + + invariant(app.operationPerformed === 'update') + expect(app.appId).toBe(createdApp.appId) + expect(app.appAddress).toBe(createdApp.appAddress) + invariant(app.confirmation) + expect(app.createdRound).toBe(createdApp.createdRound) + expect(app.updatedRound).not.toBe(app.createdRound) + expect(app.updatedRound).toBe(BigInt(app.confirmation.confirmedRound ?? 0)) + }) + + test('Deploy app - update (abi)', async () => { + const { result: createdApp } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + updatable: true, + }) + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 2, + }, + onUpdate: 'update', + updateParams: { + method: 'update_abi', + args: ['arg_io'], + }, + }) + + invariant(app.operationPerformed === 'update') + expect(app.appId).toBe(createdApp.appId) + expect(app.appAddress).toBe(createdApp.appAddress) + invariant(app.confirmation) + expect(app.createdRound).toBe(createdApp.createdRound) + expect(app.updatedRound).not.toBe(app.createdRound) + expect(app.updatedRound).toBe(BigInt(app.confirmation.confirmedRound ?? 0)) + expect(app.transaction.appOnComplete).toBe(OnApplicationComplete.UpdateApplicationOC) + expect(app.return).toBe('arg_io') + }) + + test('Deploy app - replace', async () => { + const { result: createdApp } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + deletable: true, + }) + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 2, + }, + onUpdate: 'replace', + }) + + invariant(app.operationPerformed === 'replace') + expect(app.appId).toBeGreaterThan(createdApp.appId) + expect(app.appAddress).toBe(algosdk.getApplicationAddress(app.appId)) + invariant(app.confirmation) + invariant(app.deleteResult) + invariant(app.deleteResult.confirmation) + expect(BigInt(app.deleteResult.transaction.appIndex)).toBe(createdApp.appId) + expect(app.deleteResult.transaction.appOnComplete).toBe(OnApplicationComplete.DeleteApplicationOC) + }) + + test('Deploy app - replace (abi)', async () => { + const { result: createdApp } = await factory.deploy({ + deployTimeParams: { + VALUE: 1, + }, + deletable: true, + populateAppCallResources: false, + }) + const { result: app } = await factory.deploy({ + deployTimeParams: { + VALUE: 2, + }, + onUpdate: 'replace', + createParams: { + method: 'create_abi', + args: ['arg_io'], + }, + deleteParams: { + method: 'delete_abi', + args: ['arg2_io'], + }, + populateAppCallResources: false, + }) + + invariant(app.operationPerformed === 'replace') + expect(app.appId).toBeGreaterThan(createdApp.appId) + expect(app.appAddress).toBe(algosdk.getApplicationAddress(app.appId)) + invariant(app.confirmation) + invariant(app.deleteResult) + invariant(app.deleteResult.confirmation) + expect(BigInt(app.deleteResult.transaction.appIndex)).toBe(createdApp.appId) + expect(app.deleteResult.transaction.appOnComplete).toBe(OnApplicationComplete.DeleteApplicationOC) + expect(app.return).toBe('arg_io') + expect(app.deleteReturn).toBe('arg2_io') + }) + + test('Create then call app', async () => { + const { app } = await factory.create({ + deployTimeParams: { + UPDATABLE: 0, + DELETABLE: 0, + VALUE: 1, + }, + }) + + const call = await app.send.call({ + method: 'call_abi', + args: ['test'], + }) + + invariant(call.return) + expect(call.return).toBe('Hello, test') + }) + + test('Call app with rekey', async () => { + const { testAccount, algorand } = localnet.context + const rekeyTo = algorand.account.random() + + const { app } = await factory.create({ + deployTimeParams: { + UPDATABLE: 0, + DELETABLE: 0, + VALUE: 1, + }, + }) + await app.send.optIn({ + method: 'opt_in', + rekeyTo: rekeyTo.addr, + }) + + // If the rekey didn't work this will throw + const rekeyedAccount = algorand.account.rekeyed(testAccount.addr, rekeyTo) + await algorand.send.payment({ + amount: (0).algo(), + sender: rekeyedAccount.addr, + receiver: testAccount.addr, + }) + }) + + test('Create app with abi', async () => { + const { result: call } = await factory.create({ + deployTimeParams: { + UPDATABLE: 0, + DELETABLE: 0, + VALUE: 1, + }, + method: 'create_abi', + args: ['string_io'], + }) + + invariant(call.return) + expect(call.return).toBe('string_io') + }) + + test('Update app with abi', async () => { + const deployTimeParams = { + UPDATABLE: 1, + DELETABLE: 0, + VALUE: 1, + } + const { app } = await factory.create({ + deployTimeParams, + }) + + const call = await app.send.update({ + method: 'update_abi', + args: ['string_io'], + deployTimeParams, + }) + + invariant(call.return) + expect(call.return).toBe('string_io') + expect(call.compiledApproval).toBeTruthy() + }) + + test('Delete app with abi', async () => { + const { app } = await factory.create({ + deployTimeParams: { + UPDATABLE: 0, + DELETABLE: 1, + VALUE: 1, + }, + }) + + const call = await app.send.delete({ + method: 'delete_abi', + args: ['string_io'], + }) + + invariant(call.return) + expect(call.return).toBe('string_io') + }) + + test('Construct transaction with boxes', async () => { + const { client } = await deploy() + + const call = await client.transactions.call({ + method: 'call_abi', + args: ['test'], + boxReferences: [{ appId: 0n, name: '1' }], + }) + + const encoder = new TextEncoder() + expect(call.transactions[0].boxes).toEqual([{ appIndex: 0, name: encoder.encode('1') }]) + + const call2 = await client.transactions.call({ + method: 'call_abi', + args: ['test'], + boxReferences: ['1'], + }) + + expect(call2.transactions[0].boxes).toEqual([{ appIndex: 0, name: encoder.encode('1') }]) + }) + + test('Construct transaction with abi encoding including transaction', async () => { + const { algorand, testAccount } = localnet.context + const txn = await algorand.transactions.payment({ + sender: testAccount.addr, + receiver: testAccount.addr, + amount: algokit.microAlgo(Math.ceil(Math.random() * 10000)), + }) + const { client } = await deploy() + + const result = await client.send.call({ + method: 'call_abi_txn', + args: [txn, 'test'], + }) + + invariant(result.confirmations) + invariant(result.confirmations[1]) + expect(result.transactions.length).toBe(2) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const returnValue = AppManager.getABIReturn(result.confirmations[1], getArc56Method('call_abi_txn', client.appSpec)) + expect(result.return).toBe(`Sent ${txn.amount}. test`) + expect(returnValue?.returnValue).toBe(result.return) + }) + + test('Sign all transactions in group with abi call with transaction arg', async () => { + const { algorand, testAccount } = localnet.context + const txn = await algorand.transactions.payment({ + sender: testAccount.addr, + receiver: testAccount.addr, + amount: algokit.microAlgo(Math.ceil(Math.random() * 10000)), + }) + const { client } = await deploy() + + let indexes: number[] = [] + const signer: TransactionSigner = (group, indxs) => { + indexes = indxs + return testAccount.signer(group, indexes) + } + + await client.send.call({ + method: 'call_abi_txn', + args: [txn, 'test'], + sender: testAccount.addr, + signer, + }) + + expect(indexes).toEqual([0, 1]) + }) + + test('Sign transaction in group with different signer if provided', async () => { + const { algorand, generateAccount } = localnet.context + const signer = await generateAccount({ initialFunds: (1).algo() }) + const txn = await algorand.transactions.payment({ + sender: signer.addr, + receiver: signer.addr, + amount: algokit.microAlgo(Math.ceil(Math.random() * 10000)), + }) + const { client } = await deploy() + + await client.send.call({ + method: 'call_abi_txn', + args: [{ txn, signer: signer.signer }, 'test'], + }) + }) + + test('Construct transaction with abi encoding including foreign references not in signature', async () => { + const { testAccount } = localnet.context + const { client } = await deploy() + + const result = await client.send.call({ + method: 'call_abi_foreign_refs', + appReferences: [345n], + accountReferences: [testAccount.addr], + assetReferences: [567n], + }) + + invariant(result.confirmations) + invariant(result.confirmations[0]) + expect(result.transactions.length).toBe(1) + const expectedReturnValue = AppManager.getABIReturn(result.confirmations[0], getArc56Method('call_abi_foreign_refs', client.appSpec)) + const testAccountPublicKey = algosdk.decodeAddress(testAccount.addr).publicKey + expect(result.return).toBe(`App: 345, Asset: 567, Account: ${testAccountPublicKey[0]}:${testAccountPublicKey[1]}`) + expect(expectedReturnValue?.returnValue).toBe(result.return) + }) + + describe('Errors', () => { + const logging = algoKitLogCaptureFixture() + beforeEach(logging.beforeEach) + afterEach(logging.afterEach) + + test('Export and import of source map works', async () => { + const { algorand, testAccount } = localnet.context + const { client, app } = await deploy() + + const oldSourceMaps = client.exportSourceMaps() + const newClient = algorand.client.getAppClientById({ + appId: app.appId, + defaultSender: testAccount.addr, + appSpec, + }) + + try { + await newClient.send.call({ + method: 'error', + }) + invariant(false) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e: any) { + expect(e.stack).toContain('assert failed') + } + + newClient.importSourceMaps(JSON.parse(JSON.stringify(oldSourceMaps))) + + try { + await newClient.send.call({ + method: 'error', + }) + invariant(false) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e: any) { + expect(e.stack).toMatchInlineSnapshot(` + "// error + error_7: + proto 0 0 + intc_0 // 0 + // Deliberate error + assert <--- Error + retsub + + // create + create_8:" + `) + expect(e.led).toMatchObject({ + pc: 885, + msg: 'assert failed pc=885', + }) + expect(e.led.txId.length).toBe(52) + } + }) + + test('Display nice error messages when there is a logic error', async () => { + const { testAccount } = localnet.context + const { client, app } = await deploy() + + try { + await client.send.call({ + method: 'error', + }) + invariant(false) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e: any) { + expect(e.led).toMatchObject({ + pc: 885, + msg: 'assert failed pc=885', + }) + expect(e.led.txId.length).toBe(52) + expect(e.stack).toMatchInlineSnapshot(` + "// error + error_7: + proto 0 0 + intc_0 // 0 + // Deliberate error + assert <--- Error + retsub + + // create + create_8:" + `) + expect(e.led.traces.length).toBe(1) + expect( + logging.testLogger.getLogSnapshot({ + accounts: [testAccount], + transactions: app.operationPerformed === 'create' ? [app.transaction, e.led.txId] : [], + apps: [app.appId], + }), + ).toMatchSnapshot() + } + }) + }) + + test('Fund app account', async () => { + const { testAccount } = localnet.context + const fundAmount = algokit.microAlgo(200_000) + const { client, app } = await deploy() + + const result = await client.fundAppAccount({ + amount: fundAmount, + }) + + expect(result.transaction.amount).toBe(fundAmount.microAlgo) + expect(result.transaction.type).toBe(TransactionType.pay) + expect(algosdk.encodeAddress(result.transaction.to.publicKey)).toBe(app.appAddress) + expect(algosdk.encodeAddress(result.transaction.from.publicKey)).toBe(testAccount.addr) + invariant(result.confirmation) + expect(result.confirmation.confirmedRound).toBeGreaterThan(0) + }) + + test('Retrieve state', async () => { + const { testAccount } = localnet.context + const { client } = await deploy() + + await client.send.call({ method: 'set_global', args: [1, 2, 'asdf', new Uint8Array([1, 2, 3, 4])] }) + const globalState = await client.getGlobalState() + + invariant(globalState.int1) + invariant(globalState.int2) + invariant(globalState.bytes1) + invariant(globalState.bytes2) + invariant('valueRaw' in globalState.bytes2) + expect(Object.keys(globalState).sort()).toEqual(['bytes1', 'bytes2', 'int1', 'int2', 'value']) + expect(globalState.int1.value).toBe(1n) + expect(globalState.int2.value).toBe(2n) + expect(globalState.bytes1.value).toBe('asdf') + expect(globalState.bytes2.valueRaw).toEqual(new Uint8Array([1, 2, 3, 4])) + + await client.send.optIn({ method: 'opt_in' }) + await client.send.call({ method: 'set_local', args: [1, 2, 'asdf', new Uint8Array([1, 2, 3, 4])] }) + const localState = await client.getLocalState(testAccount.addr) + + invariant(localState.local_int1) + invariant(localState.local_int2) + invariant(localState.local_bytes1) + invariant(localState.local_bytes2) + invariant('valueRaw' in localState.local_bytes2) + expect(Object.keys(localState).sort()).toEqual(['local_bytes1', 'local_bytes2', 'local_int1', 'local_int2']) + expect(localState.local_int1.value).toBe(1n) + expect(localState.local_int2.value).toBe(2n) + expect(localState.local_bytes1.value).toBe('asdf') + expect(localState.local_bytes2.valueRaw).toEqual(new Uint8Array([1, 2, 3, 4])) + + const boxName1 = new Uint8Array([0, 0, 0, 1]) + const boxName1Base64 = Buffer.from(boxName1).toString('base64') + const boxName2 = new Uint8Array([0, 0, 0, 2]) + const boxName2Base64 = Buffer.from(boxName2).toString('base64') + await client.fundAppAccount({ amount: algokit.algo(1) }) + await client.send.call({ + method: 'set_box', + args: [boxName1, 'value1'], + boxReferences: [boxName1], + }) + await client.send.call({ + method: 'set_box', + args: [boxName2, 'value2'], + boxReferences: [boxName2], + }) + + const boxValues = await client.getBoxValues() + const box1Value = await client.getBoxValue(boxName1) + expect(boxValues.map((b) => b.name.nameBase64).sort()).toEqual([boxName1Base64, boxName2Base64].sort()) + const box1 = boxValues.find((b) => b.name.nameBase64 === boxName1Base64) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + expect(box1!.value).toEqual(new Uint8Array(Buffer.from('value1'))) + expect(box1Value).toEqual(box1?.value) + const box2 = boxValues.find((b) => b.name.nameBase64 === boxName2Base64) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + expect(box2!.value).toEqual(new Uint8Array(Buffer.from('value2'))) + + const expectedValue = 1234524352 + await client.send.call({ + method: 'set_box', + args: [boxName1, new ABIUintType(32).encode(expectedValue)], + boxReferences: [boxName1], + }) + const boxes = await client.getBoxValuesFromABIType(new ABIUintType(32), (n) => n.nameBase64 === boxName1Base64) + const box1AbiValue = await client.getBoxValueFromABIType(boxName1, new ABIUintType(32)) + expect(boxes.length).toBe(1) + const [value] = boxes + expect(Number(value.value)).toBe(expectedValue) + expect(Number(box1AbiValue)).toBe(expectedValue) + }) + + describe('Call ABI methods with default arguments', () => { + test('from const', async () => { + await testAbiWithDefaultArgMethod('default_value(string)string', 'defined value', 'defined value', 'default value') + }) + /* + todo: This needs to be supported by ARC-56 + test('from abi method', async () => { + await testAbiWithDefaultArgMethod('default_value_from_abi(string)string', 'defined value', 'ABI, defined value', 'ABI, default value') + }) + test('from global state', async () => { + const globalInt1 = 456n + + await testAbiWithDefaultArgMethod('default_value_from_global_state(uint64)uint64', 123, 123n, globalInt1, async (client) => { + await client.send.call({ method: 'set_global', args: [globalInt1, 2, 'asdf', new Uint8Array([1, 2, 3, 4])] }) + }) + }) + test('from local state', async () => { + const localBytes1 = 'bananas' + await testAbiWithDefaultArgMethod( + 'default_value_from_local_state(string)string', + 'defined value', + 'Local state, defined value', + `Local state, ${localBytes1}`, + async (client) => { + await client.send.optIn({ method: 'opt_in' }) + await client.send.call({ method: 'set_local', args: [1, 2, localBytes1, new Uint8Array([1, 2, 3, 4])] }) + }, + ) + }) + */ + + async function testAbiWithDefaultArgMethod( + methodSignature: string, + definedValue: TArg, + definedValueReturnValue: TResult, + defaultValueReturnValue: TResult, + setup?: (client: AppClient) => Promise, + ) { + const { client } = await deploy() + + await setup?.(client) + + const definedValueResult = await client.send.call({ + method: methodSignature, + args: [definedValue], + }) + expect(definedValueResult.return).toBe(definedValueReturnValue) + const defaultValueResult = await client.send.call({ + method: methodSignature, + args: [undefined], + }) + expect(defaultValueResult.return).toBe(defaultValueReturnValue) + } + }) +}) diff --git a/src/types/app-factory.ts b/src/types/app-factory.ts new file mode 100644 index 00000000..4818b800 --- /dev/null +++ b/src/types/app-factory.ts @@ -0,0 +1,516 @@ +import algosdk from 'algosdk' +import { AlgorandClientInterface } from './algorand-client-interface' +import { + AppCompilationResult, + AppReturn, + DELETABLE_TEMPLATE_NAME, + SendAppTransactionResult, + TealTemplateParams, + UPDATABLE_TEMPLATE_NAME, +} from './app' +import { ABIStruct, Arc56Contract, Arc56Method, getArc56Method, getArc56ReturnValue } from './app-arc56' +import { + AppClient, + AppClientBareCallParams, + AppClientCompilationParams, + AppClientMethodCallParams, + AppClientParams, + AppSourceMaps, + ResolveAppClientByCreatorAndName, +} from './app-client' +import { + AppDeployParams, + DeployAppDeleteMethodCall, + DeployAppDeleteParams, + DeployAppUpdateMethodCall, + DeployAppUpdateParams, +} from './app-deployer' +import { AppSpec } from './app-spec' +import { AppCreateMethodCall, AppCreateParams } from './composer' +import { Expand } from './expand' +import { ExecuteParams } from './transaction' +import SourceMap = algosdk.SourceMap +import OnApplicationComplete = algosdk.OnApplicationComplete +import ABIValue = algosdk.ABIValue + +/** Parameters to create an app client */ +export interface AppFactoryParams { + /** The ARC-56 or ARC-32 application spec as either: + * * Parsed JSON ARC-56 `Contract` + * * Parsed JSON ARC-32 `AppSpec` + * * Raw JSON string (in either ARC-56 or ARC-32 format) + */ + appSpec: Arc56Contract | AppSpec | string + + /** `AlgorandClient` instance */ + algorand: AlgorandClientInterface + + /** + * Optional override for the app name; used for on-chain metadata and lookups. + * Defaults to the ARC-32/ARC-56 app spec name. + */ + appName?: string + + /** Optional address to use for the account to use as the default sender for calls. */ + defaultSender?: string + + /** The version of app that is / will be deployed; defaults to 1.0 */ + version?: string + + /** + * Whether or not the contract should have deploy-time immutability control set, undefined = ignore. + * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + * + * Useful if you want to vend multiple contracts from the same factory without specifying this value + * for each call. + */ + updatable?: boolean + + /** + * Whether or not the contract should have deploy-time permanence control set, undefined = ignore. + * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + * + * Useful if you want to vend multiple contracts from the same factory without specifying this value + * for each call. + */ + deletable?: boolean + + /** + * Optional deploy-time TEAL template replacement parameters. + * If specified here will get used in calls to `deploy` and `create` calls unless overridden in those calls. + * + * Useful if you want to vend multiple contracts from the same factory without specifying this value + * for each call. + */ + deployTimeParams?: TealTemplateParams +} + +/** onComplete parameter for a create app call */ +export type CreateOnComplete = { + onComplete?: Exclude +} + +/** Specifies a schema used for creating an app */ +export type CreateSchema = { + /** The state schema for the app. This is immutable once the app is created. By default uses the ARC32/ARC-56 spec. */ + schema?: { + /** The number of integers saved in global state. */ + globalInts: number + /** The number of byte slices saved in global state. */ + globalByteSlices: number + /** The number of integers saved in local state. */ + localInts: number + /** The number of byte slices saved in local state. */ + localByteSlices: number + } + /** Number of extra pages required for the programs. + * Defaults to the number needed for the programs in this call if not specified. + * This is immutable once the app is created. */ + extraProgramPages?: number +} + +/** Parameters to define a create call for an `AppFactory` */ +export type AppFactoryCreateParams = + | Expand + | Expand + +/** Parameters to define a deployment for an `AppFactory` */ +export type AppFactoryDeployParams = Expand< + Omit & { + /** Create transaction parameters to use if a create needs to be issued as part of deployment */ + createParams?: + | Expand + | Expand + /** Update transaction parameters to use if a create needs to be issued as part of deployment */ + updateParams?: AppClientMethodCallParams | AppClientBareCallParams + /** Delete transaction parameters to use if a create needs to be issued as part of deployment */ + deleteParams?: AppClientMethodCallParams | AppClientBareCallParams + /** + * Whether or not the contract should have deploy-time immutability control set. + * `undefined` = use AppFactory constructor value if set or base it on the app spec. + */ + updatable?: boolean + /** + * Whether or not the contract should have deploy-time permanence control set. + * `undefined` = use AppFactory constructor value if set or base it on the app spec. + */ + deletable?: boolean + } +> + +/** + * ARC-56/ARC-32 app factory that, for a given app spec, allows you to create + * and deploy one or more app instances and to create one or more app clients + * to interact with those (or other) app instances. + */ +export class AppFactory { + private _appSpec: Arc56Contract + private _appName: string + private _algorand: AlgorandClientInterface + private _version: string + private _defaultSender?: string + private _deployTimeParams?: TealTemplateParams + private _updatable?: boolean + private _deletable?: boolean + + private _approvalSourceMap: SourceMap | undefined + private _clearSourceMap: SourceMap | undefined + + private _paramsMethods: ReturnType + + constructor(params: AppFactoryParams) { + this._appSpec = AppClient.normaliseAppSpec(params.appSpec) + this._appName = params.appName ?? this._appSpec.name + this._algorand = params.algorand + this._version = params.version ?? '1.0' + this._defaultSender = params.defaultSender + this._deployTimeParams = params.deployTimeParams + this._updatable = params.updatable + this._deletable = params.deletable + this._paramsMethods = this.getParamsMethods() + } + + /** Get parameters to define create and deploy related calls to the current app */ + get params() { + return this._paramsMethods + } + + /** + * Creates an instance of the app and returns the result of the creation + * transaction and an app client to interact with that app instance. + * + * Performs deploy-time TEAL template placeholder substitutions (if specified). + * @param params The parameters to create the app + * @returns The app client and the result of the creation transaction + */ + public async create(params?: AppFactoryCreateParams) { + const updatable = params?.updatable ?? this._updatable + const deletable = params?.deletable ?? this._deletable + const deployTimeParams = params?.deployTimeParams ?? this._deployTimeParams + const compiled = await this.compile({ deployTimeParams, updatable, deletable }) + const result = await this.handleCallErrors(async () => + params && 'method' in params + ? this.parseMethodCallReturn( + this._algorand.send.appCreateMethodCall(await this.params.create({ ...params, updatable, deletable, deployTimeParams })), + getArc56Method(params.method, this._appSpec), + ) + : { + ...(await this._algorand.send.appCreate(await this.params.bare.create({ ...params, updatable, deletable, deployTimeParams }))), + return: undefined, + }, + ) + return { + app: this.getAppClientById({ + appId: result.appId, + }), + result: { + ...result, + ...(compiled as Partial), + }, + } + } + + /** + * Idempotently deploy (create if not exists, update if changed) an app against the given name for the given creator account, including deploy-time TEAL template placeholder substitutions (if specified). + * + * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`. + * + * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created. + * + * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created. + * @param params The arguments to control the app deployment + * @returns The app client and the result of the deployment + */ + public async deploy(params: AppFactoryDeployParams) { + const updatable = params.updatable ?? this._updatable ?? this.getDeployTimeControl('updatable') + const deletable = params.deletable ?? this._deletable ?? this.getDeployTimeControl('deletable') + const deployTimeParams = params.deployTimeParams ?? this._deployTimeParams + const compiled = await this.compile({ deployTimeParams, updatable, deletable }) + const deployResult = await this._algorand.appDeployer.deploy({ + ...params, + createParams: await (params.createParams && 'method' in params.createParams + ? this.params.create({ ...params.createParams, updatable, deletable, deployTimeParams }) + : this.params.bare.create({ ...params.createParams, updatable, deletable, deployTimeParams })), + updateParams: + params.updateParams && 'method' in params.updateParams + ? this.params.deployUpdate(params.updateParams) + : this.params.bare.deployUpdate(params.updateParams), + deleteParams: + params.deleteParams && 'method' in params.deleteParams + ? this.params.deployDelete(params.deleteParams) + : this.params.bare.deployDelete(params.deleteParams), + metadata: { + name: this._appName, + version: this._version, + updatable, + deletable, + }, + }) + const app = this.getAppClientById({ + appId: deployResult.appId, + }) + const result = { + ...deployResult, + ...compiled, + } + return { + app, + result: { + ...result, + return: + 'return' in result + ? result.operationPerformed === 'update' + ? params.updateParams && 'method' in params.updateParams + ? getArc56ReturnValue(result.return, getArc56Method(params.updateParams.method, this._appSpec), this._appSpec.structs) + : undefined + : params.createParams && 'method' in params.createParams + ? getArc56ReturnValue(result.return, getArc56Method(params.createParams.method, this._appSpec), this._appSpec.structs) + : undefined + : undefined, + deleteReturn: + 'deleteReturn' in result && params.deleteParams && 'method' in params.deleteParams + ? getArc56ReturnValue(result.deleteReturn, getArc56Method(params.deleteParams.method, this._appSpec), this._appSpec.structs) + : undefined, + }, + } + } + + /** + * Returns a new `AppClient` client for an app instance of the given ID. + * + * Automatically populates appName, defaultSender and source maps from the factory + * if not specified in the params. + * @param params The parameters to create the app client + * @returns The `AppClient` + */ + public getAppClientById(params: Expand>) { + return new AppClient({ + ...params, + algorand: this._algorand, + appSpec: this._appSpec, + appName: params.appName ?? this._appName, + defaultSender: params.defaultSender ?? this._defaultSender, + approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap, + clearSourceMap: params.clearSourceMap ?? this._clearSourceMap, + }) + } + + /** + * Returns a new `AppClient` client, resolving the app by creator address and name + * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). + * + * Automatically populates appName, defaultSender and source maps from the factory + * if not specified in the params. + * @param params The parameters to create the app client + * @returns The `AppClient` + */ + public getAppClientByCreatorAddressAndName( + params: Expand & ResolveAppClientByCreatorAndName>, + ) { + return AppClient.fromCreatorAndName({ + ...params, + algorand: this._algorand, + appSpec: this._appSpec, + appName: params.appName ?? this._appName, + defaultSender: params.defaultSender ?? this._defaultSender, + approvalSourceMap: params.approvalSourceMap ?? this._approvalSourceMap, + clearSourceMap: params.clearSourceMap ?? this._clearSourceMap, + }) + } + + /** + * Takes an error that may include a logic error from a call to the current app and re-exposes the + * error to include source code information via the source map and ARC-56 spec. + * @param e The error to parse + * @param isClearStateProgram Whether or not the code was running the clear state program (defaults to approval program) + * @returns The new error, or if there was no logic error or source map then the wrapped error with source details + */ + exposeLogicError(e: Error, isClearStateProgram?: boolean): Error { + return AppClient.exposeLogicError(e, this._appSpec, { + isClearStateProgram, + approvalSourceMap: this._approvalSourceMap, + clearSourceMap: this._clearSourceMap, + }) + } + + /** + * Export the current source maps for the app. + * @returns The source maps + */ + exportSourceMaps(): AppSourceMaps { + if (!this._approvalSourceMap || !this._clearSourceMap) { + throw new Error( + "Unable to export source maps; they haven't been loaded into this client - you need to call create, update, or deploy first", + ) + } + + return { + approvalSourceMap: this._approvalSourceMap, + clearSourceMap: this._clearSourceMap, + } + } + + /** + * Import source maps for the app. + * @param sourceMaps The source maps to import + */ + importSourceMaps(sourceMaps: AppSourceMaps) { + this._approvalSourceMap = new SourceMap(sourceMaps.approvalSourceMap) + this._clearSourceMap = new SourceMap(sourceMaps.clearSourceMap) + } + + private getDeployTimeControl(control: 'updatable' | 'deletable'): boolean | undefined { + const approval = this._appSpec.source?.approval ? Buffer.from(this._appSpec.source.approval, 'base64').toString('utf-8') : undefined + // variable not present, so unknown control value + if (!approval || !approval.includes(control === 'updatable' ? UPDATABLE_TEMPLATE_NAME : DELETABLE_TEMPLATE_NAME)) return undefined + + // A call is present and configured + return ( + this._appSpec.bareActions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication') || + Object.values(this._appSpec.methods).some((c) => + c.actions.call.includes(control === 'updatable' ? 'UpdateApplication' : 'DeleteApplication'), + ) + ) + } + + private getParamsMethods() { + return { + /** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */ + create: async (params: Expand) => { + return this.getABIParams( + { + ...params, + deployTimeParams: params.deployTimeParams ?? this._deployTimeParams, + schema: params.schema ?? { + globalByteSlices: this._appSpec.state.schema.global.bytes, + globalInts: this._appSpec.state.schema.global.ints, + localByteSlices: this._appSpec.state.schema.local.bytes, + localInts: this._appSpec.state.schema.local.ints, + }, + ...(await this.compile({ ...params, deployTimeParams: params.deployTimeParams ?? this._deployTimeParams })), + }, + params.onComplete ?? OnApplicationComplete.NoOpOC, + ) satisfies AppCreateMethodCall + }, + /** Return params for a deployment update ABI call */ + deployUpdate: (params: Expand) => { + return this.getABIParams(params, OnApplicationComplete.UpdateApplicationOC) satisfies DeployAppUpdateMethodCall + }, + /** Return params for a deployment delete ABI call */ + deployDelete: (params: AppClientMethodCallParams) => { + return this.getABIParams(params, OnApplicationComplete.DeleteApplicationOC) satisfies DeployAppDeleteMethodCall + }, + bare: { + /** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */ + create: async (params?: Expand) => { + return this.getBareParams( + { + ...params, + deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams, + schema: params?.schema ?? { + globalByteSlices: this._appSpec.state.schema.global.bytes, + globalInts: this._appSpec.state.schema.global.ints, + localByteSlices: this._appSpec.state.schema.local.bytes, + localInts: this._appSpec.state.schema.local.ints, + }, + ...(await this.compile({ ...params, deployTimeParams: params?.deployTimeParams ?? this._deployTimeParams })), + }, + params?.onComplete ?? OnApplicationComplete.NoOpOC, + ) satisfies AppCreateParams + }, + /** Return params for a deployment update bare call */ + deployUpdate: (params?: Expand) => { + return this.getBareParams(params, OnApplicationComplete.UpdateApplicationOC) satisfies DeployAppUpdateParams + }, + /** Return params for a deployment delete bare call */ + deployDelete: (params?: AppClientBareCallParams) => { + return this.getBareParams(params, OnApplicationComplete.DeleteApplicationOC) satisfies DeployAppDeleteParams + }, + }, + } + } + + /** Make the given call and catch any errors, augmenting with debugging information before re-throwing. */ + private async handleCallErrors(call: () => Promise) { + try { + return await call() + } catch (e) { + throw this.exposeLogicError(e as Error) + } + } + + /** + * Compiles the approval and clear state programs (if TEAL templates provided), + * performing any provided deploy-time parameter replacement and stores + * the source maps. + * + * If no TEAL templates provided it will use any byte code provided in the app spec. + * + * Will store any generated source maps for later use in debugging. + */ + private async compile(compilation?: AppClientCompilationParams) { + const result = await AppClient.compile(this._appSpec, this._algorand.app, compilation) + + if (result.compiledApproval) { + this._approvalSourceMap = result.compiledApproval.sourceMap + } + if (result.compiledClear) { + this._clearSourceMap = result.compiledClear.sourceMap + } + + return result + } + + private getBareParams( + params: TParams, + onComplete: TOnComplete, + ) { + return { + ...params, + sender: this.getSender(params?.sender), + onComplete, + } + } + + private getABIParams< + TParams extends { method: string; sender?: string; args?: AppClientMethodCallParams['args'] }, + TOnComplete extends OnApplicationComplete, + >(params: TParams, onComplete: TOnComplete) { + return { + ...params, + sender: this.getSender(params.sender), + method: getArc56Method(params.method, this._appSpec), + args: AppClient.getABIArgsWithDefaultValues(params.method, params.args, this._appSpec), + onComplete, + } + } + + /** Returns the sender for a call, using the `defaultSender` + * if none provided and throws an error if neither provided */ + private getSender(sender: string | undefined): string { + if (!sender && !this._defaultSender) { + throw new Error(`No sender provided and no default sender present in app client for call to app ${this._appName}`) + } + return sender ?? this._defaultSender! + } + + /** + * Checks for decode errors on the SendAppTransactionResult and maps the return value to the specified type + * on the ARC-56 method. + * + * If the return type is a struct then the struct will be returned. + * + * @param result The SendAppTransactionResult to be mapped + * @param method The method that was called + * @returns The smart contract response with an updated return value + */ + async parseMethodCallReturn< + TReturn extends Uint8Array | ABIValue | ABIStruct | undefined, + TResult extends SendAppTransactionResult = SendAppTransactionResult, + >(result: Promise | TResult, method: Arc56Method): Promise & AppReturn>> { + const resultValue = await result + return { ...resultValue, return: getArc56ReturnValue(resultValue.return, method, this._appSpec.structs) } as unknown as Expand< + Omit & AppReturn + > + } +} diff --git a/src/types/app-manager.ts b/src/types/app-manager.ts index 8b4da200..5eeaced9 100644 --- a/src/types/app-manager.ts +++ b/src/types/app-manager.ts @@ -5,7 +5,6 @@ import { DELETABLE_TEMPLATE_NAME, UPDATABLE_TEMPLATE_NAME, type ABIReturn, - type AppDeployMetadata, type AppState, type CompiledTeal, type TealTemplateParams, @@ -132,6 +131,7 @@ export class AppManager { sourceMap: new algosdk.SourceMap(compiled['sourcemap']), } this._compilationResults[tealCode] = result + return result } @@ -152,7 +152,7 @@ export class AppManager { async compileTealTemplate( tealTemplateCode: string, templateParams?: TealTemplateParams, - deploymentMetadata?: AppDeployMetadata, + deploymentMetadata?: { updatable?: boolean; deletable?: boolean }, ): Promise { let tealCode = AppManager.stripTealComments(tealTemplateCode) @@ -203,6 +203,16 @@ export class AppManager { } } + /** + * Returns the current global state values for the given app ID and account address + * + * @param appId The ID of the app to return global state for + * @returns The current global state for the given app + */ + public async getGlobalState(appId: bigint) { + return (await this.getById(appId)).globalState + } + /** * Returns the current local state values for the given app ID and account address * @@ -335,7 +345,7 @@ export class AppManager { stateValues[key] = { keyRaw, keyBase64, - value, + value: BigInt(value), } break } diff --git a/src/types/app-spec.ts b/src/types/app-spec.ts index 67c27863..b45c20aa 100644 --- a/src/types/app-spec.ts +++ b/src/types/app-spec.ts @@ -1,6 +1,126 @@ import algosdk from 'algosdk' +import { Arc56Contract, Method as Arc56Method, StorageKey, StructFields, getABIEncodedValue } from './app-arc56' import ABIContractParams = algosdk.ABIContractParams import ABIMethodParams = algosdk.ABIMethodParams +import ABIMethod = algosdk.ABIMethod + +export function arc32ToArc56(appSpec: AppSpec): Arc56Contract { + const arc32Structs = Object.values(appSpec.hints).flatMap((hint) => Object.entries(hint.structs ?? {})) + const structs = Object.fromEntries( + arc32Structs.map(([_, struct]) => { + const fields = Object.fromEntries(struct.elements.map((e) => [e[0], e[1]])) + return [struct.name, fields satisfies StructFields] + }), + ) satisfies { [structName: string]: StructFields } + const hint = (m: ABIMethodParams) => appSpec.hints[new ABIMethod(m).getSignature()] as Hint | undefined + const actions = (m: ABIMethodParams, type: 'CREATE' | 'CALL') => { + // eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain + return hint(m)?.call_config !== undefined ? callConfigToActions(hint(m)?.call_config!, type) : [] + } + const bareActions = (type: 'CREATE' | 'CALL') => { + return callConfigToActions(appSpec.bare_call_config, type) + } + const callConfigToActions = (c: CallConfig, type: 'CREATE' | 'CALL') => { + const actions: ('NoOp' | 'OptIn' | 'CloseOut' | 'ClearState' | 'UpdateApplication' | 'DeleteApplication')[] = [] + if (c.close_out && ['ALL', type].includes(c.close_out)) actions.push('CloseOut') + if (c.delete_application && ['ALL', type].includes(c.delete_application)) actions.push('DeleteApplication') + if (c.no_op && ['ALL', type].includes(c.no_op)) actions.push('NoOp') + if (c.opt_in && ['ALL', type].includes(c.opt_in)) actions.push('OptIn') + if (c.update_application && ['ALL', type].includes(c.update_application)) actions.push('UpdateApplication') + return actions + } + + return { + arcs: [], + name: appSpec.contract.name, + desc: appSpec.contract.desc, + structs: structs, + methods: appSpec.contract.methods.map( + (m) => + ({ + name: m.name, + desc: m.desc, + args: m.args.map((a) => ({ + name: a.name, + type: a.type, + desc: a.desc, + struct: a.name ? hint(m)?.structs?.[a.name]?.name : undefined, + defaultValue: + a.name && hint(m)?.default_arguments?.[a.name].source === 'constant' + ? Buffer.from(getABIEncodedValue(hint(m)!.default_arguments![a.name].data as string | number, a.type, structs)).toString( + 'base64', + ) + : undefined, + })), + returns: { + type: m.returns.type, + desc: m.returns.desc, + struct: hint(m)?.structs?.output?.name, + }, + events: [], + readonly: hint(m)?.read_only, + actions: { + create: actions(m, 'CREATE') as Arc56Method['actions']['create'], + call: actions(m, 'CALL'), + }, + }) satisfies Arc56Method, + ), + state: { + schema: { + global: { + ints: appSpec.state.global.num_uints, + bytes: appSpec.state.global.num_byte_slices, + }, + local: { + ints: appSpec.state.local.num_uints, + bytes: appSpec.state.local.num_byte_slices, + }, + }, + keys: { + global: Object.fromEntries( + Object.entries(appSpec.schema.global.declared).map((s) => [ + s[0], + { + key: Buffer.from(s[1].key, 'utf-8').toString('base64'), + keyType: 'bytes', + valueType: s[1].type, + desc: s[1].descr, + } satisfies StorageKey, + ]), + ), + local: Object.fromEntries( + Object.entries(appSpec.schema.local.declared).map((s) => [ + s[0], + { + key: Buffer.from(s[1].key, 'utf-8').toString('base64'), + keyType: 'bytes', + valueType: s[1].type, + desc: s[1].descr, + } satisfies StorageKey, + ]), + ), + box: {}, + }, + maps: { + global: {}, + local: {}, + box: {}, + }, + }, + source: appSpec.source, + bareActions: { + create: bareActions('CREATE') as unknown as Arc56Contract['bareActions']['create'], + call: bareActions('CALL'), + }, + byteCode: undefined, + compilerInfo: undefined, + events: undefined, + networks: undefined, + scratchVariables: undefined, + sourceInfo: undefined, + templateVariables: undefined, + } satisfies Arc56Contract +} /** An ARC-0032 Application Specification see https://github.com/algorandfoundation/ARCs/pull/150 */ export interface AppSpec { diff --git a/src/types/app.ts b/src/types/app.ts index 8af17bd8..e512b0d7 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -329,7 +329,7 @@ export interface AppDeploymentParams deleteArgs?: AppCallArgs } -/** The result of compiling the approval and clear TEAL for an app */ +/** The result of compiling the approval and clear state TEAL programs for an app */ export interface AppCompilationResult { /** The compilation result of approval */ compiledApproval: CompiledTeal @@ -337,6 +337,11 @@ export interface AppCompilationResult { compiledClear: CompiledTeal } +export type AppReturn = { + /** The ABI method call return value */ + return?: TReturn +} + /** Result from sending a single app transaction. */ export type SendAppTransactionResult = Expand< SendSingleTransactionResult & { @@ -362,7 +367,7 @@ export type SendAppCreateTransactionResult = Expand< export interface AppState { [key: string]: | { - value: number | bigint + value: bigint keyRaw: Uint8Array keyBase64: string } diff --git a/src/types/asset-manager.ts b/src/types/asset-manager.ts index 44f0f17c..6a91551c 100644 --- a/src/types/asset-manager.ts +++ b/src/types/asset-manager.ts @@ -2,7 +2,8 @@ import algosdk from 'algosdk' import { Config } from '../config' import { chunkArray } from '../util' import { AccountAssetInformation, TransactionSignerAccount } from './account' -import AlgoKitComposer, { CommonTransactionParams, ExecuteParams, MAX_TRANSACTION_GROUP_SIZE } from './composer' +import AlgoKitComposer, { CommonTransactionParams, MAX_TRANSACTION_GROUP_SIZE } from './composer' +import { ExecuteParams } from './transaction' import AssetModel = algosdk.modelsv2.Asset /** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */ @@ -298,7 +299,6 @@ export class AssetManager { ): Promise { const results: BulkAssetOptInOutResult[] = [] - const params = await this._algod.getTransactionParams().do() const sender = typeof account === 'string' ? account : account.addr for (const assetGroup of chunkArray(assetIds, MAX_TRANSACTION_GROUP_SIZE)) { diff --git a/src/types/client-manager.ts b/src/types/client-manager.ts index 8258d599..67a094ae 100644 --- a/src/types/client-manager.ts +++ b/src/types/client-manager.ts @@ -1,17 +1,12 @@ import algosdk from 'algosdk' import { SuggestedParamsWithMinFee } from 'algosdk/dist/types/types/transactions/base' import { AlgoHttpClientWithRetry } from './algo-http-client-with-retry' -import { AppLookup } from './app' -import { - AppDetails, - AppDetailsBase, - AppSpecAppDetailsBase, - ApplicationClient, - ResolveAppByCreatorAndNameBase, - ResolveAppByIdBase, -} from './app-client' +import { AlgorandClientInterface } from './algorand-client-interface' +import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client' +import { AppFactory, AppFactoryParams } from './app-factory' import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client' -import { AlgoClientConfig, AlgoConfig, genesisIdIsLocalNet } from './network-client' +import { Expand } from './expand' +import { AlgoClientConfig, AlgoConfig, NetworkDetails, genesisIdIsLocalNet } from './network-client' import Kmd = algosdk.Kmd import Indexer = algosdk.Indexer import Algodv2 = algosdk.Algodv2 @@ -27,25 +22,12 @@ export interface AlgoSdkClients { kmd?: algosdk.Kmd } -/** Details of the current network. */ -export interface NetworkDetails { - /** Whether or not the network is TestNet. */ - isTestNet: boolean - /** Whether or not the network is MainNet. */ - isMainNet: boolean - /** Whether or not the network is LocalNet. */ - isLocalNet: boolean - /** The genesis ID of the current network. */ - genesisId: string - /** The base64 genesis hash of the current network. */ - genesisHash: string -} - /** Exposes access to various API clients. */ export class ClientManager { private _algod: algosdk.Algodv2 private _indexer?: algosdk.Indexer private _kmd?: algosdk.Kmd + private _algorand?: AlgorandClientInterface /** * algosdk clients or config for interacting with the official Algorand APIs. @@ -67,7 +49,7 @@ export class ClientManager { * const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig }) * ``` */ - constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients) { + constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface) { const _clients = 'algod' in clientsOrConfig ? clientsOrConfig @@ -79,6 +61,7 @@ export class ClientManager { this._algod = _clients.algod this._indexer = _clients.indexer this._kmd = _clients.kmd + this._algorand = algorandClient } /** Returns an algosdk Algod API client. */ @@ -201,37 +184,105 @@ export class ClientManager { } /** - * Returns a new `ApplicationClient` client, resolving the app by creator address and name. - * @param details The details to resolve the app by creator address and name - * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction. - * @returns The `ApplicationClient` + * Returns a new `AppFactory` client + * @example Basic example + * ```typescript + * const factory = algorand.client.getAppFactory({ + * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\/}', + * }) + * ``` + * @example Advanced example + * ```typescript + * const factory = algorand.client.getAppFactory({ + * appSpec: parsedAppSpec_AppSpec_or_Arc56Contract, + * defaultSender: "SENDERADDRESS", + * appName: "OverriddenAppName", + * version: "2.0.0", + * updatable: true, + * deletable: false, + * deployTimeParams: { ONE: 1, TWO: 'value' } + * }) + * ``` */ - public getAppClientByCreatorAndName(details: AppClientByCreatorAndNameDetails, cachedAppLookup?: AppLookup) { - return new ApplicationClient( - { ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, - this._algod, - ) + public getAppFactory(params: Expand>) { + if (!this._algorand) { + throw new Error('Attempt to get app factory from a ClientManager without an Algorand client') + } + + return new AppFactory({ ...params, algorand: this._algorand }) } /** - * Returns a new `ApplicationClient` client, resolving the app by app ID. - * @param details The details to resolve the app by ID - * @returns The `ApplicationClient` + * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app. + * This method resolves the app ID by looking up the creator address and name + * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). + * @param params The parameters to create the app client + * @example Basic + * const appClient = algorand.client.getAppClientByCreatorAndName({ + * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}', + * // appId resolved by looking for app ID of named app by this creator + * creatorAddress: 'CREATORADDRESS', + * }) + * @returns The `AppClient` */ - public getAppClientById(details: AppClientByIdDetails) { - return new ApplicationClient({ ...details, resolveBy: 'id' }, this._algod) + public getAppClientByCreatorAndName(params: Expand>) { + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + + return AppClient.fromCreatorAndName({ + ...params, + algorand: this._algorand, + }) + } + + /** + * Returns a new `AppClient` client for managing calls and state for an ARC-32/ARC-56 app. + * @param params The parameters to create the app client + * @example Basic + * const appClient = algorand.client.getAppClientById({ + * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}', + * appId: 12345n, + * }) + * @returns The `AppClient` + */ + public getAppClientById(params: Expand>) { + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + return new AppClient({ ...params, algorand: this._algorand }) + } + + /** + * Returns a new `AppClient` client for managing calls and state for an ARC-56 app. + * This method resolves the app ID for the current network based on + * pre-determined network-specific app IDs specified in the ARC-56 app spec. + * + * If no IDs are in the app spec or the network isn't recognised, an error is thrown. + * @param params The parameters to create the app client + * @example Basic + * const appClient = algorand.client.getAppClientByNetwork({ + * appSpec: '{/* ARC-56 or ARC-32 compatible JSON *\}', + * // appId resolved by using ARC-56 spec to find app ID for current network + * }) + * @returns The `AppClient` + */ + public async getAppClientByNetwork(params: Expand>) { + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + return AppClient.fromNetwork({ ...params, algorand: this._algorand }) } /** * Returns a new typed client, resolving the app by creator address and name. * @param typedClient The typed client type to use - * @param details The details to resolve the app by creator address and name - * @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction. - * @example Use name in ARC-32 app spec + * @param params The params to resolve the app by creator address and name + * @example Use name in ARC-32 / ARC-56 app spec * ```typescript * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, { * creatorAddress: "CREATORADDRESS", - * sender: alice, + * defaultSender: alice, * }) * ``` * @example Specify name @@ -239,34 +290,93 @@ export class ClientManager { * const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, { * creatorAddress: "CREATORADDRESS", * name: "contract-name", - * sender: alice, + * defaultSender: alice, * }) * ``` * @returns The typed client instance */ - public getTypedAppClientByCreatorAndName( - typedClient: TypedAppClient, - details: TypedAppClientByCreatorAndNameDetails, - cachedAppLookup?: AppLookup, + public async getTypedAppClientByCreatorAndName>>( + typedClient: TClient, + params: Expand>, ) { - return new typedClient({ ...details, resolveBy: 'creatorAndName', findExistingUsing: cachedAppLookup ?? this.indexer }, this._algod) + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + + return typedClient.fromCreatorAndName({ ...params, algorand: this._algorand }) } /** * Returns a new typed client, resolving the app by app ID. * @param typedClient The typed client type to use - * @param details The details to resolve the app by ID + * @param params The params to resolve the app by ID * @example * ```typescript * const appClient = algorand.client.getTypedAppClientById(MyContractClient, { - * id: 12345, + * appId: 12345n, + * defaultSender: alice, + * }) + * ``` + * @returns The typed client instance + */ + public getTypedAppClientById>>( + typedClient: TClient, + params: Expand>, + ) { + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + + return new typedClient({ ...params, algorand: this._algorand }) + } + + /** + * Returns a new typed client, resolves the app ID for the current network based on + * pre-determined network-specific app IDs specified in the ARC-56 app spec. + * + * If no IDs are in the app spec or the network isn't recognised, an error is thrown. + * @param typedClient The typed client type to use + * @param params The params to resolve the app by network + * @example + * ```typescript + * const appClient = algorand.client.getTypedAppClientByNetwork(MyContractClient, { + * defaultSender: alice, + * }) + * ``` + * @returns The typed client instance + */ + public getTypedAppClientByNetwork>>( + typedClient: TClient, + params?: Expand>, + ) { + if (!this._algorand) { + throw new Error('Attempt to get app client from a ClientManager without an Algorand client') + } + + return typedClient.fromNetwork({ ...params, algorand: this._algorand }) + } + + /** + * Returns a new typed app factory. + * @param typedFactory The typed factory type to use + * @param params The params to resolve the factory by + * @example + * ```typescript + * const appFactory = algorand.client.getTypedAppFactory(MyContractClient, { * sender: alice, * }) * ``` * @returns The typed client instance */ - public getTypedAppClientById(typedClient: TypedAppClient, details: TypedAppClientByIdDetails) { - return new typedClient({ ...details, resolveBy: 'id' }, this._algod) + public getTypedAppFactory( + typedFactory: TypedAppFactory, + params?: Expand>, + ) { + if (!this._algorand) { + throw new Error('Attempt to get app factory from a ClientManager without an Algorand client') + } + + return new typedFactory({ ...params, algorand: this._algorand }) } /** @@ -504,27 +614,14 @@ export class ClientManager { * Interface to identify a typed client that can be used to interact with an application. */ export interface TypedAppClient { - new (details: AppDetails, algod: algosdk.Algodv2): TClient + new (params: Omit): TClient + fromNetwork(params: Omit): Promise + fromCreatorAndName(params: Omit): Promise } /** - * Details to resolve an app client by creator address and name. + * Interface to identify a typed factory that can be used to create and deploy an application. */ -export type AppClientByCreatorAndNameDetails = AppSpecAppDetailsBase & - AppDetailsBase & - Omit - -/** - * Details to resolve a typed app creator address and name. - */ -export type TypedAppClientByCreatorAndNameDetails = AppDetailsBase & Omit - -/** - * Details to resolve an app client by app ID. - */ -export type AppClientByIdDetails = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase - -/** - * Details to resolve a typed app by app ID. - */ -export type TypedAppClientByIdDetails = AppDetailsBase & ResolveAppByIdBase +export interface TypedAppFactory { + new (params: Omit): TClient +} diff --git a/src/types/composer.ts b/src/types/composer.ts index e2cd2c4c..b97e1eb3 100644 --- a/src/types/composer.ts +++ b/src/types/composer.ts @@ -1,19 +1,27 @@ import algosdk from 'algosdk' -import { encodeLease, encodeTransactionNote, sendAtomicTransactionComposer } from '../transaction/transaction' +import { Config } from '../config' +import { simulateAndPersistResponse } from '../debugging' +import { encodeLease, sendAtomicTransactionComposer } from '../transaction/transaction' import { TransactionSignerAccount } from './account' import { AlgoAmount } from './amount' -import { APP_PAGE_MAX_SIZE } from './app' +import { ABIReturn, APP_PAGE_MAX_SIZE } from './app' import { AppManager, BoxIdentifier, BoxReference } from './app-manager' import { Expand } from './expand' import { genesisIdIsLocalNet } from './network-client' -import { Arc2TransactionNote, SendAtomicTransactionComposerResults } from './transaction' +import { Arc2TransactionNote, ExecuteParams, SendAtomicTransactionComposerResults } from './transaction' import Transaction = algosdk.Transaction +import TransactionSigner = algosdk.TransactionSigner import TransactionWithSigner = algosdk.TransactionWithSigner import isTransactionWithSigner = algosdk.isTransactionWithSigner import encodeAddress = algosdk.encodeAddress +import SimulateResponse = algosdk.modelsv2.SimulateResponse +import modelsv2 = algosdk.modelsv2 export const MAX_TRANSACTION_GROUP_SIZE = 16 +/** Options to control a simulate request */ +export type SimulateOptions = Expand[0], 'txnGroups'>> + /** Common parameters for defining a transaction. */ export type CommonTransactionParams = { /** The address of the account sending the transaction. */ @@ -316,7 +324,7 @@ export type OnlineKeyRegistrationParams = CommonTransactionParams & { export type CommonAppCallParams = CommonTransactionParams & { /** ID of the application; 0 if the application is being created. */ appId: bigint - /** The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. */ + /** The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. */ onComplete?: algosdk.OnApplicationComplete /** Any [arguments to pass to the smart contract call](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#argument-passing). */ args?: Uint8Array[] @@ -352,7 +360,9 @@ export type AppCreateParams = Expand< /** The number of byte slices saved in local state. */ localByteSlices: number } - /** Number of extra pages required for the programs. This is immutable once the app is created. */ + /** Number of extra pages required for the programs. + * Defaults to the number needed for the programs in this call if not specified. + * This is immutable once the app is created. */ extraProgramPages?: number } > @@ -372,6 +382,14 @@ export type AppCallParams = CommonAppCallParams & { onComplete?: Exclude } +/** Parameters to define a method call transaction. */ +export type AppMethodCallParams = CommonAppCallParams & { + onComplete?: Exclude< + algosdk.OnApplicationComplete, + algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.ClearStateOC + > +} + /** Parameters to define an application delete call transaction. */ export type AppDeleteParams = CommonAppCallParams & { onComplete?: algosdk.OnApplicationComplete.DeleteApplicationOC @@ -380,7 +398,16 @@ export type AppDeleteParams = CommonAppCallParams & { export type AppCreateMethodCall = AppMethodCall export type AppUpdateMethodCall = AppMethodCall export type AppDeleteMethodCall = AppMethodCall -export type AppCallMethodCall = AppMethodCall +export type AppCallMethodCall = AppMethodCall + +export type AppMethodCallTransactionArgument = + // The following should match the partial `args` types from `AppMethodCall` below + | TransactionWithSigner + | Transaction + | Promise + | AppMethodCall + | AppMethodCall + | AppMethodCall export type AppMethodCall = Expand> & { /** The ABI method to call */ @@ -394,12 +421,13 @@ export type AppMethodCall = Expand> & { */ args?: ( | algosdk.ABIValue + // The following should match the above `AppMethodCallTransactionArgument` type above | TransactionWithSigner | Transaction | Promise | AppMethodCall | AppMethodCall - | AppMethodCall + | AppMethodCall )[] } @@ -418,16 +446,6 @@ type Txn = | { atc: algosdk.AtomicTransactionComposer; type: 'atc' } | ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & { type: 'methodCall' }) -/** Parameters to configure transaction execution. */ -export interface ExecuteParams { - /** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */ - maxRoundsToWaitForConfirmation?: number - /** Whether to suppress log messages from transaction send, default: do not suppress. */ - suppressLog?: boolean - /** Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. */ - populateAppCallResources?: boolean -} - /** Parameters to create an `AlgoKitComposer`. */ export type AlgoKitComposerParams = { /** The algod client to use to get suggestedParams and send the transaction group */ @@ -502,6 +520,22 @@ export default class AlgoKitComposer { this.appManager = params.appManager ?? new AppManager(params.algod) } + /** + * Add a pre-built transaction to the transaction group. + * @param transaction The pre-built transaction + * @param signer Optional signer override for the transaction + * @returns The composer so you can chain method calls + */ + addTransaction(transaction: Transaction, signer?: TransactionSigner): AlgoKitComposer { + this.txns.push({ + txn: transaction, + signer: signer ?? this.getSigner(algosdk.encodeAddress(transaction.from.publicKey)), + type: 'txnWithSigner', + }) + + return this + } + /** * Add a payment transaction to the transaction group. * @param params The payment transaction parameters @@ -738,7 +772,8 @@ export default class AlgoKitComposer { private commonTxnBuildStep(params: CommonTransactionParams, txn: algosdk.Transaction, suggestedParams: algosdk.SuggestedParams) { if (params.lease) txn.addLease(encodeLease(params.lease)!) if (params.rekeyTo) txn.addRekey(params.rekeyTo) - if (params.note) txn.note = encodeTransactionNote(params.note) + const encoder = new TextEncoder() + if (params.note) txn.note = typeof params.note === 'string' ? encoder.encode(params.note) : params.note if (params.firstValidRound) { txn.firstRound = Number(params.firstValidRound) @@ -760,15 +795,15 @@ export default class AlgoKitComposer { } if (params.staticFee !== undefined) { - txn.fee = params.staticFee.microAlgo + txn.fee = Number(params.staticFee.microAlgo) } else { txn.fee = txn.estimateSize() * suggestedParams.fee || algosdk.ALGORAND_MIN_TX_FEE - if (params.extraFee) txn.fee += params.extraFee.microAlgo + if (params.extraFee) txn.fee += Number(params.extraFee.microAlgo) } txn.flatFee = true if (params.maxFee !== undefined && txn.fee > params.maxFee.microAlgo) { - throw Error(`Transaction fee ${txn.fee} is greater than maxFee ${params.maxFee}`) + throw Error(`Transaction fee ${txn.fee} µALGO is greater than maxFee ${params.maxFee}`) } return txn @@ -791,7 +826,12 @@ export default class AlgoKitComposer { return typeof x === 'bigint' || typeof x === 'boolean' || typeof x === 'number' || typeof x === 'string' || x instanceof Uint8Array } - for (const arg of params.args ?? []) { + for (let i = 0; i < (params.args ?? []).length; i++) { + const arg = params.args![i] + if (arg === undefined) { + throw Error(`No value provided for argument ${i + 1} within call to ${params.method.name}`) + } + if (isAbiValue(arg)) { methodArgs.push(arg) continue @@ -1194,7 +1234,7 @@ export default class AlgoKitComposer { return await sendAtomicTransactionComposer( { atc: this.atc, - sendParams: { + executeParams: { suppressLog: params?.suppressLog, maxRoundsToWaitForConfirmation: waitRounds, populateAppCallResources: params?.populateAppCallResources, @@ -1204,6 +1244,50 @@ export default class AlgoKitComposer { ) } + /** + * Compose the atomic transaction group and simulate sending it to the network + * @returns The simulation result + */ + async simulate(options?: SimulateOptions): Promise { + await this.build() + + if (Config.debug && Config.projectRoot && !Config.traceAll) { + // Dump the traces to a file for use with AlgoKit AVM debugger + // Checks for false on traceAll because it should have been already + // executed above + await simulateAndPersistResponse({ + atc: this.atc, + projectRoot: Config.projectRoot, + algod: this.algod, + bufferSizeMb: Config.traceBufferSizeMb, + }) + } + + const { methodResults, simulateResponse } = await this.atc.simulate( + this.algod, + new modelsv2.SimulateRequest({ txnGroups: [], ...options }), + ) + + if (simulateResponse && simulateResponse.txnGroups[0].failedAt) { + const error = new Error( + `Transaction failed at transaction(s) ${simulateResponse.txnGroups[0].failedAt.join(', ')} in the group. ${simulateResponse.txnGroups.find((x) => x.failureMessage)?.failureMessage}`, + ) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ;(error as any).simulateResponse = simulateResponse + throw error + } + + const transactions = this.atc.buildGroup().map((t) => t.txn) + return { + confirmations: simulateResponse.txnGroups[0].txnResults.map((t) => t.txnResult), + transactions: transactions, + txIds: transactions.map((t) => t.txID()), + groupId: Buffer.from(transactions[0].group ?? new Uint8Array()).toString('base64'), + simulateResponse, + returns: methodResults.map((m) => m as ABIReturn), + } + } + static arc2Note(note: Arc2TransactionNote): Uint8Array { const arc2Payload = `${note.dAppName}:${note.format}${typeof note.data === 'string' ? note.data : JSON.stringify(note.data)}` const encoder = new TextEncoder() diff --git a/src/types/debugging.ts b/src/types/debugging.ts index 16cd8c71..20804540 100644 --- a/src/types/debugging.ts +++ b/src/types/debugging.ts @@ -1,5 +1,6 @@ import algosdk from 'algosdk' import { CompiledTeal } from './app' +import { AppManager } from './app-manager' /** * AVM debugger source map format. @@ -144,8 +145,8 @@ export interface PersistSourceMapsParams { sources: PersistSourceMapInput[] /** The root directory of the project. */ projectRoot: string - /** An Algodv2 client to perform the compilation. */ - client: algosdk.Algodv2 + /** An `AppManager` to perform the compilation. */ + appManager: AppManager /** A boolean indicating whether to include the source files in the output. */ withSources?: boolean } diff --git a/src/types/dispenser-client.ts b/src/types/dispenser-client.ts index 04725960..84ecad1a 100644 --- a/src/types/dispenser-client.ts +++ b/src/types/dispenser-client.ts @@ -147,11 +147,11 @@ export class TestNetDispenserApiClient { * * @returns DispenserFundResponse: An object containing the transaction ID and funded amount. */ - async fund(address: string, amount: number): Promise { + async fund(address: string, amount: number | bigint): Promise { const response = await this.processDispenserRequest( this.authToken, `fund/${dispenserAssets[DispenserAssetName.Algo].assetId}`, - { receiver: address, amount: amount, assetID: dispenserAssets[DispenserAssetName.Algo].assetId }, + { receiver: address, amount: Number(amount), assetID: dispenserAssets[DispenserAssetName.Algo].assetId }, 'POST', ) diff --git a/src/types/network-client.ts b/src/types/network-client.ts index 61a091d7..079bccfb 100644 --- a/src/types/network-client.ts +++ b/src/types/network-client.ts @@ -20,6 +20,20 @@ export interface AlgoConfig { kmdConfig?: AlgoClientConfig } +/** Details of the current network. */ +export interface NetworkDetails { + /** Whether or not the network is TestNet. */ + isTestNet: boolean + /** Whether or not the network is MainNet. */ + isMainNet: boolean + /** Whether or not the network is LocalNet. */ + isLocalNet: boolean + /** The genesis ID of the current network. */ + genesisId: string + /** The base64 genesis hash of the current network. */ + genesisHash: string +} + /** * Returns true if the given network genesisId is associated with a LocalNet network. * @param genesisId The network genesis ID diff --git a/src/types/testing.ts b/src/types/testing.ts index 3e597265..de2f577e 100644 --- a/src/types/testing.ts +++ b/src/types/testing.ts @@ -2,8 +2,7 @@ import algosdk from 'algosdk' import { TransactionLogger } from '../testing' import { TestLogger } from '../testing/test-logger' import { AlgoAmount } from '../types/amount' -import { SendTransactionFrom } from '../types/transaction' -import { TransactionSignerAccount } from './account' +import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './account' import AlgorandClient from './algorand-client' import { TransactionLookupResult } from './indexer' import { AlgoConfig } from './network-client' @@ -11,6 +10,7 @@ import Account = algosdk.Account import Algodv2 = algosdk.Algodv2 import Indexer = algosdk.Indexer import Kmd = algosdk.Kmd +import LogicSigAccount = algosdk.LogicSigAccount import Transaction = algosdk.Transaction /** @@ -96,7 +96,7 @@ export interface LogSnapshotConfig { /** Any transaction IDs or transactions to replace the ID for predictably */ transactions?: (string | Transaction)[] /** Any accounts/addresses to replace the address for predictably */ - accounts?: (string | SendTransactionFrom)[] + accounts?: (string | Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount)[] /** Any app IDs to replace predictably */ apps?: (string | number | bigint)[] } diff --git a/src/types/transaction.ts b/src/types/transaction.ts index 60db13f9..8ade2d63 100644 --- a/src/types/transaction.ts +++ b/src/types/transaction.ts @@ -103,7 +103,7 @@ export interface ConfirmedTransactionResults extends SendTransactionResult, Send * * `SigningAccount` - An AlgoKit Utils class that wraps Account to provide support for rekeyed accounts * * `LogicSigAccount` - The in-built `algosdk.LogicSigAccount` type for logic signatures * * `MultisigAccount` - An AlgoKit Utils class that wraps a multisig account and provides mechanisms to get a multisig account - * * `TransactionSignerAccount` - An AlgoKitUtils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address + * * `TransactionSignerAccount` - An AlgoKit Utils class that wraps the in-built `algosdk.TransactionSigner` along with the sender address */ export type SendTransactionFrom = Account | SigningAccount | LogicSigAccount | MultisigAccount | TransactionSignerAccount @@ -130,10 +130,24 @@ export interface TransactionGroupToSend { signer?: SendTransactionFrom } +/** Parameters to configure transaction execution. */ +export interface ExecuteParams { + /** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */ + maxRoundsToWaitForConfirmation?: number + /** Whether to suppress log messages from transaction send, default: do not suppress. */ + suppressLog?: boolean + /** Whether to use simulate to automatically populate app call resources in the txn objects. Defaults to `Config.populateAppCallResources`. */ + populateAppCallResources?: boolean +} + /** An `AtomicTransactionComposer` with transactions to send. */ export interface AtomicTransactionComposerToSend { /** The `AtomicTransactionComposer` with transactions loaded to send */ atc: AtomicTransactionComposer /** Any parameters to control the semantics of the send to the network */ + executeParams?: ExecuteParams + /** + * @deprecated - use executeParams instead + * Any parameters to control the semantics of the send to the network */ sendParams?: Omit } diff --git a/src/util.ts b/src/util.ts index 51e80f14..5f5c2bc6 100644 --- a/src/util.ts +++ b/src/util.ts @@ -29,13 +29,13 @@ export class UnsafeConversionError extends Error {} * @returns The amount of funds to add to the wallet or null if the wallet is already above the minimum spending balance */ export const calculateFundAmount = ( - minSpendingBalance: number, - currentSpendingBalance: number, - minFundingIncrement: number, -): number | null => { + minSpendingBalance: bigint, + currentSpendingBalance: bigint, + minFundingIncrement: bigint, +): bigint | null => { if (minSpendingBalance > currentSpendingBalance) { const minFundAmount = minSpendingBalance - currentSpendingBalance - return Math.max(minFundAmount, minFundingIncrement) + return BigInt(Math.max(Number(minFundAmount), Number(minFundingIncrement))) } else { return null } @@ -73,3 +73,11 @@ export const memoize = (fn: (val: T) => R) => { cached.cache = cache return cached as (val: T) => R } + +export const binaryStartsWith = (base: Uint8Array, startsWith: Uint8Array): boolean => { + if (startsWith.length > base.length) return false + for (let i = 0; i < startsWith.length; i++) { + if (base[i] !== startsWith[i]) return false + } + return true +}