x5engine / wyre-widget

React Wyre Widget Advanced

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


wyre-widget


Wyre Widget

New Version using Hooks and no side effects.

React component for the Wyre widget.

License Build Status dependencies Status NPM version

Demo first?

Live Demo

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

License

MIT

About

React Wyre Widget Advanced

License:MIT License


Languages

Language:JavaScript 94.2%Language:HTML 5.8%