From 30cd65b65e6f94577f6352f0b1d762fe5f64ade5 Mon Sep 17 00:00:00 2001 From: inaie ignacio Date: Mon, 21 Aug 2023 16:24:33 +0800 Subject: [PATCH 1/5] feat: increase discoverability of algokit resolve by id and name methods --- src/app-client.ts | 74 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/src/app-client.ts b/src/app-client.ts index b9a2dc26..a723e24d 100644 --- a/src/app-client.ts +++ b/src/app-client.ts @@ -1,5 +1,8 @@ -import { Algodv2 } from 'algosdk' -import { ApplicationClient, AppSpecAppDetails } from './types/app-client' +import { Algodv2, Indexer, SuggestedParams } from 'algosdk' +import { AppLookup, TealTemplateParams } from './types/app' +import { AppSpecAppDetails, ApplicationClient } from './types/app-client' +import { AppSpec } from './types/app-spec' +import { SendTransactionFrom } from './types/transaction' /** * Create a new ApplicationClient instance @@ -10,3 +13,70 @@ import { ApplicationClient, AppSpecAppDetails } from './types/app-client' export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { return new ApplicationClient(appDetails, algod) } + +/** + * Create a new ApplicationClient instance by id + * @param app The ARC-0032 application spec as either: + * * Parsed JSON `AppSpec` + * * Raw JSON string + * @param id The id of an existing app to call using this client, or 0 if the app hasn't been created yet + * @param algod An algod instance + * @param sender Default sender to use for transactions issued by this application client + * @param params Default suggested params object to use + * @param deployTimeParams Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls + * @param name The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) + * + * @returns The application client + */ +export function getAppClientById( + app: AppSpec | string, + id: number | bigint, + algod: Algodv2, + sender?: SendTransactionFrom, + params?: SuggestedParams, + deployTimeParams?: TealTemplateParams, + name?: string, +) { + const appDetails: AppSpecAppDetails = { app, sender, params, deployTimeParams, resolveBy: 'id', id, name } + return new ApplicationClient(appDetails, algod) +} + +/** + * Create a new ApplicationClient instance by creator and name + * @param app The ARC-0032 application spec as either: + * * Parsed JSON `AppSpec` + * * Raw JSON string + * @param creatorAddress The address of the app creator account to resolve the app by + * @param findExistingUsing The mechanism to find an existing app instance metadata for the given creator and name; either: + * An indexer instance to search the creator account apps; or + * * The cached value of the existing apps for the given creator from `getCreatorAppsByName` + * @param algod An algod instance + * @param sender Default sender to use for transactions issued by this application client + * @param params Default suggested params object to use + * @param deployTimeParams Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls + * @param name The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) + * + * @returns The application client + */ +export function getAppClientByCreatorAndName( + app: AppSpec | string, + creatorAddress: string, + findExistingUsing: Indexer | AppLookup, + algod: Algodv2, + sender?: SendTransactionFrom, + params?: SuggestedParams, + deployTimeParams?: TealTemplateParams, + name?: string, +) { + const appDetails: AppSpecAppDetails = { + app, + sender, + params, + deployTimeParams, + resolveBy: 'creatorAndName', + creatorAddress, + name, + findExistingUsing, + } + return new ApplicationClient(appDetails, algod) +} From 930e28b530732754c7fa974bfb30e1e339b6802e Mon Sep 17 00:00:00 2001 From: inaie ignacio Date: Mon, 21 Aug 2023 17:25:02 +0800 Subject: [PATCH 2/5] fix: generate doc --- docs/code/modules/index.md | 65 +++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 82e871ac..53e0af87 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -41,6 +41,8 @@ - [getAppBoxValuesFromABIType](index.md#getappboxvaluesfromabitype) - [getAppById](index.md#getappbyid) - [getAppClient](index.md#getappclient) +- [getAppClientByCreatorAndName](index.md#getappclientbycreatorandname) +- [getAppClientById](index.md#getappclientbyid) - [getAppDeploymentTransactionNote](index.md#getappdeploymenttransactionnote) - [getAppGlobalState](index.md#getappglobalstate) - [getAppLocalState](index.md#getapplocalstate) @@ -1026,7 +1028,68 @@ The application client #### Defined in -[src/app-client.ts:10](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L10) +[src/app-client.ts:13](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L13) + +___ + +### getAppClientByCreatorAndName + +▸ **getAppClientByCreatorAndName**(`app`, `creatorAddress`, `findExistingUsing`, `algod`, `sender?`, `params?`, `deployTimeParams?`, `name?`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +Create a new ApplicationClient instance by creator and name + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `app` | `string` \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-0032 application spec as either: * Parsed JSON `AppSpec` * Raw JSON string | +| `creatorAddress` | `string` | The address of the app creator account to resolve the app by | +| `findExistingUsing` | `default` \| [`AppLookup`](../interfaces/types_app.AppLookup.md) | The mechanism to find an existing app instance metadata for the given creator and name; either: An indexer instance to search the creator account apps; or * The cached value of the existing apps for the given creator from `getCreatorAppsByName` | +| `algod` | `default` | An algod instance | +| `sender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | Default sender to use for transactions issued by this application client | +| `params?` | `SuggestedParams` | Default suggested params object to use | +| `deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls | +| `name?` | `string` | The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) | + +#### Returns + +[`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +The application client + +#### Defined in + +[src/app-client.ts:61](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L61) + +___ + +### getAppClientById + +▸ **getAppClientById**(`app`, `id`, `algod`, `sender?`, `params?`, `deployTimeParams?`, `name?`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +Create a new ApplicationClient instance by id + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `app` | `string` \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-0032 application spec as either: * Parsed JSON `AppSpec` * Raw JSON string | +| `id` | `number` \| `bigint` | The id of an existing app to call using this client, or 0 if the app hasn't been created yet | +| `algod` | `default` | An algod instance | +| `sender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | Default sender to use for transactions issued by this application client | +| `params?` | `SuggestedParams` | Default suggested params object to use | +| `deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls | +| `name?` | `string` | The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) | + +#### Returns + +[`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) + +The application client + +#### Defined in + +[src/app-client.ts:31](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L31) ___ From 725ec7437884f86dbfddd5021f444d8e0004d3ca Mon Sep 17 00:00:00 2001 From: inaie ignacio Date: Wed, 23 Aug 2023 09:40:42 +0800 Subject: [PATCH 3/5] fix: pr review --- .../types_app_client.ApplicationClient.md | 78 ++++++++--------- .../types_app_client.AppClientCallABIArgs.md | 2 +- ...ypes_app_client.AppClientCallCoreParams.md | 6 +- ...s_app_client.AppClientCompilationParams.md | 6 +- ...ient.AppClientDeployCallInterfaceParams.md | 10 +-- ...es_app_client.AppClientDeployCoreParams.md | 14 ++-- .../types_app_client.AppClientDeployParams.md | 24 +++--- .../types_app_client.AppSourceMaps.md | 4 +- .../types_app_client.FundAppAccountParams.md | 8 +- .../types_app_client.SourceMapExport.md | 8 +- docs/code/modules/index.md | 50 +++++++---- docs/code/modules/types_app_client.md | 84 +++++++++++++++++-- src/app-client.ts | 81 ++++++------------ src/types/app-client.ts | 18 +++- 14 files changed, 230 insertions(+), 163 deletions(-) diff --git a/docs/code/classes/types_app_client.ApplicationClient.md b/docs/code/classes/types_app_client.ApplicationClient.md index a5894362..1eb47eb9 100644 --- a/docs/code/classes/types_app_client.ApplicationClient.md +++ b/docs/code/classes/types_app_client.ApplicationClient.md @@ -73,7 +73,7 @@ Create a new ApplicationClient instance #### Defined in -[src/types/app-client.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L270) +[src/types/app-client.ts:282](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L282) ## Properties @@ -83,7 +83,7 @@ Create a new ApplicationClient instance #### Defined in -[src/types/app-client.ts:253](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L253) +[src/types/app-client.ts:265](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L265) ___ @@ -93,7 +93,7 @@ ___ #### Defined in -[src/types/app-client.ts:252](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L252) +[src/types/app-client.ts:264](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L264) ___ @@ -103,7 +103,7 @@ ___ #### Defined in -[src/types/app-client.ts:255](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L255) +[src/types/app-client.ts:267](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L267) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[src/types/app-client.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L257) +[src/types/app-client.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L269) ___ @@ -123,7 +123,7 @@ ___ #### Defined in -[src/types/app-client.ts:258](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L258) +[src/types/app-client.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L270) ___ @@ -133,7 +133,7 @@ ___ #### Defined in -[src/types/app-client.ts:254](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L254) +[src/types/app-client.ts:266](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L266) ___ @@ -143,7 +143,7 @@ ___ #### Defined in -[src/types/app-client.ts:244](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L244) +[src/types/app-client.ts:256](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L256) ___ @@ -153,7 +153,7 @@ ___ #### Defined in -[src/types/app-client.ts:246](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L246) +[src/types/app-client.ts:258](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L258) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[src/types/app-client.ts:250](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L250) +[src/types/app-client.ts:262](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L262) ___ @@ -173,7 +173,7 @@ ___ #### Defined in -[src/types/app-client.ts:249](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L249) +[src/types/app-client.ts:261](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L261) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[src/types/app-client.ts:245](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L245) +[src/types/app-client.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L257) ___ @@ -193,7 +193,7 @@ ___ #### Defined in -[src/types/app-client.ts:248](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L248) +[src/types/app-client.ts:260](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L260) ___ @@ -203,7 +203,7 @@ ___ #### Defined in -[src/types/app-client.ts:247](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L247) +[src/types/app-client.ts:259](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L259) ## Methods @@ -227,7 +227,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:563](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L563) +[src/types/app-client.ts:575](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L575) ___ @@ -252,7 +252,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:636](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L636) +[src/types/app-client.ts:648](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L648) ___ @@ -276,7 +276,7 @@ The result of the call #### 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:629](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L629) ___ @@ -300,7 +300,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:608](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L608) +[src/types/app-client.ts:620](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L620) ___ @@ -324,7 +324,7 @@ The compiled approval and clear programs #### Defined in -[src/types/app-client.ts:307](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L307) +[src/types/app-client.ts:319](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L319) ___ @@ -348,7 +348,7 @@ The details of the created app, or the transaction to create it if `skipSending` #### Defined in -[src/types/app-client.ts:472](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L472) +[src/types/app-client.ts:484](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L484) ___ @@ -372,7 +372,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:626](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L626) +[src/types/app-client.ts:638](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L638) ___ @@ -402,7 +402,7 @@ The metadata and transaction result(s) of the deployment, or just the metadata i #### Defined in -[src/types/app-client.ts:364](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L364) +[src/types/app-client.ts:376](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L376) ___ @@ -420,7 +420,7 @@ The source maps #### Defined in -[src/types/app-client.ts:331](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L331) +[src/types/app-client.ts:343](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L343) ___ @@ -447,7 +447,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:952](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L952) +[src/types/app-client.ts:964](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L964) ___ @@ -471,7 +471,7 @@ The result of the funding #### Defined in -[src/types/app-client.ts:676](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L676) +[src/types/app-client.ts:688](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L688) ___ @@ -495,7 +495,7 @@ The ABI method for the given method #### Defined in -[src/types/app-client.ts:911](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L911) +[src/types/app-client.ts:923](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L923) ___ @@ -519,7 +519,7 @@ The ABI method params for the given method #### Defined in -[src/types/app-client.ts:889](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L889) +[src/types/app-client.ts:901](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L901) ___ @@ -538,7 +538,7 @@ The app reference, or if deployed using the `deploy` method, the app metadata to #### Defined in -[src/types/app-client.ts:921](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L921) +[src/types/app-client.ts:933](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L933) ___ @@ -556,7 +556,7 @@ The names of the boxes #### 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:742](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L742) ___ @@ -580,7 +580,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:745](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L745) +[src/types/app-client.ts:757](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L757) ___ @@ -605,7 +605,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:761](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L761) +[src/types/app-client.ts:773](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L773) ___ @@ -630,7 +630,7 @@ The (name, value) pair of the boxes with values as raw byte arrays #### Defined in -[src/types/app-client.ts:777](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L777) +[src/types/app-client.ts:789](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L789) ___ @@ -656,7 +656,7 @@ The (name, value) pair of the boxes with values as the ABI Value #### Defined in -[src/types/app-client.ts:799](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L799) +[src/types/app-client.ts:811](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L811) ___ @@ -681,7 +681,7 @@ The call args ready to pass into an app call #### Defined in -[src/types/app-client.ts:821](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L821) +[src/types/app-client.ts:833](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L833) ___ @@ -699,7 +699,7 @@ The global state #### Defined in -[src/types/app-client.ts:702](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L702) +[src/types/app-client.ts:714](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L714) ___ @@ -723,7 +723,7 @@ The global state #### Defined in -[src/types/app-client.ts:716](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L716) +[src/types/app-client.ts:728](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L728) ___ @@ -745,7 +745,7 @@ Import source maps for the app. #### Defined in -[src/types/app-client.ts:348](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L348) +[src/types/app-client.ts:360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L360) ___ @@ -769,7 +769,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:599](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L599) +[src/types/app-client.ts:611](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L611) ___ @@ -793,4 +793,4 @@ The transaction send result and the compilation result #### Defined in -[src/types/app-client.ts:524](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L524) +[src/types/app-client.ts:536](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L536) diff --git a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md index 7b528d1d..830d2e89 100644 --- a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md +++ b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md @@ -112,7 +112,7 @@ If calling an ABI method then either the name of the method, or the ABI signatur #### Defined in -[src/types/app-client.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L145) +[src/types/app-client.ts:157](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L157) ___ diff --git a/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md b/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md index ef91e344..339d7fb8 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:156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L156) +[src/types/app-client.ts:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L168) ___ @@ -36,7 +36,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L158) +[src/types/app-client.ts:170](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L170) ___ @@ -48,4 +48,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:154](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L154) +[src/types/app-client.ts:166](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L166) diff --git a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md index d31f2c54..048d362f 100644 --- a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md +++ b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md @@ -20,7 +20,7 @@ #### 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:185](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L185) ___ @@ -32,7 +32,7 @@ Any deploy-time parameters to replace in the TEAL code #### 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:181](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L181) ___ @@ -42,4 +42,4 @@ ___ #### Defined in -[src/types/app-client.ts:171](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L171) +[src/types/app-client.ts:183](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L183) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md index 06a15a34..9b35ee4c 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:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) +[src/types/app-client.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L140) ___ @@ -44,7 +44,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) +[src/types/app-client.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L142) ___ @@ -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:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L134) +[src/types/app-client.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L146) ___ @@ -68,7 +68,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:126](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L126) +[src/types/app-client.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L138) ___ @@ -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:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) +[src/types/app-client.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L144) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md index c7865797..c2c12d62 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:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) +[src/types/app-client.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) ___ @@ -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:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L112) +[src/types/app-client.ts:124](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L124) ___ @@ -60,7 +60,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) +[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) ___ @@ -72,7 +72,7 @@ What action to perform if a TEAL update is detected #### 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:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) ___ @@ -84,7 +84,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L108) +[src/types/app-client.ts:120](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L120) ___ @@ -96,7 +96,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L106) +[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) ___ @@ -108,4 +108,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:104](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L104) +[src/types/app-client.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployParams.md b/docs/code/interfaces/types_app_client.AppClientDeployParams.md index c164d7e9..624016c4 100644 --- a/docs/code/interfaces/types_app_client.AppClientDeployParams.md +++ b/docs/code/interfaces/types_app_client.AppClientDeployParams.md @@ -46,7 +46,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) +[src/types/app-client.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) ___ @@ -63,7 +63,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L112) +[src/types/app-client.ts:124](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L124) ___ @@ -79,7 +79,7 @@ Any args to pass to any create transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) +[src/types/app-client.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L140) ___ @@ -95,7 +95,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) +[src/types/app-client.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L142) ___ @@ -111,7 +111,7 @@ Any args to pass to any delete transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:134](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L134) +[src/types/app-client.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L146) ___ @@ -127,7 +127,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:126](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L126) +[src/types/app-client.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L138) ___ @@ -143,7 +143,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) +[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) ___ @@ -159,7 +159,7 @@ What action to perform if a TEAL update is detected #### 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:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) ___ @@ -175,7 +175,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L108) +[src/types/app-client.ts:120](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L120) ___ @@ -191,7 +191,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:106](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L106) +[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) ___ @@ -207,7 +207,7 @@ Any args to pass to any update transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) +[src/types/app-client.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L144) ___ @@ -223,4 +223,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:104](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L104) +[src/types/app-client.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) diff --git a/docs/code/interfaces/types_app_client.AppSourceMaps.md b/docs/code/interfaces/types_app_client.AppSourceMaps.md index 86db54c7..b34ed484 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:202](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L202) +[src/types/app-client.ts:214](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L214) ___ @@ -35,4 +35,4 @@ The source map of the clear program #### Defined in -[src/types/app-client.ts:204](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L204) +[src/types/app-client.ts:216](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L216) diff --git a/docs/code/interfaces/types_app_client.FundAppAccountParams.md b/docs/code/interfaces/types_app_client.FundAppAccountParams.md index 52da33c9..d0227ebe 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:190](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L190) +[src/types/app-client.ts:202](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L202) ___ @@ -35,7 +35,7 @@ The transaction note for the smart contract call #### Defined in -[src/types/app-client.ts:194](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L194) +[src/types/app-client.ts:206](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L206) ___ @@ -47,7 +47,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:196](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L196) +[src/types/app-client.ts:208](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L208) ___ @@ -59,4 +59,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:192](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L192) +[src/types/app-client.ts:204](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L204) diff --git a/docs/code/interfaces/types_app_client.SourceMapExport.md b/docs/code/interfaces/types_app_client.SourceMapExport.md index 32ccc9f6..efcd26f7 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:211](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L211) +[src/types/app-client.ts:223](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L223) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[src/types/app-client.ts:210](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L210) +[src/types/app-client.ts:222](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L222) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[src/types/app-client.ts:209](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L209) +[src/types/app-client.ts:221](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L221) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[src/types/app-client.ts:208](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L208) +[src/types/app-client.ts:220](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L220) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 53e0af87..541e12e4 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -1028,28 +1028,36 @@ The application client #### Defined in -[src/app-client.ts:13](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L13) +[src/app-client.ts:10](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L10) ___ ### getAppClientByCreatorAndName -▸ **getAppClientByCreatorAndName**(`app`, `creatorAddress`, `findExistingUsing`, `algod`, `sender?`, `params?`, `deployTimeParams?`, `name?`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) +▸ **getAppClientByCreatorAndName**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) Create a new ApplicationClient instance by creator and name +**`Example`** + +```ts +const client = algokit.getAppClientByCreatorAndName( + { + app: {appSpec}, + sender: {account}, + creatorAddress: {account.addr}, + findExistingUsing: {indexer}, + }, + algod, + ) +``` + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `app` | `string` \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-0032 application spec as either: * Parsed JSON `AppSpec` * Raw JSON string | -| `creatorAddress` | `string` | The address of the app creator account to resolve the app by | -| `findExistingUsing` | `default` \| [`AppLookup`](../interfaces/types_app.AppLookup.md) | The mechanism to find an existing app instance metadata for the given creator and name; either: An indexer instance to search the creator account apps; or * The cached value of the existing apps for the given creator from `getCreatorAppsByName` | +| `appDetails` | [`AppSpecAppDetailsByCreatorAndName`](types_app_client.md#appspecappdetailsbycreatorandname) | The details of the app by creator and name | | `algod` | `default` | An algod instance | -| `sender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | Default sender to use for transactions issued by this application client | -| `params?` | `SuggestedParams` | Default suggested params object to use | -| `deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls | -| `name?` | `string` | The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) | #### Returns @@ -1059,27 +1067,35 @@ The application client #### Defined in -[src/app-client.ts:61](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L61) +[src/app-client.ts:53](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L53) ___ ### getAppClientById -▸ **getAppClientById**(`app`, `id`, `algod`, `sender?`, `params?`, `deployTimeParams?`, `name?`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) +▸ **getAppClientById**(`appDetails`, `algod`): [`ApplicationClient`](../classes/types_app_client.ApplicationClient.md) Create a new ApplicationClient instance by id +**`Example`** + +```ts +const client = algokit.getAppClientById( + { + app: {appSpec}, + sender: {account}, + id: {id}, + }, + algod, + ) +``` + #### Parameters | Name | Type | Description | | :------ | :------ | :------ | -| `app` | `string` \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-0032 application spec as either: * Parsed JSON `AppSpec` * Raw JSON string | -| `id` | `number` \| `bigint` | The id of an existing app to call using this client, or 0 if the app hasn't been created yet | +| `appDetails` | [`AppSpecAppDetailsById`](types_app_client.md#appspecappdetailsbyid) | The details of the app | | `algod` | `default` | An algod instance | -| `sender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | Default sender to use for transactions issued by this application client | -| `params?` | `SuggestedParams` | Default suggested params object to use | -| `deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls | -| `name?` | `string` | The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) | #### Returns diff --git a/docs/code/modules/types_app_client.md b/docs/code/modules/types_app_client.md index bf167196..6e85edae 100644 --- a/docs/code/modules/types_app_client.md +++ b/docs/code/modules/types_app_client.md @@ -31,7 +31,11 @@ - [AppClientCreateParams](types_app_client.md#appclientcreateparams) - [AppClientUpdateParams](types_app_client.md#appclientupdateparams) - [AppDetails](types_app_client.md#appdetails) +- [AppDetailsBase](types_app_client.md#appdetailsbase) - [AppSpecAppDetails](types_app_client.md#appspecappdetails) +- [AppSpecAppDetailsBase](types_app_client.md#appspecappdetailsbase) +- [AppSpecAppDetailsByCreatorAndName](types_app_client.md#appspecappdetailsbycreatorandname) +- [AppSpecAppDetailsById](types_app_client.md#appspecappdetailsbyid) - [ResolveAppByCreatorAndName](types_app_client.md#resolveappbycreatorandname) ## Type Aliases @@ -44,7 +48,7 @@ The arguments to pass to an Application Client smart contract call #### 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:161](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L161) ___ @@ -56,7 +60,7 @@ Parameters to construct a ApplicationClient contract call #### Defined in -[src/types/app-client.ts:162](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L162) +[src/types/app-client.ts:174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L174) ___ @@ -68,7 +72,7 @@ Parameters to construct a ApplicationClient clear state contract call #### Defined in -[src/types/app-client.ts:165](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L165) +[src/types/app-client.ts:177](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L177) ___ @@ -86,7 +90,7 @@ On-complete action parameter for creating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:177](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L177) +[src/types/app-client.ts:189](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L189) ___ @@ -98,7 +102,7 @@ Parameters for creating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:183](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L183) +[src/types/app-client.ts:195](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L195) ___ @@ -110,16 +114,36 @@ Parameters for updating a contract using ApplicationClient #### 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:198](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L198) ___ ### AppDetails -Ƭ **AppDetails**: { `deployTimeParams?`: [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) ; `params?`: `SuggestedParams` ; `sender?`: [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) } & [`ResolveAppById`](../interfaces/types_app_client.ResolveAppById.md) \| [`ResolveAppByCreatorAndName`](types_app_client.md#resolveappbycreatorandname) +Ƭ **AppDetails**: [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppById`](../interfaces/types_app_client.ResolveAppById.md) \| [`ResolveAppByCreatorAndName`](types_app_client.md#resolveappbycreatorandname) + +The details of an AlgoKit Utils deployed app + +#### Defined in + +[src/types/app-client.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L93) + +___ + +### AppDetailsBase + +Ƭ **AppDetailsBase**: `Object` The details of an AlgoKit Utils deployed app +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `deployTimeParams?` | [`TealTemplateParams`](../interfaces/types_app.TealTemplateParams.md) | Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls | +| `params?` | `SuggestedParams` | Default suggested params object to use | +| `sender?` | [`SendTransactionFrom`](types_transaction.md#sendtransactionfrom) | Default sender to use for transactions issued by this application client | + #### Defined in [src/types/app-client.ts:81](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L81) @@ -128,13 +152,55 @@ ___ ### AppSpecAppDetails -Ƭ **AppSpecAppDetails**: [`AppDetails`](types_app_client.md#appdetails) & { `app`: [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) \| `string` } +Ƭ **AppSpecAppDetails**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetails`](types_app_client.md#appdetails) The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L93) +[src/types/app-client.ts:111](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L111) + +___ + +### AppSpecAppDetailsBase + +Ƭ **AppSpecAppDetailsBase**: `Object` + +The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app + +#### Type declaration + +| Name | Type | Description | +| :------ | :------ | :------ | +| `app` | [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) \| `string` | The ARC-0032 application spec as either: * Parsed JSON `AppSpec` * Raw JSON string | + +#### Defined in + +[src/types/app-client.ts:96](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L96) + +___ + +### AppSpecAppDetailsByCreatorAndName + +Ƭ **AppSpecAppDetailsByCreatorAndName**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByCreatorAndName`](types_app_client.md#resolveappbycreatorandname) + +The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by creator and name + +#### Defined in + +[src/types/app-client.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L108) + +___ + +### AppSpecAppDetailsById + +Ƭ **AppSpecAppDetailsById**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppById`](../interfaces/types_app_client.ResolveAppById.md) + +The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id + +#### Defined in + +[src/types/app-client.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L105) ___ diff --git a/src/app-client.ts b/src/app-client.ts index a723e24d..b166ec43 100644 --- a/src/app-client.ts +++ b/src/app-client.ts @@ -1,8 +1,5 @@ -import { Algodv2, Indexer, SuggestedParams } from 'algosdk' -import { AppLookup, TealTemplateParams } from './types/app' -import { AppSpecAppDetails, ApplicationClient } from './types/app-client' -import { AppSpec } from './types/app-spec' -import { SendTransactionFrom } from './types/transaction' +import { Algodv2 } from 'algosdk' +import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client' /** * Create a new ApplicationClient instance @@ -16,67 +13,43 @@ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { /** * Create a new ApplicationClient instance by id - * @param app The ARC-0032 application spec as either: - * * Parsed JSON `AppSpec` - * * Raw JSON string - * @param id The id of an existing app to call using this client, or 0 if the app hasn't been created yet + * @param appDetails The details of the app * @param algod An algod instance - * @param sender Default sender to use for transactions issued by this application client - * @param params Default suggested params object to use - * @param deployTimeParams Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls - * @param name The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) + * + * @example + * const client = algokit.getAppClientById( + * { + * app: {appSpec}, + * sender: {account}, + * id: {id}, + * }, + * algod, + * ) * * @returns The application client */ -export function getAppClientById( - app: AppSpec | string, - id: number | bigint, - algod: Algodv2, - sender?: SendTransactionFrom, - params?: SuggestedParams, - deployTimeParams?: TealTemplateParams, - name?: string, -) { - const appDetails: AppSpecAppDetails = { app, sender, params, deployTimeParams, resolveBy: 'id', id, name } +export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) { return new ApplicationClient(appDetails, algod) } /** * Create a new ApplicationClient instance by creator and name - * @param app The ARC-0032 application spec as either: - * * Parsed JSON `AppSpec` - * * Raw JSON string - * @param creatorAddress The address of the app creator account to resolve the app by - * @param findExistingUsing The mechanism to find an existing app instance metadata for the given creator and name; either: - * An indexer instance to search the creator account apps; or - * * The cached value of the existing apps for the given creator from `getCreatorAppsByName` + * @param appDetails The details of the app by creator and name * @param algod An algod instance - * @param sender Default sender to use for transactions issued by this application client - * @param params Default suggested params object to use - * @param deployTimeParams Optionally provide any deploy-time parameters to replace in the TEAL code; if specified here will get used in calls to `deploy`, `create` and `update` unless overridden in those calls - * @param name The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) + * + * @example + * const client = algokit.getAppClientByCreatorAndName( + * { + * app: {appSpec}, + * sender: {account}, + * creatorAddress: {account.addr}, + * findExistingUsing: {indexer}, + * }, + * algod, + * ) * * @returns The application client */ -export function getAppClientByCreatorAndName( - app: AppSpec | string, - creatorAddress: string, - findExistingUsing: Indexer | AppLookup, - algod: Algodv2, - sender?: SendTransactionFrom, - params?: SuggestedParams, - deployTimeParams?: TealTemplateParams, - name?: string, -) { - const appDetails: AppSpecAppDetails = { - app, - sender, - params, - deployTimeParams, - resolveBy: 'creatorAndName', - creatorAddress, - name, - findExistingUsing, - } +export function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) { return new ApplicationClient(appDetails, algod) } diff --git a/src/types/app-client.ts b/src/types/app-client.ts index c85bf0cc..3e497ee4 100644 --- a/src/types/app-client.ts +++ b/src/types/app-client.ts @@ -78,7 +78,7 @@ export interface ResolveAppById { } /** The details of an AlgoKit Utils deployed app */ -export type AppDetails = { +export type AppDetailsBase = { /** Default sender to use for transactions issued by this application client */ sender?: SendTransactionFrom /** Default suggested params object to use */ @@ -87,10 +87,13 @@ export type AppDetails = { * used in calls to `deploy`, `create` and `update` unless overridden in those calls */ deployTimeParams?: TealTemplateParams -} & (ResolveAppById | ResolveAppByCreatorAndName) +} + +/** The details of an AlgoKit Utils deployed app */ +export type AppDetails = AppDetailsBase & (ResolveAppById | ResolveAppByCreatorAndName) /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app */ -export type AppSpecAppDetails = AppDetails & { +export type AppSpecAppDetailsBase = { /** The ARC-0032 application spec as either: * * Parsed JSON `AppSpec` * * Raw JSON string @@ -98,6 +101,15 @@ export type AppSpecAppDetails = AppDetails & { app: AppSpec | string } +/** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id*/ +export type AppSpecAppDetailsById = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppById + +/** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by creator and name*/ +export type AppSpecAppDetailsByCreatorAndName = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByCreatorAndName + +/** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app */ +export type AppSpecAppDetails = AppSpecAppDetailsBase & AppDetails + /** Core parameters to pass into ApplicationClient.deploy */ export interface AppClientDeployCoreParams { /** The version of the contract, uses "1.0" by default */ From b305e2a66c3af97b71bf62a6b85c3766f954272b Mon Sep 17 00:00:00 2001 From: inaie ignacio Date: Fri, 25 Aug 2023 11:58:07 +0800 Subject: [PATCH 4/5] fix: pr review --- .../types_app_client.ApplicationClient.md | 78 +++++++++---------- .../types_app_client.AppClientCallABIArgs.md | 2 +- ...ypes_app_client.AppClientCallCoreParams.md | 6 +- ...s_app_client.AppClientCompilationParams.md | 6 +- ...ient.AppClientDeployCallInterfaceParams.md | 10 +-- ...es_app_client.AppClientDeployCoreParams.md | 14 ++-- .../types_app_client.AppClientDeployParams.md | 24 +++--- .../types_app_client.AppSourceMaps.md | 4 +- .../types_app_client.FundAppAccountParams.md | 8 +- .../types_app_client.ResolveAppById.md | 20 ++++- .../types_app_client.ResolveAppByIdBase.md | 44 +++++++++++ .../types_app_client.SourceMapExport.md | 8 +- docs/code/modules/index.md | 20 ++++- docs/code/modules/types_app_client.md | 45 +++++++---- src/app-client.ts | 14 +++- src/types/app-client.ts | 23 ++++-- 16 files changed, 214 insertions(+), 112 deletions(-) create mode 100644 docs/code/interfaces/types_app_client.ResolveAppByIdBase.md diff --git a/docs/code/classes/types_app_client.ApplicationClient.md b/docs/code/classes/types_app_client.ApplicationClient.md index 1eb47eb9..86e0ad7e 100644 --- a/docs/code/classes/types_app_client.ApplicationClient.md +++ b/docs/code/classes/types_app_client.ApplicationClient.md @@ -73,7 +73,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:289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L289) ## Properties @@ -83,7 +83,7 @@ Create a new ApplicationClient instance #### Defined in -[src/types/app-client.ts:265](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L265) +[src/types/app-client.ts:272](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L272) ___ @@ -93,7 +93,7 @@ ___ #### Defined in -[src/types/app-client.ts:264](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L264) +[src/types/app-client.ts:271](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L271) ___ @@ -103,7 +103,7 @@ ___ #### Defined in -[src/types/app-client.ts:267](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L267) +[src/types/app-client.ts:274](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L274) ___ @@ -113,7 +113,7 @@ ___ #### Defined in -[src/types/app-client.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L269) +[src/types/app-client.ts:276](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L276) ___ @@ -123,7 +123,7 @@ ___ #### Defined in -[src/types/app-client.ts:270](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L270) +[src/types/app-client.ts:277](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L277) ___ @@ -133,7 +133,7 @@ ___ #### Defined in -[src/types/app-client.ts:266](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L266) +[src/types/app-client.ts:273](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L273) ___ @@ -143,7 +143,7 @@ ___ #### Defined in -[src/types/app-client.ts:256](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L256) +[src/types/app-client.ts:263](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L263) ___ @@ -153,7 +153,7 @@ ___ #### Defined in -[src/types/app-client.ts:258](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L258) +[src/types/app-client.ts:265](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L265) ___ @@ -163,7 +163,7 @@ ___ #### Defined in -[src/types/app-client.ts:262](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L262) +[src/types/app-client.ts:269](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L269) ___ @@ -173,7 +173,7 @@ ___ #### Defined in -[src/types/app-client.ts:261](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L261) +[src/types/app-client.ts:268](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L268) ___ @@ -183,7 +183,7 @@ ___ #### Defined in -[src/types/app-client.ts:257](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L257) +[src/types/app-client.ts:264](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L264) ___ @@ -193,7 +193,7 @@ ___ #### Defined in -[src/types/app-client.ts:260](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L260) +[src/types/app-client.ts:267](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L267) ___ @@ -203,7 +203,7 @@ ___ #### Defined in -[src/types/app-client.ts:259](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L259) +[src/types/app-client.ts:266](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L266) ## Methods @@ -227,7 +227,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:575](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L575) +[src/types/app-client.ts:582](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L582) ___ @@ -252,7 +252,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:648](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L648) +[src/types/app-client.ts:655](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L655) ___ @@ -276,7 +276,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:629](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L629) +[src/types/app-client.ts:636](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L636) ___ @@ -300,7 +300,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:620](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L620) +[src/types/app-client.ts:627](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L627) ___ @@ -324,7 +324,7 @@ The compiled approval and clear programs #### Defined in -[src/types/app-client.ts:319](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L319) +[src/types/app-client.ts:326](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L326) ___ @@ -348,7 +348,7 @@ The details of the created app, or the transaction to create it if `skipSending` #### Defined in -[src/types/app-client.ts:484](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L484) +[src/types/app-client.ts:491](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L491) ___ @@ -372,7 +372,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:638](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L638) +[src/types/app-client.ts:645](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L645) ___ @@ -402,7 +402,7 @@ The metadata and transaction result(s) of the deployment, or just the metadata i #### Defined in -[src/types/app-client.ts:376](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L376) +[src/types/app-client.ts:383](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L383) ___ @@ -420,7 +420,7 @@ The source maps #### Defined in -[src/types/app-client.ts:343](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L343) +[src/types/app-client.ts:350](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L350) ___ @@ -447,7 +447,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:964](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L964) +[src/types/app-client.ts:971](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L971) ___ @@ -471,7 +471,7 @@ The result of the funding #### Defined in -[src/types/app-client.ts:688](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L688) +[src/types/app-client.ts:695](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L695) ___ @@ -495,7 +495,7 @@ The ABI method for the given method #### Defined in -[src/types/app-client.ts:923](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L923) +[src/types/app-client.ts:930](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L930) ___ @@ -519,7 +519,7 @@ The ABI method params for the given method #### Defined in -[src/types/app-client.ts:901](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L901) +[src/types/app-client.ts:908](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L908) ___ @@ -538,7 +538,7 @@ The app reference, or if deployed using the `deploy` method, the app metadata to #### Defined in -[src/types/app-client.ts:933](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L933) +[src/types/app-client.ts:940](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L940) ___ @@ -556,7 +556,7 @@ The names of the boxes #### Defined in -[src/types/app-client.ts:742](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L742) +[src/types/app-client.ts:749](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L749) ___ @@ -580,7 +580,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:757](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L757) +[src/types/app-client.ts:764](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L764) ___ @@ -605,7 +605,7 @@ The current box value as a byte array #### Defined in -[src/types/app-client.ts:773](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L773) +[src/types/app-client.ts:780](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L780) ___ @@ -630,7 +630,7 @@ The (name, value) pair of the boxes with values as raw byte arrays #### Defined in -[src/types/app-client.ts:789](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L789) +[src/types/app-client.ts:796](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L796) ___ @@ -656,7 +656,7 @@ The (name, value) pair of the boxes with values as the ABI Value #### Defined in -[src/types/app-client.ts:811](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L811) +[src/types/app-client.ts:818](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L818) ___ @@ -681,7 +681,7 @@ The call args ready to pass into an app call #### 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:840](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L840) ___ @@ -699,7 +699,7 @@ The global state #### Defined in -[src/types/app-client.ts:714](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L714) +[src/types/app-client.ts:721](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L721) ___ @@ -723,7 +723,7 @@ The global state #### Defined in -[src/types/app-client.ts:728](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L728) +[src/types/app-client.ts:735](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L735) ___ @@ -745,7 +745,7 @@ Import source maps for the app. #### Defined in -[src/types/app-client.ts:360](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L360) +[src/types/app-client.ts:367](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L367) ___ @@ -769,7 +769,7 @@ The result of the call #### Defined in -[src/types/app-client.ts:611](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L611) +[src/types/app-client.ts:618](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L618) ___ @@ -793,4 +793,4 @@ The transaction send result and the compilation result #### Defined in -[src/types/app-client.ts:536](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L536) +[src/types/app-client.ts:543](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L543) diff --git a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md index 830d2e89..ad0e3816 100644 --- a/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md +++ b/docs/code/interfaces/types_app_client.AppClientCallABIArgs.md @@ -112,7 +112,7 @@ If calling an ABI method then either the name of the method, or the ABI signatur #### Defined in -[src/types/app-client.ts:157](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L157) +[src/types/app-client.ts:164](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L164) ___ diff --git a/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md b/docs/code/interfaces/types_app_client.AppClientCallCoreParams.md index 339d7fb8..ee1b3fdb 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:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L168) +[src/types/app-client.ts:175](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L175) ___ @@ -36,7 +36,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:170](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L170) +[src/types/app-client.ts:177](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L177) ___ @@ -48,4 +48,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:166](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L166) +[src/types/app-client.ts:173](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L173) diff --git a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md index 048d362f..2fbd89f9 100644 --- a/docs/code/interfaces/types_app_client.AppClientCompilationParams.md +++ b/docs/code/interfaces/types_app_client.AppClientCompilationParams.md @@ -20,7 +20,7 @@ #### Defined in -[src/types/app-client.ts:185](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L185) +[src/types/app-client.ts:192](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L192) ___ @@ -32,7 +32,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:181](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L181) +[src/types/app-client.ts:188](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L188) ___ @@ -42,4 +42,4 @@ ___ #### Defined in -[src/types/app-client.ts:183](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L183) +[src/types/app-client.ts:190](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L190) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCallInterfaceParams.md index 9b35ee4c..1cfcb557 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:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L140) +[src/types/app-client.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L147) ___ @@ -44,7 +44,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L142) +[src/types/app-client.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L149) ___ @@ -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:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L146) +[src/types/app-client.ts:153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L153) ___ @@ -68,7 +68,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L138) +[src/types/app-client.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L145) ___ @@ -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:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L144) +[src/types/app-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L151) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md b/docs/code/interfaces/types_app_client.AppClientDeployCoreParams.md index c2c12d62..66510c0d 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:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) +[src/types/app-client.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L135) ___ @@ -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:124](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L124) +[src/types/app-client.ts:131](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L131) ___ @@ -60,7 +60,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) +[src/types/app-client.ts:137](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L137) ___ @@ -72,7 +72,7 @@ What action to perform if a TEAL update is detected #### Defined in -[src/types/app-client.ts:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) +[src/types/app-client.ts:139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L139) ___ @@ -84,7 +84,7 @@ Parameters to control transaction sending #### 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:127](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L127) ___ @@ -96,7 +96,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) +[src/types/app-client.ts:125](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L125) ___ @@ -108,4 +108,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) +[src/types/app-client.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L123) diff --git a/docs/code/interfaces/types_app_client.AppClientDeployParams.md b/docs/code/interfaces/types_app_client.AppClientDeployParams.md index 624016c4..e9e085e4 100644 --- a/docs/code/interfaces/types_app_client.AppClientDeployParams.md +++ b/docs/code/interfaces/types_app_client.AppClientDeployParams.md @@ -46,7 +46,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:128](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L128) +[src/types/app-client.ts:135](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L135) ___ @@ -63,7 +63,7 @@ If this is not specified then it will automatically be determined based on the A #### Defined in -[src/types/app-client.ts:124](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L124) +[src/types/app-client.ts:131](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L131) ___ @@ -79,7 +79,7 @@ Any args to pass to any create transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:140](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L140) +[src/types/app-client.ts:147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L147) ___ @@ -95,7 +95,7 @@ Override the on-completion action for the create call; defaults to NoOp #### Defined in -[src/types/app-client.ts:142](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L142) +[src/types/app-client.ts:149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L149) ___ @@ -111,7 +111,7 @@ Any args to pass to any delete transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L146) +[src/types/app-client.ts:153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L153) ___ @@ -127,7 +127,7 @@ Any deploy-time parameters to replace in the TEAL code #### Defined in -[src/types/app-client.ts:138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L138) +[src/types/app-client.ts:145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L145) ___ @@ -143,7 +143,7 @@ What action to perform if a schema break is detected #### Defined in -[src/types/app-client.ts:130](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L130) +[src/types/app-client.ts:137](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L137) ___ @@ -159,7 +159,7 @@ What action to perform if a TEAL update is detected #### Defined in -[src/types/app-client.ts:132](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L132) +[src/types/app-client.ts:139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L139) ___ @@ -175,7 +175,7 @@ Parameters to control transaction sending #### 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:127](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L127) ___ @@ -191,7 +191,7 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) +[src/types/app-client.ts:125](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L125) ___ @@ -207,7 +207,7 @@ Any args to pass to any update transaction that is issued as part of deployment #### Defined in -[src/types/app-client.ts:144](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L144) +[src/types/app-client.ts:151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L151) ___ @@ -223,4 +223,4 @@ The version of the contract, uses "1.0" by default #### Defined in -[src/types/app-client.ts:116](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L116) +[src/types/app-client.ts:123](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L123) diff --git a/docs/code/interfaces/types_app_client.AppSourceMaps.md b/docs/code/interfaces/types_app_client.AppSourceMaps.md index b34ed484..6c2a5c27 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:214](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L214) +[src/types/app-client.ts:221](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L221) ___ @@ -35,4 +35,4 @@ The source map of the clear program #### Defined in -[src/types/app-client.ts:216](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L216) +[src/types/app-client.ts:223](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L223) diff --git a/docs/code/interfaces/types_app_client.FundAppAccountParams.md b/docs/code/interfaces/types_app_client.FundAppAccountParams.md index d0227ebe..b8f41181 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:202](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L202) +[src/types/app-client.ts:209](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L209) ___ @@ -35,7 +35,7 @@ The transaction note for the smart contract call #### Defined in -[src/types/app-client.ts:206](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L206) +[src/types/app-client.ts:213](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L213) ___ @@ -47,7 +47,7 @@ Parameters to control transaction sending #### Defined in -[src/types/app-client.ts:208](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L208) +[src/types/app-client.ts:215](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L215) ___ @@ -59,4 +59,4 @@ The optional sender to send the transaction from, will use the application clien #### Defined in -[src/types/app-client.ts:204](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L204) +[src/types/app-client.ts:211](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L211) diff --git a/docs/code/interfaces/types_app_client.ResolveAppById.md b/docs/code/interfaces/types_app_client.ResolveAppById.md index 4958131a..cad8545c 100644 --- a/docs/code/interfaces/types_app_client.ResolveAppById.md +++ b/docs/code/interfaces/types_app_client.ResolveAppById.md @@ -6,6 +6,12 @@ Configuration to resolve app by ID +## Hierarchy + +- [`ResolveAppByIdBase`](types_app_client.ResolveAppByIdBase.md) + + ↳ **`ResolveAppById`** + ## Table of contents ### Properties @@ -22,9 +28,13 @@ Configuration to resolve app by ID The id of an existing app to call using this client, or 0 if the app hasn't been created yet +#### Inherited from + +[ResolveAppByIdBase](types_app_client.ResolveAppByIdBase.md).[id](types_app_client.ResolveAppByIdBase.md#id) + #### Defined in -[src/types/app-client.ts:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L75) +[src/types/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L77) ___ @@ -34,9 +44,13 @@ ___ The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) +#### Inherited from + +[ResolveAppByIdBase](types_app_client.ResolveAppByIdBase.md).[name](types_app_client.ResolveAppByIdBase.md#name) + #### Defined in -[src/types/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L77) +[src/types/app-client.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L79) ___ @@ -48,4 +62,4 @@ How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'cr #### Defined in -[src/types/app-client.ts:73](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L73) +[src/types/app-client.ts:84](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L84) diff --git a/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md b/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md new file mode 100644 index 00000000..7eb3a65c --- /dev/null +++ b/docs/code/interfaces/types_app_client.ResolveAppByIdBase.md @@ -0,0 +1,44 @@ +[@algorandfoundation/algokit-utils](../README.md) / [types/app-client](../modules/types_app_client.md) / ResolveAppByIdBase + +# Interface: ResolveAppByIdBase + +[types/app-client](../modules/types_app_client.md).ResolveAppByIdBase + +Configuration to resolve app by ID + +## Hierarchy + +- **`ResolveAppByIdBase`** + + ↳ [`ResolveAppById`](types_app_client.ResolveAppById.md) + +## Table of contents + +### Properties + +- [id](types_app_client.ResolveAppByIdBase.md#id) +- [name](types_app_client.ResolveAppByIdBase.md#name) + +## Properties + +### id + +• **id**: `number` \| `bigint` + +The id of an existing app to call using this client, or 0 if the app hasn't been created yet + +#### Defined in + +[src/types/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L77) + +___ + +### name + +• `Optional` **name**: `string` + +The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) + +#### Defined in + +[src/types/app-client.ts:79](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L79) diff --git a/docs/code/interfaces/types_app_client.SourceMapExport.md b/docs/code/interfaces/types_app_client.SourceMapExport.md index efcd26f7..9f03c1ce 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:223](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L223) +[src/types/app-client.ts:230](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L230) ___ @@ -31,7 +31,7 @@ ___ #### Defined in -[src/types/app-client.ts:222](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L222) +[src/types/app-client.ts:229](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L229) ___ @@ -41,7 +41,7 @@ ___ #### 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:228](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L228) ___ @@ -51,4 +51,4 @@ ___ #### Defined in -[src/types/app-client.ts:220](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L220) +[src/types/app-client.ts:227](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L227) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 541e12e4..6f35952e 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -1013,6 +1013,20 @@ ___ Create a new ApplicationClient instance +**`Example`** + +```ts +const client = algokit.getAppClientById( + { + app: {appSpec}, + sender: {account}, + id: {id}, + resolveBy: 'id' + }, + algod, + ) +``` + #### Parameters | Name | Type | Description | @@ -1028,7 +1042,7 @@ The application client #### Defined in -[src/app-client.ts:10](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L10) +[src/app-client.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L20) ___ @@ -1067,7 +1081,7 @@ The application client #### Defined in -[src/app-client.ts:53](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L53) +[src/app-client.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L63) ___ @@ -1105,7 +1119,7 @@ The application client #### Defined in -[src/app-client.ts:31](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L31) +[src/app-client.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L41) ___ diff --git a/docs/code/modules/types_app_client.md b/docs/code/modules/types_app_client.md index 6e85edae..21dea6ac 100644 --- a/docs/code/modules/types_app_client.md +++ b/docs/code/modules/types_app_client.md @@ -20,6 +20,7 @@ - [AppSourceMaps](../interfaces/types_app_client.AppSourceMaps.md) - [FundAppAccountParams](../interfaces/types_app_client.FundAppAccountParams.md) - [ResolveAppById](../interfaces/types_app_client.ResolveAppById.md) +- [ResolveAppByIdBase](../interfaces/types_app_client.ResolveAppByIdBase.md) - [SourceMapExport](../interfaces/types_app_client.SourceMapExport.md) ### Type Aliases @@ -37,6 +38,7 @@ - [AppSpecAppDetailsByCreatorAndName](types_app_client.md#appspecappdetailsbycreatorandname) - [AppSpecAppDetailsById](types_app_client.md#appspecappdetailsbyid) - [ResolveAppByCreatorAndName](types_app_client.md#resolveappbycreatorandname) +- [ResolveAppByCreatorAndNameBase](types_app_client.md#resolveappbycreatorandnamebase) ## Type Aliases @@ -48,7 +50,7 @@ The arguments to pass to an Application Client smart contract call #### 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:168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L168) ___ @@ -60,7 +62,7 @@ Parameters to construct a ApplicationClient contract call #### Defined in -[src/types/app-client.ts:174](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L174) +[src/types/app-client.ts:181](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L181) ___ @@ -72,7 +74,7 @@ Parameters to construct a ApplicationClient clear state contract call #### Defined in -[src/types/app-client.ts:177](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L177) +[src/types/app-client.ts:184](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L184) ___ @@ -90,7 +92,7 @@ On-complete action parameter for creating a contract using ApplicationClient #### 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:196](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L196) ___ @@ -102,7 +104,7 @@ Parameters for creating a contract using ApplicationClient #### 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:202](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L202) ___ @@ -114,7 +116,7 @@ Parameters for updating a contract using ApplicationClient #### Defined in -[src/types/app-client.ts:198](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L198) +[src/types/app-client.ts:205](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L205) ___ @@ -126,7 +128,7 @@ The details of an AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:93](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L93) +[src/types/app-client.ts:100](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L100) ___ @@ -146,7 +148,7 @@ The details of an AlgoKit Utils deployed app #### 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:88](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L88) ___ @@ -158,7 +160,7 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:111](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L111) +[src/types/app-client.ts:118](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L118) ___ @@ -176,37 +178,49 @@ The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app #### Defined in -[src/types/app-client.ts:96](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L96) +[src/types/app-client.ts:103](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L103) ___ ### AppSpecAppDetailsByCreatorAndName -Ƭ **AppSpecAppDetailsByCreatorAndName**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByCreatorAndName`](types_app_client.md#resolveappbycreatorandname) +Ƭ **AppSpecAppDetailsByCreatorAndName**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByCreatorAndNameBase`](types_app_client.md#resolveappbycreatorandnamebase) The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by creator and name #### Defined in -[src/types/app-client.ts:108](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L108) +[src/types/app-client.ts:115](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L115) ___ ### AppSpecAppDetailsById -Ƭ **AppSpecAppDetailsById**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppById`](../interfaces/types_app_client.ResolveAppById.md) +Ƭ **AppSpecAppDetailsById**: [`AppSpecAppDetailsBase`](types_app_client.md#appspecappdetailsbase) & [`AppDetailsBase`](types_app_client.md#appdetailsbase) & [`ResolveAppByIdBase`](../interfaces/types_app_client.ResolveAppByIdBase.md) The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id #### 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:112](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L112) ___ ### ResolveAppByCreatorAndName -Ƭ **ResolveAppByCreatorAndName**: `Object` +Ƭ **ResolveAppByCreatorAndName**: [`ResolveAppByCreatorAndNameBase`](types_app_client.md#resolveappbycreatorandnamebase) & { `resolveBy`: ``"creatorAndName"`` } + +Configuration to resolve app by creator and name `getCreatorAppsByName` + +#### Defined in + +[src/types/app-client.ts:69](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L69) + +___ + +### ResolveAppByCreatorAndNameBase + +Ƭ **ResolveAppByCreatorAndNameBase**: `Object` Configuration to resolve app by creator and name `getCreatorAppsByName` @@ -217,7 +231,6 @@ Configuration to resolve app by creator and name `getCreatorAppsByName` | `creatorAddress` | `string` | The address of the app creator account to resolve the app by | | `findExistingUsing` | `Indexer` \| [`AppLookup`](../interfaces/types_app.AppLookup.md) | The mechanism to find an existing app instance metadata for the given creator and name; either: * An indexer instance to search the creator account apps; or * The cached value of the existing apps for the given creator from `getCreatorAppsByName` | | `name?` | `string` | The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) | -| `resolveBy` | ``"creatorAndName"`` | How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` | #### Defined in diff --git a/src/app-client.ts b/src/app-client.ts index b166ec43..0c1f4bc0 100644 --- a/src/app-client.ts +++ b/src/app-client.ts @@ -6,6 +6,16 @@ import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetails * @param appDetails The details of the app * @param algod An algod instance * @returns The application client + * @example + * const client = algokit.getAppClientById( + * { + * app: {appSpec}, + * sender: {account}, + * id: {id}, + * resolveBy: 'id' + * }, + * algod, + * ) */ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { return new ApplicationClient(appDetails, algod) @@ -29,7 +39,7 @@ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { * @returns The application client */ export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) { - return new ApplicationClient(appDetails, algod) + return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod) } /** @@ -51,5 +61,5 @@ export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algod * @returns The application client */ export function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) { - return new ApplicationClient(appDetails, algod) + return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod) } diff --git a/src/types/app-client.ts b/src/types/app-client.ts index 3e497ee4..127b5f94 100644 --- a/src/types/app-client.ts +++ b/src/types/app-client.ts @@ -53,9 +53,7 @@ import { LogicError } from './logic-error' import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction' /** Configuration to resolve app by creator and name `getCreatorAppsByName` */ -export type ResolveAppByCreatorAndName = { - /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */ - resolveBy: 'creatorAndName' +export type ResolveAppByCreatorAndNameBase = { /** The address of the app creator account to resolve the app by */ creatorAddress: string /** The optional name override to resolve the app by within the creator account (default: uses the name in the ABI contract) */ @@ -67,16 +65,25 @@ export type ResolveAppByCreatorAndName = { findExistingUsing: Indexer | AppLookup } -/** Configuration to resolve app by ID */ -export interface ResolveAppById { +/** Configuration to resolve app by creator and name `getCreatorAppsByName` */ +export type ResolveAppByCreatorAndName = ResolveAppByCreatorAndNameBase & { /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */ - resolveBy: 'id' + resolveBy: 'creatorAndName' +} + +/** Configuration to resolve app by ID */ +export interface ResolveAppByIdBase { /** The id of an existing app to call using this client, or 0 if the app hasn't been created yet */ id: number | bigint /** The optional name to use to mark the app when deploying `ApplicationClient.deploy` (default: uses the name in the ABI contract) */ name?: string } +export interface ResolveAppById extends ResolveAppByIdBase { + /** How the app ID is resolved, either by `'id'` or `'creatorAndName'`; must be `'creatorAndName'` if you want to use `deploy` */ + resolveBy: 'id' +} + /** The details of an AlgoKit Utils deployed app */ export type AppDetailsBase = { /** Default sender to use for transactions issued by this application client */ @@ -102,10 +109,10 @@ export type AppSpecAppDetailsBase = { } /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by id*/ -export type AppSpecAppDetailsById = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppById +export type AppSpecAppDetailsById = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByIdBase /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app by creator and name*/ -export type AppSpecAppDetailsByCreatorAndName = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByCreatorAndName +export type AppSpecAppDetailsByCreatorAndName = AppSpecAppDetailsBase & AppDetailsBase & ResolveAppByCreatorAndNameBase /** The details of an ARC-0032 app spec specified, AlgoKit Utils deployed app */ export type AppSpecAppDetails = AppSpecAppDetailsBase & AppDetails From e6ab854a713913e36ea7e147cdca8d4f8b91d9f0 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Fri, 25 Aug 2023 10:32:39 +0200 Subject: [PATCH 5/5] chore: minor typo fixes --- docs/code/modules/index.md | 37 +++++++++++++++++++++++++++---------- src/app-client.ts | 32 +++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/docs/code/modules/index.md b/docs/code/modules/index.md index 6f35952e..73b88825 100644 --- a/docs/code/modules/index.md +++ b/docs/code/modules/index.md @@ -1016,17 +1016,34 @@ Create a new ApplicationClient instance **`Example`** ```ts -const client = algokit.getAppClientById( +Resolve by creator and name +const client = algokit.getAppClient( { + resolveBy: 'creatorAndName', app: {appSpec}, sender: {account}, - id: {id}, - resolveBy: 'id' + creatorAddress: {creator}, + findExistingUsing: indexerClient, }, - algod, + algodClient, ) ``` +**`Example`** + +```ts +Resolve by id: +const client = algokit.getAppClient( + { + resolveBy: 'id', + app: {appSpec}, + sender: {account}, + id: {id}, + }, + algodClient, +) +``` + #### Parameters | Name | Type | Description | @@ -1042,7 +1059,7 @@ The application client #### Defined in -[src/app-client.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L20) +[src/app-client.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L34) ___ @@ -1060,9 +1077,9 @@ const client = algokit.getAppClientByCreatorAndName( app: {appSpec}, sender: {account}, creatorAddress: {account.addr}, - findExistingUsing: {indexer}, + findExistingUsing: {indexerClient}, }, - algod, + algodClient, ) ``` @@ -1081,7 +1098,7 @@ The application client #### Defined in -[src/app-client.ts:63](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L63) +[src/app-client.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L77) ___ @@ -1100,7 +1117,7 @@ const client = algokit.getAppClientById( sender: {account}, id: {id}, }, - algod, + algodClient, ) ``` @@ -1119,7 +1136,7 @@ The application client #### Defined in -[src/app-client.ts:41](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L41) +[src/app-client.ts:55](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-client.ts#L55) ___ diff --git a/src/app-client.ts b/src/app-client.ts index 0c1f4bc0..41d984ce 100644 --- a/src/app-client.ts +++ b/src/app-client.ts @@ -5,17 +5,31 @@ import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetails * Create a new ApplicationClient instance * @param appDetails The details of the app * @param algod An algod instance - * @returns The application client - * @example - * const client = algokit.getAppClientById( + * + * @example Resolve by creator and name + * const client = algokit.getAppClient( * { + * resolveBy: 'creatorAndName', * app: {appSpec}, * sender: {account}, - * id: {id}, - * resolveBy: 'id' + * creatorAddress: {creator}, + * findExistingUsing: indexerClient, * }, - * algod, + * algodClient, * ) + * + * @example Resolve by id: + * const client = algokit.getAppClient( + * { + * resolveBy: 'id', + * app: {appSpec}, + * sender: {account}, + * id: {id}, + * }, + * algodClient, + * ) + * + * @returns The application client */ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { return new ApplicationClient(appDetails, algod) @@ -33,7 +47,7 @@ export function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) { * sender: {account}, * id: {id}, * }, - * algod, + * algodClient, * ) * * @returns The application client @@ -53,9 +67,9 @@ export function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algod * app: {appSpec}, * sender: {account}, * creatorAddress: {account.addr}, - * findExistingUsing: {indexer}, + * findExistingUsing: {indexerClient}, * }, - * algod, + * algodClient, * ) * * @returns The application client