Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Lightweight JavaScript SDK Dash RPC, made Browser, Node.js, & Bundler compatible
Dash Client Library to connect to Dash Core (dashd
) via RPC
dashd-rpc runs on node, and can be installed via npm:
npm install --save dashrpc
You can examine DashRpc.callspec
to see the list of supported RPCs:
console.info('Supported RPCs:');
console.info(DashRpc.callspec);
If any of them are out of date with Dash: Docs: RPCs: Quick Reference, feel free to open an issue or PR.
Config parameters :
- protocol : (string - optional) - (default: 'https') - Set the protocol to be used. Either `http` or `https`.
- user : (string - optional) - (default: 'user') - Set the user credential.
- pass : (string - optional) - (default: 'pass') - Set the password credential.
- host : (string - optional) - (default: '127.0.0.1') - The host you want to connect with.
- port : (integer - optional) - (default: 9998) - Set the port on which perform the RPC command.
Config:
var config = {
protocol: 'http',
user: 'dash',
pass: 'local321',
host: '127.0.0.1',
port: 19998,
onconnected: function () {
console.info('[dashrpc] connected to `${config.host:config.port}`');
},
};
var DashRpc = require('dashrpc');
var rpc = DashRpc.create(config);
async function main() {
let height = await rpc.init({ retry: 5000 });
console.info(`[dashrpc] best block height is ${height}`);
let rawMempool = await rpc.getRawMemPool();
for (let result of rawMempool.result) {
let rawTx = await rpc.getRawTransaction(r);
console.info(`RawTX: ${rawTx.result}`);
}
}
main
.then(function () {
process.exit(0);
})
.catch(function (err) {
console.error(err);
process.exit(1);
});
You can dynamically access to the help of each method by doing
const DashRpc = require('dashrpc');
var client = DashRpc.create({
protocol:'http',
user: 'dash',
pass: 'local321',
host: '127.0.0.1',
port: 19998,
timeout: 1000
});
// Get full help
{
let help = client.help();
console.log(help)
}
// Get help of specific method
{
let getinfoHelp = client.help('getinfo');
console.log(getinfoHelp)
}
This was originally forked from https://github.com/dashpay/dashd-rpc, but has since become its own project.
© 2024-Present Dash Incubator
© 2013-2022 Dash Core Group, Inc.
FAQs
Lightweight JavaScript SDK Dash RPC, made Browser, Node.js, & Bundler compatible
The npm package dashrpc receives a total of 0 weekly downloads. As such, dashrpc popularity was classified as not popular.
We found that dashrpc 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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.