hedera-defi-payment
v1.0.0
Published
A lightweight React component for generating Hedera payment links.
Downloads
93
Maintainers
Readme
hedera-defi-payment
A lightweight SDK for generating secure Hedera-based payment links for merchants. This package enables any merchant or developer to quickly generate a payment URL by providing simple transaction details such as:
merchant name
merchant address
amount
coin type
callback URL✨ Features:
Generate Hedera payment links instantly
Supports HBAR and USDC
Built-in input validation
Simple TypeScript interface
Zero external dependencies
Works with Node.js & frontend applications📦 Installation:
npm install hedera-defi-payment
or
yarn add hedera-defi-payment🔧 Usage:
Import the SDK function
import { generatePaymentLink } from "hedera-defi-payment";
Define the payment details
const details = { merchant_name: "My Shop", merchant_address: "0.0.123456", amount: 49.99, coin_name: "HBAR", back_url: "https://myshop.com/payment-success" };
Generate the payment link
const paymentURL = generatePaymentLink(details); console.log(paymentURL);
🧾 MerchantDetails Interface:
interface MerchantDetails { merchant_name: string; merchant_address: string; amount: number; coin_name: 'HBAR' | 'USDC'; back_url: string; }
🔗 Output Example:
A successful call returns a URL such as https://your-base-payment-url.com?merchant_name=My%20Shop&merchant_address=0.0.123456&amount=49.99&order_id=1234567&network=testnet&blockchain=hedera&coin_name=HBAR&back_url=https%3A%2F%2Fmyshop.com%2Fpayment-success
