
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
Client-side library for working with DRPC (drpc.org). It's responsibility to communicate with DRPC and also to check provided signatures for response data, validating data authenticity. Supports node and browser.
Client-side library for working with DRPC (drpc.org). It's responsibility to communicate with DRPC and also to check provided signatures for response data, validating data authenticity. Supports node and browser.
npm install drpc-sdk
import { HTTPApi } from 'drpc-sdk';
async function getBlockHeight() {
let api = new HTTPApi({
api_key: 'api key',
url: 'https://drpc.org/api',
provider_ids: ['test'],
provider_num: 1,
});
// single request
let blockheight = await api.call({
method: 'eth_blockNumber',
params: [],
});
// batch request
let batch = await api.callMulti([
{
method: 'eth_blockNumber',
params: [],
},
{
method: 'eth_getBlockByNumber',
params: ['0x100001'],
},
]);
}
This module is written to work in node and browser. Because of that, by default webpack and other bundlers will try to bundle node dependencies (like node-fetch, etc). However, if you use webpack you can just define constant and it will eliminate any non-browser code.
{
// ....
plugins: [
new webpack.DefinePlugin({
__isBrowser__: 'true',
}),
],
};
If you're using web3.js, drpc-sdk exposes the provider
import { HttpDrpcProvider } from 'drpc-sdk/dist/esm/providers/web3';
// for cjs
// import { DrpcProvider } from 'drpc-sdk/dist/cjs/providers/web3';
async function getBlock(tag) {
let state = provider({
api_key: 'api key',
url: 'https://drpc.org/api',
provider_ids: ['test'],
provider_num: 1,
});
// or WsDrpcProvider for websockets
let provider = new HttpDrpcProvider(state);
let web3 = new Web3(provider);
let result = await web3.eth.getBlockNumber();
}
If you're using ethers.js, drpc-sdk exposes the provider
import { DrpcProvider } from 'drpc-sdk/dist/esm/providers/ethers';
// for cjs
// import { DrpcProvider } from 'drpc-sdk/dist/cjs/providers/ethers';
async function getBlock(tag) {
let state = provider({
api_key: 'api key',
url: 'https://drpc.org/api',
provider_ids: ['test'],
provider_num: 1,
});
let provider = new DrpcProvider(state);
let block = await provider.getBlock(tag);
}
FAQs
Client-side library for working with DRPC (drpc.org). It's responsibility to communicate with DRPC and also to check provided signatures for response data, validating data authenticity. Supports node and browser.
We found that drpc-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.