andromedaprotocol / andromeda.js

Command line interface for interactions with Andromeda contracts.
1 stars 1 forks source link

Chain Client Refactor #58

Closed crnbarr93 closed 1 year ago

crnbarr93 commented 1 year ago

Motivation

A need has arisen to integrate chains that do not support CosmJS as such the way that the AndromedaClient class interacts with these chains must be through a different SDK. This also includes the generation of wallets, primarily for the CLI.

Implementation

The API used to interact with a chain has been abstracted away from CosmJS in to a ChainClient interface that exposes methods that resemble those exposed by CosmJS. Using this chains can be integrated in to the AndromedaClient class by implementing these functions and then created when connecting to a particular chain. The following clients were added:

Each of these implements their own SDK, terra.js for TerraClient, @injectivelabs/sdk-ts for InjectiveClient and then cosmjs for CosmClient (what was used previously.

Each of these clients has primarily unique implementations of each method. The clients are abstracted to the AndromedaClient and created dynamically dependent on the chain being used so that a developer/user will be unaware. They are exposed so if the user wishes to use them directly they may.

Testing

Each client and method combination was tested using the CLI on chain.

Notes

N/A

Future work

N/A