Skip to content

Radiant-Core/MuonPaySDK

 
 

Repository files navigation

Muon Pay SDK

Muon Pay SDK is a powerful and easy-to-integrate solution for merchants looking to accept payments on the Radiant (RXD) blockchain. Built by ThinkDot Solutions, Muon Pay provides a streamlined way to handle transactions, deposits, and balance management through a RESTful API.


Features

  • Send & receive payments using Radiant (RXD) in photons.
  • Generate new deposit addresses for seamless merchant transactions.
  • Check balances and transaction statuses in real-time.
  • Automated postback system to notify backend systems of payments.
  • Admin panel for managing server settings.

Prerequisites

  • Node.js v21+ (required for smooth operation)
  • ElectrumX Server for blockchain communication
  • .env file for configuration

Installation

# Clone the repository
git clone https://github.com/RadiantRanger42/MuonPaySDK.git
cd MuonPaySDK

# Install dependencies
npm install

# Start the server
npm run server

API Endpoints

All API methods use POST requests.

1. Broadcast a Transaction

Endpoint: /api/user/transaction/broadcast

Request Parameters:

{
  "myAddress": "string",
  "toAddress": "string",
  "amount": "integer (in photons)"
}

Responses:

  • Success:
{
  "success": true,
  "message": "Transaction broadcasted successfully",
  "data": { "txId": "string" }
}
  • Error Cases:
{
  "success": false,
  "message": "Sender and receiver addresses are required"
}
{
  "success": false,
  "message": "Insufficient funds for the transaction"
}

2. Get Balance

Endpoint: /api/user/transaction/balance

Request Parameters: None

Responses:

  • Success:
{
  "success": true,
  "message": "Balance Retrieved",
  "confirmedBalance": "integer",
  "unconfirmedBalance": "integer",
  "totalBalance": "integer"
}
  • Error:
{
  "success": false,
  "message": "Radiant Address is required"
}

3. Generate New Deposit Address

Endpoint: /api/user/transaction/new/address

Request Parameters:

{
  "userid": "integer",
  "amountNeeded": "integer"
}

Responses:

  • Success:
{
  "success": true,
  "message": "Address generated successfully",
  "data": {
    "addressId": "integer",
    "userid": "integer",
    "amount": "integer",
    "fee": "integer",
    "address": "string",
    "time": "timestamp"
  }
}
  • Error:
{
  "success": false,
  "message": "User ID / Unique Identifier is required"
}

4. Check Deposit Status

Endpoint: /api/user/transaction/check/deposit

Request Parameters:

{
  "address": "string"
}

Responses:

  • Success (Payment Found):
{
  "success": true,
  "found": true,
  "message": "Payment was found",
  "ReqAmount": "integer",
  "amountReceived": "integer",
  "amountFulfilled": "boolean",
  "data": { "depositHistory": [] }
}
  • Success (No Payment Found):
{
  "success": true,
  "found": false,
  "message": "No Payments found for this address",
  "data": []
}
  • Error:
{
  "success": false,
  "message": "Address is required"
}

5. Postback Data (Automatic Notification)

Muon Pay SDK sends a POST request to the POSTBACK_URL (configured in .env) when a payment is received.

Postback Payload:

{
  "success": true,
  "id": "integer",
  "message": "Payment was found",
  "ReqAmount": "integer",
  "amountReceived": "integer",
  "amountFulfilled": "boolean",
  "data": { "depositHistory": [] },
  "method": "credit"
}

Admin Panel

Admins can access the control panel at:

/admin-user-panel

Features:

  • View key metrics
  • Change ElectrumX server (requires app restart)
  • Update admin credentials (modify server.js)

Support & Integration

For integration help or custom development, contact RxddApps.


License

Muon Pay SDK is open-source under the MIT License.

Built with ❤️ by ThinkDot Solutions. 🚀

About

A SDK to integrate RXD payments into a website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • CSS 40.9%
  • JavaScript 30.0%
  • HTML 20.2%
  • SCSS 8.9%