Skip to content

archanova/react-wyre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


logo


react-wyre

React component for the Wyre widget.

License Build Status dependencies Status NPM version

Install

npm install react-wyre

Getting started

import React from 'react'
import Wyre from 'react-wyre'

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

License

MIT