An Implementation of Amino for clients with Javascript
Current state: 1.0.0 First major public release
Built and maintenance by
contributors
and
cyber•Congress
For more information spec, please refer: https://github.com/tendermint/go-amino
Features:
- Encode and Decode simple types: ints 8/16/32/64, booleans, strings, bytes
- Encode and Decode recursive Structs and Interfaces, Arrays
- Encode simple Time data
Install From NPM:
Run npm i js-amino
Install From Source
- Run
npm install
Running The Examples
cd src/examples
go get
- Run examples, e. g. in Go:
go run string.go
and in JSnode string.js
Running The Unit Test
- Run
npm test
To Do:
- Full support for Time encoding and decoding
- More Unit test
- Benchmarking
Gitcoin program
We want to pay you for your contribution! We constantly fund our issues on gitcoin and attach good description for them with project state and user stories. We try to answer to comments regular in issues and in our devChat.
Our cosmos ecosystem initiative
Usage (MsgMultiSend example)
const Codec FieldOtions TypeFactory Utils Types WireTypes = ; let StdTx = TypeFactory; let MsgMultiSend = TypeFactory; let Coin = TypeFactory; let Input = TypeFactory; let Output = TypeFactory; let Fee = TypeFactory; let PubKeySecp256k1 = TypeFactory let Signature = TypeFactory let codec = ; codec;codec;codec; let coin = 'cyb' "10000"; let addressFrom = 5958243131321631642022337236931361661811752366948186 let addressTo = 942221144219610751203139142219243137605425013915346168 let input = addressFrom coin;let output = addressTo coin;let sendMultiMsg = input output;let fee = 'cyb' '0' 200000; let pubKey = 2272402559614721642913219210821959134206201126224631602423617012416495431806246250;let signature = 16576109615312919014752224341062352082243619025204362261299710935130217228144106101341418395252219235229237533891111731215814671821132362411701212172023623131358029; let sig = pubKey signature;let stdTx = sendMultiMsg fee sig 'elonmusk'; let jsonTx = codec;let decodedDataTx = ; console;console;codec;console;
Binary stdTx: 220124098932381080194104154209103610205958243131321631642022337236931361661811752366948186181210399121981854948484848183610209422211442196107512031391422192431376054250139153461681812103991219818549484848481814108103991219818148161921541226106103823590233135332272402559614721642913219210821959134206201126224631602423617012416495431806246250186416576109615312919014752224341062352082243619025204362261299710935130217228144106101341418395252219235229237533891111731215814671821132362411701212172023623131358029348101108111110109117115107 Json: "type":"auth/StdTx""value":"msg":"type":"cosmos-sdk/MsgMultiSend""value":"inputs":"address":5958243131321631642022337236931361661811752366948186"coins":"denom":"cyb""amount":"10000""outputs":"address":942221144219610751203139142219243137605425013915346168"coins":"denom":"cyb""amount":"10000""fee":"amount":"denom":"cyb""amount":"0""gas":"200000""signatures":"pub_key":"type":"tendermint/PubKeySecp256k1""value":"AhsYAP9gkxVAHYTAbNs7hs7JfuA/oBjsqnykXyu0Bvb6""signature":"pUxtPTWBvpM04CJq69DgJL4ZzCTigWFtI4LZ5JBqCoYOt1/82+sWXCU1A1lvrQyekkdScezxqnnZFOwXgyNQHQ==""memo":"elonmusk" Decoded data: msg: inputs: Array outputs: Array fee: amount: Object gas: 200000 signatures: pub_key: Array signature: Array memo: 'elonmusk'
Contributing Guide
Contribution are welcome! Please read this guide before contributing.
Contributors
Thanks goes to these wonderful people (emoji key):
JungHwan Tony Yun 💻 | TanNgocDo 💻 🚧 | philipstanislaus 📖 | Ales Puchilo 📆 | Valery Litvin 💻 | Cyber Admin 📖 | Ethan Frey ⚠️ |
This project follows the all-contributors specification. Contributions of any kind welcome!
License
Code are licensed under MIT license by contributors