Sequence Node SDK

Usage

Get the module

The Sequence SDK is available via npm. Node 4 or greater is required.

To install, add the sequence-sdk NPM module to your package.json:

{
  "dependencies": {
    "sequence-sdk": "~1.0.4"
  }
}

In your code

const sequence = require('sequence-sdk')
const ledger = new sequence.Client({
  ledger: 'ledger',
  credential: '...'
})

Async usage

You can use either promises or callbacks for async API calls:

With promises:

ledger.assets.create({...}).then(result => {
  // operate on result
}).catch(err => {
  // handle errors
})

With callbacks:

ledger.assets.create({...}, (err, result) => {
  if (err) {
    // handle errors
    return
  }

  // operate on result
})

Documentation

Comprehensive instructions and examples are available in the developer documentation.