Skip to content

Commit 734c1bd

Browse files
committed
feat: support app call transaction access references
1 parent 3929c78 commit 734c1bd

19 files changed

+721
-223
lines changed

docs/code/classes/types_algorand_client_transaction_creator.AlgorandClientTransactionCreator.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ await algorand.createTransaction.appCall({
112112
appReferences: [123n, 1234n]
113113
assetReferences: [12345n]
114114
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
115+
accessReferences: [{ appId: 1234n }]
115116
lease: 'lease',
116117
note: 'note',
117118
// You wouldn't normally set this field
@@ -141,7 +142,7 @@ await algorand.createTransaction.appCall({
141142

142143
#### Defined in
143144

144-
[src/types/algorand-client-transaction-creator.ts:458](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L458)
145+
[src/types/algorand-client-transaction-creator.ts:462](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L462)
145146

146147
___
147148

@@ -182,6 +183,7 @@ await algorand.createTransaction.appCallMethodCall({
182183
appReferences: [123n, 1234n]
183184
assetReferences: [12345n]
184185
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
186+
accessReferences: [{ appId: 1234n }]
185187
lease: 'lease',
186188
note: 'note',
187189
// You wouldn't normally set this field
@@ -211,13 +213,13 @@ await algorand.createTransaction.appCallMethodCall({
211213

212214
#### Defined in
213215

214-
[src/types/algorand-client-transaction-creator.ts:653](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L653)
216+
[src/types/algorand-client-transaction-creator.ts:661](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L661)
215217

216218
___
217219

218220
### appCreate
219221

220-
• **appCreate**: (`params`: \{ `accountReferences?`: (`string` \| `Address`)[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` \| `Address` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` \| `Address` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` \| `bigint` }) => `Promise`\<`Transaction`\>
222+
• **appCreate**: (`params`: \{ `accessReferences?`: [`AccessReference`](../interfaces/types_app_manager.AccessReference.md)[] ; `accountReferences?`: (`string` \| `Address`)[] ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `extraProgramPages?`: `number` ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `NoOpOC` \| `OptInOC` \| `CloseOutOC` \| `UpdateApplicationOC` \| `DeleteApplicationOC` ; `rekeyTo?`: `string` \| `Address` ; `schema?`: \{ `globalByteSlices`: `number` ; `globalInts`: `number` ; `localByteSlices`: `number` ; `localInts`: `number` } ; `sender`: `string` \| `Address` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` \| `bigint` }) => `Promise`\<`Transaction`\>
221223

222224
Create an application create transaction.
223225

@@ -249,6 +251,7 @@ await algorand.createTransaction.appCreate({
249251
appReferences: [123n, 1234n]
250252
assetReferences: [12345n]
251253
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
254+
accessReferences: [{ appId: 1234n }]
252255
lease: 'lease',
253256
note: 'note',
254257
// You wouldn't normally set this field
@@ -271,6 +274,7 @@ await algorand.createTransaction.appCreate({
271274
| Name | Type | Description |
272275
| :------ | :------ | :------ |
273276
| `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. |
274278
| `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). |
275279
| `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). |
276280
| `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)). |
@@ -303,7 +307,7 @@ await algorand.createTransaction.appCreate({
303307

304308
#### Defined in
305309

306-
[src/types/algorand-client-transaction-creator.ts:354](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L354)
310+
[src/types/algorand-client-transaction-creator.ts:355](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L355)
307311

308312
___
309313

@@ -353,6 +357,7 @@ await algorand.createTransaction.appCreateMethodCall({
353357
appReferences: [123n, 1234n]
354358
assetReferences: [12345n]
355359
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
360+
accessReferences: [{ appId: 1234n }]
356361
lease: 'lease',
357362
note: 'note',
358363
// You wouldn't normally set this field
@@ -382,7 +387,7 @@ await algorand.createTransaction.appCreateMethodCall({
382387

383388
#### Defined in
384389

385-
[src/types/algorand-client-transaction-creator.ts:513](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L513)
390+
[src/types/algorand-client-transaction-creator.ts:518](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L518)
386391

387392
___
388393

@@ -411,6 +416,7 @@ await algorand.createTransaction.appDelete({
411416
appReferences: [123n, 1234n]
412417
assetReferences: [12345n]
413418
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
419+
accessReferences: [{ appId: 1234n }]
414420
lease: 'lease',
415421
note: 'note',
416422
// You wouldn't normally set this field
@@ -440,7 +446,7 @@ await algorand.createTransaction.appDelete({
440446

441447
#### Defined in
442448

443-
[src/types/algorand-client-transaction-creator.ts:424](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L424)
449+
[src/types/algorand-client-transaction-creator.ts:427](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L427)
444450

445451
___
446452

@@ -481,6 +487,7 @@ await algorand.createTransaction.appDeleteMethodCall({
481487
appReferences: [123n, 1234n]
482488
assetReferences: [12345n]
483489
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
490+
accessReferences: [{ appId: 1234n }]
484491
lease: 'lease',
485492
note: 'note',
486493
// You wouldn't normally set this field
@@ -510,13 +517,13 @@ await algorand.createTransaction.appDeleteMethodCall({
510517

511518
#### Defined in
512519

513-
[src/types/algorand-client-transaction-creator.ts:607](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L607)
520+
[src/types/algorand-client-transaction-creator.ts:614](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L614)
514521

515522
___
516523

517524
### appUpdate
518525

519-
• **appUpdate**: (`params`: \{ `accountReferences?`: (`string` \| `Address`)[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` \| `Address` ; `sender`: `string` \| `Address` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` \| `bigint` }) => `Promise`\<`Transaction`\>
526+
• **appUpdate**: (`params`: \{ `accessReferences?`: [`AccessReference`](../interfaces/types_app_manager.AccessReference.md)[] ; `accountReferences?`: (`string` \| `Address`)[] ; `appId`: `bigint` ; `appReferences?`: `bigint`[] ; `approvalProgram`: `string` \| `Uint8Array` ; `args?`: `Uint8Array`[] ; `assetReferences?`: `bigint`[] ; `boxReferences?`: ([`BoxIdentifier`](../modules/types_app_manager.md#boxidentifier) \| [`BoxReference`](../interfaces/types_app_manager.BoxReference.md))[] ; `clearStateProgram`: `string` \| `Uint8Array` ; `extraFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `firstValidRound?`: `bigint` ; `lastValidRound?`: `bigint` ; `lease?`: `string` \| `Uint8Array` ; `maxFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `note?`: `string` \| `Uint8Array` ; `onComplete?`: `UpdateApplicationOC` ; `rekeyTo?`: `string` \| `Address` ; `sender`: `string` \| `Address` ; `signer?`: `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md) ; `staticFee?`: [`AlgoAmount`](types_amount.AlgoAmount.md) ; `validityWindow?`: `number` \| `bigint` }) => `Promise`\<`Transaction`\>
520527

521528
Create an application update transaction.
522529

@@ -541,6 +548,7 @@ await algorand.createTransaction.appUpdate({
541548
appReferences: [123n, 1234n]
542549
assetReferences: [12345n]
543550
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
551+
accessReferences: [{ appId: 1234n }]
544552
lease: 'lease',
545553
note: 'note',
546554
// You wouldn't normally set this field
@@ -563,6 +571,7 @@ await algorand.createTransaction.appUpdate({
563571
| Name | Type | Description |
564572
| :------ | :------ | :------ |
565573
| `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. |
566575
| `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). |
567576
| `params.appId` | `bigint` | ID of the application; 0 if the application is being created. |
568577
| `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). |
@@ -590,7 +599,7 @@ await algorand.createTransaction.appUpdate({
590599

591600
#### Defined in
592601

593-
[src/types/algorand-client-transaction-creator.ts:390](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L390)
602+
[src/types/algorand-client-transaction-creator.ts:392](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L392)
594603

595604
___
596605

@@ -633,6 +642,7 @@ await algorand.createTransaction.appUpdateMethodCall({
633642
appReferences: [123n, 1234n]
634643
assetReferences: [12345n]
635644
boxReferences: ["box1", {appId: 1234n, name: "box2"}]
645+
accessReferences: [{ appId: 1234n }]
636646
lease: 'lease',
637647
note: 'note',
638648
// You wouldn't normally set this field
@@ -662,7 +672,7 @@ await algorand.createTransaction.appUpdateMethodCall({
662672

663673
#### Defined in
664674

665-
[src/types/algorand-client-transaction-creator.ts:561](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L561)
675+
[src/types/algorand-client-transaction-creator.ts:567](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L567)
666676

667677
___
668678

@@ -1116,7 +1126,7 @@ await algorand.createTransaction.offlineKeyRegistration({
11161126

11171127
#### Defined in
11181128

1119-
[src/types/algorand-client-transaction-creator.ts:725](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L725)
1129+
[src/types/algorand-client-transaction-creator.ts:733](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L733)
11201130

11211131
___
11221132

@@ -1182,7 +1192,7 @@ await algorand.createTransaction.onlineKeyRegistration({
11821192

11831193
#### Defined in
11841194

1185-
[src/types/algorand-client-transaction-creator.ts:695](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L695)
1195+
[src/types/algorand-client-transaction-creator.ts:703](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client-transaction-creator.ts#L703)
11861196

11871197
___
11881198

0 commit comments

Comments
 (0)