This library allows you to quickly integrate Slyk with your Node.js application.
For additional information and documentation please visit our developers page.
$ yarn add @slyk/slyk-sdk-node
The slyk-sdk-node
requires node v8.12 or higher.
const slykSDK = require('@slyk/slyk-sdk-node');
(function() {
const slyk = slykSDK({ apikey: 'api-key' });
slyk.wallet.get('8399340e-8c1f-4c4f-94e0-81a5ee0378e1')
.then(function(wallet) {
wallet.getBalance({ filter: { assetCode: 'in:btc,usd' } })
.then(function(balance) {
console.log(balance);
});
});
})();
import slykSDK from '@slyk/slyk-sdk-node';
(async () => {
const slyk = slykSDK({ apikey: 'api-key' });
const wallet = await slyk.wallet.get('8399340e-8c1f-4c4f-94e0-81a5ee0378e1');
const balance = await wallet.getBalance({ filter: { assetCode: 'in:btc,usd' } });
console.log(balance);
})();
[
{ "amount": "0.50000000", "assetCode": "btc" },
{ "amount": "25.50000000", "assetCode": "usd" }
]