-
Notifications
You must be signed in to change notification settings - Fork 28
Amino-js support #48
Description
Hi, I have been asking around for amino codecs in javascript, and irisnet comes up a lot. Today, someone sent me a link to your implementation: https://github.com/irisnet/irisnet-crypto/blob/master/chains/iris/amino.js and I'd like to figure out the status and if it is ready for outside use.
As a background, I used to work at cosmos on the sdk itself and understand the golang side quite well. I left some months ago, and am working on a pure javascript (actually typescript) client library that can speak to multiple modern blockchains. I would like to add support for cosmos-sdk, but the only blocker for me is the amino codec support in javascript, which seems to be a huge effort, and which makes the cost/benefit of integration not worth it currently.
I took a look at the code in https://github.com/irisnet/irisnet-crypto/tree/master/chains/iris and it seems like pretty solid implementations of GetSignBytes(), but I only see two usages of MarshalBinary(), which are for the pubkey. This is a relatively simple example, an interface (needing the proper amino prefix) along with a byte array (needing a length prefix). This is a great step forward to implement the interface switching, but I don't see how any larger structs are handled.
In particular, how would in MarshalBinary() on a Coin, a Msg or a Tx? Which I need to post it to the blockchain as a valid tx and not require any golang daemon between the js client and the tendermint node?
If this is not yet done, that is a decent answer. I would also be willing to collaborate a bit if there is some working code.