Skip to content

Commit

Permalink
Merge main into release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Dec 6, 2024
2 parents 00ba553 + 0007131 commit 2c6a0d6
Show file tree
Hide file tree
Showing 56 changed files with 858 additions and 760 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The goal of this library is to provide intuitive, productive utility functions t

Note: If you prefer Python there's an equivalent [Python utility library](https://github.com/algorandfoundation/algokit-utils-py).

[Install](#install) | [Documentation](docs/README.md)
[Install](#install) | [Documentation](./docs/README.md)

## Install

Expand Down
59 changes: 53 additions & 6 deletions docs/capabilities/transaction-composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,57 @@ The [methods to construct a transaction](../code/classes/types_composer.default.
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],
}).
const result = algorand
.newGroup()
.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (100).microAlgo() })
.addAppCallMethodCall({
sender: 'SENDER',
appId: 123n,
method: abiMethod,
args: [1, 2, 3],
})
```

## Simulating a transaction

Transactions can be simulated using the simulate endpoint in algod, which enables evaluating the transaction on the network without it actually being commited to a block.
This is a powerful feature, which has a number of options which are detailed in the [simulate API docs](https://developer.algorand.org/docs/rest-apis/algod/#post-v2transactionssimulate).

For example you can simulate a transaction group like below:

```typescript
const result = await algorand
.newGroup()
.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (100).microAlgo() })
.addAppCallMethodCall({
sender: 'SENDER',
appId: 123n,
method: abiMethod,
args: [1, 2, 3],
})
.simulate()
```

The above will execute a simulate request asserting that all transactions in the group are correctly signed.

### Simulate without signing

There are situations where you may not be able to (or want to) sign the transactions when executing simulate.
In these instances you should set `skipSignatures: true` which automatically builds empty transaction signers and sets both `fix-signers` and `allow-empty-signatures` to `true` when sending the algod API call.

For example:

```typescript
const result = await algorand
.newGroup()
.addPayment({ sender: 'SENDER', receiver: 'RECEIVER', amount: (100).microAlgo() })
.addAppCallMethodCall({
sender: 'SENDER',
appId: 123n,
method: abiMethod,
args: [1, 2, 3],
})
.simulate({
skipSignatures: true,
})
```
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:111](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L111)
[src/types/account.ts:110](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L110)

## Properties

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

#### 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:75](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L75)

___

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

#### Defined in

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

___

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

#### Defined in

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

## Accessors

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

#### 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:82](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L82)

___

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

#### 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:103](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L103)

___

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

#### 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:96](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L96)

___

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

#### 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:89](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/account.ts#L89)
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ URLTokenBaseHTTPClient.delete

#### Defined in

[src/types/algo-http-client-with-retry.ts:101](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L101)
[src/types/algo-http-client-with-retry.ts:100](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L100)

___

Expand All @@ -170,7 +170,7 @@ URLTokenBaseHTTPClient.get

#### Defined in

[src/types/algo-http-client-with-retry.ts:58](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L58)
[src/types/algo-http-client-with-retry.ts:57](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L57)

___

Expand All @@ -197,4 +197,4 @@ URLTokenBaseHTTPClient.post

#### Defined in

[src/types/algo-http-client-with-retry.ts:92](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L92)
[src/types/algo-http-client-with-retry.ts:91](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/algo-http-client-with-retry.ts#L91)
32 changes: 16 additions & 16 deletions docs/code/classes/types_app_client.AppClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ It does this by replacing any `undefined` values with the equivalent default val

#### Defined in

[src/types/app-client.ts:1030](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1030)
[src/types/app-client.ts:1029](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1029)

___

Expand Down Expand Up @@ -685,7 +685,7 @@ ___

#### Defined in

[src/types/app-client.ts:1405](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1405)
[src/types/app-client.ts:1404](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1404)

___

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

#### Defined in

[src/types/app-client.ts:1139](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1139)
[src/types/app-client.ts:1138](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1138)

___

Expand Down Expand Up @@ -736,7 +736,7 @@ ___

#### Defined in

[src/types/app-client.ts:1392](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1392)
[src/types/app-client.ts:1391](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1391)

___

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

#### Defined in

[src/types/app-client.ts:1104](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1104)
[src/types/app-client.ts:1103](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1103)

___

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

#### Defined in

[src/types/app-client.ts:1168](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1168)
[src/types/app-client.ts:1167](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1167)

___

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

#### Defined in

[src/types/app-client.ts:1437](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1437)
[src/types/app-client.ts:1436](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1436)

___

Expand Down Expand Up @@ -986,7 +986,7 @@ ___

#### Defined in

[src/types/app-client.ts:1334](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1334)
[src/types/app-client.ts:1333](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1333)

___

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

#### Defined in

[src/types/app-client.ts:1201](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1201)
[src/types/app-client.ts:1200](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1200)

___

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

#### Defined in

[src/types/app-client.ts:1241](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1241)
[src/types/app-client.ts:1240](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1240)

___

Expand All @@ -1055,7 +1055,7 @@ if none provided and throws an error if neither provided

#### Defined in

[src/types/app-client.ts:1375](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1375)
[src/types/app-client.ts:1374](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1374)

___

Expand All @@ -1064,7 +1064,7 @@ ___
**getSigner**(`sender`, `signer`): `undefined` \| `TransactionSigner` \| [`TransactionSignerAccount`](../interfaces/types_account.TransactionSignerAccount.md)

Returns the signer for a call, using the provided signer or the `defaultSigner`
if no signer was provided and the call will use default sender
if no signer was provided and the sender resolves to the default sender, the call will use default signer
or `undefined` otherwise (so the signer is resolved from `AlgorandClient`)

#### Parameters
Expand All @@ -1080,7 +1080,7 @@ or `undefined` otherwise (so the signer is resolved from `AlgorandClient`)

#### Defined in

[src/types/app-client.ts:1385](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1385)
[src/types/app-client.ts:1384](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1384)

___

Expand Down Expand Up @@ -1109,7 +1109,7 @@ ___

#### Defined in

[src/types/app-client.ts:1509](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1509)
[src/types/app-client.ts:1508](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1508)

___

Expand Down Expand Up @@ -1137,7 +1137,7 @@ Make the given call and catch any errors, augmenting with debugging information

#### Defined in

[src/types/app-client.ts:1429](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1429)
[src/types/app-client.ts:1428](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L1428)

___

Expand Down Expand Up @@ -1224,7 +1224,7 @@ Will store any generated source maps for later use in debugging.

#### Defined in

[src/types/app-client.ts:977](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L977)
[src/types/app-client.ts:976](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/app-client.ts#L976)

___

Expand Down
Loading

0 comments on commit 2c6a0d6

Please sign in to comment.