
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@waves/data-service-client-js
Advanced tools
const DataServiceClient = require('@waves/data-service-client-js').default;
// Initialization
const client = new DataServiceClient({
rootUrl: 'http://api.wavesplatform.com/v0',
fetch: req => window.fetch(req).then(res => res.text()), // fetch must return string
parse: str => JSON.parse(str),
});
// Fetching
(async () => {
const { data } = await client.getAssets('WAVES'); // data: Asset {}
})();
{ data, ...meta }
await client.getAssets('WAVES'); // One { data: Asset }
await client.getAssets('WAVES', '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS'); // Or many { data: Asset[] }
await client.getAssetsByTicker('WAVES'); // Many { data: Asset[] }
await client.getAssetsByTicker('*'); // Many { data: Asset[] } - all assets
const getPairs = client.getPairs('MATCHER_ID'); // set up DEX matcher
await getPairs([
'WAVES/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS',
'WAVES/474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu'
]); // get pairs
await client.getExchangeTxs('8rEwYY4wQ4bkEkk95EiyeQnvnonX6TAnU6eiBAbVSADk'); // By id { data: Tx }
await client.getExchangeTxs({
timeStart?: string | Date | number;
timeEnd?: string | Date | number;
matcher?: string;
sender?: string;
amountAsset?: string | Asset;
priceAsset?: string | Asset;
limit?: number;
sort?: 'asc'|'desc';
}); // With filters { data: Tx[] }
await client.getExchangeTxs(); // Top 100 with default filters (timeStart = timestamp of first entry in db, timeEnd = now)
const alias1 = await client.aliases.getById('@askerych');
/*
{ data: {
address: '3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M',
alias: '@askerych'
}
}
*/
const alias2 = await client.aliases.getByAddress(
'3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M'
);
/*
{ data: [{
address: '3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M',
alias: '@askerych'
}]
}
*/
await client.getCandles(amountAsset: string, priceAsset: string, {
timeStart: string | Date | number;
timeEnd?: string | Date | number;
interval: string; // interval pattern is xy, where x - number, y - one of m (minutes), h (hours), d (days), M (Month)
});
await client.getCandles('WAVES', '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS', {
timeStart: '2018-12-01',
timeEnd: '2018-12-31',
interval: '1d'
});
type Response<T> = {
data: T;
fetchMore?: TFunction;
};
const response1 = await client.getExchangeTxs({ limit: 1, sort: 'asc' });
const data1 = response1.data;
// Process data
const response2 = await res1.fetchMore(2); // 2 more
You can set custom fetcher, parser and transformer for library.
type TLibOptions = {
rootUrl: string;
fetch?: TFunction;
parse?: TParser;
transform?: TFunction;
};
The path is fetch -> parse -> transform
Fetch accepts (url, options)
Fetch by default is fetch(...).then(res => res.text())
Parse by default is JSON.parse.bind(JSON) , you can use json-bigint's parse if you want to add support for bignumbers.
Transform function has next signature by default (it depends on your parse function):
({
__type,
data,
...rest
}) => any
Basically you can switch on __type and do transformations.
FAQs
## Usage
We found that @waves/data-service-client-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.