Skip to content

feat!: replace AlgorandClientInterface with AlgorandClient #387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- [types/account-manager.spec](modules/types_account_manager_spec.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-interface](modules/types_algorand_client_interface.md)
- [types/algorand-client-transaction-creator](modules/types_algorand_client_transaction_creator.md)
- [types/algorand-client-transaction-sender](modules/types_algorand_client_transaction_sender.md)
- [types/algorand-client.asset.spec](modules/types_algorand_client_asset_spec.md)
Expand Down Expand Up @@ -43,7 +42,6 @@
- [types/dispenser-client.spec](modules/types_dispenser_client_spec.md)
- [types/expand](modules/types_expand.md)
- [types/indexer](modules/types_indexer.md)
- [types/interface-of](modules/types_interface_of.md)
- [types/kmd-account-manager](modules/types_kmd_account_manager.md)
- [types/lifecycle-events](modules/types_lifecycle_events.md)
- [types/logging](modules/types_logging.md)
Expand Down
10 changes: 5 additions & 5 deletions docs/code/classes/types_app_client.AppClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const appClient = new AppClient({

### \_algorand

• `Private` **\_algorand**: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• `Private` **\_algorand**: [`AlgorandClient`](types_algorand_client.AlgorandClient.md)

#### Defined in

Expand Down Expand Up @@ -306,13 +306,13 @@ ___

### algorand

• `get` **algorand**(): [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• `get` **algorand**(): [`AlgorandClient`](types_algorand_client.AlgorandClient.md)

A reference to the underlying `AlgorandClient` this app client is using.

#### Returns

[`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
[`AlgorandClient`](types_algorand_client.AlgorandClient.md)

#### Defined in

Expand Down Expand Up @@ -1345,7 +1345,7 @@ using AlgoKit app deployment semantics (i.e. looking for the app creation transa
| Name | Type | Description |
| :------ | :------ | :------ |
| `params` | `Object` | The parameters to create the app client |
| `params.algorand` | [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface) | An `AlgorandClient` instance |
| `params.algorand` | [`AlgorandClient`](types_algorand_client.AlgorandClient.md) | An `AlgorandClient` instance |
| `params.appLookupCache?` | [`AppLookup`](../interfaces/types_app_deployer.AppLookup.md) | An optional cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this `ClientManager` on construction. |
| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name |
| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) |
Expand Down Expand Up @@ -1392,7 +1392,7 @@ If no IDs are in the app spec or the network isn't recognised, an error is throw
| Name | Type | Description |
| :------ | :------ | :------ |
| `params` | `Object` | The parameters to create the app client |
| `params.algorand` | [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface) | An `AlgorandClient` instance |
| `params.algorand` | [`AlgorandClient`](types_algorand_client.AlgorandClient.md) | An `AlgorandClient` instance |
| `params.appName?` | `string` | Optional override for the app name; used for on-chain metadata and lookups. Defaults to the ARC-32/ARC-56 app spec name |
| `params.appSpec` | `string` \| [`Arc56Contract`](../interfaces/types_app_arc56.Arc56Contract.md) \| [`AppSpec`](../interfaces/types_app_spec.AppSpec.md) | The ARC-56 or ARC-32 application spec as either: * Parsed JSON ARC-56 `Contract` * Parsed JSON ARC-32 `AppSpec` * Raw JSON string (in either ARC-56 or ARC-32 format) |
| `params.approvalSourceMap?` | `ProgramSourceMap` | Optional source map for the approval program |
Expand Down
6 changes: 3 additions & 3 deletions docs/code/classes/types_app_factory.AppFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const appFactory = new AppFactory({

### \_algorand

• `Private` **\_algorand**: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• `Private` **\_algorand**: [`AlgorandClient`](types_algorand_client.AlgorandClient.md)

#### Defined in

Expand Down Expand Up @@ -265,13 +265,13 @@ Send transactions to the current app

### algorand

• `get` **algorand**(): [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• `get` **algorand**(): [`AlgorandClient`](types_algorand_client.AlgorandClient.md)

Return the algorand client this factory is using.

#### Returns

[`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
[`AlgorandClient`](types_algorand_client.AlgorandClient.md)

#### Defined in

Expand Down
4 changes: 2 additions & 2 deletions docs/code/classes/types_client_manager.ClientManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ algosdk clients or config for interacting with the official Algorand APIs.
| Name | Type | Description |
| :------ | :------ | :------ |
| `clientsOrConfig` | [`AlgoConfig`](../interfaces/types_network_client.AlgoConfig.md) \| [`AlgoSdkClients`](../interfaces/types_client_manager.AlgoSdkClients.md) | The clients or config to use |
| `algorandClient?` | [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface) | - |
| `algorandClient?` | [`AlgorandClient`](types_algorand_client.AlgorandClient.md) | - |

#### Returns

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

### \_algorand

• `Private` `Optional` **\_algorand**: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• `Private` `Optional` **\_algorand**: [`AlgorandClient`](types_algorand_client.AlgorandClient.md)

#### Defined in

Expand Down
2 changes: 1 addition & 1 deletion docs/code/interfaces/types_app_client.AppClientParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Parameters to create an app client

### algorand

• **algorand**: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• **algorand**: [`AlgorandClient`](../classes/types_algorand_client.AlgorandClient.md)

An `AlgorandClient` instance

Expand Down
2 changes: 1 addition & 1 deletion docs/code/interfaces/types_app_factory.AppFactoryParams.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Parameters to create an app client

### algorand

• **algorand**: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface)
• **algorand**: [`AlgorandClient`](../classes/types_algorand_client.AlgorandClient.md)

`AlgorandClient` instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Interface to identify a typed client that can be used to interact with an applic

| Name | Type |
| :------ | :------ |
| `params` | `Omit`\<\{ `algorand`: [`AlgorandClientInterface`](../modules/types_algorand_client_interface.md#algorandclientinterface) ; `appLookupCache?`: [`AppLookup`](types_app_deployer.AppLookup.md) ; `appName?`: `string` ; `appSpec`: `string` \| [`Arc56Contract`](types_app_arc56.Arc56Contract.md) \| [`AppSpec`](types_app_spec.AppSpec.md) ; `approvalSourceMap?`: `ProgramSourceMap` ; `clearSourceMap?`: `ProgramSourceMap` ; `creatorAddress`: `string` \| `Address` ; `defaultSender?`: `string` \| `Address` ; `defaultSigner?`: `TransactionSigner` ; `ignoreCache?`: `boolean` }, ``"appSpec"``\> |
| `params` | `Omit`\<\{ `algorand`: [`AlgorandClient`](../classes/types_algorand_client.AlgorandClient.md) ; `appLookupCache?`: [`AppLookup`](types_app_deployer.AppLookup.md) ; `appName?`: `string` ; `appSpec`: `string` \| [`Arc56Contract`](types_app_arc56.Arc56Contract.md) \| [`AppSpec`](types_app_spec.AppSpec.md) ; `approvalSourceMap?`: `ProgramSourceMap` ; `clearSourceMap?`: `ProgramSourceMap` ; `creatorAddress`: `string` \| `Address` ; `defaultSender?`: `string` \| `Address` ; `defaultSigner?`: `TransactionSigner` ; `ignoreCache?`: `boolean` }, ``"appSpec"``\> |

#### Returns

Expand Down
40 changes: 0 additions & 40 deletions docs/code/modules/types_algorand_client_interface.md

This file was deleted.

25 changes: 0 additions & 25 deletions docs/code/modules/types_interface_of.md

This file was deleted.

53 changes: 0 additions & 53 deletions src/types/algorand-client-interface.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/types/app-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { legacySendTransactionBridge } from '../transaction/legacy-bridge'
import { encodeTransactionNote, getSenderAddress } from '../transaction/transaction'
import { asJson, binaryStartsWith } from '../util'
import { TransactionSignerAccount } from './account'
import { AlgorandClientInterface } from './algorand-client-interface'
import { type AlgorandClient } from './algorand-client'
import { AlgoAmount } from './amount'
import {
ABIAppCallArg,
Expand Down Expand Up @@ -325,7 +325,7 @@ export interface AppClientParams {
appSpec: Arc56Contract | AppSpec | string

/** An `AlgorandClient` instance */
algorand: AlgorandClientInterface
algorand: AlgorandClient

/**
* Optional override for the app name; used for on-chain metadata and lookups.
Expand Down Expand Up @@ -477,7 +477,7 @@ export class AppClient {
private _appAddress: Address
private _appName: string
private _appSpec: Arc56Contract
private _algorand: AlgorandClientInterface
private _algorand: AlgorandClient
private _defaultSender?: Address
private _defaultSigner?: TransactionSigner

Expand Down Expand Up @@ -675,7 +675,7 @@ export class AppClient {
}

/** A reference to the underlying `AlgorandClient` this app client is using. */
public get algorand(): AlgorandClientInterface {
public get algorand(): AlgorandClient {
return this._algorand
}

Expand Down
6 changes: 3 additions & 3 deletions src/types/app-factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import algosdk, { Address } from 'algosdk'
import { TransactionSignerAccount } from './account'
import { AlgorandClientInterface } from './algorand-client-interface'
import { type AlgorandClient } from './algorand-client'
import {
AppCompilationResult,
AppReturn,
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface AppFactoryParams {
appSpec: Arc56Contract | AppSpec | string

/** `AlgorandClient` instance */
algorand: AlgorandClientInterface
algorand: AlgorandClient

/**
* Optional override for the app name; used for on-chain metadata and lookups.
Expand Down Expand Up @@ -170,7 +170,7 @@ export type AppFactoryDeployParams = Expand<
export class AppFactory {
private _appSpec: Arc56Contract
private _appName: string
private _algorand: AlgorandClientInterface
private _algorand: AlgorandClient
private _version: string
private _defaultSender?: Address
private _defaultSigner?: TransactionSigner
Expand Down
6 changes: 3 additions & 3 deletions src/types/client-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import algosdk, { SuggestedParams } from 'algosdk'
import { AlgoHttpClientWithRetry } from './algo-http-client-with-retry'
import { AlgorandClientInterface } from './algorand-client-interface'
import { type AlgorandClient } from './algorand-client'
import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client'
import { AppFactory, AppFactoryParams } from './app-factory'
import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client'
Expand Down Expand Up @@ -49,7 +49,7 @@ export class ClientManager {
private _algod: algosdk.Algodv2
private _indexer?: algosdk.Indexer
private _kmd?: algosdk.Kmd
private _algorand?: AlgorandClientInterface
private _algorand?: AlgorandClient

/**
* algosdk clients or config for interacting with the official Algorand APIs.
Expand All @@ -71,7 +71,7 @@ export class ClientManager {
* const clientManager = new ClientManager({ algodConfig, indexerConfig, kmdConfig })
* ```
*/
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClientInterface) {
constructor(clientsOrConfig: AlgoConfig | AlgoSdkClients, algorandClient?: AlgorandClient) {
const _clients =
'algod' in clientsOrConfig
? clientsOrConfig
Expand Down
3 changes: 0 additions & 3 deletions src/types/interface-of.ts

This file was deleted.