0.0.8 • Published 6 years ago

neo-qrcode v0.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

NEO QR Code Generator

A QR code generator for receiving NEO/GAS/NEP5. Complies with the URI standard format detailed in the NEP9 proposal.

Imgur

Can be configured to include:

  • Address
  • Asset
  • Amount

...and all others detailed in NEP9

Usage

In a browser - cdn npm.io

<script src="https://cdn.jsdelivr.net/npm/neo-qrcode/build/neoqr.min.js"></script>
window.NeoQR

Install via npm npm version

npm i --save neo-qrcode
var NeoQR = require('neo-qrcode');

import NeoQR from 'neo-qrcode';

Example

HTML

  <body>
    <canvas id="canvas-container"></canvas>

    <img id="img-container"></img>

    <img id="img-src-container"></img>
  </body>

JS

var options = {
  address: 'AR8rRBxgWw5siKsp1dUmfTLy6QQTjcqoqB',
  asset: 'NEO', // or 'GAS' or 'ceab719b8baa2310f232ee0d277c061704541cfb'
  amount: 1,
  description: 'Sunday morning breakfast'
};



// attach to canvas element

var canvasContainer = document.getElementById('canvas-container');
var canvasQrCode = new NeoQR({nep9Data: options, canvasEl: canvasContainer});



// attach to a img element

var imgContainer = document.getElementById('img-container');
var imgQrCode = new NeoQR({nep9Data: options, imgEl: imgContainer});



// set img src from data url

var imgSrcContainer = document.getElementById('img-src-container');
var qrCode = new NeoQR({nep9Data: options});
qrCode.toDataURL()
.then(imgData => imgSrcContainer.src = imgData);
0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago