wyre-widget
v0.0.3
Published
React Wyre widget.
Downloads
254
Maintainers
Readme
Wyre Widget
New Version using Hooks and no side effects.
Demo first?
Install
npm i -S wyre-widget
Getting started
import React from 'react'
import Wyre from 'wyre-widget'
class App extends React.Component {
constructor (props) {
super(props)
this.state = {
open: false
}
}
render () {
return (
<Wyre
config={{
env: 'test',
accountId: 'AC-BAAA2222',
auth: {
type: 'secretKey',
secretKey: '6a6f7f9187f766f66938638f1afd79b20fb5989e2837e6f989'
},
operation: {
type: 'debitcard',
destCurrency: 'ETH',
destAmount: 0.01,
dest: '0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1'
},
style: {
primaryColor: '#0055ff'
}
}}
onReady={() => console.log('ready')}
onClose={event => console.log('close', event)}
onComplete={event => console.log('complete', event)}
open={this.state.open}>
<button onClick={() => this.setState({ open: true })}>
Buy ETH
</button>
</Wyre>
)
}
}
export default App
Please read the Wyre documentation for the configuration options.
Development
npm install
npm run build
npm run lint