-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Deprecated methods in transaction module BREAKING CHANGE: `ExecuteParams` has been moved from `types/composer` to `types/transaction` * feat: Added `AppClient` as an ARC-56 compatible non-typed application client * feat: Added `AppFactory` as an ARC-32/ARC-56 compatible mechanism to create and deploy apps and create app clients test: Added test coverage of AppClient and AppFactory BREAKING CHANGE: `persistSourceMaps` takes `appManager` rather than `client` now * docs: Added migration guide and app-client documentation feat: Added appClient.params.fundAppAccount and appClient.transactions.fundAppAccount fix: Allow extraProgramPages to be passed into create and deploy call as override * feat: Proper ARC-56 struct support feat: Added a number of methods and types to ARC-56 to make interacting with it easier * Linting and PR review * feat: ARC-56 Typed client support * feat: Added logging when sending app calls * fix: Fixing minor bugs * fixes * feat: Finalised typed app client construction methods * PR feedback * feat: AlgoAmount microAlgo/s property now returns a bigint BREAKING CHANGE: microAlgo/s property in AlgoAmount now returns a bigint
- Loading branch information
Showing
152 changed files
with
9,457 additions
and
2,187 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
# AlgoKit composer | ||
|
||
TODO | ||
The `AlgoKitComposer` class allows you to easily compose one or more compliant Algorand transactions and execute and/or simulate them. | ||
|
||
It's the core of how the [`AlgorandClient`](./algorand-client.md) class composes and sends transactions. | ||
|
||
To get an instance of `AlgoKitComposer` you can either get it from an [app client](./app-client.md), from an [`AlgorandClient`](./algorand-client.md), or by new-ing up via the constructor. | ||
|
||
```typescript | ||
const composerFromAlgorand = algorand.newGroup() | ||
const composerFromAppClient = appClient.newGroup() | ||
const composerFromConstructor = new AlgoKitComposer({ | ||
algod, | ||
/* Return the algosdk.TransactionSigner for this address*/ | ||
getSigner: (address: string) => signer, | ||
}) | ||
const composerFromConstructorWithOptionalParams = new AlgoKitComposer({ | ||
algod, | ||
/* Return the algosdk.TransactionSigner for this address*/ | ||
getSigner: (address: string) => signer, | ||
getSuggestedParams: () => algod.getTransactionParams().do(), | ||
defaultValidityWindow: 1000, | ||
appManager: new AppManager(algod), | ||
}) | ||
``` | ||
|
||
## Constructing a transaction | ||
|
||
To construct a transaction you need to add it to the composer, passing in the relevant [params object](../code/modules/types_composer.md#type-aliases) for that transaction. Params are normal JavaScript objects and all of them extend the [common call parameters](./algorand-client.md#transaction-parameters). | ||
|
||
The [methods to construct a transaction](../code/classes/types_composer.default.md#methods) are all named `add{TransactionType}` and return an instance of the composer so they can be chained together fluently to construct a transaction group. | ||
|
||
For example: | ||
|
||
```typescript | ||
const result = algorand.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (100).microAlgo() }).addAppCallMethodCall({ | ||
sender: 'SENDER', | ||
appId: 123n, | ||
method: abiMethod, | ||
args: [1, 2, 3], | ||
}). | ||
``` |
Oops, something went wrong.