{"id":13425709,"url":"https://github.com/emg110/algorand-qrcode","last_synced_at":"2025-03-15T20:31:06.916Z","repository":{"id":49416401,"uuid":"363146862","full_name":"emg110/algorand-qrcode","owner":"emg110","description":"Algorand QR Code generator is a JavaScript module that outputs an standard QR code (exportable to SVG file and text) from a JSON object. It works in terminal, NodeJS and modern browsers. Complies to Algorand ABNF Grammar.","archived":false,"fork":false,"pushed_at":"2023-02-17T12:23:53.000Z","size":2565,"stargazers_count":19,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-11-20T16:20:53.904Z","etag":null,"topics":["algorand","algorand-qrcode","algorand-uri","browser","cli","generator","javascript","nodejs","payment","qr","qr-codes","qr-generator","qrcode","wallet","web"],"latest_commit_sha":null,"homepage":"https://developer.algorand.org/solutions/algorand-qr-code-generator-javascript/","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/emg110.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-30T13:18:57.000Z","updated_at":"2024-01-03T05:17:34.256Z","dependencies_parsed_at":"2024-01-03T05:17:29.263Z","dependency_job_id":"f9423a5d-0213-4400-b10f-5e4d0f6439b4","html_url":"https://github.com/emg110/algorand-qrcode","commit_stats":{"total_commits":160,"total_committers":2,"mean_commits":80.0,"dds":"0.018750000000000044","last_synced_commit":"860f81b2b55d0f0e9680f872e87f91d31e392a61"},"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emg110%2Falgorand-qrcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emg110%2Falgorand-qrcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emg110%2Falgorand-qrcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emg110%2Falgorand-qrcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emg110","download_url":"https://codeload.github.com/emg110/algorand-qrcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790948,"owners_count":20348378,"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":["algorand","algorand-qrcode","algorand-uri","browser","cli","generator","javascript","nodejs","payment","qr","qr-codes","qr-generator","qrcode","wallet","web"],"created_at":"2024-07-31T00:01:17.147Z","updated_at":"2025-03-15T20:31:06.346Z","avatar_url":"https://github.com/emg110.png","language":"JavaScript","funding_links":[],"categories":["Learning Resources","Community Resources"],"sub_categories":["Projects"],"readme":"[\u003cimg title=\"Algorand QR Code Generator (Banner art by Stasya Tikhonova, curtsey of Algorand)\" src=\"./examples/images/algorand-qrcode-banner.jpg\"\u003e](https://developer.algorand.org/solutions/algorand-qr-code-generator-javascript/)\n\n# Algorand QR Code Generator V3.2.0\n[![NPM](https://img.shields.io/npm/v/algorand-qrcode.svg)](https://www.npmjs.com/package/algorand-qrcode) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![npm](https://img.shields.io/static/v1?label=license\u0026message=MIT\u0026color=green\u0026style=flat-square)](https://github.com/emg110/algorand-qrcode/blob/master/license)\n\nNew version 3 is a complete re-write of the Algorand QRCode generation tool. Simpler and more effective!\n\nBreaking changes: The way to import and some of options have changed , please consult this readme.\n\n\u003cdiv style=\"display:block; text-align:center; align-items:center; margin:auto\"\u003e\n  \u003cimg style=\"display:block; margin:auto; cursor:pointer; text-align:center; align-items:center;\" title=\"Generated QR example\" src=\"./examples/images/generated-qr.png\" height=\"auto\" width=\"150\"\u003e\n\u003c/div\u003e\n\n\u003cp style=\"text-align:center; display:block; background-color:#4fcdf0; font-size:0.7em\"\u003ealgorand://AMESZ5UX7ZJL5M6GYEHXM63OMFCPOJ23UXCQ6CVTI2HVX6WUELYIY262WI?label=emg110@gmail.com\u003c/p\u003e\n\n## Demo\n\n###  [Live Demo](https://emg110.github.io/algorandqrcode/)\n\n## Links\n\n###  [Algorand Developers Portal Publication](https://developer.algorand.org/solutions/algorand-qr-code-generator-javascript/)\n\n###  [Algorand Dev Hours Presentation](https://cutt.ly/SnkO7Xl)\n\n###  [Algorand Dev Hours Presentation Video on YouTube](https://www.youtube.com/watch?v=RzP3y42Lf4o)\n\n\n## News\n\n\u003e ##  Version 3.2.0 is now here!\n\n\u003e ###  Now completely supports any modern web framework\n\n\u003e ### Modern JS Module in both Node and Browser\n\n\n\n## Technical notes\n\n- Amount is in MicroAlgos\n  \n- Algorand URI reference specification: [Algorand payment prompts specification](https://developer.algorand.org/docs/reference/payment_prompts/).\n  \n- Requires NodeJS version later than 10. \n  \n \n\n## Table of contents\n\n\n- [Highlights](#highlights)\n- [Algorand URI's ABNF Grammar](#algorand-uri-abnf-grammar)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Error correction level](#error-correction-level)\n- [Mentioned Trademarks](#mentioned-trademarks)\n- [Credits](#credits)\n- [License](#license)\n\n\n\n## Highlights\n- Supports NodeJS and Browser.\n- Supports RFC 3986 and Algorand URI ABNF Grammar.\n- CLI utility.\n- Save QR code as valid SVG image or text\n\n## Algorand URI ABNF Grammar\n\n```javascript\n    algorandurn     = \"algorand://\" algorandaddress [ \"?\" algorandparams ]\n    algorandaddress = *base32\n    algorandparams  = algorandparam [ \"\u0026\" algorandparams ]\n    algorandparam   = [ amountparam / labelparam / noteparam / assetparam  ]\n    amountparam     = \"amount=\" *digit\n    labelparam      = \"label=\" *qchar\n    assetparam      = \"asset=\" *digit\n    note            = \"note=\" *qchar\n```\n\n## Installation and use\n\n\n```shell\nnpm install --save algorand-qrcode\n```\nand then \n\n```shell\nimport algoqrcode from \"algorand-qrcode/lib/bundle.min.js\"\n```\n\nor, install it globally to use `qrcode` cli command to generate Algorand URI qrcode images in your terminal.\n\n```shell\nnpm install -g algorand-qrcode\n```\nand then \n\n```shell\nalgoqrcode [options]\n```\n\n## Usage\n\n### Browser and Frameworks (react...) use\n\n```javascript\nimport algoqrcode from \"algorand-qrcode/lib/bundle.min.js\";\nconst MyQrCodeComponent = (props)=\u003e{\n  let qrcode = algoqrcode({wallet:props.wallet, label:props.label})\n  let scg = qrcode.svg()\n  return svg\n}\n \n      \n```\n\n### CLI\n\n```\nUsage: algoqrcode [options]\n\nAlgorand options:\n  -m, --amount Amount (in Micro Algos) of Algorand transaction          [number]\n  -w, --wallet Destination Wallet address (Algorand account address)      [string]\n  -l, --label Label of Algorand transaction                             [string]\n  -a, --asset Algorand asset id (in case of Algorand ASA transfer)      [string]\n  -n, --note note                                                       [string]\n\nQR Code options:\n              \n  -e, --ecl     Error correction level           [choices: \"L\", \"M\", \"Q\", \"H\"]\n\n\n\nRenderer options:\n  -o, --output        Output type           [choices: \"file\", \"svg\", \"terminal\"]\n  -w, --wallet        Destination wallet                                [number]\n  -p, --padding       Padding around QRcode                             [number]\n  -b, --background    Light color                                       [string]\n  -c, --color         Dark color                                        [string]\n  -s, --size          QRcode image width and height (px)                [number]\n  -f, --file          Output file                                       [string]\n\n\nOptions:\n\n  -h, --help    Show help                                              [boolean]\n  --version     Show version number                                    [boolean]\n\nExamples:\n    - Send 1 Algo transaction:\n    algoqrcode -w \"AMESZ5UX7ZJL5M6GYEHXM63OMFCPOJ23UXCQ6CVTI2HVX6WUELYIY262WI\" -m 1000000 -s 128 -n \"This is an Algo payment transaction QR Code\"\n\n    - Save Algorand contact label as svg image:\n    algoqrcode -w \"AMESZ5UX7ZJL5M6GYEHXM63OMFCPOJ23UXCQ6CVTI2HVX6WUELYIY262WI\" -l \"emg110@gmail.com\" -o file -f sample.svg \n\n```\n\n\n### NodeJS\nImport the module `algorand-qrcode` for your NodeJS module\n\n```javascript\n        import algoqrcode from 'algorand-qrcode'\n        let qrcode = algoqrcode({\n            wallet: \"AMESZ5UX7ZJL5M6GYEHXM63OMFCPOJ23UXCQ6CVTI2HVX6WUELYIY262WI\",\n            label: \"Test Label\",\n            output: \"svg\",\n            size:256\n        })\n        let svg = qrcode.svg()\n        console.log(svg)\n```\n\n## Error correction level\nError correction capability allows to successfully scan a QR Code even if the symbol is dirty or damaged.\nFour levels are available to choose according to the operating environment.\n\nHigher levels offer a better error resistance but reduce the symbol's capacity.\u003cbr\u003e\nIf the chances that the QR Code symbol may be corrupted are low (for example if it is showed through a monitor)\nis possible to safely use a low error level such as `Low` or `Medium`.\n\nPossible levels are shown below:\n\n| Level            | Error resistance |\n|------------------|:----------------:|\n| **L** (Low)      | **~7%**          |\n| **M** (Medium)   | **~15%**         |\n| **Q** (Quartile) | **~25%**         |\n| **H** (High)     | **~30%**         |\n\nThe percentage indicates the maximum amount of damaged surface after which the symbol becomes unreadable.\n\nError level can be set through `options.ecl` property.\u003cbr\u003e\nIf not specified, the default value is `M`.\n\n\n\n#### QR Code options\n\n    \n##### `errorCorrectionLevel`\n  Type: `String`\u003cbr\u003e\n  Default: `M`\n\n  Error correction level.\u003cbr\u003e\n  Possible values are `low, medium, quartile, high` or `L, M, Q, H`.\n\n\n#### Algorand URI params\n\n##### `wallet`\n  Type: `String`\u003cbr\u003e\n\n  Wallet address for Algorand transaction.\n\n##### `amount`\n  Type: `Number`\u003cbr\u003e\n\n  Amount of Algorand transaction in MicroAlgos or Standard Asset Unit.\n  \n##### `label`\n  Type: `String`\u003cbr\u003e\n\n  Label of Algorand transaction.\n\n##### `asset`\n  Type: `String`\u003cbr\u003e\n\n  Asset Id of Algorand transaction if used. If not specified , Algo will be used as fungible token.\n  \n##### `note`\n  Type: `String`\u003cbr\u003e\n\n  note  field content of Algorand transaction.\n\n\n#### Renderers options\n\n##### `ecl`\n  Type: `String`\u003cbr\u003e\n  Default: `M`\n\n  Define the error correction level.\n\n##### `padding`\n  Type: `Number`\u003cbr\u003e\n  Default: `5`\n\n  Define how much wide the quiet zone should be.\n\n##### `size`\n  Type: `Number`\u003cbr\u003e\n  Default: `128`\n\n  Width and height.\n\n\n##### `color`\nType: `String`\u003cbr\u003e\nDefault: `#000000ff`\n\nColor of dark module. Value must be in hex format (RGBA).\u003cbr\u003e\nNote: dark color should always be darker than `color.light`.\n\n##### `background`\nType: `String`\u003cbr\u003e\nDefault: `#ffffffff`\n\nColor of light module. Value must be in hex format (RGBA).\u003cbr\u003e\n\n\n## License\n[MIT](https://github.com/emg110/algorand-qrcode/blob/master/license)\n\n\n## Credits\n\u003e Special appreciations to  [Sheghzo](https://github.com/sheghzo/).\n\n\n  \n\u003e The idea for this lib was inspired by: Algorand developers portal Article [Payment Prompts with Algorand Mobile Wallet](https://developer.algorand.org/articles/payment-prompts-with-algorand-mobile-wallet/ ) ,from Jason Paulos.\n\n\n## Mentioned Trademarks\n\"QR Code\" curtsey of :\u003cbr\u003e\n[\u003cimg title=\"DENSO WAVE Incorporated\" src=\"https://milliontech.com/wp-content/uploads/2017/01/Denso-Wave-Logo-300x102.png\" height=\"auto\" width=\"128\"\u003e](https://www.denso-wave.com)\n\n\n\"Algorand\" curtsey of:\u003cbr\u003e\n[\u003cimg title=\"Algorand Technologies\" src=\"https://www.algorand.com/assets/media-kit/logos/full/png/algorand_full_logo_black.png\" height=\"auto\" width=\"128\"\u003e](https://algorand.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femg110%2Falgorand-qrcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femg110%2Falgorand-qrcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femg110%2Falgorand-qrcode/lists"}