How to use the qrcode/lib/browser.toDataURL function in qrcode

To help you get started, we’ve selected a few qrcode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github airgap-it / airgap-web-signer / src / app.js View on Github external
window.generateAndSignTransaction(function (tx) {
      document.getElementById('from_identicon_confirm').src = blockies.toDataUrl('0x' + tx.from.toString('hex'))
      document.getElementById('from_identicon_confirm').style.paddingBottom = '0'
      document.getElementById('to_identicon_confirm').src = blockies.toDataUrl('0x' + tx.to.toString('hex'))
      document.getElementById('to_identicon_confirm').style.paddingBottom = '0'
      document.getElementById('amount_confirm').textContent = parseInt(tx.value.toString('hex'), 16) / WEIINETHER
      document.getElementById('fee_confirm').textContent = (parseInt(tx.gas.toString('hex'), 16) * parseInt(tx.gasPrice.toString('hex'), 16)) / WEIINETHER
      document.getElementById('confirm_modal').classList.add('is-active')
      qrcode.toDataURL(tx.serialize().toString('hex'), function (err, url) {
        document.getElementById('qr_holder').src = url
      })
    }, errorModal)
  }