From 2a2a0ea785091b576c5ed50284e4ea268b2442a6 Mon Sep 17 00:00:00 2001 From: Joe Polny Date: Sat, 4 Jan 2025 06:47:28 -0500 Subject: [PATCH] fix: replace AlgorandClientInterface with AlgorandClient (#355) --- src/types/algorand-client-interface.ts | 5 ----- src/types/app-client.ts | 8 ++++---- src/types/app-factory.ts | 6 +++--- src/types/client-manager.ts | 6 +++--- src/types/instance_of.ts | 4 ---- 5 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 src/types/algorand-client-interface.ts delete mode 100644 src/types/instance_of.ts diff --git a/src/types/algorand-client-interface.ts b/src/types/algorand-client-interface.ts deleted file mode 100644 index 17392fb4..00000000 --- a/src/types/algorand-client-interface.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AlgorandClient } from './algorand-client' -import { InterfaceOf } from './instance_of' - - /** AlgorandClient interface used to eleminate circular dependencies */ -export type AlgorandClientInterface = InterfaceOf diff --git a/src/types/app-client.ts b/src/types/app-client.ts index fa37c077..b04f0270 100644 --- a/src/types/app-client.ts +++ b/src/types/app-client.ts @@ -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 { AlgorandClient } from './algorand-client' import { AlgoAmount } from './amount' import { ABIAppCallArg, @@ -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. @@ -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 @@ -639,7 +639,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 } diff --git a/src/types/app-factory.ts b/src/types/app-factory.ts index 1c2d317f..c378cf08 100644 --- a/src/types/app-factory.ts +++ b/src/types/app-factory.ts @@ -1,6 +1,6 @@ import algosdk, { Address } from 'algosdk' import { TransactionSignerAccount } from './account' -import { AlgorandClientInterface } from './algorand-client-interface' +import { AlgorandClient } from './algorand-client' import { AppCompilationResult, AppReturn, @@ -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. @@ -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 diff --git a/src/types/client-manager.ts b/src/types/client-manager.ts index 0c58938f..0c49fd1d 100644 --- a/src/types/client-manager.ts +++ b/src/types/client-manager.ts @@ -1,6 +1,6 @@ import algosdk, { SuggestedParams } from 'algosdk' import { AlgoHttpClientWithRetry } from './algo-http-client-with-retry' -import { AlgorandClientInterface } from './algorand-client-interface' +import { AlgorandClient } from './algorand-client' import { AppClient, AppClientParams, ResolveAppClientByCreatorAndName } from './app-client' import { AppFactory, AppFactoryParams } from './app-factory' import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './dispenser-client' @@ -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. @@ -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 diff --git a/src/types/instance_of.ts b/src/types/instance_of.ts deleted file mode 100644 index 7bf8e92f..00000000 --- a/src/types/instance_of.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type InterfaceOf = { - [Member in keyof ClassType]: ClassType[Member]; -}; -