1.3.2 • Published 4 months ago
ensc-pay v1.3.2
📌 README.md for ENSC Ramp
# ENSC Ramp
**ENSC Ramp** is a lightweight, embeddable React component that enables seamless on-ramp and off-ramp transactions for ENSC stablecoin. It provides an easy-to-use checkout UI for businesses and users to perform ENSC and fiat payments via Lisk Chain.
## 🚀 Features
- 🔥 **Fully Embeddable** - Integrate into any React project.
- 💳 **Simple Checkout UI** - Enter amount, email, and select a blockchain network.
- ⚡ **Supports ENSC Stablecoin** - Designed for payments with ENSC.
- ✅ **Peer Dependency on React** - Ensures compatibility across projects.
- 🛠 **Customizable** - Pass callbacks to handle success & errors.
---
## 📦 Installation
Install the package via **npm** or **yarn**:
```bash
npm install ensc-ramp
or
yarn add ensc-ramp
📖 Usage
Basic Example
Import and use the <Checkout />
component in your React app:
import React from "react";
import { Checkout } from "ensc-ramp";
function App() {
const handleSuccess = (data) => {
console.log("Payment Successful:", data);
};
const handleError = (error) => {
console.error("Payment Error:", error);
};
return (
<div>
<h1>ENSC Checkout</h1>
<Checkout onSuccess={handleSuccess} onError={handleError} />
</div>
);
}
export default App;
⚙️ Props (API)
Prop Name | Type | Description |
---|---|---|
onSuccess | function | Callback function triggered after a successful payment. Receives { email, amount, network } . |
onError | function | Callback function triggered when there's an error. Receives an error message string. |
🌍 Supported Networks
The component currently supports:
- Lisk (ERC20)
- ENSC Stablecoin
🔧 Customization
You can override the styles by wrapping the <Checkout />
component in a styled div or using global CSS.
🛠 Development
To modify the package locally:
Clone the repository:
git clone https://github.com/prosperavest/ensc-ramp.git cd ensc-ramp
Install dependencies:
yarn install
Build the package:
yarn build
Run the example project:
cd example yarn start
🎯 Testing Locally
If you want to test the package inside another React project, link it locally:
In the
ensc-ramp
package folder:yarn build
In your test project:
yarn add file:../ensc-ramp
Use
<Checkout />
in your app and start the project.