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

xnogate

v2.0.4

Published

xnogate is a Node.js library for processing NANO ($XNO) cryptocurrency payments in your application, providing a reliable and secure way to receive and validate payments. Ideal for e-commerce websites, online marketplaces, and other applications. Start ac

Downloads

19

Readme

xnogate

xnogate is a safe, reliable payment gateway library for the NANO (XNO) cryptocurrency.

Installation

To install xnogate, run the following command:

npm i xnogate

Usage

WARNING: do not use any of the keys or addresses listed below to send real assets!

To use the payment gateway module, import it as follows:

const { payments } = require("xnogate")

Create a Payment

To create a new payment, call the payments.create(config, amount) method, passing in a configuration object and the desired amount in NANO. The configuration object should contain the following properties:

  • seed: a 64-character string representing the seed to be used to generate the private key for the wallet. If not provided, a random seed will be generated.
  • index: index of the wallet to use. If not provided, 0 will be used.
  • destination: the address of the account to which the payment will be made.
  • timeout: the timeout for the payment, in seconds.

Example:

const config = {
  seed: "6e78325f7061796d656e745f676174657761795f746573745f786e6f67617465",
  index: 0,
  destination: "nano_3ujqppynxfakp59i99o75qkwi1dm6btox9gndegbnuyxpc53sw7ikmb1zp8z",
  timeout: 30 // 30 seconds
};

const amount = 0.5; // 0.5 NANO

const interval = payments.create(config, amount);

Start a Payment

To start a payment, call the payments.start(interval, onSuccess, onTimeout) method, passing in the interval object returned from payments.create, as well as the onSuccess and onTimeout callbacks. o variable in the callback is the interval itself, you can retrieve or store some data there

Example:

payments.start(interval, 
  (o) => { console.log("Payment successful"); }, 
  (o) => { console.log("Payment timed out"); }
);

Alternatively:

interval.start(
  (o) => { console.log("Payment successful"); }, 
  (o) => { console.log("Payment timed out"); }
);

Donate

If you find this module useful and would like to support its development, please consider making a donation to the following Nano address:

nano_3ujqppynxfakp59i99o75qkwi1dm6btox9gndegbnuyxpc53sw7ikmb1zp8z

Your contribution is greatly appreciated and will help ensure the continued maintenance and improvement of this project, and some extra motivation. Thank you for your support!