Skip to content

Commit

Permalink
chore: update package json to cover refactor semantic commits
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Oct 23, 2024
1 parent d50bf6a commit e013ad6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/code/classes/types_composer.default.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Create an `TransactionComposer`.

| Name | Type | Description |
| :------ | :------ | :------ |
| `params` | [`AlgoKitComposerParams`](../modules/types_composer.md#algokitcomposerparams) | The configuration for this composer |
| `params` | [`TransactionComposerParams`](../modules/types_composer.md#transactioncomposerparams) | The configuration for this composer |

#### Returns

Expand Down
46 changes: 23 additions & 23 deletions docs/code/modules/types_composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

### Type Aliases

- [AlgoKitComposerParams](types_composer.md#algokitcomposerparams)
- [AppCallMethodCall](types_composer.md#appcallmethodcall)
- [AppCallParams](types_composer.md#appcallparams)
- [AppCreateMethodCall](types_composer.md#appcreatemethodcall)
Expand All @@ -38,6 +37,7 @@
- [OnlineKeyRegistrationParams](types_composer.md#onlinekeyregistrationparams)
- [PaymentParams](types_composer.md#paymentparams)
- [SimulateOptions](types_composer.md#simulateoptions)
- [TransactionComposerParams](types_composer.md#transactioncomposerparams)
- [Txn](types_composer.md#txn)

### Variables
Expand All @@ -46,28 +46,6 @@

## Type Aliases

### AlgoKitComposerParams

Ƭ **AlgoKitComposerParams**: `Object`

Parameters to create an `TransactionComposer`.

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `algod` | `algosdk.Algodv2` | The algod client to use to get suggestedParams and send the transaction group |
| `appManager?` | [`AppManager`](../classes/types_app_manager.AppManager.md) | An existing `AppManager` to use to manage app compilation and cache compilation results. If not specified than an ephemeral one will be created. |
| `defaultValidityWindow?` | `number` | How many rounds a transaction should be valid for by default; if not specified then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet). |
| `getSigner` | (`address`: `string`) => `algosdk.TransactionSigner` | - |
| `getSuggestedParams?` | () => `Promise`\<`algosdk.SuggestedParams`\> | - |

#### Defined in

[src/types/composer.ts:464](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L464)

___

### AppCallMethodCall

Ƭ **AppCallMethodCall**: [`AppMethodCall`](types_composer.md#appmethodcall)\<[`AppMethodCallParams`](types_composer.md#appmethodcallparams)\>
Expand Down Expand Up @@ -374,6 +352,28 @@ Options to control a simulate request

___

### TransactionComposerParams

Ƭ **TransactionComposerParams**: `Object`

Parameters to create an `TransactionComposer`.

#### Type declaration

| Name | Type | Description |
| :------ | :------ | :------ |
| `algod` | `algosdk.Algodv2` | The algod client to use to get suggestedParams and send the transaction group |
| `appManager?` | [`AppManager`](../classes/types_app_manager.AppManager.md) | An existing `AppManager` to use to manage app compilation and cache compilation results. If not specified than an ephemeral one will be created. |
| `defaultValidityWindow?` | `number` | How many rounds a transaction should be valid for by default; if not specified then will be 10 rounds (or 1000 rounds if issuing transactions to LocalNet). |
| `getSigner` | (`address`: `string`) => `algosdk.TransactionSigner` | - |
| `getSuggestedParams?` | () => `Promise`\<`algosdk.SuggestedParams`\> | - |

#### Defined in

[src/types/composer.ts:464](https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/composer.ts#L464)

___

### Txn

Ƭ **Txn**: [`PaymentParams`](types_composer.md#paymentparams) & \{ `type`: ``"pay"`` } \| [`AssetCreateParams`](types_composer.md#assetcreateparams) & \{ `type`: ``"assetCreate"`` } \| [`AssetConfigParams`](types_composer.md#assetconfigparams) & \{ `type`: ``"assetConfig"`` } \| [`AssetFreezeParams`](types_composer.md#assetfreezeparams) & \{ `type`: ``"assetFreeze"`` } \| [`AssetDestroyParams`](types_composer.md#assetdestroyparams) & \{ `type`: ``"assetDestroy"`` } \| [`AssetTransferParams`](types_composer.md#assettransferparams) & \{ `type`: ``"assetTransfer"`` } \| [`AssetOptInParams`](types_composer.md#assetoptinparams) & \{ `type`: ``"assetOptIn"`` } \| [`AssetOptOutParams`](types_composer.md#assetoptoutparams) & \{ `type`: ``"assetOptOut"`` } \| [`AppCallParams`](types_composer.md#appcallparams) \| [`AppCreateParams`](types_composer.md#appcreateparams) \| [`AppUpdateParams`](types_composer.md#appupdateparams) & \{ `type`: ``"appCall"`` } \| [`OnlineKeyRegistrationParams`](types_composer.md#onlinekeyregistrationparams) & \{ `type`: ``"keyReg"`` } \| `algosdk.TransactionWithSigner` & \{ `type`: ``"txnWithSigner"`` } \| \{ `atc`: `algosdk.AtomicTransactionComposer` ; `type`: ``"atc"`` } \| [`AppCallMethodCall`](types_composer.md#appcallmethodcall) \| [`AppCreateMethodCall`](types_composer.md#appcreatemethodcall) \| [`AppUpdateMethodCall`](types_composer.md#appupdatemethodcall) & \{ `type`: ``"methodCall"`` }
Expand Down
19 changes: 19 additions & 0 deletions docs/v7-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ If you are converting from an older typed client to a new one you will need to m
- `client.compose()` is now `client.newGroup()`
- `client.compose()....execute()` is now `client.compose()....send()`

### Step 5 - Rename AlgoKitComposer to TransactionComposer

In v7, `AlgoKitComposer` has been renamed to `TransactionComposer`. To migrate:

1. Replace all occurrences of `AlgoKitComposer` with `TransactionComposer`.
2. Update import statements:

```typescript
// Old
import { AlgoKitComposer } from '@algorandfoundation/algokit-utils'
// New
import { TransactionComposer } from '@algorandfoundation/algokit-utils'
```

3. Rename `AlgoKitComposerParams` type to `TransactionComposerParams` (if you were referencing it directly).
4. Review code interacting with the composer for compatibility with the new class.

This change aligns the class name with its purpose and improves consistency with Algorand terminology.

### Optional steps

#### AlgoKit VScode AVM debugger extension utils
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
{
"type": "chore",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
}
]
}
Expand All @@ -143,6 +147,10 @@
"type": "build",
"section": "Dependencies and Other Build Updates",
"hidden": false
},
{
"type": "refactor",
"section": "Code Refactoring"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/types/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export type Txn =
| ((AppCallMethodCall | AppCreateMethodCall | AppUpdateMethodCall) & { type: 'methodCall' })

/** Parameters to create an `TransactionComposer`. */
export type AlgoKitComposerParams = {
export type TransactionComposerParams = {
/** The algod client to use to get suggestedParams and send the transaction group */
algod: algosdk.Algodv2
/** The function used to get the TransactionSigner for a given address */
Expand Down Expand Up @@ -524,7 +524,7 @@ export default class TransactionComposer {
* Create an `TransactionComposer`.
* @param params The configuration for this composer
*/
constructor(params: AlgoKitComposerParams) {
constructor(params: TransactionComposerParams) {
this.algod = params.algod
const defaultGetSuggestedParams = () => params.algod.getTransactionParams().do()
this.getSuggestedParams = params.getSuggestedParams ?? defaultGetSuggestedParams
Expand Down

0 comments on commit e013ad6

Please sign in to comment.