@bananocoin/bananojs
TypeScript icon, indicating that this package has built-in type declarations

2.10.10 • Public • Published

bananojs

JavaScript utilities for the banano cryptocurrency.

make sure to use npm i @bananocoin/bananojs@latest to get the latest version.

now includes Ledger Nano S/X Support in a different project: https://github.com/BananoCoin/bananojs-hw

simple banano functions

const run = async () => {
  const bananojs = require('@bananocoin/bananojs');
  bananojs.setBananodeApiUrl('https://kaliumapi.appditto.com/api');

  //generate random seed and wallet, then log first address of wallet
  const crypto = require('crypto');
  const seed = crypto.randomBytes(32).toString('hex'); //seeds are 32 bytes
  const privateKey = bananojs.getPrivateKey(seed, 0);
  const publicKey = await bananojs.getPublicKey(privateKey);
  const account = bananojs.getBananoAccount(publicKey); //the Banano address
  console.log(account);

  //get account info of addresses: https://docs.nano.org/commands/rpc-protocol/#account_info
  console.log(await bananojs.getAccountInfo(account)); //should log "{ error: 'Account not found' }" since account is unopened (hasn't received any transactions yet)
  console.log(await bananojs.getAccountInfo("ban_1rp1aceaawpub5zyztzs4tn7gcugm5bc3o6oga16bb18bquqm1bjnoomynze")); //works

  //get account history of address: https://docs.nano.org/commands/rpc-protocol/#account_history
  console.log(await bananojs.getAccountHistory("ban_1rp1aceaawpub5zyztzs4tn7gcugm5bc3o6oga16bb18bquqm1bjnoomynze", 3)); //(last 3 transactions)
};
run();

examples of most functions as part of the cli

https://github.com/BananoCoin/bananojs/blob/master/main.js

simple browser integration

https://bananocoin.github.io/bananojs/web/

description on how to do browser integration

https://github.com/BananoCoin/bananojs/blob/master/docs/banano-client-side.md

complete documentation of all functions that are documented.

https://github.com/BananoCoin/bananojs/blob/master/docs/documentation.md

notes on using CLI:

please remember to install and test before running the CLI.

  npm i;

  #test on osx/linux
  npm test;

  # test on windows.
  npm run win-test;

  npm start;

complete documentation of camo CLI functions

https://github.com/BananoCoin/bananojs/blob/master/docs/camo-banano-cli.md

complete documentation of banano CLI functions

https://github.com/BananoCoin/bananojs/blob/master/docs/banano-cli.md

complete documentation of nano CLI functions

https://github.com/BananoCoin/bananojs/blob/master/docs/nano-cli.md

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.10.1011latest

Version History

VersionDownloads (Last 7 Days)Published
2.10.1011
2.10.81
2.10.70
2.10.61
2.10.50
2.10.41
2.10.20
2.10.11
2.10.00
2.9.20
2.9.11
2.8.100
2.8.90
2.8.80
2.8.70
2.8.60
2.8.51
2.8.30
2.8.20
2.8.10
2.7.191
2.7.181
2.7.170
2.7.160
2.7.150
2.7.140
2.7.131
2.7.120
2.7.110
2.7.104
2.7.90
2.7.81
2.7.71
2.7.60
2.7.20
2.6.231
2.6.210
2.6.190
2.6.170
2.6.161
2.6.140
2.6.110
2.6.90
2.6.70
2.6.60
2.6.50
2.6.40
2.6.30
2.6.20
2.6.10
2.5.170
2.5.160
2.5.150
2.5.140
2.5.131
2.5.121
2.5.111
2.5.100
2.5.90
2.5.80
2.5.70
2.5.60
2.5.50
2.5.40
2.5.30
2.5.20
2.5.11
2.5.01
2.4.260
2.4.250
2.4.242
2.4.230
2.4.221
2.4.210
2.4.190
2.4.181
2.4.170
2.4.160
2.4.150
2.4.130
2.4.121
2.4.110
2.4.101
2.4.81
2.4.70
2.4.61
2.4.50
2.4.40
2.4.31
2.4.20
2.4.10
2.4.01
2.3.00
2.2.80
2.2.71
2.2.61
2.2.50
2.2.41
2.2.30
2.2.21
2.2.12
2.2.00
2.1.30
2.1.21
2.1.11
2.1.00
2.0.131
2.0.122
2.0.110
2.0.100
2.0.90
2.0.80
2.0.70
2.0.60
2.0.51
2.0.40
2.0.30
2.0.20
2.0.10
2.0.00
1.1.80
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.0.530
1.0.521
1.0.510
1.0.500
1.0.490
1.0.480
1.0.471
1.0.460
1.0.451
1.0.441
1.0.431
1.0.420
1.0.412
1.0.400
1.0.390
1.0.381
1.0.370
1.0.360
1.0.351
1.0.340
1.0.331
1.0.321
1.0.310
1.0.300
1.0.290
1.0.281
1.0.271
1.0.260
1.0.250
1.0.240
1.0.230
1.0.220
1.0.211
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.130
1.0.120
1.0.101
1.0.90
1.0.82
1.0.70
1.0.61
1.0.51
1.0.40

Package Sidebar

Install

npm i @bananocoin/bananojs

Weekly Downloads

74

Version

2.10.10

License

MIT

Unpacked Size

792 kB

Total Files

76

Last publish

Collaborators

  • dev-ptera
  • coranos