Skip to content

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Sep 23, 2025

Small spike to demonstrate my idea for making AlgorandClient more tree-shakeable

Comment on lines -53 to -54
this._assetManager = assetManager
this._appManager = appManager
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're able to completely remove the dependency on the asset and app manager

Comment on lines +5 to +8
import type { AppDeployer } from './app-deployer'
import type { AppManager } from './app-manager'
import type { AssetManager } from './asset-manager'
import type { AlgoSdkClients, ClientManager } from './client-manager'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove remove the dependency on all of the managers from the AlgorandClient

Comment on lines +13 to +17
clientManager?: Partial<InterfaceOf<ClientManager>>
accountManager?: Partial<InterfaceOf<AccountManager>>
appManager?: Partial<InterfaceOf<AppManager>>
assetManager?: Partial<InterfaceOf<AssetManager>>
appDeployer?: Partial<InterfaceOf<AppDeployer>>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial interfaces of the managers are passed in to AlgorandClient ctor

return this
}

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static methods would live in a new "Builder" class. This would be the main difference as far as users are concerned. AlgorandClient.localnet() would become something along the lines of new AlgorandClientBuilder().localnet().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant