Skip to content

Commit

Permalink
feat: Added AppFactory as an ARC-32/ARC-56 compatible mechanism to …
Browse files Browse the repository at this point in the history
…create and deploy apps and create app clients

test: Added test coverage of AppClient and AppFactory
  • Loading branch information
robdmoore committed Sep 5, 2024
1 parent e7c345f commit 5a789eb
Show file tree
Hide file tree
Showing 73 changed files with 3,567 additions and 1,128 deletions.
2 changes: 2 additions & 0 deletions docs/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
- [types/app-client](modules/types_app_client.md)
- [types/app-client.spec](modules/types_app_client_spec.md)
- [types/app-deployer](modules/types_app_deployer.md)
- [types/app-factory](modules/types_app_factory.md)
- [types/app-factory-and-client.spec](modules/types_app_factory_and_client_spec.md)
- [types/app-manager](modules/types_app_manager.md)
- [types/app-spec](modules/types_app_spec.md)
- [types/asset](modules/types_asset.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ await algorand.transactions.appCreate({
| `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). |
| `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. |
| `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. |
| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. |
| `params.onComplete?` | `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. |
| `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). |
| `params.schema?` | `Object` | The state schema for the app. This is immutable once the app is created. |
| `params.schema.globalByteSlices` | `number` | The number of byte slices saved in global state. |
Expand Down Expand Up @@ -614,7 +614,7 @@ await algorand.transactions.appUpdate({
| `params.lease?` | `string` \| `Uint8Array` | Prevent multiple transactions with the same lease being included within the validity window. A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/) enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios). |
| `params.maxFee?` | [`AlgoAmount`](types_amount.AlgoAmount.md) | Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. |
| `params.note?` | `string` \| `Uint8Array` | Note to attach to the transaction. Max of 1000 bytes. |
| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call. |
| `params.onComplete?` | `UpdateApplicationOC` | The [on-complete](https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#oncomplete) action of the call; defaults to no-op. |
| `params.rekeyTo?` | `string` | Change the signing key of the sender to the given address. **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/). |
| `params.sender` | `string` | The address of the account sending the transaction. |
| `params.signer?` | `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) | The function used to sign transaction(s); if not specified then an attempt will be made to find a registered signer for the given `sender` or use a default signer (if configured). |
Expand Down

Large diffs are not rendered by default.

568 changes: 400 additions & 168 deletions docs/code/classes/types_app_client.AppClient.md

Large diffs are not rendered by default.

85 changes: 44 additions & 41 deletions docs/code/classes/types_app_client.ApplicationClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

**`Deprecated`**

Use `AppClient` instead.
Use `AppClient` instead e.g. via `algorand.client.getAppClientById`,
`algorand.client.getAppClientByCreatorAndName`, or `algorand.client.getAppClientByNetwork`.
If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.

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

Expand Down Expand Up @@ -82,7 +85,7 @@ Create a new ApplicationClient instance

#### Defined in

[src/types/app-client.ts:1166](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1166)
[src/types/app-client.ts:1305](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1305)

## Properties

Expand All @@ -92,7 +95,7 @@ Create a new ApplicationClient instance

#### Defined in

[src/types/app-client.ts:1154](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1154)
[src/types/app-client.ts:1293](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1293)

___

Expand All @@ -102,7 +105,7 @@ ___

#### Defined in

[src/types/app-client.ts:1153](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1153)
[src/types/app-client.ts:1292](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1292)

___

Expand All @@ -112,7 +115,7 @@ ___

#### Defined in

[src/types/app-client.ts:1156](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1156)
[src/types/app-client.ts:1295](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1295)

___

Expand All @@ -122,7 +125,7 @@ ___

#### Defined in

[src/types/app-client.ts:1158](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1158)
[src/types/app-client.ts:1297](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1297)

___

Expand All @@ -132,7 +135,7 @@ ___

#### Defined in

[src/types/app-client.ts:1159](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1159)
[src/types/app-client.ts:1298](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1298)

___

Expand All @@ -142,7 +145,7 @@ ___

#### Defined in

[src/types/app-client.ts:1155](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1155)
[src/types/app-client.ts:1294](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1294)

___

Expand All @@ -152,7 +155,7 @@ ___

#### Defined in

[src/types/app-client.ts:1145](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1145)
[src/types/app-client.ts:1284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1284)

___

Expand All @@ -162,7 +165,7 @@ ___

#### Defined in

[src/types/app-client.ts:1147](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1147)
[src/types/app-client.ts:1286](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1286)

___

Expand All @@ -172,7 +175,7 @@ ___

#### Defined in

[src/types/app-client.ts:1151](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1151)
[src/types/app-client.ts:1290](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1290)

___

Expand All @@ -182,7 +185,7 @@ ___

#### Defined in

[src/types/app-client.ts:1150](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1150)
[src/types/app-client.ts:1289](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1289)

___

Expand All @@ -192,7 +195,7 @@ ___

#### Defined in

[src/types/app-client.ts:1146](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1146)
[src/types/app-client.ts:1285](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1285)

___

Expand All @@ -202,7 +205,7 @@ ___

#### Defined in

[src/types/app-client.ts:1149](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1149)
[src/types/app-client.ts:1288](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1288)

___

Expand All @@ -212,7 +215,7 @@ ___

#### Defined in

[src/types/app-client.ts:1148](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1148)
[src/types/app-client.ts:1287](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1287)

## Methods

Expand All @@ -236,7 +239,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1484](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1484)
[src/types/app-client.ts:1623](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1623)

___

Expand All @@ -261,7 +264,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1557](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1557)
[src/types/app-client.ts:1696](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1696)

___

Expand All @@ -285,7 +288,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1538](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1538)
[src/types/app-client.ts:1677](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1677)

___

Expand All @@ -309,7 +312,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1529](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1529)
[src/types/app-client.ts:1668](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1668)

___

Expand All @@ -333,7 +336,7 @@ The compiled approval and clear programs

#### Defined in

[src/types/app-client.ts:1203](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1203)
[src/types/app-client.ts:1342](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1342)

___

Expand All @@ -357,7 +360,7 @@ The details of the created app, or the transaction to create it if `skipSending`

#### Defined in

[src/types/app-client.ts:1382](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1382)
[src/types/app-client.ts:1521](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1521)

___

Expand All @@ -381,7 +384,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1547](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1547)
[src/types/app-client.ts:1686](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1686)

___

Expand Down Expand Up @@ -411,7 +414,7 @@ The metadata and transaction result(s) of the deployment, or just the metadata i

#### Defined in

[src/types/app-client.ts:1272](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1272)
[src/types/app-client.ts:1411](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1411)

___

Expand All @@ -429,7 +432,7 @@ The source maps

#### Defined in

[src/types/app-client.ts:1239](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1239)
[src/types/app-client.ts:1378](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1378)

___

Expand All @@ -456,7 +459,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:1875](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1875)
[src/types/app-client.ts:2014](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2014)

___

Expand All @@ -480,7 +483,7 @@ The result of the funding

#### Defined in

[src/types/app-client.ts:1597](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1597)
[src/types/app-client.ts:1736](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1736)

___

Expand All @@ -504,7 +507,7 @@ The ABI method for the given method

#### Defined in

[src/types/app-client.ts:1834](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1834)
[src/types/app-client.ts:1973](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1973)

___

Expand All @@ -528,7 +531,7 @@ The ABI method params for the given method

#### Defined in

[src/types/app-client.ts:1812](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1812)
[src/types/app-client.ts:1951](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1951)

___

Expand All @@ -548,7 +551,7 @@ ___

#### Defined in

[src/types/app-client.ts:1892](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1892)
[src/types/app-client.ts:2031](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L2031)

___

Expand All @@ -567,7 +570,7 @@ The app reference, or if deployed using the `deploy` method, the app metadata to

#### Defined in

[src/types/app-client.ts:1844](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1844)
[src/types/app-client.ts:1983](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1983)

___

Expand All @@ -585,7 +588,7 @@ The names of the boxes

#### Defined in

[src/types/app-client.ts:1653](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1653)
[src/types/app-client.ts:1792](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1792)

___

Expand All @@ -609,7 +612,7 @@ The current box value as a byte array

#### Defined in

[src/types/app-client.ts:1668](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1668)
[src/types/app-client.ts:1807](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1807)

___

Expand All @@ -634,7 +637,7 @@ The current box value as a byte array

#### Defined in

[src/types/app-client.ts:1684](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1684)
[src/types/app-client.ts:1823](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1823)

___

Expand All @@ -659,7 +662,7 @@ The (name, value) pair of the boxes with values as raw byte arrays

#### Defined in

[src/types/app-client.ts:1700](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1700)
[src/types/app-client.ts:1839](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1839)

___

Expand All @@ -685,7 +688,7 @@ The (name, value) pair of the boxes with values as the ABI Value

#### Defined in

[src/types/app-client.ts:1722](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1722)
[src/types/app-client.ts:1861](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1861)

___

Expand All @@ -710,7 +713,7 @@ The call args ready to pass into an app call

#### Defined in

[src/types/app-client.ts:1744](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1744)
[src/types/app-client.ts:1883](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1883)

___

Expand All @@ -728,7 +731,7 @@ The global state

#### Defined in

[src/types/app-client.ts:1625](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1625)
[src/types/app-client.ts:1764](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1764)

___

Expand All @@ -752,7 +755,7 @@ The global state

#### Defined in

[src/types/app-client.ts:1639](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1639)
[src/types/app-client.ts:1778](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1778)

___

Expand All @@ -774,7 +777,7 @@ Import source maps for the app.

#### Defined in

[src/types/app-client.ts:1256](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1256)
[src/types/app-client.ts:1395](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1395)

___

Expand All @@ -798,7 +801,7 @@ The result of the call

#### Defined in

[src/types/app-client.ts:1520](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1520)
[src/types/app-client.ts:1659](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1659)

___

Expand All @@ -822,4 +825,4 @@ The transaction send result and the compilation result

#### Defined in

[src/types/app-client.ts:1445](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1445)
[src/types/app-client.ts:1584](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1584)
Loading

0 comments on commit 5a789eb

Please sign in to comment.