Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dashevo/dapi-grpc
Advanced tools
Decentralized API GRPC definition files and generated clients
Ensure you have the latest NodeJS installed.
Clone the repo:
git clone https://github.com/dashevo/dapi-grpc
Install npm packages:
npm install
npm install @dashevo/dapi-grpc
Node users are able to access exported elements by requiring them under v0 property.
Provide a client to perform core request.
const {
v0: {
CorePromiseClient,
},
} = require('@dashevo/dapi-grpc');
const client = new CorePromiseClient(url);
Provided method allow to then perform the request, by passing a specific request parameter (see below example). All methods share the same API :
Here is a usage example for requesting a Block by its hash and handling its response :
const {
v0: {
CorePromiseClient,
GetBlockRequest,
GetBlockResponse,
},
} = require('@dashevo/dapi-grpc');
const client = new CorePromiseClient(url);
async function getBlockByHash(hash, options = {}) {
const getBlockRequest = new GetBlockRequest();
getBlockRequest.setHash(hash);
const response = await client.getBlock(
getBlockRequest,
{},
options,
);
const blockBinaryArray = response.getBlock();
return Buffer.from(blockBinaryArray);
}
Available methods :
For streams, such as subscribeToTransactionsWithProofs and subscribeToBlockHeadersWithChainLocks, a grpc-web stream will be returned. More info on their usage can be read over their repository.
Provide a client to perform platform request. Method's API and usage is similar to CorePromiseClient.
const {
v0: {
PlatformPromiseClient,
},
} = require('@dashevo/dapi-grpc');
const client = new PlatformPromiseClient(url);
Available methods :
Feel free to dive in! Open an issue or submit PRs.
MIT © Dash Core Group, Inc.
FAQs
DAPI GRPC definition file and generated clients
The npm package @dashevo/dapi-grpc receives a total of 565 weekly downloads. As such, @dashevo/dapi-grpc popularity was classified as not popular.
We found that @dashevo/dapi-grpc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.