Skip to content
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

New package xchain-cosmos-sdk #836

Merged
merged 8 commits into from
Sep 26, 2023
Merged

Conversation

hippocampus-web3
Copy link
Collaborator

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.

@hippocampus-web3 hippocampus-web3 force-pushed the 834-new-package-cosmos-sdk branch from 9014605 to a0c7961 Compare September 24, 2023 08:55
@hippocampus-web3 hippocampus-web3 marked this pull request as ready for review September 24, 2023 09:12
@hippocampus-web3 hippocampus-web3 mentioned this pull request Sep 24, 2023
@Thorian1te
Copy link
Collaborator

Just quickly, do any packages depending on the new xchain-utils version need bumping?

@hippocampus-web3
Copy link
Collaborator Author

Not bumping necessary. The change on xchain-utils is a minor and retrocompatible change

@Thorian1te Thorian1te merged commit d7f058a into master Sep 26, 2023
1 check passed
@hippocampus-web3 hippocampus-web3 deleted the 834-new-package-cosmos-sdk branch November 24, 2023 14:54
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.

2 participants