{"id":13834627,"url":"https://github.com/zh/banano-uri-generator","last_synced_at":"2025-04-10T01:32:32.650Z","repository":{"id":42790892,"uuid":"273265406","full_name":"zh/banano-uri-generator","owner":"zh","description":"Banano URI Generator is a simple library for generating URIs for the Banano cryptocurrency.","archived":false,"fork":false,"pushed_at":"2023-01-07T19:15:24.000Z","size":1154,"stargazers_count":4,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T14:37:56.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-18T14:50:19.000Z","updated_at":"2023-02-06T18:22:59.000Z","dependencies_parsed_at":"2023-02-07T22:16:04.298Z","dependency_job_id":null,"html_url":"https://github.com/zh/banano-uri-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-uri-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-uri-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-uri-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fbanano-uri-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zh","download_url":"https://codeload.github.com/zh/banano-uri-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140747,"owners_count":21054345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T14:00:48.556Z","updated_at":"2025-04-10T01:32:27.635Z","avatar_url":"https://github.com/zh.png","language":"JavaScript","funding_links":[],"categories":["Client Libraries"],"sub_categories":["JavaScript"],"readme":"# Banano URI Generator\n\nBanano URI Generator is a simple library for generating URIs for the Banano cryptocurrency.\nIt currently supports URIs for sending to an address, changing the representative to an address,\nimporting a private key, and importing a seed.\n\nThe code is based on great [nano-uri-generator library](https://github.com/alecrios/nano-uri-generator) by Alec Rios.\n\n## URI Specifications\n\nTBD\n\n## Installation\n\n```\nnpm install banano-uri-generator\n```\n\n## API\n\n``` ts\n/**\n * Generates a URI for changing the representative.\n *\n * @param {string} address The address to change the representative to.\n * @param {string} [label] The label of the representative change.\n * @param {string} [message] The message of the representative change.\n *\n * @throws {Error} Address must be defined.\n *\n * @returns {string} The URI for changing the representative.\n */\nexport declare function getChangeRepURI(address: string, label?: string, message?: string): string;\n```\n\n``` ts\n/**\n * Generates a URI for importing a private key.\n *\n * @param {string} privateKey The private key to import.\n * @param {string} [label] The label of the import.\n * @param {string} [message] The message of the import.\n *\n * @throws {Error} Private key must be defined.\n *\n * @returns {string} The URI for importing a private key.\n */\nexport declare function getImportPrivateKeyURI(privateKey: string, label?: string, message?: string): string;\n```\n\n``` ts\n/**\n * Generates a URI for importing a seed.\n *\n * @param {string} seed The seed to import.\n * @param {string} [label] The label of the import.\n * @param {string} [message] The message of the import.\n * @param {number | string} [lastIndex] The last index to import.\n *\n * @throws {Error} Seed must be defined.\n *\n * @returns {string} The URI for importing a seed.\n */\nexport declare function getImportSeedURI(seed: string, label?: string, message?: string, lastIndex?: number | string): string;\n```\n\n``` ts\n/**\n * Generates a URI for sending.\n *\n * @param {string} address The address to send to.\n * @param {number | string} [amount] The amount to send (in raw).\n * @param {string} [label] The label of the transaction.\n * @param {string} [message] The message of the transaction.\n *\n * @throws {Error} Address must be defined.\n *\n * @returns {string} The URI for sending.\n */\nexport declare function getSendURI(address: string, amount?: number | string, label?: string, message?: string): string;\n```\n\n## Examples\n\nGenerate an URI for sending Banano to an address:\n\n```js\nimport { getSendURI } from 'banano-uri-generator';\n\nconst bananoAddress = 'ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk';\nconst amount = '10000000000000000000000000000';\nconst label = 'Developer Fund';\n\ngetSendURI(bananoAddress, amount, label);\n// banano:ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk?amount=10000000000000000000000000000\u0026label=Developer%20Fund\n```\n\nGenerate an URI for changing the representative to an address:\n\n```js\nimport { getChangeRepURI } from 'banano-uri-generator';\n\nconst bananoAddress = 'ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk';\nconst label = 'Banano Representative';\n\ngetChangeRepURI(bananoAddress, label);\n// bananorep:ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk?label=Banano%20Representative\n```\n\n## QR Code Generation\n\nTo convert an URI to a QR code (using a library such as [qrcode](https://github.com/soldair/node-qrcode)):\n\n```js\nimport { getSendURI } from 'banano-uri-generator';\nimport QRCode from 'qrcode';\n\nconst uri = getSendURI('ban_3x9zbabf15c7sg6raiytndyf45tbwhtoedocz5gcp4n84hydti87ysj849fk');\nconst svg = QRCode.toString(uri, {type: 'svg'});\n```\n\n## See Also\n\n- [Nano URI Generator](https://github.com/alecrios/nano-uri-generator) - Simple library for generating URIs for the Nano cryptocurrency.\n- [Nano Address Validator](https://github.com/alecrios/nano-address-validator) - Validates Nano addresses for syntax and checksum integrity.\n- [Nano Unit Converter](https://github.com/alecrios/nano-unit-converter) - Converts Nano amounts from one unit to another.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fbanano-uri-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzh%2Fbanano-uri-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fbanano-uri-generator/lists"}