
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
bitshares-rpc
Advanced tools
Simple wrapper for the jayson library to make rpc calls to the Bitshares client
#Bitshares-rpc
A very simple API wrapper for the excellent jayson library and Q for promises to make an RPC client for Bitshares.
##Installation npm install bitshares-rpc
##Usage var bitshares = require('bitshares-rpc'); var config = require('config.json');
var bitshares_client = bitshares.client({
port: config.port, // Optional - default 1775
hostname: config.hostname, // Optional - default 127.0.0.1
username: config.username,
password: config.password
});
bitshares_client.request('RPC_METHOD', [PARAMS]).then(function(result) {
// Use result
})
.catch(function(error) {
// Handle error
});
RPC_METHOD can by any method found in the Bitshares client.
PARAMS is optional for methods that do not take parameters, if needed it should be an array of parameters.
##Examples
Some specific use cases:
bitshares_client.request('getinfo')
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.log(error);
});
bitshares_client.request('blockchain_list_delegates',[10, 10])
.then(function(result) {
console.log(result);
})
.catch(function(error) {
console.log(error);
});
Chaining with Q:
var Q = require('q');
Q.all([
bitshares_client.request('getinfo'),
bitshares_client.request('blockchain_list_delegates',[10, 10])
])
.then(function(result) {
var getinfo = result[0];
var delegates = result[1];
})
.catch(function(error) {
console.log(error);
})
bitshares-rpc is freely distributable under the terms of the MIT license.
FAQs
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.