You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/capabilities/app.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,6 +382,7 @@ When interacting with apps (creating, updating, deleting, calling), there are so
382
382
-`appReferences?: bigint[]` - The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
383
383
-`assetReferences?: bigint[]` - The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).
384
384
-`boxReferences?: (BoxReference | BoxIdentifier)[]` - Any [boxes](#box-references) to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays)
385
+
-`accessReference?: AccessReference[]` - Unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty.
385
386
386
387
When making an ABI call, the `args` parameter is replaced with a different type and there is also a `method` parameter per the [`AppMethodCall`](../code/modules/types_composer.md#appmethodcall) type:
Access references provide a unified way to specify all types of resource references (accounts, apps, assets, boxes, asset holdings, and app locals) that need to be accessible during smart contract execution. They are an alternative to using the separate `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` parameters.
435
+
436
+
In using this unified field, you are able to use a total of 16 individual references, however cross references which enable smart contract access to local state and account asset balance information must be explicitly defined using `locals` and `holdings` fields respectively.
437
+
When using the seperate reference arrays, you are constraints to a collective total of 8.
438
+
439
+
The separate reference arrays (`accountReferences`, `appReferences`, etc.) remain fully supported, however when using `accessReferences`, you cannot also use `accountReferences`, `appReferences`, `assetReferences` or `boxReferences`.
440
+
431
441
## Compilation
432
442
433
443
The [`AppManager`](#appmanager) class allows you to compile TEAL code with caching semantics that allows you to avoid duplicate compilation and keep track of source maps from compiled code.
|`params`|`Object`| The parameters for the app creation transaction |
277
+
|`params.accessReferences?`|[`AccessReference`](../interfaces/types_app_manager.AccessReference.md)[]| Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. |
274
278
|`params.accountReferences?`| (`string`\|`Address`)[]| Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). |
275
279
|`params.appReferences?`|`bigint`[]| The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). |
276
280
|`params.approvalProgram`|`string`\|`Uint8Array`| The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). |
|`params`|`Object`| The parameters for the app update transaction |
574
+
|`params.accessReferences?`|[`AccessReference`](../interfaces/types_app_manager.AccessReference.md)[]| Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. |
566
575
|`params.accountReferences?`| (`string`\|`Address`)[]| Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). |
567
576
|`params.appId`|`bigint`| ID of the application; 0 if the application is being created. |
568
577
|`params.appReferences?`|`bigint`[]| The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). |
0 commit comments