Skip to content

Commit 3d899a4

Browse files
authored
Merge pull request #457 from algorandfoundation/composer-integration
Composer integration
2 parents f1b5883 + b0df331 commit 3d899a4

File tree

170 files changed

+6318
-18041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+6318
-18041
lines changed

MIGRATION-NOTES.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,43 @@
22

33
A collection of random notes pop up during the migration process.
44

5-
- TODO: review the retry logic
6-
- const { lastRound: firstRound } = suggestedParams! // TODO: document suggested params doesn't have first round anymore
75
- explain the type differences between transact and algod
8-
- remove waitForIndexer
9-
- DO NOT remove it
10-
- ATC was removed as a transaction type in the composer
116
- Fee calc inside the txn constructor
127
- error messages changed, for example, asset tests
138
- `AssetHoldingReference` replaced by `HoldingReference`
149
- `ApplicationLocalReference` replaced by `LocalsReference`
15-
- BoxReference is gone too
16-
- Error name is gone (snapshot tests updated)
17-
- TODO: remove the ATC too
1810
- TODO: add interface for breaking change, for example, Transaction
19-
- TODO: simplify signer + account
2011
- TODO: take notes of the legacy functions to be removed and communicate with devrels
21-
- TODO: standardise box ref
2212
- TODO: keep track of the changes we make to algokit_transact to fit with algosdk
2313
- For integration with lora to work:
2414
- need to update subscriber to use the new utils and remove algosdk
25-
- TODO: go ahead with resource/fee on build. Need to have backward compatibility, when resource population is set in send, do it but make sure that it only happens once.
2615
- `encodeUnsignedSimulateTransaction` was removed from sdk
16+
- can't addatc into the composer anymore, can addTransactionComposer to composer. Adding composer is just cloning the txns from the param composer to the caller composer
17+
- SendAtomicTransactionComposerResults.group is string | undefined
18+
- buildTransactions will include the signer for nested txn now, this was done at the ATC before
2719
- Discuss the inconsistency of transaction and txn, txIds, txID
2820
- Disucss the naming of foreignApps vs appReferences + access references
2921
- Discuss appCall vs applicationCall
3022
- SourceMap was renamed to ProgramSourceMap
3123
- OnApplicationComplete.UpdateApplicationOC was renamed to OnApplicationComplete.UpdateApplication
3224
- ResourceReference (algod) vs AccessReference (utils)
25+
- check for buffer polyfill
26+
- transaction.ts
27+
- sendTransaction takes composer
28+
- getGroupExecutionInfo removed
29+
- getAtomicTransactionComposerTransactions becomes async
30+
- call composer .build instead of atc buildGroup. This will populate resources too
31+
- suggestedParams was removed from AdditionalAtomicTransactionComposerContext
32+
- generated app client will be changed, no references to atc anymore (this was for v2, confirm for v3)
33+
- atc.parseMethodResponse was replaced by app-manager.getABIReturn
34+
- transaction_asserts uses 'noble/ed25519' while composer uses nacl, which one should we use?
35+
- additionalAtcContext was removed from AtomicTransactionComposerToSend
36+
- ABI
37+
- how to construct ABIStruct from string
38+
- Make sure that the python utils also sort resources during resource population
39+
- migration stratefy for EventType.TxnGroupSimulated in utils-ts-debug
40+
- TODO: docs for composer simulate workflow
41+
- without calling `build` first => simulate without resource population
42+
- call `build` -> resource population into transactions with signers -> simulate will use the transactions with signers
43+
- review the names of SignedTransactionWrapper
44+
- TODO: re-export transact under utils/transact folder

docs/code/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
- [types/app-factory-and-client.spec](modules/types_app_factory_and_client_spec.md)
3030
- [types/app-manager](modules/types_app_manager.md)
3131
- [types/app-spec](modules/types_app_spec.md)
32-
- [types/asset](modules/types_asset.md)
3332
- [types/asset-manager](modules/types_asset_manager.md)
3433
- [types/async-event-emitter](modules/types_async_event_emitter.md)
3534
- [types/async-event-emitter.spec](modules/types_async_event_emitter_spec.md)
@@ -51,4 +50,3 @@
5150
- [types/network-client](modules/types_network_client.md)
5251
- [types/testing](modules/types_testing.md)
5352
- [types/transaction](modules/types_transaction.md)
54-
- [types/transfer](modules/types_transfer.md)

docs/code/classes/types_account_manager.AccountManager.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ ___
221221

222222
### ensureFunded
223223

224-
**ensureFunded**(`accountToFund`, `dispenserAccount`, `minSpendingBalance`, `options?`): `Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
224+
**ensureFunded**(`accountToFund`, `dispenserAccount`, `minSpendingBalance`, `options?`): `Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
225225

226226
Funds a given account using a dispenser account as a funding source such that
227227
the given account has a certain amount of Algo free to spend (accounting for
@@ -240,7 +240,7 @@ https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr
240240

241241
#### Returns
242242

243-
`Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
243+
`Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
244244

245245
- The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
246246
- `undefined` if no funds were needed.
@@ -264,7 +264,7 @@ ___
264264

265265
### ensureFundedFromEnvironment
266266

267-
**ensureFundedFromEnvironment**(`accountToFund`, `minSpendingBalance`, `options?`): `Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
267+
**ensureFundedFromEnvironment**(`accountToFund`, `minSpendingBalance`, `options?`): `Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
268268

269269
Funds a given account using a dispenser account retrieved from the environment,
270270
per the `dispenserFromEnvironment` method, as a funding source such that
@@ -289,7 +289,7 @@ https://dev.algorand.co/concepts/smart-contracts/costs-constraints#mbr
289289

290290
#### Returns
291291

292-
`Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
292+
`Promise`\<`undefined` \| \{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] } & [`EnsureFundedResult`](../interfaces/types_account_manager.EnsureFundedResult.md)\>
293293

294294
- The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
295295
- `undefined` if no funds were needed.
@@ -680,7 +680,7 @@ ___
680680

681681
### rekeyAccount
682682

683-
**rekeyAccount**(`account`, `rekeyTo`, `options?`): `Promise`\<\{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] }\>
683+
**rekeyAccount**(`account`, `rekeyTo`, `options?`): `Promise`\<\{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] }\>
684684

685685
Rekey an account to a new address.
686686

@@ -696,7 +696,7 @@ Rekey an account to a new address.
696696

697697
#### Returns
698698

699-
`Promise`\<\{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] }\>
699+
`Promise`\<\{ `confirmation`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper) ; `confirmations`: [`PendingTransactionResponseWrapper`](../modules/types_transaction.md#pendingtransactionresponsewrapper)[] ; `groupId`: `undefined` \| `string` ; `returns?`: [`ABIReturn`](../modules/types_app.md#abireturn)[] ; `transaction`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md) ; `transactions`: [`TransactionWrapper`](types_transaction.TransactionWrapper.md)[] ; `txIds`: `string`[] }\>
700700

701701
The result of the transaction and the transaction that was sent
702702

docs/code/classes/types_algorand_client.AlgorandClient.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ const payment = await AlgorandClient.mainNet().createTransaction.payment({
359359

360360
#### Defined in
361361

362-
[src/types/algorand-client.ts:272](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L272)
362+
[src/types/algorand-client.ts:273](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L273)
363363

364364
___
365365

@@ -387,7 +387,7 @@ const result = await AlgorandClient.mainNet().send.payment({
387387

388388
#### Defined in
389389

390-
[src/types/algorand-client.ts:258](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L258)
390+
[src/types/algorand-client.ts:259](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L259)
391391

392392
## Methods
393393

@@ -417,10 +417,16 @@ ___
417417

418418
### newGroup
419419

420-
**newGroup**(): [`TransactionComposer`](types_composer.TransactionComposer.md)
420+
**newGroup**(`composerConfig?`): [`TransactionComposer`](types_composer.TransactionComposer.md)
421421

422422
Start a new `TransactionComposer` transaction group
423423

424+
#### Parameters
425+
426+
| Name | Type |
427+
| :------ | :------ |
428+
| `composerConfig?` | [`TransactionComposerConfig`](../modules/types_composer.md#transactioncomposerconfig) |
429+
424430
#### Returns
425431

426432
[`TransactionComposer`](types_composer.TransactionComposer.md)
@@ -700,7 +706,7 @@ const algorand = AlgorandClient.defaultLocalNet();
700706

701707
#### Defined in
702708

703-
[src/types/algorand-client.ts:284](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L284)
709+
[src/types/algorand-client.ts:285](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L285)
704710

705711
___
706712

@@ -730,7 +736,7 @@ const algorand = AlgorandClient.fromClients({ algod, indexer, kmd });
730736

731737
#### Defined in
732738

733-
[src/types/algorand-client.ts:327](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L327)
739+
[src/types/algorand-client.ts:328](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L328)
734740

735741
___
736742

@@ -760,7 +766,7 @@ const client = AlgorandClient.fromConfig({ algodConfig, indexerConfig, kmdConfig
760766

761767
#### Defined in
762768

763-
[src/types/algorand-client.ts:361](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L361)
769+
[src/types/algorand-client.ts:362](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L362)
764770

765771
___
766772

@@ -797,7 +803,7 @@ const client = AlgorandClient.fromEnvironment();
797803

798804
#### Defined in
799805

800-
[src/types/algorand-client.ts:350](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L350)
806+
[src/types/algorand-client.ts:351](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L351)
801807

802808
___
803809

@@ -821,7 +827,7 @@ const algorand = AlgorandClient.mainNet();
821827

822828
#### Defined in
823829

824-
[src/types/algorand-client.ts:312](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L312)
830+
[src/types/algorand-client.ts:313](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L313)
825831

826832
___
827833

@@ -845,4 +851,4 @@ const algorand = AlgorandClient.testNet();
845851

846852
#### Defined in
847853

848-
[src/types/algorand-client.ts:298](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L298)
854+
[src/types/algorand-client.ts:299](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algorand-client.ts#L299)

0 commit comments

Comments
 (0)