Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR introduces a new package,
xchain-cosmos-sdk
, aimed at consolidating common logic for packages utilizing CosmosSDK technology within the Xchainjs repository as the existing basic packages containing common logic for UTXO and EVM chains.Objectives:
Unified Support: The primary goal is to offer unified support for cryptocurrency wallets across different chains.
Implementation Details:
Official Dependencies: The official dependencies provided by CosmosSDK, the @cosmjs package set, are utilized to interact with nodes from JavaScript.
Base Package Creation: This initial PR focuses on creating the base package, with subsequent tasks planned to extend functionality and support.
Future Work:
Kujira Wallet Support: The first task post this PR is to extend support to the Kujira wallet to test the new implementation.
Update Existing Wallets: Subsequently, each wallet supported by Xchain that works with CosmosSDK will be updated to avoid the current code duplication (cosmos, thorchain, binance, and maya).
This package is crucial to avoid code duplication and to ensure more coherent and efficient support for wallets working with CosmosSDK technology in the Xchain ecosystem.
ADDITIONAL NOTES:
Performance Optimization:
Given the number of wallets supported by Xchain and the computational cost of some address generation processes, I thnk it is crucial to convert address generation into an asynchronous process to avoid browser thread blocking and freezing.
Rationale:
The getAddress method of the XChainClient interface remains synchronous in this PR, with addresses being generated manually instead of using @cosmjs. This might be a significant change but we should start thinking about make the address generation asynchronous
This future change will help to optimize performance and prevent browser thread blocking, which is common in projects using Xchain that generate all address together at the start of the application due to the computational cost of some address generation processes.
The asynchronous approach to address generation is pivotal to enhancing user experience by preventing browser blockages and improving overall performance.