Introducing cosmosjs

Jeong-hwan, Yun
Node A-Team
Published in
3 min readAug 6, 2019

What is cosmosjs?

Cosmosjs is a general-purpose library for web client-side. It aims to provide a general way to make web API and for frontend developers to use. With this library, blockchains that use cosmos-sdk, as well as Cosmos hub (Gaia), can create their own API for javascript.

Why do we need this?

There are already javascript APIs for blockchains that use comsos-sdk. For example, Binance chain has its own javascript API, and some other chains support their own javascript API by forking Binance chain’s or making one from scratch. For developers to define the structure of transaction or messages through redundant copy-paste activity, or to manually merge every time there is an update on the original API seems inefficient. Also, this makes it difficult for front-end developers to share their coding experience and it is inefficient to learn every chains’ API in order to use them. And the most inefficient thing to us is that they don’t fit with the module system.

Module system in cosmosjs

We believe that the developers should provide their API with a modularized way for their chain’s module in cosmos-sdk. Even though the developer can make their blockchain by adding other chain’s module and providing their features as module — thanks to well-made cosmos-sdk — they can’t do the same things for javascript client-side library because there is no library to provide a modular system. We decided to make cosmosjs to solve this problem. Developers can make their chain’s API by adding other’s module and providing their API as a modulized way.

Typescript

We determined to use typescript that is a typed superset of javascript that compiles to plain javascript according to its homepage. Typescript is the fastest growing language on the web. Typescript supports type checking and accepts the features of modern javascript quickly. If you don’t know how to use typescript, don’t hesitate to use cosmosjs because typescript is fully compatible with javascript.

Future

If you are familiar with dapp, you might know the web wallet like MetaMask or Scatter. Its main role is to provide a secure vault so that users can use multiple dapps with a manageable number of private keys and not providing a private key directly to dapps. With web wallet, users use multiple dapps with familiar ways without studying how to use each dapp’s wallet. For well-made user experience is crucial for mass adoption, and providing a web wallet is the first step. But, if there is no library that many developers use in common, providing a web wallet becomes difficult because web wallets can’t support all the library for a specific chain. There is web3.js for Ethereum and is eosjs for EOS. We expect that cosmosjs can take such position on Cosmos ecosystem.

To clear out a confusion…

This is different with cosmosjs from Cosmostation

Node A-Team (Moniker: ATEAM) is a Cosmos-SDK and Tendermint-based Blockchain Validator, which currently participates in Cosmos, IRISnet and Terra. Based on the knowledge and experience gained from various testnets and mainnet, Node A-Team contributes to Cosmos Ecosystem and operates highly secure nodes.

> ATEAM History
— Cosmos: “Game of Stakes” — Never Jailed
— IRISnet: “FUXI Betanet” — Reward Winner
— Terra-project: “Genesis Drill” — Top Tier

[ATEAM Validator Address: cosmosvaloper14l0fp639yudfl46zauvv8rkzjgd4u0zk2aseys]

Webpage: https://nodeateam.com/

Twitter: https://twitter.com/Node_Ateam

E-mail: contact@nodeateam.com

--

--