Generating a QR code using the NXT / Ardor api for scanning

0

Currently the nxt gui generates a QR code for certain pages where you can scan with your phone or another computer to do an air gap transaction. How can you do this via the api?

Patoshi パトシ

Posted 2016-08-04T21:38:11.260

Reputation: 8 911

Answers

1

https://nxtwiki.org/wiki/The_Nxt_API_Examples#Encode_QR_Code

You can do the following:

http://localhost:7876/nxt?
  requestType=encodeQRCode&
  qrCodeData=NXT-7A48-47JL-T7LD-D5FS3&
  width=100&
  height=100

Or via the command line:

curl -d requestType=encodeQRCode -d qrCodeData=NXT-XXX-XXX-XXX-XXX -d width=100 -d height=100 http://localhost:7876/nxt

You can use it in an image tag like this:

< img src="data:image/gif;base64,R0lGODlhEAAQAMQAAO....." width="100" height="100" />

Patoshi パトシ

Posted 2016-08-04T21:38:11.260

Reputation: 8 911