2.2.4 • Published 6 years ago
sequence-sdk v2.2.4
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": "~2.2.4"
}
}
TypeScript
If you're using TypeScript, include the following in your tsconfig.json
:
{
"compilerOptions": {
"lib": ["es2015", "es2016", "esnext"],
"types": ["node"]
}
}
Also, run:
npm i --save-dev @types/node
In your code
const sequence = require('sequence-sdk')
const ledger = new sequence.Client({
ledgerName: 'ledger',
credential: '...',
})
Calling convention
Most SDK methods return Promise objects, which you can use with async/await, or consume directly.
With async/await:
async function main() {
try {
const account = await ledger.accounts.create({...})
// operate on account
} catch (err) {
// handle errors
}
}
With the Promise object itself:
function main() {
return ledger.accounts.create({...}).then(account => {
// operate on account
}).catch(err => {
// handle errors
})
}
Documentation
Comprehensive instructions and examples are available in the developer documentation.
2.2.4
6 years ago
2.2.3
6 years ago
2.2.2
6 years ago
2.2.1
6 years ago
2.2.0
6 years ago
2.1.0
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.5.2
6 years ago
1.5.1
6 years ago
2.0.0-rc.2
6 years ago
2.0.0-rc.1
6 years ago
1.5.0
6 years ago
1.4.0
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.4
6 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago
0.0.1
7 years ago