https://github.com/bitcoin-com/bitcoin-invoice-components
React components for BCH invoices
https://github.com/bitcoin-com/bitcoin-invoice-components
Last synced: about 1 year ago
JSON representation
React components for BCH invoices
- Host: GitHub
- URL: https://github.com/bitcoin-com/bitcoin-invoice-components
- Owner: Bitcoin-com
- License: mit
- Created: 2020-04-15T12:21:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-02T23:27:27.000Z (over 2 years ago)
- Last Synced: 2025-03-27T14:55:26.333Z (about 1 year ago)
- Language: JavaScript
- Size: 2.21 MB
- Stars: 2
- Watchers: 6
- Forks: 5
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Build on Bitcoin Cash (BCH)
> React component for BIP70 invoices on BCH. BCH and SLP invoices are supported.
This repo is a fork of [badger-components-react](https://www.npmjs.com/package/badger-components-react), and only preserves functionality for BIP70 invoice components. For general components, see [badger-components-react](https://www.npmjs.com/package/badger-components-react).
### Install
```bash
$ npm install --save badger-components-react
```
### Install Peer Dependencies
This library depends on the following three peer dependencies
* `styled-components` ^4.0.0
* `react` ^16.3.0
* `react-dom` ^16.3.0
```bash
$ npm install --save styled-components react react-dom
```
### Add to React Project
```js
import React from 'react'
import { Invoice } from 'bitcoin-invoice-components'
const Example = (props) => {
// URL structure of your bip70 invoice
const bip70base = 'https://pay.bitcoin.com/i/'
// Payment ID of your bip70 invoice
const paymentId = 'EGKe7SA1TmttK2E3fakdg8'
return (
<>
{/* Minimal Example */}
console.log('success example function called')}
failFn={() => console.log('fail example function called')}
/>
>
)
};
export default Example
```