
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
qaap-barge
Advanced tools
(deprecated - please use rpc-websockets)
Barge wraps the "websockets/ws" library providing JSON RPC 2.0 support on top.
npm install qaap-barge
var Barge = require('qaap-barge')
// instantiate Barge and connect to an RPC server
var ws = new Barge('ws://localhost:8080/rpc/1.0')
ws.on('open', function() {
// call an RPC method with parameters
ws.call('sum', [5, 3]).then(function(result) {
require('assert').equal(result, 8)
})
// send a notification to an RPC server
ws.notify('openedNewsModule')
// subscribe to receive an event
ws.subscribe('feedUpdated')
ws.on('feedUpdated', function() {
updateLogic()
})
// unsubscribe from an event
ws.unsubscribe('feedUpdated')
// close a websocket connection
ws.close()
})
var Barge = require('qaap-barge')
var ws = new Barge('ws://localhost:8080/rpc/1.0')
Instantiate a Barge client.
Parameters:
address
{String}: The URL of the WebSocket server. Defaults to 'ws://localhost:8080/rpc/1.0'.options
{Object}: Client options that are also forwarded to ws
.
autoconnect
{Boolean}: Client autoconnect upon Barge class instantiation. Defaults to true
.reconnect
{Boolean}: Whether client should reconnect automatically once the connection is down. Defaults to true
.reconnect_interval
{Number}: Time between adjacent reconnects. Defaults to 1000
.max_reconnects
{Number}: Maximum number of times the client should try to reconnect. Defaults to 5
.Calls a registered RPC method on server. Resolves once the response is ready. Throws if an RPC error was received.
Parameters:
method
{String}: An RPC method name to run on server-side.params
{Object|Array}: Optional parameter(s) to be sent along the request.Sends a JSON-RPC 2.0 notification to server.
Parameters:
method
{String}: An RPC method name to run on server-side.params
{Object|Array}: Optional parameter(s) to be sent along the request.Subscribes for a defined event.
Parameters:
event
{String}: Event name.Unsubscribes from a defined event.
Parameters:
event
{String}: Event name.Closes a WebSocket connection gracefully.
Parameters:
code
{Number}: Socket close code.data
{String}: Optional data to be sent to socket before closing.Emits when the connection is opened and ready for use.
Emits when a socket error is raised.
Emits when the connection is closed.
Emits a notification event a client has subscribed to once the server sends it.
Example:
ws.subscribe('feedUpdated')
ws.on('feedUpdated', handlerFunction)
FAQs
JSON-RPC client over WebSockets for Node.js
The npm package qaap-barge receives a total of 0 weekly downloads. As such, qaap-barge popularity was classified as not popular.
We found that qaap-barge 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.