cosmjs
cosmjs copied to clipboard
Where are actual docs and implementations?
I know, this may sound a bit general, but.. readme explains some libs:
- @cosmjs/stargate: A client library for the Cosmos SDK 0.40 (cosmoshub-4), 0.41 and 0.42 (Stargate)
- @cosmjs/crypto: Cryptography for blockchain projects, e.g. hashing (SHA-2, Keccak256, Ripemd160), signing (secp256k1, ed25519), HD key derivation (BIPO39, SLIP-0010), KDFs and symmetric encryption for key storage (PBKDF2, Argon2, XChaCha20Poly1305)
- ...
but when I try to use any of these, I see that:
- https://github.com/cosmos/cosmjs/blob/main/packages/crypto/README.md tells "Little of it is implemented here, but mainly it is a curation of external libraries along with correctness tests." No links to implementations are provided, which is somewhat problematic. At least I'm having difficulties to implement getting address and keys (pub, pri) from mnemonic and I've tried several libs like
@lunie/cosmos-keys(browser-only, doesn't work in node.js),@cosmjs/launchpad(don't how to get private key + don't know how to convert public key as Uint8Array to string) andcosmos-lib(fails with "error:0308010C:digital envelope routines::unsupported"). Also I haven't found any info on whether bech32prefix should be the same for cosmos mainnet and vega testnet. - https://github.com/cosmos/cosmjs/blob/main/packages/stargate/README.md contains no docs regarding usage of the lib. It's even unclear whether there's anything implemented, or just interfaces. I won't list all the attempts here, like for crypto.
Too many questions, too few answers, may be I'm looking in the wrong places?
https://github.com/CosmWasm/cosmwasmjs may be helpful. This is a very early WIP but the idea to make easier onboarding.
You are totally right, the doc currently is far less complete than the implementation.
@ethanfrey thanks, it looks much frienlier, although with the first attempt to use I also got into a blocker: https://github.com/CosmWasm/CosmWasmJS/issues/17 May be you have an idea?
Check my progress : https://github.com/CosmWasm/CosmWasmJS/blob/docs/docs/intro.md . 💯 Also I answered in https://github.com/CosmWasm/CosmWasmJS/issues/17
Thanks, very helpful of you (TypeScript suggestions also work very well for some tasks). Looking forward to see examples of how to create and sign simple send transactions to further broadcast them with CosmWasmClient.broadcastTx. Also, I'd be grateful to find how to get address, publicKey and privateKey from a mnemonic.