Banano URI Generator
Banano URI Generator is a simple library for generating URIs for the Banano cryptocurrency. It currently supports URIs for sending to an address, changing the representative to an address, importing a private key, and importing a seed.
The code is based on great nano-uri-generator library by Alec Rios.
URI Specifications
TBD
Installation
npm install banano-uri-generator
API
/*** Generates a URI for changing the representative.** @param* @param* @param** @throws** @returns*/declare ;
/*** Generates a URI for importing a private key.** @param* @param* @param** @throws** @returns*/declare ;
/*** Generates a URI for importing a seed.** @param* @param* @param* @param {number | string} [lastIndex] The last index to import.** @throws** @returns*/declare ;
/*** Generates a URI for sending.** @param* @param {number | string} [amount] The amount to send (in raw).* @param* @param** @throws** @returns*/declare ;
Examples
Generate an URI for sending Banano to an address:
; const bananoAddress = 'ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk';const amount = '10000000000000000000000000000';const label = 'Developer Fund'; ;// banano:ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk?amount=10000000000000000000000000000&label=Developer%20Fund
Generate an URI for changing the representative to an address:
; const bananoAddress = 'ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk';const label = 'Banano Representative'; ;// bananorep:ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk?label=Banano%20Representative
QR Code Generation
To convert an URI to a QR code (using a library such as qrcode):
;; const uri = ;const svg = QRCode;
See Also
- Nano URI Generator - Simple library for generating URIs for the Nano cryptocurrency.
- Nano Address Validator - Validates Nano addresses for syntax and checksum integrity.
- Nano Unit Converter - Converts Nano amounts from one unit to another.