1.5.1 • Published 6 years ago

cosmos-sdk v1.5.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

cosmos-sdk-js

JavaScript client for the Cosmos SDK API

Usage

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

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


// build a transaction
let tx = await client.build('send', {
  to: key.address,
  amount: { amount: 12345, denom: 'mycoin' },
  fee: { amount: 23, denom: 'atom' }
})

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

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

// query account
let queryResult = await query({
  type: 'account',
  data: 'sigs:BDADF167E6CF2CDF2D621E590FF1FED2787A40E0'
})
console.log(result)

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

6 years ago

1.5.0

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

7 years ago