Skip to content

Commit

Permalink
feat: AlgorandClient and related classes (#234)
Browse files Browse the repository at this point in the history
* feat: client and composer

* add composer and client to index.ts

* fix flatFee check

* fix typos

Co-authored-by: Tristan Menzel <[email protected]>

* implement isAbiValue

Co-authored-by: Tristan Menzel <[email protected]>

* txnMethodMap

* return txnWithSigners instead of mutating

co-authored-by: Tristan Menzel <[email protected]>

* improve methodCalls efficiency

co-authored-by: Tristan Menzel <[email protected]>

* refactor: Use switch blocks over if/else chains

* send and transaction

* rm debug from test

* implement max fee in composer

* start adding comments

* assetOptIn

* add more comments

* flatFee -> staticFee

* Uint8Array | string

* bigint and AlgoAmount

* Tweaks to AlgorandClient: (#248)

* Tweaks to AlgorandClient:
* Rename AlgoKitClient to AlgorandClient and added static construction methods
* Added fluent with* methods to AlgorandClient to allow for fluent configuration
* Extracted client related stuff to ClientManager and account stuff to AccountManager and added extra functionality to both
* Add transaction and confirmation to the result of sending a single transaction for better ergonomics
* Added ability to specify suggested params and create a copy of suggested params when providing it
* Moved classes to types directory
* Added getAccountInformation to make tests terser (this method should have been added ages ago)
* Incorporated client into testing fixture
* Changed all possible bigint | numbers' to number (where it's impractical for them to hit 2^53)
* Incorporated TransactionSignerAccount with TransactionSigner to allow for terser code
* Rename ID to Id for consistency with rest of algokit utils

* use bigint where applicable

---------

Co-authored-by: Joe Polny <[email protected]>

* fix rollup issues

* to -> receiver

* getAccountAssetInformation

* change with... methods to set...

* persistent algorandClient

* defaultValidityWindow configuration

* fix AlgorandClient export

* closeRemainderTo

* onlineKeyReg

* update asset param comments

* AlgokitComposerParams

* AccountManager TSDoc

* generate docs

* refactor: Added final polish for beta release of AlgorandClient and AlgoKitComposer
test: Fixing indexer intermittent test timeouts with 20s waits for tests that wait for indexer

* rm aliases

* atc property and status check on build

* common build step in buildMethodCall

* export AlgorandClient

* fix typo

* use beta tag

* revert test changes made in 15ba017

* fix circular import

---------

Co-authored-by: Tristan Menzel <[email protected]>
Co-authored-by: Tristan Menzel <[email protected]>
Co-authored-by: Rob Moore (MakerX) <[email protected]>
  • Loading branch information
4 people authored Apr 18, 2024
1 parent 56265b0 commit ad7dc8e
Show file tree
Hide file tree
Showing 48 changed files with 5,598 additions and 161 deletions.
5 changes: 5 additions & 0 deletions docs/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
- [index](modules/index.md)
- [testing](modules/testing.md)
- [types/account](modules/types_account.md)
- [types/account-manager](modules/types_account_manager.md)
- [types/algo-http-client-with-retry](modules/types_algo_http_client_with_retry.md)
- [types/algorand-client](modules/types_algorand_client.md)
- [types/algorand-client.spec](modules/types_algorand_client_spec.md)
- [types/amount](modules/types_amount.md)
- [types/amount.spec](modules/types_amount_spec.md)
- [types/app](modules/types_app.md)
- [types/app-client](modules/types_app_client.md)
- [types/app-client.spec](modules/types_app_client_spec.md)
- [types/app-spec](modules/types_app_spec.md)
- [types/asset](modules/types_asset.md)
- [types/client-manager](modules/types_client_manager.md)
- [types/composer](modules/types_composer.md)
- [types/config](modules/types_config.md)
- [types/debugging](modules/types_debugging.md)
- [types/dispenser-client](modules/types_dispenser_client.md)
Expand Down
20 changes: 10 additions & 10 deletions docs/code/classes/types_account.MultisigAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Account wrapper that supports partial or full multisig signing.

#### Defined in

[src/types/account.ts:38](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L38)
[src/types/account.ts:39](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L39)

## Properties

Expand All @@ -59,7 +59,7 @@ Account wrapper that supports partial or full multisig signing.

#### Defined in

[src/types/account.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L16)
[src/types/account.ts:17](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L17)

___

Expand All @@ -69,7 +69,7 @@ ___

#### Defined in

[src/types/account.ts:14](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L14)
[src/types/account.ts:15](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L15)

___

Expand All @@ -79,7 +79,7 @@ ___

#### Defined in

[src/types/account.ts:17](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L17)
[src/types/account.ts:18](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L18)

___

Expand All @@ -89,7 +89,7 @@ ___

#### Defined in

[src/types/account.ts:15](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L15)
[src/types/account.ts:16](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L16)

## Accessors

Expand All @@ -105,7 +105,7 @@ The address of the multisig account

#### Defined in

[src/types/account.ts:30](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L30)
[src/types/account.ts:31](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L31)

___

Expand All @@ -121,7 +121,7 @@ The parameters for the multisig account

#### Defined in

[src/types/account.ts:20](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L20)
[src/types/account.ts:21](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L21)

___

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

#### Defined in

[src/types/account.ts:34](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L34)
[src/types/account.ts:35](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L35)

___

Expand All @@ -151,7 +151,7 @@ readonly (`default` \| [`SigningAccount`](types_account.SigningAccount.md))[]

#### Defined in

[src/types/account.ts:25](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L25)
[src/types/account.ts:26](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L26)

## Methods

Expand All @@ -175,4 +175,4 @@ The transaction signed by the present signers

#### Defined in

[src/types/account.ts:53](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L53)
[src/types/account.ts:54](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L54)
16 changes: 8 additions & 8 deletions docs/code/classes/types_account.SigningAccount.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Account wrapper that supports a rekeyed account

#### Defined in

[src/types/account.ts:104](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L104)
[src/types/account.ts:105](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L105)

## Properties

Expand All @@ -58,7 +58,7 @@ Account wrapper that supports a rekeyed account

#### Defined in

[src/types/account.ts:69](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L69)
[src/types/account.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L70)

___

Expand All @@ -68,7 +68,7 @@ ___

#### Defined in

[src/types/account.ts:71](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L71)
[src/types/account.ts:72](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L72)

___

Expand All @@ -78,7 +78,7 @@ ___

#### Defined in

[src/types/account.ts:70](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L70)
[src/types/account.ts:71](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L71)

## Accessors

Expand All @@ -98,7 +98,7 @@ Account.addr

#### Defined in

[src/types/account.ts:76](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L76)
[src/types/account.ts:77](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L77)

___

Expand All @@ -114,7 +114,7 @@ Algorand account of the sender address and signer private key

#### Defined in

[src/types/account.ts:97](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L97)
[src/types/account.ts:98](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L98)

___

Expand All @@ -130,7 +130,7 @@ Transaction signer for the underlying signing account

#### Defined in

[src/types/account.ts:90](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L90)
[src/types/account.ts:91](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L91)

___

Expand All @@ -150,4 +150,4 @@ Account.sk

#### Defined in

[src/types/account.ts:83](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L83)
[src/types/account.ts:84](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L84)
Loading

0 comments on commit ad7dc8e

Please sign in to comment.