Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@walletconnect/jsonrpc-utils
Advanced tools
@walletconnect/jsonrpc-utils is a utility library for working with JSON-RPC in the context of WalletConnect. It provides tools for creating, validating, and managing JSON-RPC requests and responses, which are essential for communication between clients and servers in a decentralized environment.
Creating JSON-RPC Requests
This feature allows you to create a JSON-RPC request. The `formatJsonRpcRequest` function takes a method name and parameters, and returns a properly formatted JSON-RPC request object.
const { formatJsonRpcRequest } = require('@walletconnect/jsonrpc-utils');
const request = formatJsonRpcRequest('eth_sendTransaction', [{ from: '0x...', to: '0x...', value: '0x...' }]);
console.log(request);
Validating JSON-RPC Responses
This feature allows you to validate JSON-RPC responses. The `isJsonRpcResponseSuccess` function checks if a response is successful, while `isJsonRpcResponseError` checks if it contains an error.
const { isJsonRpcResponseSuccess, isJsonRpcResponseError } = require('@walletconnect/jsonrpc-utils');
const response = { jsonrpc: '2.0', result: '0x1', id: 1 };
console.log(isJsonRpcResponseSuccess(response)); // true
console.log(isJsonRpcResponseError(response)); // false
Handling JSON-RPC Errors
This feature allows you to create a JSON-RPC error response. The `formatJsonRpcError` function takes an id and an error message, and returns a properly formatted JSON-RPC error object.
const { formatJsonRpcError } = require('@walletconnect/jsonrpc-utils');
const error = formatJsonRpcError(1, 'Something went wrong');
console.log(error);
json-rpc-engine is a modular JSON-RPC middleware engine for building JSON-RPC servers and clients. It provides a flexible way to handle JSON-RPC requests and responses, similar to @walletconnect/jsonrpc-utils, but with a focus on middleware composition.
jayson is a full-featured JSON-RPC 2.0/1.0 client and server for Node.js. It offers a comprehensive set of tools for creating and managing JSON-RPC requests and responses, similar to @walletconnect/jsonrpc-utils, but with additional support for server-side operations.
jsonrpc-lite is a lightweight JSON-RPC 2.0 library for Node.js and the browser. It provides basic utilities for creating and parsing JSON-RPC requests and responses, similar to @walletconnect/jsonrpc-utils, but with a focus on minimalism and simplicity.
FAQs
Utilities for JSON-RPC
The npm package @walletconnect/jsonrpc-utils receives a total of 301,461 weekly downloads. As such, @walletconnect/jsonrpc-utils popularity was classified as popular.
We found that @walletconnect/jsonrpc-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.