1.3.2 • Published 10 months ago

ensc-pay v1.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

📌 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 NameTypeDescription
onSuccessfunctionCallback function triggered after a successful payment. Receives { email, amount, network }.
onErrorfunctionCallback 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:

  1. Clone the repository:

    git clone https://github.com/prosperavest/ensc-ramp.git
    cd ensc-ramp
  2. Install dependencies:

    yarn install
  3. Build the package:

    yarn build
  4. Run the example project:

    cd example
    yarn start

🎯 Testing Locally

If you want to test the package inside another React project, link it locally:

  1. In the ensc-ramp package folder:

    yarn build
  2. In your test project:

    yarn add file:../ensc-ramp
  3. Use <Checkout /> in your app and start the project.


1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.3.2

10 months ago

1.0.5

10 months ago

1.3.1

10 months ago

1.0.4

10 months ago

1.3.0

10 months ago

1.0.11

10 months ago

1.0.12

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago