Gathering detailed insights and metrics for @dev-ptera/nano-node-rpc
Gathering detailed insights and metrics for @dev-ptera/nano-node-rpc
Gathering detailed insights and metrics for @dev-ptera/nano-node-rpc
Gathering detailed insights and metrics for @dev-ptera/nano-node-rpc
Nanocurrency Remote Procedure Call (RPC) client written in Typescript.
npm install @dev-ptera/nano-node-rpc
Typescript
Module System
Node Version
NPM Version
@dev-ptera/nano-node-rpc v2.1.0
Updated on Dec 30, 2022
@dev-ptera/nano-node-rpc v2.0.2
Updated on Jul 14, 2021
@dev-ptera/nano-node-rpc v2.0.1
Updated on Jun 20, 2021
@dev-ptera/nano-rpc-proxy v2.0.0
Updated on May 22, 2021
@dev-ptera/nano-rpc-proxy v1.1.1
Updated on May 21, 2021
@dev-ptera/nano-node-rpc v1.1.0
Updated on May 21, 2021
TypeScript (92.64%)
JavaScript (7.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
111 Commits
3 Forks
12 Branches
1 Contributors
Updated on Dec 30, 2022
Latest Version
2.1.0
Package Id
@dev-ptera/nano-node-rpc@2.1.0
Unpacked Size
47.42 kB
Size
11.33 kB
File Count
19
NPM Version
8.5.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
6
This is a Nanocurrency remote procedure call (RPC) client written in Typescript with a singular dependency on axios.
Use this package to fetch Nanocurrency data from either a local Nano Node, a Nano Node Proxy server, or My Nano Ninja.
All RPC calls are defined in the Nano.org Docs.
npm install @dev-ptera/nano-node-rpc
or
yarn add @dev-ptera/nano-node-rpc
Typescript
1import { NanoClient } from "@dev-ptera/nano-node-rpc";
2
3/* Below are three potential nano clients; pick one. */
4
5/* Localhost Nano Node */
6const localClient = new NanoClient({url: "http://[::1]:7076"});
7
8/* Web API */
9const remoteClient = new NanoClient({url: "[URL]"});
10
11/* My Nano Ninja */
12const myNanoNinjaClient = new NanoClient({
13 url: "https://mynano.ninja/api/node",
14 requestHeaders: {
15 "Authorization": process.env.NINJA_API_KEY
16 }
17});
Javascript
1const NanoClient = require("@dev-ptera/nano-node-rpc").NanoClient; 2/* Same client configuration as typescript example. */
1import { NanoClient } from "@dev-ptera/nano-node-rpc"; 2import * as RPC from "@dev-ptera/nano-node-rpc/types" 3import { AxiosError } from "axios"; 4 5const client = new NanoClient({ url: "http://localhost:7076" }) 6 7// Some methods do not require arguments: 8client 9 .block_count() 10 .then((count: RPC.BlockCountReponse) => { 11 console.log(count); 12 /** 13 * { 14 * "count": "1826834", 15 * "unchecked": "3385205" 16 * } 17 */ 18 }) 19 .catch((e: AxiosError) => { 20 // Deal with your errors here. 21 }); 22 23// Some methods require arguments: 24client 25 .account_balance("nano_1ninja7rh37ehfp9utkor5ixmxyg8kme8fnzc4zty145ibch8kf5jwpnzr3r") 26 .then((balance: RPC.AccountBalanceResponse) => { 27 console.log(balance); 28 /** 29 * { 30 * "balance": "325586539664609129644855132177", 31 * "pending": "2309370929000000000000000000000000" 32 * } 33 */ 34 }) 35 .catch((e: AxiosError) => { 36 // Deal with your errors here. 37 });
All method calls return native NodeJS promises. You need to use the then()
/ catch()
pattern shown above.
If the call was successful, the data will be passed to then()
, otherwise the error will be passed to catch()
.
See examples.js
file for more examples.
The method calls are the same as the original RPC actions defined on the Nano.org Docs.
E.g. the Nano block_count
RPC method would be accessible via client.block_count()
.
If a method is not available as a method on NanoClient
, you can use the _send
method below:
1client._send("block_info", { 2 "json_block": true, 3 "hash": "87434F8041869A01C8F6F263B87972D7BA443A72E0A97D7A3FD0CCC2358FD6F9" 4}).then(block_info => { 5 console.log(block_info); 6 /** 7 * { 8 * "block_account": "nano_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est", 9 * "amount": "30000000000000000000000000000000000", 10 * "balance": "5606157000000000000000000000000000000", 11 * "height": "58", 12 * "local_timestamp": "0", 13 * "confirmed": "true", 14 * "contents": { 15 * ... 16 * }, 17 * "subtype": "send" 18 * } 19 */ 20}) 21.catch(e => { 22 // Deal with your errors here. 23});
Some RPC response types will change depending on the optional parameters included in the request.
peers
is an example of a request that can conditionally include PeersResponseDetails
when the flag peer_details
is true.
yarn build
> creates output in the /dist
folder
yarn test
> runs test suite; requires a local Banano node to pass
yarn prettier
> run code formatting
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/22 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More