@polkadot/react-qr
Advanced tools
Comparing version 0.43.0-beta.6 to 0.43.0-beta.7
{ | ||
"name": "@polkadot/react-qr", | ||
"version": "0.43.0-beta.6", | ||
"version": "0.43.0-beta.7", | ||
"description": "Generates and reads QR codes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import { BaseProps } from './types'; | ||
import React from 'react'; | ||
interface ScanType { | ||
address: string; | ||
genesisHash: string; | ||
} | ||
interface Props extends BaseProps { | ||
onError?: (error: Error) => void; | ||
onScan?: (aqddress: string, genesisHash: string) => void; | ||
onScan?: (scanned: ScanType) => void; | ||
} | ||
@@ -7,0 +11,0 @@ export default class ScanAddress extends React.PureComponent<Props> { |
@@ -40,3 +40,6 @@ "use strict"; | ||
(0, _utilCrypto.decodeAddress)(address); | ||
onScan(address, genesisHash); | ||
onScan({ | ||
address, | ||
genesisHash | ||
}); | ||
} catch (error) { | ||
@@ -43,0 +46,0 @@ console.error('@polkadot/react-qr:QrScanAddress', error.message, data); |
import { BaseProps } from './types'; | ||
import React from 'react'; | ||
interface ScanType { | ||
signature: string; | ||
} | ||
interface Props extends BaseProps { | ||
onError?: (error: Error) => void; | ||
onScan?: (data: Uint8Array) => void; | ||
onScan?: (scanned: ScanType) => void; | ||
} | ||
@@ -7,0 +10,0 @@ export default class ScanSignature extends React.PureComponent<Props> { |
@@ -12,5 +12,7 @@ "use strict"; | ||
var _util = require("@polkadot/util"); | ||
var _Scan = _interopRequireDefault(require("./Scan")); | ||
var _util = require("./util"); | ||
var _util2 = require("./util"); | ||
@@ -33,3 +35,5 @@ // Copyright 2017-2019 @polkadot/react-qr authors & contributors | ||
onScan((0, _util.encodeString)(data)); | ||
onScan({ | ||
signature: (0, _util.u8aToHex)((0, _util2.encodeString)(data)) | ||
}); | ||
}; | ||
@@ -36,0 +40,0 @@ } |
34084
682