metasdk-react
SDK to communicate between React and App using QRCode
Install
npm i metasdk-react
Components
- Login
- Request
- SendTransaction
Usage
If callbackUrl
will be given as prop, a component shows QR code directly, not popup button.
import React Component from 'react'import Login Request SendTransaction from 'metasdk-react' {} { return <div> <Login ='testmsg' ='example' = = /> <Request = ='example' = = /> <SendTransaction ='sendTransactionByRequest' = ='method' = = /> <SendTransaction ='sendTransactionWithCallbackURL' = ='method' = ='http://localhost/callback' /> <SendTransaction ='sendTransactionByRaw' ='0x8101487270f5411cf213b8d348a2ab46df66245d' ='0x01' ='0x02' = = ='2em' ='bottom right' ='SendTransaction' = = /> </div> }
QRCode styles can be set for all components like above example SendTransaction
qrpopup
decides if QRCode exists within popup or not. default:false
qrsize
changes the size of QRCode by pixel. default:128
qrvoffset
is a vertical offset from origin. default:20
qrpadding
applies padding thickness of QRCode as style. default:1em
qrposition
decides relative position from origin, declaration for positions are inutil.js
. default:bottom right
qrtext
setsButton
text to open QRCode popup
Test
cd metasdk-react
npm start
[Ctrl+C]
cd example
npm start