You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/migration-from-cosmjs.md
+30-26
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Migrating from CosmJS to @interchainjs/cosmos
2
2
3
-
This guide shows you how to migrate from CosmJS to the new InterchainJS SDK. The updated examples below follow the patterns used in our unit tests, with a special focus on wallet generation that completely removes any CosmJS dependency.
3
+
This guide shows you how to migrate from CosmJS to the new InterchainJS SDK. The updated examples below follow the patterns used in our unit tests, with a special focus on wallet generation and signers that completely removes any CosmJS dependency.
4
4
5
5
## 1. Overview
6
6
7
7
### Goal:
8
8
Replace CosmJS with @interchainjs/cosmos to sign, build, and broadcast transactions on Cosmos-based blockchains.
9
9
10
10
### Key Improvements:
11
-
- Wallet Generation: Create wallets using our own methods (using Secp256k1Auth and generateMnemonic) instead of CosmJS’s DirectSecp256k1HdWallet.
11
+
- Wallet Generation: Create wallets using our own methods (using Secp256k1Auth and Bip39) instead of CosmJS’s DirectSecp256k1HdWallet.
12
12
- Modular Imports: Import only the needed submodules to reduce bundle size.
13
13
- Unified Signer Interfaces: Use Direct (Protobuf) or Amino signing with a consistent API.
- Derive auth objects using Secp256k1Auth.fromMnemonic().
263
267
- Note: This method completely avoids any dependency on CosmJS wallet implementations.
264
268
4. Adapt Signer Interfaces:
@@ -273,7 +277,7 @@ import { HDPath } from '@interchainjs/types';
273
277
274
278
## 6. Conclusion
275
279
276
-
This updated migration guide demonstrates how to generate wallets and sign transactions using the new InterchainJS SDK without any dependency on CosmJS. By leveraging built-in utilities such as generateMnemonic, Secp256k1Auth.fromMnemonic, and HDPath, your application can fully transition to a modern, modular, and lightweight approach to interacting with Cosmos blockchains.
280
+
This updated migration guide demonstrates how to generate wallets and sign transactions using the new InterchainJS SDK without any dependency on CosmJS. By leveraging built-in utilities such as Secp256k1Auth.fromMnemonic, and HDPath, your application can fully transition to a modern, modular, and lightweight approach to interacting with Cosmos blockchains.
277
281
278
282
For further details, refer to the GitHub repository README and unit tests (e.g., [token.test.ts](../networks/cosmos/starship/__tests__/token.test.ts)).
0 commit comments