cosmos/cosmos-sdk-js

Name: cosmos-sdk-js

Owner: COSMOS

Description: JavaScript client for the Cosmos SDK API

Created: 2017-07-27 18:24:53.0

Updated: 2018-03-15 14:37:59.0

Pushed: 2017-12-30 03:08:11.0

Homepage:

Size: 21

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

cosmos-sdk-js

JavaScript client for the Cosmos SDK API

Usage
install --save cosmos-sdk
s
client = require('cosmos-sdk')('http://localhost:45512')

reate a key
key = await client.generateKey({ name: 'matt', passphrase: 'top secret' })


uild a transaction
tx = await client.build('send', {
: key.address,
ount: { amount: 12345, denom: 'mycoin' },
e: { amount: 23, denom: 'atom' }


ow sign the tx
signedTx = await client.sign({ tx, name: 'judd', password: 'other top secret' })

end the signed transaction to the node to send out to other nodes
result = await client.send(tx)

uery account
queryResult = await query({
pe: 'account',
ta: 'sigs:BDADF167E6CF2CDF2D621E590FF1FED2787A40E0'

ole.log(result)



"height": 1170,
"data": {
  "coins": [
    {
      "denom": "mycoin",
      "amount": 12345
    }
  ]
}



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.