npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oxapayapi

v1.0.0

Published

This module allows you to integrate oxapay payment in your application

Downloads

3

Readme

Installation

Install oxapayapi with npm

npm install oxapayapi

package.json

In your package.json file add these fields too

{
    "scripts": {
        "dev": "node --env-file=.env app.mjs" //replace app.mjs with your main js file
    },
    "type": "module", // to use import and export [ES6]
}

Run Locally

  npm run dev

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

MERCHANT_APIKEY

PAYOUT_APIKEY

Create Oxapay instance

import Oxapay from "oxapayapi"

const oxapay = new Oxapay(process.env.MERCHANT_APIKEY, process.env.PAYOUT_APIKEY)

Create Invoice

import Oxapay from "oxapayapi"

const oxapay = new Oxapay("Your Merchant API Key", "Your Payout API Key")

oxapay.createInvoice(10, "USDT", 30, 0, "https://example.com/callback", "UNIQUEID123", "ORDER-123ABCD").then(res => {
    console.log(res)
})

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | amount | NUMBER | Required. The amount for the payment. If the currency field is not filled, the amount should be specified in dollars. If the currency field is filled, the amount should correspond to the specified currency. | | currency | STRING | Required. Specify the currency symbol if you want the invoice amount calculated with a specific currency. You can also create invoices in fiat currencies. | | lifeTime | NUMBER | Required. Set the expiration time for the payment link in minutes (15-2880). | | feePaidByPayer | NUMBER | Required. Specify whether the payer will cover the invoice commission. 1 indicates that the payer will pay the fee, while 0 indicates that the merchant will pay the fee. | | callback_url | STRING | Required. The URL where payment information will be sent. Use this to receive notifications about the payment status. | | uniqueId | STRING | Required. Specify a unique ID to find who is the sender [user's unique id]. | | orderId | STRING | Required. Specify a unique order ID for reference in your system. |

Create Static Wallet

import Oxapay from "oxapayapi"

const oxapay = new Oxapay("Your Merchant API Key", "Your Payout API Key")

oxapay.createStaticWallet(10, "TRC20", "https://example.com/callback").then(res => {
    console.log(res)
})

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | currency | STRING | Required. The specific currency for which you want to create a static address. | | network | STRING | Required. The blockchain network on which the static address should be created. If not specified, the default network will be used. | | callback_url | STRING | Required. The URL where payment information will be sent. Use this to receive notifications about payments made to the static address. |

Create Payout

import Oxapay from "oxapayapi"

const oxapay = new Oxapay("Your Merchant API Key", "Your Payout API Key")

oxapay.createPayout("Your wallet address", 10, "USDT", "UNIQUEID-123", "https://example.com/callback", "TRC20").then(res => {
    console.log(res)
})

| Parameter | Type | Description | | :-------- | :------- | :------------------------- | | address | STRING | Required. The cryptocurrency address of the recipient where the payout will be sent. | | amount | NUMBER | Required. The amount of cryptocurrency to be sent as the payout. | | currency | STRING | Required. The symbol of the cryptocurrency to be sent (e.g., BTC, ETH, LTC, etc.). | | uniqueId | STRING | Required. Specify a unique ID to find who withdraw the money [user's unique id]. | | callback_url | STRING | Required. The URL where payment information and status updates will be sent. You can include additional parameters in the URL if needed. | | network | STRING | Required. The blockchain network to be used for the payout. The field is required for external payment. |

Authors